html_url
stringlengths
51
51
comments
stringlengths
67
24.7k
title
stringlengths
6
280
body
stringlengths
51
36.2k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/6113
Hi! This should be fixed in the latest (patch) release (run `pip install -U datasets` to install it). This behavior was due to a bug in our authentication logic.
load_dataset() fails with streamlit caching inside docker
### Describe the bug When calling `load_dataset` in a streamlit application running within a docker container, get a failure with the error message: EmptyDatasetError: The directory at hf://datasets/fetch-rewards/inc-rings-2000@bea27cf60842b3641eae418f38864a2ec4cde684 doesn't contain any data files Traceback: File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script exec(code, module.__dict__) File "/home/user/app/app.py", line 62, in <module> dashboard() File "/home/user/app/app.py", line 47, in dashboard feat_dict, path_gml = load_data(hf_repo, model_gml_dict[selected_model], hf_token) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 211, in wrapper return cached_func(*args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 240, in __call__ return self._get_or_create_cached_value(args, kwargs) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 266, in _get_or_create_cached_value return self._handle_cache_miss(cache, value_key, func_args, func_kwargs) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 320, in _handle_cache_miss computed_value = self._info.func(*func_args, **func_kwargs) File "/home/user/app/hf_interface.py", line 16, in load_data hf_dataset = load_dataset(repo_id, use_auth_token=hf_token) File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 2109, in load_dataset builder_instance = load_dataset_builder( File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1795, in load_dataset_builder dataset_module = dataset_module_factory( File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1486, in dataset_module_factory raise e1 from None File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1476, in dataset_module_factory ).get_module() File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1032, in get_module else get_data_patterns(base_path, download_config=self.download_config) File "/opt/conda/lib/python3.10/site-packages/datasets/data_files.py", line 458, in get_data_patterns raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None ### Steps to reproduce the bug ```python @st.cache_resource def load_data(repo_id: str, hf_token=None): """Load data from HuggingFace Hub """ hf_dataset = load_dataset(repo_id, use_auth_token=hf_token) hf_dataset = hf_dataset.map(lambda x: json.loads(x["ground_truth"]), remove_columns=["ground_truth"]) return hf_dataset ``` ### Expected behavior Expect to load. Note: works fine with datasets==2.13.1 ### Environment info datasets==2.14.2, Ubuntu bionic-based Docker container.
29
load_dataset() fails with streamlit caching inside docker ### Describe the bug When calling `load_dataset` in a streamlit application running within a docker container, get a failure with the error message: EmptyDatasetError: The directory at hf://datasets/fetch-rewards/inc-rings-2000@bea27cf60842b3641eae418f38864a2ec4cde684 doesn't contain any data files Traceback: File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script exec(code, module.__dict__) File "/home/user/app/app.py", line 62, in <module> dashboard() File "/home/user/app/app.py", line 47, in dashboard feat_dict, path_gml = load_data(hf_repo, model_gml_dict[selected_model], hf_token) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 211, in wrapper return cached_func(*args, **kwargs) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 240, in __call__ return self._get_or_create_cached_value(args, kwargs) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 266, in _get_or_create_cached_value return self._handle_cache_miss(cache, value_key, func_args, func_kwargs) File "/opt/conda/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 320, in _handle_cache_miss computed_value = self._info.func(*func_args, **func_kwargs) File "/home/user/app/hf_interface.py", line 16, in load_data hf_dataset = load_dataset(repo_id, use_auth_token=hf_token) File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 2109, in load_dataset builder_instance = load_dataset_builder( File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1795, in load_dataset_builder dataset_module = dataset_module_factory( File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1486, in dataset_module_factory raise e1 from None File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1476, in dataset_module_factory ).get_module() File "/opt/conda/lib/python3.10/site-packages/datasets/load.py", line 1032, in get_module else get_data_patterns(base_path, download_config=self.download_config) File "/opt/conda/lib/python3.10/site-packages/datasets/data_files.py", line 458, in get_data_patterns raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None ### Steps to reproduce the bug ```python @st.cache_resource def load_data(repo_id: str, hf_token=None): """Load data from HuggingFace Hub """ hf_dataset = load_dataset(repo_id, use_auth_token=hf_token) hf_dataset = hf_dataset.map(lambda x: json.loads(x["ground_truth"]), remove_columns=["ground_truth"]) return hf_dataset ``` ### Expected behavior Expect to load. Note: works fine with datasets==2.13.1 ### Environment info datasets==2.14.2, Ubuntu bionic-based Docker container. Hi! This should be fixed in the latest (patch) release (run `pip install -U datasets` to install it). This behavior was due to a bug in our authentication logic.
[ -0.4902493357658386, 0.21815185248851776, -0.10225380957126617, 0.3766001760959625, 0.24528191983699799, 0.0007976144552230835, 0.6295652389526367, 0.18384715914726257, 0.11621171236038208, 0.029357101768255234, 0.008320800960063934, 0.06578747183084488, 0.059611160308122635, 0.1201762855052948, -0.0019907671958208084, 0.10144565999507904, 0.04686347395181656, 0.20678392052650452, -0.25852882862091064, 0.08274129778146744, 0.03713323175907135, -0.02757926471531391, -0.24984875321388245, -0.16014117002487183, -0.12944234907627106, -0.009749122895300388, 0.0527043417096138, 0.2996668219566345, 0.04354189336299896, -0.36648425459861755, 0.38419440388679504, 0.0981089323759079, 0.035995326936244965, 0.7266322374343872, -0.00011289682879578322, 0.10414908826351166, 0.5091999173164368, -0.28271418809890747, -0.559167206287384, -0.30931931734085083, -0.3631628751754761, -0.23063838481903076, 0.061042942106723785, -0.08379378169775009, -0.0980432778596878, -0.2034330517053604, -0.1733904927968979, -0.3647885024547577, 0.39423617720603943, 0.26300591230392456, 0.19618311524391174, 0.4579565227031708, -0.16441284120082855, 0.06005745008587837, -0.08208020031452179, 0.18731029331684113, -0.1051563024520874, 0.3037320077419281, 0.36938562989234924, -0.2954593896865845, -0.040609002113342285, 0.5195595026016235, -0.240692138671875, 0.20270469784736633, 0.36575961112976074, -0.05775599181652069, -0.08438699692487717, -0.03472848981618881, 0.14576922357082367, 0.07743509113788605, 0.6123794913291931, -0.24627207219600677, -0.5807837843894958, -0.41362184286117554, -0.15923666954040527, -0.194760262966156, 0.2747417688369751, 0.17303338646888733, -0.22578658163547516, 0.0964653491973877, -0.1299166977405548, -0.07441162317991257, -0.1981847882270813, -0.20242737233638763, 0.08056792616844177, 0.30742302536964417, -0.056513428688049316, 0.055632077157497406, -0.21318358182907104, 0.04293248429894447, 0.5457226037979126, -0.1197981983423233, -0.2296447455883026, 0.0659896656870842, -0.22880969941616058, 0.21005773544311523, -0.010863903909921646, -0.11128862202167511, 0.06151452660560608, 0.23937571048736572, 0.42960724234580994, 0.11464793235063553, 0.0924300104379654, 0.2639753818511963, 0.04785977303981781, 0.5324473977088928, 0.13027435541152954, 0.22585245966911316, 0.1720655858516693, 0.08588966727256775, 0.1437835395336151, -0.23003508150577545, -0.12094235420227051, 0.2335621416568756, 0.021150849759578705, 0.09516655653715134, 0.04268265515565872, -0.04636552184820175, -0.4176251292228699, -0.17747046053409576, 0.014210127294063568, 0.006064318120479584, 0.25880166888237, 0.5656327605247498, 0.0060685910284519196, 0.41930654644966125, -0.08187655359506607, 0.09859181940555573, 0.02653457224369049, -0.2021004855632782, -0.2894807457923889, -0.028361225500702858, -0.041848406195640564, 0.0502002090215683, 0.22674132883548737, -0.3691697120666504, 0.5176411867141724, -0.13721057772636414, -0.10416994988918304, 0.04342927783727646, 0.26146700978279114, -0.2923636734485626, -0.05986541137099266, 0.3300940692424774, 0.02393227070569992, -0.08176147937774658, 0.2384844273328781, 0.04443042725324631, 0.23175835609436035, 0.18586832284927368, -0.23373231291770935, -0.1906771957874298, 0.0017248447984457016, 0.18885530531406403, -0.09157529473304749, 0.09004364907741547, -0.5470285415649414, 0.14031609892845154, 0.22798174619674683, -0.182562917470932, -0.029604870826005936, -0.2318033128976822, -0.041834741830825806, -0.07112421095371246, 0.2561923563480377, 0.6509056091308594, -0.13906940817832947, -0.10314259678125381, -0.08997665345668793, -0.03765849769115448, 0.3328261077404022, -0.05592458322644234, -0.25358840823173523, 0.30729734897613525, -0.2954900860786438, 0.04659119248390198, 0.27792471647262573, -0.6818628311157227, -0.45587897300720215, 0.0814409852027893, 0.025112122297286987, 0.18741193413734436, 0.14668969810009003, 0.06314270943403244, 0.17815899848937988, -0.10941094905138016, -0.08675377815961838, 0.1894092857837677, -0.18376696109771729, -0.017694927752017975, -0.1394745260477066, -0.10828865319490433, 0.23718027770519257, 0.0897357389330864, 0.09519164264202118, 0.16670358180999756, 0.15940217673778534, 0.3423129916191101, -0.0969376266002655, -0.17054548859596252, 0.05493788421154022, 0.15604837238788605, -0.05534142628312111, 0.09764078259468079, 0.0994320660829544, 0.01744993031024933, -0.6709553003311157, 0.35719406604766846, -0.17634925246238708, -0.10537540912628174, -0.1402679979801178, -0.01464758813381195, -0.21896398067474365, 0.16700398921966553, -0.21579508483409882, -0.35356956720352173, 0.14408573508262634, 0.4374326169490814, -0.04863107204437256, -0.031057219952344894, -0.11119713634252548, 0.7982784509658813, -0.3220258355140686, 0.01273643970489502, 0.1429608315229416, 0.2467632293701172, 0.04382768273353577, -0.25795942544937134, 0.11331504583358765, -0.010883815586566925, 0.2341172695159912, -0.1554153561592102, -0.17801053822040558, 0.4121684730052948, -0.11635345965623856, 0.23683986067771912, -0.019453037530183792, -0.09771811962127686, 0.19833680987358093, 0.12271666526794434, 0.1333443820476532, 0.1898009330034256, 0.2995643615722656, -0.17552578449249268, -0.07350420206785202, 0.11712078750133514, -0.3282296657562256, 0.21230754256248474, -0.008838750422000885, -0.13731014728546143, 0.3174301087856293, 0.10026907920837402, 0.188856840133667, -0.03430114686489105, 0.280221551656723, -0.13806721568107605, 0.27792298793792725, -0.09986951947212219, -0.038243867456912994, 0.1651124805212021, 0.02870878390967846, 0.16418668627738953, 0.1117781549692154, 0.1331648826599121, -0.21025630831718445, -0.28241556882858276, 0.40645405650138855, 0.35828542709350586, 0.5720880627632141, 0.2018197625875473, -0.046974826604127884, -0.1705993413925171, 0.28114014863967896, -0.10687457025051117, 0.11230652034282684, -0.054908763617277145, 0.048741213977336884, 0.43404173851013184, 0.18060334026813507, -0.04377283900976181, -0.08749599009752274, -0.32842326164245605, 0.15733662247657776, 0.24679261445999146, -0.18905186653137207, 0.24901331961154938, -0.010558493435382843, -0.2299962043762207, 0.031980037689208984, -0.023662567138671875, -0.13718368113040924, -0.2457161545753479, -0.28622549772262573, 0.6486889123916626, 0.04624761641025543, 0.03943730145692825, -0.17684432864189148, 0.166346937417984, 0.3286762237548828, -0.24960245192050934, -0.5057199597358704, -0.05357640981674194, -0.15661485493183136, -0.015286646783351898, 0.23314307630062103, -0.016895540058612823, 0.23628969490528107, 0.030456677079200745, 0.07993315160274506, -0.2771325409412384, -0.15948837995529175, 0.1076108068227768, -0.0880710557103157, 0.2954876720905304, -0.039666544646024704, 0.1719495952129364, 0.06967589259147644, -0.03586481511592865, 0.16883067786693573, 0.05535580962896347, -0.19332978129386902, -0.11411695182323456, 0.06448981165885925, 0.11052332818508148, -0.24892474710941315, -0.19715240597724915, -0.4229266941547394, -0.38455766439437866, -0.05161270126700401, -0.034832462668418884, 0.12243308871984482, 0.15597863495349884, -0.004368852823972702, 0.21722686290740967, 0.17745643854141235, -0.2361394166946411, -0.1343163549900055, -0.0468229241669178, 0.07329877465963364, -0.06294619292020798, -0.15925128757953644, 0.05452444404363632, 0.13064172863960266, 0.33635714650154114, 0.2448039948940277, -0.31456059217453003, -0.16582079231739044, 0.20912526547908783, 0.002324022352695465, -0.4246025085449219, -0.34167343378067017, 0.2035660445690155, -0.007500898092985153, -0.018148746341466904, -0.22197645902633667, 0.13901013135910034, 0.03976867347955704, -0.16615691781044006, 0.2538583278656006, 0.033969517797231674, 0.09333286434412003, -0.044411417096853256, 0.5037254691123962, 0.004340425133705139, 0.025706050917506218, 0.2111573964357376, 0.2655426561832428, 0.5835881233215332, -0.1309613436460495, -0.29798054695129395, 0.07481314241886139, 0.04308458790183067, -0.07870444655418396, 0.008317403495311737, 0.024464484304189682, -0.0695907324552536, -0.16885313391685486, -0.29245156049728394, 0.009610503911972046, 0.13355040550231934, 0.24103514850139618, -0.4038337469100952, 0.1327027529478073, 0.08332343399524689, 0.191427081823349, -0.14597779512405396, -0.1688467264175415, -0.2578732371330261, 0.20515744388103485, 0.20080915093421936, 0.15098774433135986, -0.13810017704963684, -0.003837205469608307, -0.42026886343955994, 0.11950583010911942, 0.1186928004026413, 0.4680584967136383, -0.30534178018569946, 0.2819874882698059, -0.2719125747680664, -0.11242543160915375, 0.23153164982795715, -0.23000553250312805, 0.17940422892570496, 0.024422377347946167, 0.07274326682090759, -0.28392839431762695, -0.06541366130113602, -0.03905259072780609, 0.4623679220676422, -0.1860986053943634, 0.34239453077316284, -0.10117492079734802, -0.12566520273685455, -0.25732070207595825, 0.15807658433914185, -0.10217483341693878, -0.07561080157756805, -0.20902615785598755, -0.22935158014297485, -0.08924279361963272, -0.02611788734793663, 0.023522593080997467, -0.03929682448506355, 0.06112563610076904, -0.12976156175136566, -0.12954293191432953, 0.02547915279865265, -0.02755417674779892, 0.06662164628505707, 0.348538875579834, -0.2035045474767685, -0.02708306536078453, 0.26400917768478394, 0.11708900332450867, 0.3383603096008301, 0.25062257051467896, 0.1357111930847168, 0.003513649106025696, 0.055649783462285995, -0.04751567170023918, 0.0025543011724948883, 0.15873977541923523, -0.19728201627731323, -0.07402470707893372, 0.11892956495285034, -0.05754006281495094, -0.27299681305885315, 0.28418880701065063, -0.17889386415481567, 0.1831773817539215, -0.16630759835243225, -0.6510417461395264, 0.03191422298550606, -0.16162388026714325, 0.13578319549560547, 0.6659630537033081, -0.30920523405075073, -0.414993017911911, 0.3066420257091522, -0.017116740345954895, 0.5451033115386963, 0.1808256357908249, 0.06999070942401886, 0.3650708496570587, 0.09905210137367249, 0.40914031863212585, -0.24852332472801208, 0.25772836804389954, -0.14982585608959198, -0.27633464336395264, -0.17459437251091003, -0.18963958323001862, 0.015717871487140656, 0.060039110481739044, -0.19908323884010315, 0.5082526803016663, -0.09792201220989227, 0.31032809615135193, 0.056246109306812286, 0.09342241287231445, -0.21699124574661255, -0.2895931899547577, -0.27115339040756226, 0.19918358325958252, -0.3602287769317627, 0.16237208247184753, -0.19838693737983704, -0.040052272379398346, -0.23781901597976685, -0.055214956402778625, -0.21540802717208862, 0.22323188185691833, -0.5144203901290894, 0.186039537191391, -0.24342192709445953, -0.26058071851730347, -0.18636533617973328, 0.2757950723171234, -0.22851023077964783, -0.14354479312896729, -0.15338456630706787, 0.23013539612293243, -0.2867141366004944, 0.11953307688236237, 0.05087821185588837, -0.055655647069215775, 0.35326364636421204, -0.057457998394966125, -0.0672430694103241, 0.11087048053741455, -0.3356839716434479, -0.4212755262851715, 0.2638533115386963, 0.09456215798854828, 0.26866957545280457, -0.014030452817678452, -0.27338624000549316, 0.0474562831223011, -0.11287073791027069, -0.10070107877254486, 0.11846316605806351, -0.017014358192682266, -0.11617401242256165, 0.010165795683860779, -0.14824417233467102, -0.10464915633201599, -0.036272935569286346, 0.4916021227836609, 0.04414816200733185, -0.2835072875022888, 0.49893718957901, -0.024746187031269073, -0.15067395567893982, -0.19877099990844727, 0.020574912428855896, 0.04862266033887863, -0.23312805593013763, 0.05982745811343193, -0.31253671646118164, -0.21682775020599365, -0.03834979981184006, 0.06206214427947998, 0.24548761546611786, 0.15044628083705902, -0.11630485951900482, -0.5878969430923462, -0.42329686880111694, -0.00897587463259697, -0.2318313717842102, -0.057373229414224625, -0.060346536338329315, -0.1434558629989624, -0.0708121657371521, -0.13652008771896362, -0.2893887162208557, -0.2024223804473877, -0.2940390110015869, 0.025615837424993515, 0.3423084318637848, -0.003383171744644642, 0.5167281031608582, -0.08939550817012787, 0.05833003669977188, 0.12409310042858124, -0.1584971398115158, -0.23600876331329346, 0.045794546604156494, 0.1119968369603157, 0.056122250854969025, -0.13346754014492035, -0.22298608720302582, -0.2193356305360794, -0.20002299547195435, -0.20257356762886047, 0.34796395897865295, 0.17176833748817444, -0.09646151959896088, -0.19329702854156494, -0.03513295575976372, 0.43038588762283325, -0.23639647662639618, 0.002414279617369175, 0.013638107106089592, 0.12368995696306229, -0.17389918863773346, 0.0839730054140091, 0.20522676408290863, 0.09591852873563766, -0.364230215549469, 0.06832759827375412, -0.16936811804771423, 0.12288432568311691, 0.4396395981311798, -0.36563926935195923, 0.1680845469236374, 0.13020287454128265, 0.13265608251094818, 0.00755572784692049, -0.25251829624176025, -0.08954617381095886, 0.20244447886943817, 0.18832191824913025, -0.04687235504388809, 0.012098539620637894, -0.2117670327425003, 0.11763112246990204, 0.057923316955566406, 0.21541261672973633, 0.1241055279970169, -0.32932260632514954, -0.012661740183830261, 0.2787081301212311, 0.8293591737747192, -0.34347832202911377, 0.07405973970890045, -0.11826900392770767, -0.05086774751543999, 0.2903404235839844, 0.25735726952552795, 0.08180408924818039, 0.1349373161792755, 0.702898383140564, 0.0314246229827404, 0.2377379685640335, 0.2929634749889374, 0.07532619684934616, -0.2279576063156128, -0.3673804998397827, -0.4167686998844147, 0.36186471581459045, 0.13119584321975708, 0.35470134019851685, -0.20049583911895752, 0.23560792207717896, -0.5435617566108704, -0.1783468872308731, 0.0804845318198204, -0.12578101456165314, -0.26100319623947144, 0.21148613095283508, 0.07031548023223877, -0.08267576992511749, 0.18786567449569702, -0.07176216691732407, 0.2343626618385315, 0.11626885831356049, -0.08700686693191528, 0.12332528829574585, -0.3306623101234436, -0.09605302661657333, -0.07637697458267212, 0.5234545469284058, -0.14325492084026337, -0.2408348172903061, 0.3464263081550598, 0.4882061183452606, 0.059964243322610855, 0.07078278064727783, 0.2948541045188904, 0.5638357996940613, 0.4346369504928589, 0.1503015160560608, -0.09525319188833237, -0.09151257574558258, -0.1586514115333557, -0.15979042649269104, 0.2421732097864151, -0.028481710702180862, -0.1774422526359558, 0.041015662252902985, 0.18896552920341492, -0.13063476979732513, 0.306073933839798, 0.2020820677280426, 0.12103746831417084, 0.04384677857160568, 0.14836852252483368, -0.08548376709222794, -0.017737112939357758, -0.1583501696586609, 0.0769324004650116, -0.2347116619348526, 0.26603588461875916, 0.38947224617004395, 0.16301538050174713, 0.1632080227136612, 0.1217711865901947, 0.0590616837143898, -0.11659065634012222, 0.38020867109298706, 0.2021631896495819, -0.20960289239883423, -0.28798550367355347, -0.02160467952489853, -0.549717366695404, 0.03211192414164543, -0.15244850516319275, 0.05969446897506714, 0.028238173574209213, 0.20310375094413757, -0.11038103699684143, -0.014046203345060349, 0.19405128061771393, 0.09371845424175262, 0.33071696758270264, -0.4554213881492615, -0.5350496768951416, -0.3815842866897583, -0.19538460671901703, 0.2324175238609314, 0.03106493502855301, -0.5391826629638672, 0.13259896636009216, -0.013726487755775452, 0.12191961705684662, -0.009192512370646, -0.2119428813457489, 0.09545091539621353, 0.4354076087474823, 0.28198134899139404, -0.01720980927348137, 0.27839285135269165, -0.010158352553844452, -0.12732583284378052, -0.2591201364994049, -0.418277382850647, -0.1601196527481079, -0.023894857615232468, -0.016430428251624107, 0.4489211142063141, -0.3500334620475769, -0.020737335085868835, -0.5009876489639282, 0.37335193157196045, -0.009375326335430145, -0.3514811396598816, -0.30561524629592896, 0.212990865111351, -0.14413683116436005, 0.1816009283065796, -0.026422005146741867, -0.039633359760046005, 0.020545249804854393, 0.017192520201206207, -0.3537924587726593, -0.0135158970952034, 0.5301709771156311, -0.32597339153289795, -0.2324741780757904, 0.2895883023738861, 0.09735071659088135, 0.3416745662689209, 0.13343307375907898, -0.5689393281936646, 0.22395336627960205, 0.28632551431655884, 0.03997854143381119, -0.21798759698867798, -0.12552455067634583, -0.14953374862670898, 0.24617551267147064, -0.11907351016998291, -0.07703906297683716, -0.03005557507276535, -0.2893577218055725, 0.11994172632694244, 0.04435114562511444 ]
https://github.com/huggingface/datasets/issues/6112
Thanks for reporting! This is a bug in converting the `ArrayXD` types to YAML. It will be fixed soon.
yaml error using push_to_hub with generated README.md
### Describe the bug When I construct a dataset with the following features: ``` features = Features( { "pixel_values": Array3D(dtype="float64", shape=(3, 224, 224)), "input_ids": Sequence(feature=Value(dtype="int64")), "attention_mask": Sequence(Value(dtype="int64")), "tokens": Sequence(Value(dtype="string")), "bbox": Array2D(dtype="int64", shape=(512, 4)), } ) ``` and run `push_to_hub`, the individual `*.parquet` files are pushed, but when trying to upload the auto-generated README, I run into the following error: ``` Traceback (most recent call last): File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 261, in hf_raise_for_status response.raise_for_status() File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://huggingface.co/api/datasets/looppayments/multitask_document_classification_dataset/commit/main The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/kevintee/loop-payments/ml/src/ml/data_scripts/build_document_classification_training_data.py", line 297, in <module> build_dataset() File "/Users/kevintee/loop-payments/ml/src/ml/data_scripts/build_document_classification_training_data.py", line 290, in build_dataset push_to_hub(dataset, "multitask_document_classification_dataset") File "/Users/kevintee/loop-payments/ml/src/ml/data_scripts/build_document_classification_training_data.py", line 135, in push_to_hub dataset.push_to_hub(f"looppayments/{dataset_name}", private=True) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 5577, in push_to_hub HfApi(endpoint=config.HF_ENDPOINT).upload_file( File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2728, in create_commit hf_raise_for_status(commit_resp, endpoint_name="commit") File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 299, in hf_raise_for_status raise BadRequestError(message, response=response) from e huggingface_hub.utils._errors.BadRequestError: (Request ID: Root=1-64ca9c3d-2d2bbef354e102482a9a168e;bc00371c-8549-4859-9f41-43ff140ad36e) Bad request for commit endpoint: Invalid YAML in README.md: unknown tag !<tag:yaml.org,2002:python/tuple> (10:9) 7 | - 3 8 | - 224 9 | - 224 10 | dtype: float64 --------------^ 11 | - name: input_ids 12 | sequence: int64 ``` My guess is that the auto-generated yaml is unable to be parsed for some reason. ### Steps to reproduce the bug The description contains most of what's needed to reproduce the issue, but I've added a shortened code snippet: ``` from datasets import Array2D, Array3D, ClassLabel, Dataset, Features, Sequence, Value from PIL import Image from transformers import AutoProcessor features = Features( { "pixel_values": Array3D(dtype="float64", shape=(3, 224, 224)), "input_ids": Sequence(feature=Value(dtype="int64")), "attention_mask": Sequence(Value(dtype="int64")), "tokens": Sequence(Value(dtype="string")), "bbox": Array2D(dtype="int64", shape=(512, 4)), } ) processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) def preprocess_dataset(rows): # Get images images = [ Image.open(png_filename).convert("RGB") for png_filename in rows["png_filename"] ] encoding = processor( images, rows["tokens"], boxes=rows["bbox"], truncation=True, padding="max_length", ) encoding["tokens"] = rows["tokens"] return encoding dataset = dataset.map( preprocess_dataset, batched=True, batch_size=5, features=features, ) ``` ### Expected behavior Using datasets==2.11.0, I'm able to succesfully push_to_hub, no issues, but with datasets==2.14.2, I run into the above error. ### Environment info - `datasets` version: 2.14.2 - Platform: macOS-12.5-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 1.5.3
19
yaml error using push_to_hub with generated README.md ### Describe the bug When I construct a dataset with the following features: ``` features = Features( { "pixel_values": Array3D(dtype="float64", shape=(3, 224, 224)), "input_ids": Sequence(feature=Value(dtype="int64")), "attention_mask": Sequence(Value(dtype="int64")), "tokens": Sequence(Value(dtype="string")), "bbox": Array2D(dtype="int64", shape=(512, 4)), } ) ``` and run `push_to_hub`, the individual `*.parquet` files are pushed, but when trying to upload the auto-generated README, I run into the following error: ``` Traceback (most recent call last): File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 261, in hf_raise_for_status response.raise_for_status() File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://huggingface.co/api/datasets/looppayments/multitask_document_classification_dataset/commit/main The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/Users/kevintee/loop-payments/ml/src/ml/data_scripts/build_document_classification_training_data.py", line 297, in <module> build_dataset() File "/Users/kevintee/loop-payments/ml/src/ml/data_scripts/build_document_classification_training_data.py", line 290, in build_dataset push_to_hub(dataset, "multitask_document_classification_dataset") File "/Users/kevintee/loop-payments/ml/src/ml/data_scripts/build_document_classification_training_data.py", line 135, in push_to_hub dataset.push_to_hub(f"looppayments/{dataset_name}", private=True) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 5577, in push_to_hub HfApi(endpoint=config.HF_ENDPOINT).upload_file( File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/hf_api.py", line 2728, in create_commit hf_raise_for_status(commit_resp, endpoint_name="commit") File "/Users/kevintee/.pyenv/versions/dev2/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 299, in hf_raise_for_status raise BadRequestError(message, response=response) from e huggingface_hub.utils._errors.BadRequestError: (Request ID: Root=1-64ca9c3d-2d2bbef354e102482a9a168e;bc00371c-8549-4859-9f41-43ff140ad36e) Bad request for commit endpoint: Invalid YAML in README.md: unknown tag !<tag:yaml.org,2002:python/tuple> (10:9) 7 | - 3 8 | - 224 9 | - 224 10 | dtype: float64 --------------^ 11 | - name: input_ids 12 | sequence: int64 ``` My guess is that the auto-generated yaml is unable to be parsed for some reason. ### Steps to reproduce the bug The description contains most of what's needed to reproduce the issue, but I've added a shortened code snippet: ``` from datasets import Array2D, Array3D, ClassLabel, Dataset, Features, Sequence, Value from PIL import Image from transformers import AutoProcessor features = Features( { "pixel_values": Array3D(dtype="float64", shape=(3, 224, 224)), "input_ids": Sequence(feature=Value(dtype="int64")), "attention_mask": Sequence(Value(dtype="int64")), "tokens": Sequence(Value(dtype="string")), "bbox": Array2D(dtype="int64", shape=(512, 4)), } ) processor = AutoProcessor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=False) def preprocess_dataset(rows): # Get images images = [ Image.open(png_filename).convert("RGB") for png_filename in rows["png_filename"] ] encoding = processor( images, rows["tokens"], boxes=rows["bbox"], truncation=True, padding="max_length", ) encoding["tokens"] = rows["tokens"] return encoding dataset = dataset.map( preprocess_dataset, batched=True, batch_size=5, features=features, ) ``` ### Expected behavior Using datasets==2.11.0, I'm able to succesfully push_to_hub, no issues, but with datasets==2.14.2, I run into the above error. ### Environment info - `datasets` version: 2.14.2 - Platform: macOS-12.5-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 1.5.3 Thanks for reporting! This is a bug in converting the `ArrayXD` types to YAML. It will be fixed soon.
[ -0.14145323634147644, -0.6504641175270081, 0.16394361853599548, 0.21164977550506592, 0.35897690057754517, 0.14997635781764984, 0.37134379148483276, 0.23591384291648865, 0.14923766255378723, -0.15944093465805054, 0.16326947510242462, 0.03520447760820389, -0.10284475982189178, 0.33771488070487976, 0.43635740876197815, 0.30045968294143677, 0.15735721588134766, -0.1943465769290924, 0.031214509159326553, -0.09743228554725647, -0.3234218955039978, 0.2141670137643814, 0.025811463594436646, 0.06524012982845306, -0.3981071412563324, 0.0011548735201358795, -0.0358501560986042, 0.4780605733394623, -0.12093459814786911, -0.4328179657459259, 0.2847924828529358, -0.11912348121404648, -0.25556403398513794, 0.17135868966579437, -0.00012178571341792122, 0.02819962054491043, 0.41314518451690674, -0.27102044224739075, -0.039580583572387695, -0.23875007033348083, 0.07305505871772766, -0.22700002789497375, -0.09074494987726212, -0.2272927165031433, 0.10545425862073898, 0.24145786464214325, -0.1343519687652588, 0.004036262631416321, 0.3302229046821594, 0.34649592638015747, 0.10656355321407318, 0.04698207229375839, 0.2681000232696533, -0.12348254770040512, 0.4714028835296631, 0.2493216097354889, -0.3086612820625305, 0.11240148544311523, 0.33524444699287415, -0.017344169318675995, -0.05123618617653847, 0.2731113135814667, -0.0551811158657074, -0.07601084560155869, 0.3089870810508728, 0.14148931205272675, 0.5767883658409119, -0.11656400561332703, -0.006000899244099855, 0.019627772271633148, 0.11826657503843307, -0.46864765882492065, -0.31945034861564636, -0.45595496892929077, -0.2252746820449829, -0.2073276937007904, 0.21407172083854675, 0.3688887655735016, -0.2580106854438782, -0.05299763381481171, -0.2935098707675934, -0.4572281837463379, -0.12811756134033203, -0.08191373199224472, 0.027662158012390137, 0.08863790333271027, 0.03282253444194794, -0.011526893824338913, -0.07310201227664948, 0.02921891212463379, 0.4163159728050232, 0.031057678163051605, 0.04761173203587532, 0.03587951138615608, 0.05500852316617966, -0.12232037633657455, -0.046318162232637405, -0.13099618256092072, 0.3722655475139618, -0.2445056140422821, -0.22740407288074493, -0.041572295129299164, 0.08949320018291473, 0.1805170476436615, 0.13869759440422058, 0.018592718988656998, 0.041280996054410934, 0.07477691769599915, 0.011205563321709633, 0.48239779472351074, 0.23815757036209106, -0.09240096807479858, -0.059380192309617996, -0.015632405877113342, 0.17444027960300446, 0.10787613689899445, 0.38599681854248047, -0.2463742047548294, -0.3046479821205139, 0.07191319763660431, -0.22759416699409485, 0.2518409788608551, -0.1364513635635376, 0.24235019087791443, 0.008782655000686646, -0.08994099497795105, 0.014014869928359985, 0.2692982852458954, -0.33032453060150146, 0.2513807713985443, -0.11525511741638184, 0.3155227601528168, -0.07115760445594788, 0.32477232813835144, 0.13086861371994019, 0.008531156927347183, 0.25057879090309143, 0.17718136310577393, 0.017191335558891296, -0.3610873222351074, -0.024185478687286377, 0.15486373007297516, 0.09766299277544022, 0.31091633439064026, 0.15126614272594452, 0.23695573210716248, 0.28693699836730957, -0.17680740356445312, -0.22710296511650085, -0.06973615288734436, -0.6048263311386108, -0.5944979190826416, 0.24313396215438843, 0.13796670734882355, 0.04300007224082947, 0.24729792773723602, -0.2882198393344879, -0.10204439610242844, 0.38395804166793823, 0.16065844893455505, 0.0478074736893177, 0.0641893520951271, -0.11003297567367554, -0.04409168288111687, 0.08439565449953079, 0.4933112859725952, 0.24088002741336823, -0.10181908309459686, 0.07921500504016876, 0.3790680170059204, -0.11128180474042892, 0.09066684544086456, -0.14883814752101898, 0.09730258584022522, -0.3141493499279022, 0.5424294471740723, 0.10122048854827881, -0.9887419939041138, -0.2142314314842224, 0.0032973401248455048, -0.14308464527130127, 0.08886197954416275, 0.1005750298500061, -0.1235983595252037, 0.2041584849357605, -0.19266732037067413, 0.3150995373725891, 0.011765338480472565, -0.10925585776567459, 0.18631112575531006, -0.5193573236465454, -0.14840739965438843, -0.2818172872066498, 0.009260453283786774, 0.05993759632110596, -0.1493847668170929, 0.25357306003570557, 0.4716935157775879, 0.19058887660503387, -0.1543629914522171, 0.3992045521736145, 0.13085821270942688, 0.4038398861885071, -0.1196560487151146, 0.11050032824277878, 0.07638918608427048, -0.4154723882675171, 0.0712624341249466, -0.19349035620689392, 0.26163119077682495, -0.4781016409397125, -0.17809486389160156, -0.4858822822570801, 0.10526515543460846, -0.32094427943229675, -0.3360667824745178, 0.0955502986907959, -0.2373591661453247, -0.3277064263820648, 0.16395550966262817, 0.049897342920303345, 0.5355046987533569, -0.23097485303878784, 0.2883095145225525, -0.45719659328460693, 0.44972527027130127, -0.1268385648727417, -0.216757670044899, 0.30656594038009644, 0.19335807859897614, 0.43426647782325745, -0.10621105879545212, 0.12221647053956985, 0.3073747754096985, 0.13349100947380066, 0.3162272870540619, -0.15333643555641174, 0.03390879184007645, 0.45600518584251404, -0.19914931058883667, 0.032572463154792786, -0.2051454484462738, 0.10321614146232605, -0.14842845499515533, -0.18434664607048035, 0.18726226687431335, 0.025475729256868362, 0.22662824392318726, 0.04066003859043121, 0.2081145942211151, -0.055126775056123734, -0.003747686743736267, 0.11100877076387405, -0.24845172464847565, 0.10003968328237534, -0.04397149384021759, 0.049724385142326355, -0.28830718994140625, 0.3763183355331421, 0.32250380516052246, 0.5579285025596619, 0.12984730303287506, 0.124118871986866, 0.1354053020477295, -0.1916445791721344, -0.1872965395450592, 0.0610961839556694, 0.027698203921318054, -0.07783366739749908, -0.1218094527721405, -0.2794712483882904, 0.43882566690444946, -0.15359684824943542, -0.0926608145236969, 0.11274977028369904, 0.00651179626584053, 0.30044716596603394, 0.36409372091293335, 0.29878610372543335, -0.07296629250049591, -0.4359251856803894, 0.23111200332641602, 0.06189870834350586, 0.22051183879375458, -0.48262691497802734, 0.018692053854465485, 0.17621693015098572, 0.33913347125053406, -0.09226788580417633, -0.19475631415843964, -0.3774302303791046, -0.49377894401550293, 0.020823847502470016, 0.449350506067276, 0.08910353481769562, -0.06393352150917053, 0.17026875913143158, -0.0458393394947052, 0.1726902574300766, 0.1407080590724945, -0.16785180568695068, -0.15463697910308838, -0.0000742659904062748, -0.049984678626060486, 0.08055062592029572, 0.2993072271347046, 0.24986746907234192, -0.17036902904510498, 0.16938868165016174, -0.42332786321640015, -0.23939268290996552, 0.1483975499868393, -0.30232763290405273, 0.39775606989860535, 0.15162216126918793, 0.04931103438138962, 0.1278504878282547, -0.16010631620883942, 0.3770144581794739, 0.06583978980779648, -0.3301166594028473, 0.11775054037570953, 0.06600049138069153, -0.1682557612657547, -0.07852155715227127, -0.23691020905971527, 0.07963588833808899, -0.34073594212532043, 0.015478899702429771, 0.2001737356185913, 0.08976893126964569, 0.04425473511219025, -0.17938710749149323, 0.004366029053926468, 0.1392655223608017, -0.22670546174049377, -0.07225674390792847, -0.011263862252235413, 0.3250895142555237, -0.2548500895500183, -0.2046167254447937, 0.20612946152687073, 0.060238614678382874, 0.0639900267124176, 0.27912184596061707, -0.4776427745819092, -0.49083411693573, 0.15435755252838135, -0.15492109954357147, 0.07476429641246796, -0.21552230417728424, 0.3305395245552063, 0.22385360300540924, 0.032839223742485046, -0.13226427137851715, -0.3083094656467438, 0.32483911514282227, 0.3331586420536041, -0.08884559571743011, -0.10114020109176636, 0.2185201495885849, 0.21928450465202332, 0.23670870065689087, 0.12550081312656403, 0.27404528856277466, 0.5245695114135742, 0.08665022253990173, 0.17522895336151123, -0.15140561759471893, -0.29721906781196594, -0.0449855737388134, -0.11108536273241043, 0.084281787276268, 0.14703789353370667, 0.17619648575782776, 0.1240989938378334, -0.09242957085371017, -0.28398385643959045, -0.22768595814704895, -0.37793198227882385, -0.27805188298225403, 0.11117422580718994, 0.0738489031791687, -0.02386314794421196, 0.20755653083324432, -0.13531586527824402, -0.22445380687713623, 0.49826452136039734, 0.277692973613739, 0.13107621669769287, 0.09726287424564362, -0.24755336344242096, 0.13154835999011993, -0.41119277477264404, 0.02427509054541588, 0.17835885286331177, 0.20961390435695648, -0.05191299691796303, 0.10459855943918228, 0.1257631480693817, -0.4166472554206848, 0.5181112289428711, -0.3652258515357971, 0.1989174634218216, 0.04219144582748413, -0.09978131204843521, -0.11922483146190643, -0.027987271547317505, 0.047222211956977844, 0.37028780579566956, -0.24558663368225098, 0.8610211610794067, -0.5090005397796631, -0.012849703431129456, -0.15453962981700897, -0.1531280279159546, -0.18299856781959534, 0.07933756709098816, 0.07383418083190918, -0.5158477425575256, -0.4263285994529724, 0.0014226175844669342, 0.2369576394557953, 0.2437833547592163, 0.07920878380537033, -0.2814617455005646, 0.26764893531799316, 0.014629021286964417, 0.06509612500667572, -0.18303874135017395, 0.19098523259162903, -0.26615744829177856, 0.2217007577419281, 0.05310468375682831, 0.26912927627563477, 0.525093138217926, 0.31487348675727844, 0.034569960087537766, -0.33698466420173645, -0.18631437420845032, -0.2978343665599823, 0.03296089172363281, 0.5744413137435913, 0.24706435203552246, 0.09834863990545273, 0.04485920071601868, -0.062430817633867264, -0.23274680972099304, 0.04839375615119934, 0.42238491773605347, -0.30497175455093384, -0.5446643829345703, -0.08099427819252014, 0.48013344407081604, -0.18750351667404175, 0.16593687236309052, 0.2727091908454895, 0.37828803062438965, -0.5377066731452942, 0.16004127264022827, 0.30642080307006836, 0.9193121790885925, -0.12390291690826416, 0.14421766996383667, 0.3534284830093384, 0.026573121547698975, 0.009170569479465485, -0.654715895652771, 0.1001836284995079, -0.4703080952167511, 0.11124446988105774, -0.06734650582075119, -0.015332609415054321, 0.11697699129581451, -0.0373603031039238, -0.11252500116825104, 0.03586095571517944, 0.024992063641548157, 0.2024191915988922, -0.19832836091518402, 0.15270088613033295, -0.41434788703918457, -0.3061416447162628, -0.3123632073402405, 0.0567794069647789, 0.02191157080233097, 0.06807492673397064, 0.011509720236063004, -0.3344745635986328, -0.2502674162387848, -0.2868955731391907, -0.4269530475139618, 0.053052425384521484, -0.13874222338199615, -0.08245007693767548, -0.02367481216788292, -0.17698931694030762, 0.07636210322380066, -0.23899289965629578, 0.5556507706642151, 0.19052518904209137, -0.4286903440952301, 0.1991696059703827, -0.14345040917396545, -0.21438753604888916, 0.10505112260580063, -0.022396765649318695, 0.11290834844112396, -0.2317412793636322, -0.026163801550865173, 0.012972763739526272, -0.10558463633060455, -0.10718050599098206, 0.017037928104400635, -0.2372037023305893, 0.23310326039791107, -0.38595259189605713, -0.1166362315416336, -0.11227782070636749, 0.006062939763069153, -0.3286377191543579, 0.026541825383901596, -0.06548458337783813, -0.07510897517204285, -0.16484050452709198, -0.011654771864414215, -0.1977328360080719, -0.02087908424437046, 0.22427457571029663, -0.13096307218074799, -0.1294078230857849, 0.23603282868862152, 0.10129263997077942, -0.3282178044319153, -0.04628879576921463, 0.01851772516965866, 0.2608298659324646, -0.5221939086914062, 0.0671795904636383, -0.11972098052501678, -0.11626078933477402, 0.026142332702875137, 0.43768012523651123, 0.06516474485397339, -0.09756115078926086, 0.14471018314361572, -0.397928386926651, -0.10237108170986176, 0.23219892382621765, -0.062255632132291794, 0.0002068295143544674, -0.050146639347076416, 0.03799208998680115, -0.07376410812139511, 0.09737350046634674, -0.21984797716140747, 0.18513450026512146, -0.14133071899414062, 0.3399105966091156, -0.042275842279195786, -0.18268728256225586, 0.09292436391115189, -0.18648838996887207, 0.03144177049398422, 0.22929014265537262, -0.41852253675460815, -0.04725303128361702, -0.23538532853126526, 0.16098333895206451, 0.12441706657409668, -0.13248662650585175, 0.03731312230229378, 0.008225515484809875, -0.12912282347679138, -0.24624019861221313, 0.17452211678028107, 0.367666631937027, -0.07008007168769836, -0.4042609632015228, 0.6609430313110352, 0.1541983187198639, -0.2504768371582031, 0.09650039672851562, -0.1016736850142479, 0.14924386143684387, -0.2933330237865448, -0.13378746807575226, -0.1738472431898117, 0.030415579676628113, 0.14729905128479004, 0.22789494693279266, 0.2759513854980469, 0.12298517674207687, 0.5566917657852173, -0.28549760580062866, -0.10182878375053406, 0.10866125673055649, 0.2902641296386719, 0.24044623970985413, -0.31736326217651367, -0.17900745570659637, 0.05632166936993599, 0.0777207463979721, -0.015170302242040634, -0.11659397929906845, 0.42513781785964966, -0.5247478485107422, -0.07319290190935135, 0.249220609664917, 0.5344079732894897, -0.01317518949508667, -0.18750303983688354, 0.3377857208251953, 0.7587686777114868, -0.2899250090122223, -0.04618772491812706, 0.2197524756193161, -0.17134229838848114, 0.3562914729118347, 0.1042959988117218, 0.03691544756293297, 0.22234860062599182, 0.3125665485858917, -0.005517482757568359, 0.08921632170677185, 0.3057498335838318, -0.11837244778871536, -0.14032311737537384, -0.12060212343931198, -0.016901031136512756, 0.12786412239074707, 0.16851720213890076, 0.21180158853530884, 0.03362186625599861, 0.3988734483718872, 0.24031774699687958, -0.21381570398807526, -0.32125145196914673, 0.26941296458244324, -0.15083204209804535, 0.06057952716946602, 0.47075146436691284, -0.20895671844482422, -0.39982515573501587, 0.08302605152130127, -0.15343421697616577, -0.18445447087287903, 0.20445729792118073, -0.08611501008272171, 0.03844970464706421, 0.13371653854846954, 0.07018360495567322, -0.0017892587929964066, 0.33339303731918335, -0.31607845425605774, 0.24767248332500458, 0.21154995262622833, -0.18612343072891235, -0.2046060711145401, 0.14368562400341034, 0.4778110980987549, 0.30702707171440125, -0.311020165681839, 0.040549520403146744, 0.3310847878456116, 0.03970988094806671, 0.280333936214447, 0.109307661652565, -0.011549364775419235, 0.23657377064228058, 0.09767013788223267, 0.044733189046382904, -0.09354342520236969, -0.09403795003890991, 0.030769530683755875, -0.18770602345466614, 0.23245854675769806, 0.11423663049936295, -0.20656126737594604, -0.16770847141742706, -0.1206304281949997, -0.026555173099040985, -0.20162343978881836, -0.21924854815006256, 0.4548560380935669, -0.09414619207382202, 0.18899789452552795, -0.14044085144996643, 0.05203846096992493, -0.06386137753725052, 0.3506315052509308, 0.24490422010421753, -0.3448292016983032, -0.22498828172683716, -0.013040035963058472, -0.47606393694877625, 0.23926924169063568, -0.2560389041900635, -0.00525365024805069, 0.05919932946562767, -0.13597193360328674, 0.08808062225580215, -0.008718102239072323, -0.2979624271392822, 0.1603628247976303, 0.03624542057514191, 0.2661040425300598, -0.11559424549341202, 0.023364156484603882, 0.30794757604599, -0.2609979510307312, 0.04944867640733719, -0.2620602250099182, 0.4168524742126465, -0.10315166413784027, 0.021427854895591736, 0.09321925789117813, 0.28159254789352417, 0.13728778064250946, 0.03568213805556297, 0.04705577343702316, 0.021558048203587532, 0.29521802067756653, -0.3210248351097107, -0.43710172176361084, -0.13308459520339966, -0.2942379117012024, 0.09333294630050659, 0.1156129315495491, -0.18631646037101746, 0.211747407913208, 0.012095116078853607, -0.3818643391132355, -0.22569772601127625, 0.42190736532211304, 0.07536868751049042, -0.08183126151561737, -0.22866828739643097, 0.2789510488510132, -0.2969748377799988, 0.010144300758838654, 0.32145142555236816, -0.06931823492050171, 0.1277245432138443, 0.17683902382850647, -0.15381038188934326, -0.5238481760025024, 0.5752625465393066, -0.27509936690330505, -0.23171281814575195, 0.21577435731887817, 0.3072219491004944, 0.3704407215118408, -0.12074842303991318, -0.5158799290657043, -0.0865788459777832, 0.2978360950946808, 0.01951582357287407, -0.3290562629699707, 0.16557577252388, -0.015782639384269714, -0.3049033284187317, -0.05303661525249481, 0.08428937196731567, 0.13822656869888306, -0.26176175475120544, 0.35995396971702576, -0.08035828918218613 ]
https://github.com/huggingface/datasets/issues/6111
This should work: `load_dataset("path/to/downloaded_repo")` `load_from_disk` is intended to be used on directories created with `Dataset.save_to_disk` or `DatasetDict.save_to_disk`
raise FileNotFoundError("Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." )
### Describe the bug For researchers in some countries or regions, it is usually the case that the download ability of `load_dataset` is disabled due to the complex network environment. People in these regions often prefer to use git clone or other programming tricks to manually download the files to the disk (for example, [How to elegantly download hf models, zhihu zhuanlan](https://zhuanlan.zhihu.com/p/475260268) proposed a crawlder based solution, and [Is there any mirror for hf_hub, zhihu answer](https://www.zhihu.com/question/371644077) provided some cloud based solutions, and [How to avoid pitfalls on Hugging face downloading, zhihu zhuanlan] gave some useful suggestions), and then use `load_from_disk` to get the dataset object. However, when one finally has the local files on the disk, it is still buggy when trying to load the files into objects. ### Steps to reproduce the bug Steps to reproduce the bug: 1. Found CIFAR dataset in hugging face: https://huggingface.co/datasets/cifar100/tree/main 2. Click ":" button to show "Clone repository" option, and then follow the prompts on the box: ```bash cd my_directory_absolute git lfs install git clone https://huggingface.co/datasets/cifar100 ls my_directory_absolute/cifar100 # confirm that the directory exists and it is OK. ``` 3. Write A python file to try to load the dataset ```python from datasets import load_dataset, load_from_disk dataset = load_from_disk("my_directory_absolute/cifar100") ``` Notice that according to issue #3700 , it is wrong to use load_dataset("my_directory_absolute/cifar100"), so we must use load_from_disk instead. 4. Then you will see the error reported: ```log --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[5], line 9 1 from datasets import load_dataset, load_from_disk ----> 9 dataset = load_from_disk("my_directory_absolute/cifar100") File [~/miniconda3/envs/ai/lib/python3.10/site-packages/datasets/load.py:2232), in load_from_disk(dataset_path, fs, keep_in_memory, storage_options) 2230 return DatasetDict.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options) 2231 else: -> 2232 raise FileNotFoundError( 2233 f"Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." 2234 ) FileNotFoundError: Directory my_directory_absolute/cifar100 is neither a `Dataset` directory nor a `DatasetDict` directory. ``` ### Expected behavior The dataset should be load successfully. ### Environment info ```bash datasets-cli env ``` -> results: ```txt Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.14.2 - Platform: Linux-4.18.0-372.32.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 ```
17
raise FileNotFoundError("Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." ) ### Describe the bug For researchers in some countries or regions, it is usually the case that the download ability of `load_dataset` is disabled due to the complex network environment. People in these regions often prefer to use git clone or other programming tricks to manually download the files to the disk (for example, [How to elegantly download hf models, zhihu zhuanlan](https://zhuanlan.zhihu.com/p/475260268) proposed a crawlder based solution, and [Is there any mirror for hf_hub, zhihu answer](https://www.zhihu.com/question/371644077) provided some cloud based solutions, and [How to avoid pitfalls on Hugging face downloading, zhihu zhuanlan] gave some useful suggestions), and then use `load_from_disk` to get the dataset object. However, when one finally has the local files on the disk, it is still buggy when trying to load the files into objects. ### Steps to reproduce the bug Steps to reproduce the bug: 1. Found CIFAR dataset in hugging face: https://huggingface.co/datasets/cifar100/tree/main 2. Click ":" button to show "Clone repository" option, and then follow the prompts on the box: ```bash cd my_directory_absolute git lfs install git clone https://huggingface.co/datasets/cifar100 ls my_directory_absolute/cifar100 # confirm that the directory exists and it is OK. ``` 3. Write A python file to try to load the dataset ```python from datasets import load_dataset, load_from_disk dataset = load_from_disk("my_directory_absolute/cifar100") ``` Notice that according to issue #3700 , it is wrong to use load_dataset("my_directory_absolute/cifar100"), so we must use load_from_disk instead. 4. Then you will see the error reported: ```log --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[5], line 9 1 from datasets import load_dataset, load_from_disk ----> 9 dataset = load_from_disk("my_directory_absolute/cifar100") File [~/miniconda3/envs/ai/lib/python3.10/site-packages/datasets/load.py:2232), in load_from_disk(dataset_path, fs, keep_in_memory, storage_options) 2230 return DatasetDict.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options) 2231 else: -> 2232 raise FileNotFoundError( 2233 f"Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." 2234 ) FileNotFoundError: Directory my_directory_absolute/cifar100 is neither a `Dataset` directory nor a `DatasetDict` directory. ``` ### Expected behavior The dataset should be load successfully. ### Environment info ```bash datasets-cli env ``` -> results: ```txt Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.14.2 - Platform: Linux-4.18.0-372.32.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 ``` This should work: `load_dataset("path/to/downloaded_repo")` `load_from_disk` is intended to be used on directories created with `Dataset.save_to_disk` or `DatasetDict.save_to_disk`
[ -0.2685803771018982, -0.06441403180360794, 0.07613176852464676, 0.36047497391700745, 0.04826785624027252, -0.09567469358444214, 0.10725240409374237, 0.23474422097206116, 0.24625685811042786, 0.1420275866985321, -0.15977632999420166, 0.08738145232200623, 0.020607292652130127, 0.10617546737194061, 0.07854142040014267, 0.01053592748939991, 0.0315161868929863, 0.03417903929948807, -0.6918331384658813, -0.20704248547554016, -0.24459390342235565, 0.29019400477409363, 0.14227689802646637, 0.018990546464920044, -0.10251641273498535, -0.12898863852024078, -0.16343167424201965, 0.6054629683494568, -0.18631583452224731, -0.08732243627309799, 0.2295733094215393, 0.04001610726118088, 0.21535015106201172, 0.7305638194084167, -0.00011113502841908485, 0.16581889986991882, 0.17618826031684875, -0.03929421305656433, -0.5917066931724548, -0.4094899892807007, 0.34962204098701477, 0.03128945827484131, 0.06290818005800247, -0.18381184339523315, -0.14679023623466492, 0.09620839357376099, 0.16525708138942719, -0.1326177418231964, 0.2705259323120117, 0.3432183563709259, 0.16637426614761353, 0.3672279715538025, 0.21362435817718506, -0.21856394410133362, 0.0392734557390213, 0.39880743622779846, -0.1898919939994812, 0.5879904627799988, 0.03528875857591629, 0.06733392924070358, -0.054960787296295166, 0.15975311398506165, -0.12762819230556488, -0.028013909235596657, 0.5269319415092468, 0.09606871753931046, -0.07411783933639526, -0.3445342779159546, 0.05774744600057602, 0.2050488293170929, 0.2938068211078644, -0.23967967927455902, -0.3719455599784851, -0.2467142790555954, -0.004097826778888702, -0.01028887927532196, 0.2606619894504547, 0.03430699557065964, -0.12453927099704742, 0.25404247641563416, -0.15530091524124146, -0.09873741120100021, -0.15647584199905396, 0.19849884510040283, -0.04051665961742401, -0.25494393706321716, -0.11702010035514832, -0.0018419940024614334, 0.30767813324928284, -0.12102571129798889, -0.19010668992996216, -0.46886637806892395, -0.054036084562540054, 0.07491033524274826, -0.13235527276992798, 0.1193201020359993, 0.2710428535938263, 0.28812021017074585, 0.25552812218666077, 0.13631868362426758, 0.2199152410030365, -0.11005738377571106, -0.31322813034057617, 0.056612152606248856, 0.17644965648651123, 0.20595528185367584, -0.16015075147151947, 0.052542541176080704, 0.2630329728126526, 0.40274783968925476, -0.024734385311603546, -0.06466078758239746, -0.011089213192462921, -0.1822417676448822, -0.4756045341491699, -0.0013279411941766739, 0.5227885246276855, -0.16875103116035461, -0.26265957951545715, -0.069558285176754, 0.08126942068338394, 0.12346714735031128, 0.2327864170074463, 0.5094819664955139, 0.05428243428468704, -0.093495212495327, 0.2366766333580017, 0.1604876071214676, -0.11832663416862488, -0.09471505880355835, -0.16622546315193176, 0.0941779613494873, 0.033607661724090576, 0.10994558036327362, 0.10122896730899811, -0.30492621660232544, 0.16306069493293762, -0.22014854848384857, 0.2672426700592041, 0.05150863528251648, -0.1861533522605896, -0.26154908537864685, 0.10927204042673111, 0.46786871552467346, -0.0365719273686409, -0.10365567356348038, 0.281024694442749, -0.2582605183124542, -0.11265545338392258, 0.08672743290662766, -0.1922883838415146, -0.2786116600036621, -0.12432039529085159, 0.13113901019096375, -0.19014930725097656, 0.08058003336191177, -0.4516790807247162, -0.1697731614112854, -0.340270072221756, -0.05889178067445755, 0.10262272506952286, -0.029813550412654877, -0.22963911294937134, -0.18942084908485413, 0.39064520597457886, 0.857356071472168, -0.1126251295208931, 0.07181866466999054, -0.4552200138568878, -0.1054505705833435, -0.02447475492954254, 0.3188113868236542, -0.1641567051410675, 0.4836153984069824, -0.6427759528160095, 0.15184660255908966, 0.3489421010017395, -0.5417800545692444, -0.4081420302391052, 0.4141632318496704, -0.3210620880126953, 0.31155648827552795, 0.10351879894733429, 0.04705587029457092, -0.18493379652500153, -0.06565485894680023, 0.026564719155430794, 0.2014462798833847, 0.023365342989563942, -0.005839601159095764, -0.1996641457080841, -0.3638891875743866, -0.1003383994102478, 0.1627802848815918, 0.1138448417186737, 0.4014335572719574, 0.3901670277118683, -0.3870822787284851, 0.2643735408782959, -0.33933383226394653, -0.09939559549093246, 0.3052979111671448, 0.3714905381202698, 0.08486834168434143, 0.03684702515602112, 0.10838408768177032, -0.5783799290657043, 0.30550336837768555, 0.016990207135677338, 0.12751391530036926, -0.18325310945510864, -0.0809062123298645, -0.23986086249351501, 0.02200985699892044, -0.24417239427566528, 0.05316273868083954, 0.10070556402206421, 0.15674811601638794, 0.07825419306755066, -0.08304367959499359, -0.019382447004318237, 0.5406789779663086, -0.1848699450492859, 0.17321091890335083, -0.43656209111213684, 0.5115260481834412, -0.18991103768348694, -0.10964824259281158, -0.10455619543790817, -0.05092260241508484, 0.09317877888679504, -0.24118363857269287, -0.1238354742527008, 0.4005262553691864, -0.15221665799617767, 0.19488383829593658, 0.009625504724681377, 0.13435222208499908, 0.24201713502407074, -0.21873927116394043, 0.044235311448574066, 0.27842724323272705, 0.28713786602020264, 0.18841294944286346, -0.1330515742301941, 0.2662205100059509, -0.32212015986442566, 0.031867921352386475, 0.3144184947013855, -0.10568345338106155, 0.2146846055984497, -0.04860426485538483, -0.03724326938390732, -0.059238847345113754, 0.49813753366470337, -0.08560533076524734, 0.5943825244903564, 0.06208948791027069, -0.17295028269290924, 0.15091076493263245, 0.1648627072572708, -0.0958174616098404, 0.13927710056304932, 0.2057461440563202, 0.0007592514157295227, 0.1387535184621811, 0.060467928647994995, 0.3530752956867218, 0.5395947098731995, 0.1393897831439972, -0.07688768953084946, 0.20112808048725128, 0.12605302035808563, -0.014055512845516205, 0.24760153889656067, -0.004870947450399399, 0.368238627910614, 0.3471686542034149, -0.13311202824115753, 0.06900347769260406, -0.4841655194759369, -0.38689959049224854, -0.18935781717300415, 0.0492502823472023, -0.4460197389125824, 0.14029660820960999, -0.07708413898944855, -0.10393242537975311, -0.24390365183353424, 0.1636960804462433, -0.2248137891292572, -0.08654319494962692, -0.23135030269622803, 0.5575091242790222, -0.3009207844734192, -0.0556224100291729, 0.009609788656234741, 0.16414235532283783, -0.15288372337818146, -0.10483754426240921, -0.3284949064254761, 0.1514870822429657, -0.19426599144935608, -0.050284262746572495, 0.3661644160747528, -0.22733478248119354, 0.08481952548027039, -0.433962345123291, 0.051991283893585205, -0.617687463760376, -0.2430378794670105, 0.2820192575454712, 0.06703434884548187, 0.5094625949859619, 0.2056247740983963, 0.30439120531082153, -0.12808026373386383, -0.23536381125450134, 0.17349101603031158, -0.08966289460659027, -0.22976024448871613, 0.1432119607925415, -0.06873781234025955, -0.05947796627879143, -0.2363603115081787, -0.2425594925880432, -0.4206852316856384, -0.4049266576766968, 0.30610695481300354, 0.00846768170595169, 0.10223720222711563, 0.6059832572937012, 0.1481982171535492, 0.18669098615646362, 0.1255708932876587, 0.13583478331565857, -0.06489404290914536, -0.4495312571525574, 0.26320576667785645, -0.2292703092098236, -0.4807106554508209, -0.12808339297771454, -0.016987286508083344, -0.17602837085723877, 0.022783666849136353, -0.4674588441848755, -0.2350350171327591, -0.06858158856630325, 0.32656508684158325, -0.04924461618065834, -0.14227060973644257, 0.23528891801834106, -0.08831603825092316, 0.0016280300915241241, -0.17664484679698944, -0.028632406145334244, 0.19774498045444489, 0.15837791562080383, 0.09743152558803558, -0.05984999239444733, 0.4056326150894165, 0.002468518912792206, 0.3298984467983246, 0.0340408980846405, 0.1488165408372879, 0.49900686740875244, -0.1582537144422531, 0.5130494832992554, -0.464611679315567, -0.35042089223861694, -0.15843409299850464, -0.07146734744310379, -0.4111618399620056, 0.4197818636894226, 0.009853444993495941, 0.13061711192131042, -0.18014760315418243, -0.4358445405960083, -0.5035189986228943, -0.4108198285102844, -0.008810346946120262, 0.015428675338625908, -0.04583960399031639, -0.005111344158649445, -0.015798456966876984, -0.07937990874052048, -0.07863877713680267, 0.15836189687252045, 0.5512445569038391, 0.22773616015911102, 0.13361231982707977, -0.20475487411022186, -0.3703681230545044, -0.31445133686065674, 0.24188466370105743, 0.03226049989461899, 0.07926961034536362, -0.36667078733444214, -0.06925591081380844, -0.06207835674285889, -0.2893804609775543, 0.788637638092041, 0.19404302537441254, 0.3782319724559784, 0.015029050409793854, -0.2368277609348297, -0.21893835067749023, -0.10893334448337555, 0.21245820820331573, 0.047344595193862915, -0.08342693746089935, 0.4754897356033325, -0.2511345148086548, -0.06427770853042603, 0.21579790115356445, 0.21217992901802063, -0.16437764465808868, 0.03975922241806984, -0.21589437127113342, -0.4513472318649292, -0.31918811798095703, -0.26276618242263794, 0.002298586070537567, 0.1383187621831894, -0.09174758195877075, 0.1724744290113449, 0.05652052164077759, 0.0034242942929267883, 0.04993841424584389, 0.056645650416612625, 0.37008410692214966, 0.008300460875034332, 0.22395901381969452, 0.18079832196235657, 0.13415738940238953, 0.502440333366394, 0.657386302947998, -0.034960515797138214, -0.2243470847606659, 0.04774295911192894, -0.06400822848081589, -0.08779056370258331, 0.35489165782928467, -0.04770263656973839, -0.31829047203063965, 0.3630203306674957, 0.09126502275466919, -0.3309478163719177, 0.012759380042552948, 0.10879148542881012, -0.05649256706237793, -0.13301733136177063, 0.10041970014572144, 0.4836731553077698, 0.030260086059570312, 0.021082013845443726, 0.17998158931732178, 0.37313687801361084, -0.28211110830307007, 0.4509871006011963, -0.18676523864269257, 0.9144400358200073, -0.03673940524458885, 0.18013665080070496, 0.31699904799461365, -0.17444655299186707, 0.395885169506073, -0.2174472212791443, -0.035196103155612946, -0.2881319224834442, -0.40223315358161926, -0.06258318573236465, -0.05842607095837593, 0.2637491226196289, 0.18216043710708618, -0.1088082417845726, 0.2901230454444885, -0.12618982791900635, 0.19615837931632996, -0.15559571981430054, 0.2335081547498703, -0.1522698998451233, -0.13262063264846802, -0.2530747056007385, 0.10998199880123138, -0.07835143804550171, 0.5246104598045349, -0.15334776043891907, -0.23284918069839478, -0.3555995225906372, -0.31590399146080017, -0.03419259190559387, 0.17088526487350464, -0.15767139196395874, 0.2198466658592224, -0.012657450512051582, -0.2643114924430847, -0.35506412386894226, 0.17385533452033997, 0.33411523699760437, -0.017670150846242905, -0.28502580523490906, 0.12455189973115921, -0.19931556284427643, 0.18089333176612854, -0.056493740528821945, -0.17181386053562164, 0.3326796293258667, -0.08348163217306137, -0.13660767674446106, -0.4246935248374939, -0.2956399917602539, -0.2257748395204544, 0.2677886486053467, -0.16623659431934357, 0.012141640298068523, 0.07282128930091858, -0.12043935060501099, 0.10861559212207794, -0.08005422353744507, -0.14997023344039917, 0.11306110769510269, -0.12794248759746552, -0.08001506328582764, -0.20933397114276886, -0.0027317123021930456, -0.3079514503479004, -0.11694898456335068, 0.490979939699173, -0.24573057889938354, 0.14538992941379547, 0.3988833725452423, 0.11519643664360046, -0.09849109500646591, -0.21222944557666779, 0.14232732355594635, 0.3680264949798584, -0.4808524549007416, 0.226565420627594, 0.02854377031326294, -0.015451565384864807, -0.22583064436912537, 0.5035821199417114, 0.34602782130241394, -0.3873843252658844, -0.24856644868850708, -0.4026907682418823, -0.2620629072189331, 0.27906596660614014, -0.016883790493011475, 0.16141986846923828, 0.4006061553955078, -0.010232293978333473, 0.18071845173835754, -0.219127357006073, -0.29992246627807617, -0.06886808574199677, -0.3688223659992218, -0.03663702309131622, 0.497234046459198, 0.020759595558047295, 0.3035246431827545, 0.0013830438256263733, 0.10442408919334412, -0.12333051860332489, -0.16283965110778809, -0.19901496171951294, -0.05596939101815224, 0.1372925341129303, -0.01380041241645813, -0.1396251916885376, 0.012617968022823334, -0.30028608441352844, -0.09663374722003937, -0.168822780251503, 0.08891935646533966, 0.14302965998649597, 0.02288438007235527, -0.05327025428414345, -0.10770419239997864, 0.16680796444416046, -0.2191552221775055, 0.24280360341072083, 0.013086700811982155, 0.2340034693479538, -0.1120004802942276, 0.1102374717593193, -0.2656247615814209, -0.07471529394388199, -0.2427813857793808, -0.053991515189409256, -0.06579753756523132, 0.2191304862499237, 0.29010581970214844, -0.12931543588638306, -0.0029197484254837036, -0.054329607635736465, 0.31219449639320374, 0.10464128106832504, -0.1281684935092926, -0.027934350073337555, 0.16484184563159943, 0.12755969166755676, -0.17318511009216309, -0.2813203036785126, 0.20275096595287323, -0.2798771560192108, 0.10344448685646057, 0.11632951349020004, 0.02494513988494873, -0.03997587412595749, 0.0015142261981964111, 0.03071744740009308, 0.7683966755867004, 0.14325189590454102, 0.09144417941570282, 0.3608546853065491, -0.10145854949951172, 0.2412720024585724, -0.002846295014023781, 0.051174361258745193, 0.33591726422309875, 0.5229349732398987, -0.3579714298248291, 0.02373426966369152, -0.2506181001663208, 0.2712361216545105, 0.24883301556110382, -0.5451616048812866, 0.45780596137046814, 0.007885225117206573, -0.05614277347922325, -0.058817651122808456, -0.0786115899682045, 0.001726388931274414, -0.34916120767593384, -0.13646048307418823, -0.24380013346672058, 0.2841907739639282, -0.18012401461601257, 0.16564442217350006, -0.29025593400001526, -0.18091636896133423, 0.0022561997175216675, 0.07929062843322754, -0.02698475681245327, -0.17472493648529053, 0.2448442429304123, 0.1322837620973587, -0.004905868321657181, 0.0673103928565979, -0.05421139672398567, 0.1343158781528473, 0.0028220750391483307, -0.18990746140480042, 0.232417032122612, 0.18641266226768494, 0.03136961907148361, 0.10676352679729462, 0.4649530053138733, 0.3789122998714447, 0.36076995730400085, 0.12976136803627014, 0.08384636044502258, 0.05957476422190666, -0.1856934279203415, -0.19621190428733826, -0.13262519240379333, -0.23862454295158386, 0.10449211299419403, 0.35577118396759033, 0.17733368277549744, -0.1359422206878662, 0.052073486149311066, -0.029590796679258347, 0.13119098544120789, -0.19827112555503845, 0.18919676542282104, -0.19692710041999817, -0.08386494219303131, -0.0012301476672291756, 0.008023791015148163, -0.3349694311618805, 0.17468343675136566, 0.3640054166316986, -0.19951173663139343, 0.267204612493515, 0.07386220991611481, 0.07735956460237503, 0.17404672503471375, 0.34176987409591675, 0.34328746795654297, 0.08112442493438721, -0.2299298197031021, 0.019717618823051453, -0.6158757209777832, 0.014174152165651321, -0.008375083096325397, 0.168191596865654, 0.0675828605890274, 0.03002401441335678, -0.016125496476888657, -0.103995680809021, 0.1778852343559265, -0.09383845329284668, 0.12873390316963196, 0.23069116473197937, -0.0400703139603138, -0.21980664134025574, -0.1460805982351303, 0.06913871318101883, -0.0795852541923523, -0.5833837389945984, 0.19352051615715027, -0.0931045264005661, 0.04434452950954437, 0.14394107460975647, -0.07750168442726135, -0.14527887105941772, -0.15230302512645721, 0.36713337898254395, 0.13237223029136658, 0.1828312873840332, -0.25532686710357666, -0.28062543272972107, -0.09030963480472565, -0.1827327311038971, -0.06439989060163498, 0.14716513454914093, -0.01895318180322647, 0.3411335349082947, -0.22716902196407318, -0.11863354593515396, -0.3576570451259613, 0.02743503451347351, 0.18418064713478088, 0.1695718765258789, -0.42313989996910095, 0.30353283882141113, -0.3606525659561157, 0.11146806180477142, 0.07836618274450302, 0.2387489378452301, -0.025044497102499008, 0.04130101948976517, -0.2680346369743347, -0.25893014669418335, 0.6637139320373535, -0.2597299814224243, -0.028269115835428238, -0.0777079164981842, 0.2275693118572235, 0.16002029180526733, -0.15532752871513367, -0.20913341641426086, 0.14299200475215912, 0.24167612195014954, 0.10074856877326965, -0.08253267407417297, 0.09100742638111115, -0.08256550878286362, -0.008008964359760284, 0.05171048641204834, 0.4207123816013336, 0.06149352714419365, -0.304254412651062, 0.28569841384887695, -0.09946244955062866 ]
https://github.com/huggingface/datasets/issues/6111
> This should work: `load_dataset("path/to/downloaded_repo")` > > `load_from_disk` is intended to be used on directories created with `Dataset.save_to_disk` or `DatasetDict.save_to_disk` Thanks for your help. This works.
raise FileNotFoundError("Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." )
### Describe the bug For researchers in some countries or regions, it is usually the case that the download ability of `load_dataset` is disabled due to the complex network environment. People in these regions often prefer to use git clone or other programming tricks to manually download the files to the disk (for example, [How to elegantly download hf models, zhihu zhuanlan](https://zhuanlan.zhihu.com/p/475260268) proposed a crawlder based solution, and [Is there any mirror for hf_hub, zhihu answer](https://www.zhihu.com/question/371644077) provided some cloud based solutions, and [How to avoid pitfalls on Hugging face downloading, zhihu zhuanlan] gave some useful suggestions), and then use `load_from_disk` to get the dataset object. However, when one finally has the local files on the disk, it is still buggy when trying to load the files into objects. ### Steps to reproduce the bug Steps to reproduce the bug: 1. Found CIFAR dataset in hugging face: https://huggingface.co/datasets/cifar100/tree/main 2. Click ":" button to show "Clone repository" option, and then follow the prompts on the box: ```bash cd my_directory_absolute git lfs install git clone https://huggingface.co/datasets/cifar100 ls my_directory_absolute/cifar100 # confirm that the directory exists and it is OK. ``` 3. Write A python file to try to load the dataset ```python from datasets import load_dataset, load_from_disk dataset = load_from_disk("my_directory_absolute/cifar100") ``` Notice that according to issue #3700 , it is wrong to use load_dataset("my_directory_absolute/cifar100"), so we must use load_from_disk instead. 4. Then you will see the error reported: ```log --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[5], line 9 1 from datasets import load_dataset, load_from_disk ----> 9 dataset = load_from_disk("my_directory_absolute/cifar100") File [~/miniconda3/envs/ai/lib/python3.10/site-packages/datasets/load.py:2232), in load_from_disk(dataset_path, fs, keep_in_memory, storage_options) 2230 return DatasetDict.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options) 2231 else: -> 2232 raise FileNotFoundError( 2233 f"Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." 2234 ) FileNotFoundError: Directory my_directory_absolute/cifar100 is neither a `Dataset` directory nor a `DatasetDict` directory. ``` ### Expected behavior The dataset should be load successfully. ### Environment info ```bash datasets-cli env ``` -> results: ```txt Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.14.2 - Platform: Linux-4.18.0-372.32.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 ```
26
raise FileNotFoundError("Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." ) ### Describe the bug For researchers in some countries or regions, it is usually the case that the download ability of `load_dataset` is disabled due to the complex network environment. People in these regions often prefer to use git clone or other programming tricks to manually download the files to the disk (for example, [How to elegantly download hf models, zhihu zhuanlan](https://zhuanlan.zhihu.com/p/475260268) proposed a crawlder based solution, and [Is there any mirror for hf_hub, zhihu answer](https://www.zhihu.com/question/371644077) provided some cloud based solutions, and [How to avoid pitfalls on Hugging face downloading, zhihu zhuanlan] gave some useful suggestions), and then use `load_from_disk` to get the dataset object. However, when one finally has the local files on the disk, it is still buggy when trying to load the files into objects. ### Steps to reproduce the bug Steps to reproduce the bug: 1. Found CIFAR dataset in hugging face: https://huggingface.co/datasets/cifar100/tree/main 2. Click ":" button to show "Clone repository" option, and then follow the prompts on the box: ```bash cd my_directory_absolute git lfs install git clone https://huggingface.co/datasets/cifar100 ls my_directory_absolute/cifar100 # confirm that the directory exists and it is OK. ``` 3. Write A python file to try to load the dataset ```python from datasets import load_dataset, load_from_disk dataset = load_from_disk("my_directory_absolute/cifar100") ``` Notice that according to issue #3700 , it is wrong to use load_dataset("my_directory_absolute/cifar100"), so we must use load_from_disk instead. 4. Then you will see the error reported: ```log --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) Cell In[5], line 9 1 from datasets import load_dataset, load_from_disk ----> 9 dataset = load_from_disk("my_directory_absolute/cifar100") File [~/miniconda3/envs/ai/lib/python3.10/site-packages/datasets/load.py:2232), in load_from_disk(dataset_path, fs, keep_in_memory, storage_options) 2230 return DatasetDict.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options) 2231 else: -> 2232 raise FileNotFoundError( 2233 f"Directory {dataset_path} is neither a `Dataset` directory nor a `DatasetDict` directory." 2234 ) FileNotFoundError: Directory my_directory_absolute/cifar100 is neither a `Dataset` directory nor a `DatasetDict` directory. ``` ### Expected behavior The dataset should be load successfully. ### Environment info ```bash datasets-cli env ``` -> results: ```txt Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.14.2 - Platform: Linux-4.18.0-372.32.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.10.12 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3 ``` > This should work: `load_dataset("path/to/downloaded_repo")` > > `load_from_disk` is intended to be used on directories created with `Dataset.save_to_disk` or `DatasetDict.save_to_disk` Thanks for your help. This works.
[ -0.2685803771018982, -0.06441403180360794, 0.07613176852464676, 0.36047497391700745, 0.04826785624027252, -0.09567469358444214, 0.10725240409374237, 0.23474422097206116, 0.24625685811042786, 0.1420275866985321, -0.15977632999420166, 0.08738145232200623, 0.020607292652130127, 0.10617546737194061, 0.07854142040014267, 0.01053592748939991, 0.0315161868929863, 0.03417903929948807, -0.6918331384658813, -0.20704248547554016, -0.24459390342235565, 0.29019400477409363, 0.14227689802646637, 0.018990546464920044, -0.10251641273498535, -0.12898863852024078, -0.16343167424201965, 0.6054629683494568, -0.18631583452224731, -0.08732243627309799, 0.2295733094215393, 0.04001610726118088, 0.21535015106201172, 0.7305638194084167, -0.00011113502841908485, 0.16581889986991882, 0.17618826031684875, -0.03929421305656433, -0.5917066931724548, -0.4094899892807007, 0.34962204098701477, 0.03128945827484131, 0.06290818005800247, -0.18381184339523315, -0.14679023623466492, 0.09620839357376099, 0.16525708138942719, -0.1326177418231964, 0.2705259323120117, 0.3432183563709259, 0.16637426614761353, 0.3672279715538025, 0.21362435817718506, -0.21856394410133362, 0.0392734557390213, 0.39880743622779846, -0.1898919939994812, 0.5879904627799988, 0.03528875857591629, 0.06733392924070358, -0.054960787296295166, 0.15975311398506165, -0.12762819230556488, -0.028013909235596657, 0.5269319415092468, 0.09606871753931046, -0.07411783933639526, -0.3445342779159546, 0.05774744600057602, 0.2050488293170929, 0.2938068211078644, -0.23967967927455902, -0.3719455599784851, -0.2467142790555954, -0.004097826778888702, -0.01028887927532196, 0.2606619894504547, 0.03430699557065964, -0.12453927099704742, 0.25404247641563416, -0.15530091524124146, -0.09873741120100021, -0.15647584199905396, 0.19849884510040283, -0.04051665961742401, -0.25494393706321716, -0.11702010035514832, -0.0018419940024614334, 0.30767813324928284, -0.12102571129798889, -0.19010668992996216, -0.46886637806892395, -0.054036084562540054, 0.07491033524274826, -0.13235527276992798, 0.1193201020359993, 0.2710428535938263, 0.28812021017074585, 0.25552812218666077, 0.13631868362426758, 0.2199152410030365, -0.11005738377571106, -0.31322813034057617, 0.056612152606248856, 0.17644965648651123, 0.20595528185367584, -0.16015075147151947, 0.052542541176080704, 0.2630329728126526, 0.40274783968925476, -0.024734385311603546, -0.06466078758239746, -0.011089213192462921, -0.1822417676448822, -0.4756045341491699, -0.0013279411941766739, 0.5227885246276855, -0.16875103116035461, -0.26265957951545715, -0.069558285176754, 0.08126942068338394, 0.12346714735031128, 0.2327864170074463, 0.5094819664955139, 0.05428243428468704, -0.093495212495327, 0.2366766333580017, 0.1604876071214676, -0.11832663416862488, -0.09471505880355835, -0.16622546315193176, 0.0941779613494873, 0.033607661724090576, 0.10994558036327362, 0.10122896730899811, -0.30492621660232544, 0.16306069493293762, -0.22014854848384857, 0.2672426700592041, 0.05150863528251648, -0.1861533522605896, -0.26154908537864685, 0.10927204042673111, 0.46786871552467346, -0.0365719273686409, -0.10365567356348038, 0.281024694442749, -0.2582605183124542, -0.11265545338392258, 0.08672743290662766, -0.1922883838415146, -0.2786116600036621, -0.12432039529085159, 0.13113901019096375, -0.19014930725097656, 0.08058003336191177, -0.4516790807247162, -0.1697731614112854, -0.340270072221756, -0.05889178067445755, 0.10262272506952286, -0.029813550412654877, -0.22963911294937134, -0.18942084908485413, 0.39064520597457886, 0.857356071472168, -0.1126251295208931, 0.07181866466999054, -0.4552200138568878, -0.1054505705833435, -0.02447475492954254, 0.3188113868236542, -0.1641567051410675, 0.4836153984069824, -0.6427759528160095, 0.15184660255908966, 0.3489421010017395, -0.5417800545692444, -0.4081420302391052, 0.4141632318496704, -0.3210620880126953, 0.31155648827552795, 0.10351879894733429, 0.04705587029457092, -0.18493379652500153, -0.06565485894680023, 0.026564719155430794, 0.2014462798833847, 0.023365342989563942, -0.005839601159095764, -0.1996641457080841, -0.3638891875743866, -0.1003383994102478, 0.1627802848815918, 0.1138448417186737, 0.4014335572719574, 0.3901670277118683, -0.3870822787284851, 0.2643735408782959, -0.33933383226394653, -0.09939559549093246, 0.3052979111671448, 0.3714905381202698, 0.08486834168434143, 0.03684702515602112, 0.10838408768177032, -0.5783799290657043, 0.30550336837768555, 0.016990207135677338, 0.12751391530036926, -0.18325310945510864, -0.0809062123298645, -0.23986086249351501, 0.02200985699892044, -0.24417239427566528, 0.05316273868083954, 0.10070556402206421, 0.15674811601638794, 0.07825419306755066, -0.08304367959499359, -0.019382447004318237, 0.5406789779663086, -0.1848699450492859, 0.17321091890335083, -0.43656209111213684, 0.5115260481834412, -0.18991103768348694, -0.10964824259281158, -0.10455619543790817, -0.05092260241508484, 0.09317877888679504, -0.24118363857269287, -0.1238354742527008, 0.4005262553691864, -0.15221665799617767, 0.19488383829593658, 0.009625504724681377, 0.13435222208499908, 0.24201713502407074, -0.21873927116394043, 0.044235311448574066, 0.27842724323272705, 0.28713786602020264, 0.18841294944286346, -0.1330515742301941, 0.2662205100059509, -0.32212015986442566, 0.031867921352386475, 0.3144184947013855, -0.10568345338106155, 0.2146846055984497, -0.04860426485538483, -0.03724326938390732, -0.059238847345113754, 0.49813753366470337, -0.08560533076524734, 0.5943825244903564, 0.06208948791027069, -0.17295028269290924, 0.15091076493263245, 0.1648627072572708, -0.0958174616098404, 0.13927710056304932, 0.2057461440563202, 0.0007592514157295227, 0.1387535184621811, 0.060467928647994995, 0.3530752956867218, 0.5395947098731995, 0.1393897831439972, -0.07688768953084946, 0.20112808048725128, 0.12605302035808563, -0.014055512845516205, 0.24760153889656067, -0.004870947450399399, 0.368238627910614, 0.3471686542034149, -0.13311202824115753, 0.06900347769260406, -0.4841655194759369, -0.38689959049224854, -0.18935781717300415, 0.0492502823472023, -0.4460197389125824, 0.14029660820960999, -0.07708413898944855, -0.10393242537975311, -0.24390365183353424, 0.1636960804462433, -0.2248137891292572, -0.08654319494962692, -0.23135030269622803, 0.5575091242790222, -0.3009207844734192, -0.0556224100291729, 0.009609788656234741, 0.16414235532283783, -0.15288372337818146, -0.10483754426240921, -0.3284949064254761, 0.1514870822429657, -0.19426599144935608, -0.050284262746572495, 0.3661644160747528, -0.22733478248119354, 0.08481952548027039, -0.433962345123291, 0.051991283893585205, -0.617687463760376, -0.2430378794670105, 0.2820192575454712, 0.06703434884548187, 0.5094625949859619, 0.2056247740983963, 0.30439120531082153, -0.12808026373386383, -0.23536381125450134, 0.17349101603031158, -0.08966289460659027, -0.22976024448871613, 0.1432119607925415, -0.06873781234025955, -0.05947796627879143, -0.2363603115081787, -0.2425594925880432, -0.4206852316856384, -0.4049266576766968, 0.30610695481300354, 0.00846768170595169, 0.10223720222711563, 0.6059832572937012, 0.1481982171535492, 0.18669098615646362, 0.1255708932876587, 0.13583478331565857, -0.06489404290914536, -0.4495312571525574, 0.26320576667785645, -0.2292703092098236, -0.4807106554508209, -0.12808339297771454, -0.016987286508083344, -0.17602837085723877, 0.022783666849136353, -0.4674588441848755, -0.2350350171327591, -0.06858158856630325, 0.32656508684158325, -0.04924461618065834, -0.14227060973644257, 0.23528891801834106, -0.08831603825092316, 0.0016280300915241241, -0.17664484679698944, -0.028632406145334244, 0.19774498045444489, 0.15837791562080383, 0.09743152558803558, -0.05984999239444733, 0.4056326150894165, 0.002468518912792206, 0.3298984467983246, 0.0340408980846405, 0.1488165408372879, 0.49900686740875244, -0.1582537144422531, 0.5130494832992554, -0.464611679315567, -0.35042089223861694, -0.15843409299850464, -0.07146734744310379, -0.4111618399620056, 0.4197818636894226, 0.009853444993495941, 0.13061711192131042, -0.18014760315418243, -0.4358445405960083, -0.5035189986228943, -0.4108198285102844, -0.008810346946120262, 0.015428675338625908, -0.04583960399031639, -0.005111344158649445, -0.015798456966876984, -0.07937990874052048, -0.07863877713680267, 0.15836189687252045, 0.5512445569038391, 0.22773616015911102, 0.13361231982707977, -0.20475487411022186, -0.3703681230545044, -0.31445133686065674, 0.24188466370105743, 0.03226049989461899, 0.07926961034536362, -0.36667078733444214, -0.06925591081380844, -0.06207835674285889, -0.2893804609775543, 0.788637638092041, 0.19404302537441254, 0.3782319724559784, 0.015029050409793854, -0.2368277609348297, -0.21893835067749023, -0.10893334448337555, 0.21245820820331573, 0.047344595193862915, -0.08342693746089935, 0.4754897356033325, -0.2511345148086548, -0.06427770853042603, 0.21579790115356445, 0.21217992901802063, -0.16437764465808868, 0.03975922241806984, -0.21589437127113342, -0.4513472318649292, -0.31918811798095703, -0.26276618242263794, 0.002298586070537567, 0.1383187621831894, -0.09174758195877075, 0.1724744290113449, 0.05652052164077759, 0.0034242942929267883, 0.04993841424584389, 0.056645650416612625, 0.37008410692214966, 0.008300460875034332, 0.22395901381969452, 0.18079832196235657, 0.13415738940238953, 0.502440333366394, 0.657386302947998, -0.034960515797138214, -0.2243470847606659, 0.04774295911192894, -0.06400822848081589, -0.08779056370258331, 0.35489165782928467, -0.04770263656973839, -0.31829047203063965, 0.3630203306674957, 0.09126502275466919, -0.3309478163719177, 0.012759380042552948, 0.10879148542881012, -0.05649256706237793, -0.13301733136177063, 0.10041970014572144, 0.4836731553077698, 0.030260086059570312, 0.021082013845443726, 0.17998158931732178, 0.37313687801361084, -0.28211110830307007, 0.4509871006011963, -0.18676523864269257, 0.9144400358200073, -0.03673940524458885, 0.18013665080070496, 0.31699904799461365, -0.17444655299186707, 0.395885169506073, -0.2174472212791443, -0.035196103155612946, -0.2881319224834442, -0.40223315358161926, -0.06258318573236465, -0.05842607095837593, 0.2637491226196289, 0.18216043710708618, -0.1088082417845726, 0.2901230454444885, -0.12618982791900635, 0.19615837931632996, -0.15559571981430054, 0.2335081547498703, -0.1522698998451233, -0.13262063264846802, -0.2530747056007385, 0.10998199880123138, -0.07835143804550171, 0.5246104598045349, -0.15334776043891907, -0.23284918069839478, -0.3555995225906372, -0.31590399146080017, -0.03419259190559387, 0.17088526487350464, -0.15767139196395874, 0.2198466658592224, -0.012657450512051582, -0.2643114924430847, -0.35506412386894226, 0.17385533452033997, 0.33411523699760437, -0.017670150846242905, -0.28502580523490906, 0.12455189973115921, -0.19931556284427643, 0.18089333176612854, -0.056493740528821945, -0.17181386053562164, 0.3326796293258667, -0.08348163217306137, -0.13660767674446106, -0.4246935248374939, -0.2956399917602539, -0.2257748395204544, 0.2677886486053467, -0.16623659431934357, 0.012141640298068523, 0.07282128930091858, -0.12043935060501099, 0.10861559212207794, -0.08005422353744507, -0.14997023344039917, 0.11306110769510269, -0.12794248759746552, -0.08001506328582764, -0.20933397114276886, -0.0027317123021930456, -0.3079514503479004, -0.11694898456335068, 0.490979939699173, -0.24573057889938354, 0.14538992941379547, 0.3988833725452423, 0.11519643664360046, -0.09849109500646591, -0.21222944557666779, 0.14232732355594635, 0.3680264949798584, -0.4808524549007416, 0.226565420627594, 0.02854377031326294, -0.015451565384864807, -0.22583064436912537, 0.5035821199417114, 0.34602782130241394, -0.3873843252658844, -0.24856644868850708, -0.4026907682418823, -0.2620629072189331, 0.27906596660614014, -0.016883790493011475, 0.16141986846923828, 0.4006061553955078, -0.010232293978333473, 0.18071845173835754, -0.219127357006073, -0.29992246627807617, -0.06886808574199677, -0.3688223659992218, -0.03663702309131622, 0.497234046459198, 0.020759595558047295, 0.3035246431827545, 0.0013830438256263733, 0.10442408919334412, -0.12333051860332489, -0.16283965110778809, -0.19901496171951294, -0.05596939101815224, 0.1372925341129303, -0.01380041241645813, -0.1396251916885376, 0.012617968022823334, -0.30028608441352844, -0.09663374722003937, -0.168822780251503, 0.08891935646533966, 0.14302965998649597, 0.02288438007235527, -0.05327025428414345, -0.10770419239997864, 0.16680796444416046, -0.2191552221775055, 0.24280360341072083, 0.013086700811982155, 0.2340034693479538, -0.1120004802942276, 0.1102374717593193, -0.2656247615814209, -0.07471529394388199, -0.2427813857793808, -0.053991515189409256, -0.06579753756523132, 0.2191304862499237, 0.29010581970214844, -0.12931543588638306, -0.0029197484254837036, -0.054329607635736465, 0.31219449639320374, 0.10464128106832504, -0.1281684935092926, -0.027934350073337555, 0.16484184563159943, 0.12755969166755676, -0.17318511009216309, -0.2813203036785126, 0.20275096595287323, -0.2798771560192108, 0.10344448685646057, 0.11632951349020004, 0.02494513988494873, -0.03997587412595749, 0.0015142261981964111, 0.03071744740009308, 0.7683966755867004, 0.14325189590454102, 0.09144417941570282, 0.3608546853065491, -0.10145854949951172, 0.2412720024585724, -0.002846295014023781, 0.051174361258745193, 0.33591726422309875, 0.5229349732398987, -0.3579714298248291, 0.02373426966369152, -0.2506181001663208, 0.2712361216545105, 0.24883301556110382, -0.5451616048812866, 0.45780596137046814, 0.007885225117206573, -0.05614277347922325, -0.058817651122808456, -0.0786115899682045, 0.001726388931274414, -0.34916120767593384, -0.13646048307418823, -0.24380013346672058, 0.2841907739639282, -0.18012401461601257, 0.16564442217350006, -0.29025593400001526, -0.18091636896133423, 0.0022561997175216675, 0.07929062843322754, -0.02698475681245327, -0.17472493648529053, 0.2448442429304123, 0.1322837620973587, -0.004905868321657181, 0.0673103928565979, -0.05421139672398567, 0.1343158781528473, 0.0028220750391483307, -0.18990746140480042, 0.232417032122612, 0.18641266226768494, 0.03136961907148361, 0.10676352679729462, 0.4649530053138733, 0.3789122998714447, 0.36076995730400085, 0.12976136803627014, 0.08384636044502258, 0.05957476422190666, -0.1856934279203415, -0.19621190428733826, -0.13262519240379333, -0.23862454295158386, 0.10449211299419403, 0.35577118396759033, 0.17733368277549744, -0.1359422206878662, 0.052073486149311066, -0.029590796679258347, 0.13119098544120789, -0.19827112555503845, 0.18919676542282104, -0.19692710041999817, -0.08386494219303131, -0.0012301476672291756, 0.008023791015148163, -0.3349694311618805, 0.17468343675136566, 0.3640054166316986, -0.19951173663139343, 0.267204612493515, 0.07386220991611481, 0.07735956460237503, 0.17404672503471375, 0.34176987409591675, 0.34328746795654297, 0.08112442493438721, -0.2299298197031021, 0.019717618823051453, -0.6158757209777832, 0.014174152165651321, -0.008375083096325397, 0.168191596865654, 0.0675828605890274, 0.03002401441335678, -0.016125496476888657, -0.103995680809021, 0.1778852343559265, -0.09383845329284668, 0.12873390316963196, 0.23069116473197937, -0.0400703139603138, -0.21980664134025574, -0.1460805982351303, 0.06913871318101883, -0.0795852541923523, -0.5833837389945984, 0.19352051615715027, -0.0931045264005661, 0.04434452950954437, 0.14394107460975647, -0.07750168442726135, -0.14527887105941772, -0.15230302512645721, 0.36713337898254395, 0.13237223029136658, 0.1828312873840332, -0.25532686710357666, -0.28062543272972107, -0.09030963480472565, -0.1827327311038971, -0.06439989060163498, 0.14716513454914093, -0.01895318180322647, 0.3411335349082947, -0.22716902196407318, -0.11863354593515396, -0.3576570451259613, 0.02743503451347351, 0.18418064713478088, 0.1695718765258789, -0.42313989996910095, 0.30353283882141113, -0.3606525659561157, 0.11146806180477142, 0.07836618274450302, 0.2387489378452301, -0.025044497102499008, 0.04130101948976517, -0.2680346369743347, -0.25893014669418335, 0.6637139320373535, -0.2597299814224243, -0.028269115835428238, -0.0777079164981842, 0.2275693118572235, 0.16002029180526733, -0.15532752871513367, -0.20913341641426086, 0.14299200475215912, 0.24167612195014954, 0.10074856877326965, -0.08253267407417297, 0.09100742638111115, -0.08256550878286362, -0.008008964359760284, 0.05171048641204834, 0.4207123816013336, 0.06149352714419365, -0.304254412651062, 0.28569841384887695, -0.09946244955062866 ]
https://github.com/huggingface/datasets/issues/6110
This is expected behavior. You must provide `cache_file_name` when performing `.map` on an in-memory dataset for the result to be cached.
[BUG] Dataset initialized from in-memory data does not create cache.
### Describe the bug `Dataset` initialized from in-memory data (dictionary in my case, haven't tested with other types) does not create cache when processed with the `map` method, unlike `Dataset` initialized by other methods such as `load_dataset`. ### Steps to reproduce the bug ```python # below code was run the second time so the map function can be loaded from cache if exists from datasets import load_dataset, Dataset dataset = load_dataset("tatsu-lab/alpaca")['train'] dataset = dataset.map(lambda x: {'input': x['input'] + 'hi'}) # some random map print(len(dataset.cache_files)) # 1 # copy the exact same data but initialize from a dictionary memory_dataset = Dataset.from_dict({ 'instruction': dataset['instruction'], 'input': dataset['input'], 'output': dataset['output'], 'text': dataset['text']}) memory_dataset = memory_dataset.map(lambda x: {'input': x['input'] + 'hi'}) # exact same map print(len(memory_dataset.cache_files)) # Map: 100%|██████████| 52002[/52002] # 0 ``` ### Expected behavior The `map` function should create cache regardless of the method the `Dataset` was created. ### Environment info - `datasets` version: 2.14.2 - Platform: Linux-5.15.0-41-generic-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
21
[BUG] Dataset initialized from in-memory data does not create cache. ### Describe the bug `Dataset` initialized from in-memory data (dictionary in my case, haven't tested with other types) does not create cache when processed with the `map` method, unlike `Dataset` initialized by other methods such as `load_dataset`. ### Steps to reproduce the bug ```python # below code was run the second time so the map function can be loaded from cache if exists from datasets import load_dataset, Dataset dataset = load_dataset("tatsu-lab/alpaca")['train'] dataset = dataset.map(lambda x: {'input': x['input'] + 'hi'}) # some random map print(len(dataset.cache_files)) # 1 # copy the exact same data but initialize from a dictionary memory_dataset = Dataset.from_dict({ 'instruction': dataset['instruction'], 'input': dataset['input'], 'output': dataset['output'], 'text': dataset['text']}) memory_dataset = memory_dataset.map(lambda x: {'input': x['input'] + 'hi'}) # exact same map print(len(memory_dataset.cache_files)) # Map: 100%|██████████| 52002[/52002] # 0 ``` ### Expected behavior The `map` function should create cache regardless of the method the `Dataset` was created. ### Environment info - `datasets` version: 2.14.2 - Platform: Linux-5.15.0-41-generic-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 This is expected behavior. You must provide `cache_file_name` when performing `.map` on an in-memory dataset for the result to be cached.
[ -0.08459498733282089, -0.3960629403591156, 0.030023247003555298, 0.37451669573783875, 0.3451509177684784, 0.14292441308498383, 0.039096251130104065, 0.28264227509498596, 0.20719891786575317, 0.004734143614768982, -0.0554051473736763, 0.5577744245529175, 0.06757719069719315, -0.21267572045326233, 0.10460899770259857, 0.25769487023353577, 0.24275094270706177, -0.06393121182918549, -0.3344968259334564, -0.12977001070976257, -0.21080461144447327, -0.046687088906764984, -0.1887311339378357, -0.3478710651397705, -0.42643311619758606, -0.039299771189689636, -0.2129305601119995, 0.042517997324466705, 0.08688382059335709, -0.4939166009426117, 0.5698970556259155, -0.1381353884935379, -0.039673879742622375, 0.40567144751548767, -0.00010949879651889205, -0.014539055526256561, 0.28493618965148926, -0.04717933014035225, -0.025568213313817978, 0.06581462174654007, -0.30169162154197693, -0.24837522208690643, 0.045885100960731506, -0.22723442316055298, -0.1197456419467926, 0.019866596907377243, 0.03183130919933319, -0.7294943928718567, 0.5185462236404419, 0.23022913932800293, 0.21933069825172424, 0.005836918950080872, -0.1639314591884613, 0.09216681122779846, 0.06437357515096664, 0.03045755811035633, -0.25494998693466187, 0.02194530889391899, 0.04225568100810051, -0.2819005250930786, -0.05273042619228363, 0.1886914074420929, -0.15086455643177032, 0.30614620447158813, 0.21645967662334442, 0.30269575119018555, -0.05108099803328514, -0.2951362431049347, 0.05629139766097069, 0.12138690054416656, 0.5420815348625183, -0.4848701059818268, -0.3854624629020691, -0.18345803022384644, -0.1474461853504181, -0.09720276296138763, 0.3709185719490051, -0.016705231741070747, -0.15264011919498444, 0.23149749636650085, -0.11776483058929443, 0.16352231800556183, 0.1558997631072998, 0.2007657140493393, -0.0632353127002716, 0.08231058716773987, -0.013718688860535622, 0.008246054872870445, -0.07232915610074997, -0.041052985936403275, 0.046034075319767, -0.26138779520988464, -0.005772676318883896, 0.46741241216659546, -0.2820288836956024, -0.026429079473018646, 0.30969667434692383, -0.18187451362609863, 0.1889382004737854, -0.1834930032491684, 0.2010737657546997, -0.05927931144833565, -0.014277379959821701, 0.05465076118707657, 0.14205510914325714, 0.3231451213359833, -0.06338801980018616, 0.32362523674964905, 0.13927718997001648, -0.18653947114944458, -0.3855714797973633, -0.10640612989664078, 0.13078317046165466, 0.06117822974920273, 0.7719628810882568, -0.1148308664560318, 0.07684174180030823, 0.010415799915790558, 0.0493713840842247, 0.20920711755752563, -0.4536110758781433, -0.08004987239837646, -0.020607491955161095, 0.2735086679458618, -0.1924113929271698, 0.13532134890556335, 0.0850449651479721, -0.01052312646061182, -0.06102890893816948, 0.11803162097930908, -0.3454323410987854, 0.03667682781815529, -0.1386183202266693, 0.2786023020744324, 0.344522088766098, -0.11341705918312073, 0.23210331797599792, -0.0004588961601257324, -0.006160657852888107, -0.21430230140686035, 0.3613695502281189, -0.3063652217388153, 0.4728246033191681, 0.17160983383655548, -0.16247473657131195, 0.307137668132782, 0.12391922622919083, -0.04793809726834297, -0.1433696150779724, 0.36117953062057495, -0.20783770084381104, -0.20004132390022278, 0.23223988711833954, 0.18378770351409912, -0.05102375149726868, 0.11079753935337067, -0.13505643606185913, 0.2725229561328888, 0.5473434329032898, -0.11568546295166016, 0.01548120379447937, 0.14968490600585938, -0.24743050336837769, -0.4454728662967682, 0.4433540999889374, 0.518868625164032, -0.2947404682636261, -0.04349151998758316, -0.03386003524065018, 0.1417812705039978, 0.07703639566898346, 0.2564702332019806, -0.17720328271389008, 0.4495929181575775, -0.22703194618225098, 0.16143572330474854, 0.03414314240217209, -0.422901451587677, -0.8355463147163391, 0.025184519588947296, 0.13958501815795898, 0.18531590700149536, 0.009150445461273193, 0.22833304107189178, 0.0659639835357666, -0.045453909784555435, 0.22551588714122772, 0.35038191080093384, -0.1286126971244812, 0.2726829946041107, -0.47973018884658813, -0.2256879359483719, 0.31586581468582153, 0.16192707419395447, 0.02549397014081478, 0.21329014003276825, 0.011536549776792526, 0.0015483386814594269, 0.07343602925539017, 0.14169487357139587, 0.1820019781589508, 0.2045781910419464, 0.0318484827876091, 0.03642129898071289, 0.07925935089588165, -0.09537631273269653, -0.3556410074234009, 0.2859830856323242, 0.08136020600795746, -0.11892982572317123, -0.14537353813648224, -0.17889803647994995, -0.09065234661102295, 0.05672099441289902, -0.1219460666179657, -0.2297525703907013, 0.16990603506565094, -0.019508857280015945, 0.3550264239311218, 0.1311560869216919, -0.15466153621673584, 0.5229058265686035, 0.18062350153923035, -0.019432036206126213, -0.1959986835718155, 0.1284625083208084, 0.008102312684059143, -0.12988479435443878, -0.33620819449424744, 0.0633799284696579, 0.08977413177490234, -0.06083768233656883, -0.29868605732917786, 0.34872573614120483, 0.13552233576774597, 0.042879119515419006, -0.179168239235878, 0.05776776373386383, 0.09453386068344116, -0.07203610241413116, -0.11317169666290283, 0.00027918070554733276, 0.31975024938583374, -0.20161768794059753, -0.1354760080575943, 0.16941794753074646, 0.3996399939060211, -0.13651539385318756, -0.15459971129894257, -0.1014997810125351, 0.1213831976056099, -0.03434005007147789, 0.06826183199882507, -0.3580233156681061, -0.053430650383234024, -0.10047724843025208, 0.31722062826156616, 0.10245224088430405, -0.0627153143286705, -0.02911635860800743, 0.4013500213623047, 0.15175534784793854, 0.10975872725248337, -0.06179262325167656, -0.22058020532131195, -0.21738673746585846, 0.09439311921596527, 0.17591041326522827, 0.3273438811302185, 0.09999381005764008, 0.08820080757141113, 0.14675091207027435, 0.08993209153413773, 0.05217999219894409, 0.06794160604476929, -0.017478197813034058, 0.11523140966892242, 0.04719886928796768, 0.3297193944454193, 0.18834209442138672, -0.07564529031515121, 0.3575911223888397, 0.2732107639312744, 0.18600520491600037, -0.11145339906215668, -0.09972372651100159, -0.2297733873128891, -0.1111915186047554, 0.10666853189468384, -0.035550471395254135, 0.014445383101701736, -0.17454105615615845, -0.1389673799276352, 0.22132854163646698, 0.06161588430404663, 0.3101564645767212, 0.037856198847293854, 0.13022908568382263, -0.004959218204021454, -0.313725084066391, -0.2793675661087036, -0.2558600902557373, -0.057305846363306046, 0.03798939660191536, 0.06401867419481277, -0.15797872841358185, 0.33797696232795715, 0.046780139207839966, 0.0001705065369606018, -0.13996417820453644, -0.18283969163894653, 0.13708660006523132, 0.05797632038593292, 0.24662359058856964, -0.12099435925483704, 0.020724009722471237, -0.25657057762145996, -0.045955073088407516, 0.3354921340942383, -0.2208525836467743, -0.20621788501739502, -0.06807323545217514, 0.13186106085777283, 0.048077285289764404, -0.16974714398384094, -0.39663755893707275, 0.0011834874749183655, -0.1549171805381775, -0.05106520652770996, 0.028956256806850433, -0.007694266736507416, 0.06589172780513763, 0.012423433363437653, 0.12316463887691498, 0.0718936026096344, 0.08409371972084045, -0.4835931658744812, -0.28649890422821045, 0.4481847584247589, -0.16192248463630676, -0.23519787192344666, -0.12559954822063446, -0.3152666985988617, 0.21787506341934204, 0.40138137340545654, -0.48276859521865845, -0.04346846044063568, -0.22059331834316254, 0.4519210755825043, -0.033523499965667725, 0.004900399595499039, 0.5229474306106567, -0.036691125482320786, -0.03070502169430256, -0.27572202682495117, -0.2558157444000244, 0.06357422471046448, 0.12198158353567123, 0.14949341118335724, 0.18618449568748474, 0.42595887184143066, 0.08441516757011414, 0.45267266035079956, 0.16461879014968872, 0.035252638161182404, 0.40715980529785156, -0.02216390334069729, 0.24381554126739502, -0.38183531165122986, -0.11930868029594421, -0.2158607691526413, -0.1151319295167923, -0.05704871192574501, 0.06224250793457031, 0.2683144211769104, -0.38181838393211365, -0.22098185122013092, 0.26364952325820923, -0.45277220010757446, -0.22036413848400116, -0.1261574923992157, -0.4537688195705414, 0.22975769639015198, 0.35395270586013794, 0.17309455573558807, -0.45691952109336853, -0.10763633251190186, 0.010217081755399704, -0.19538791477680206, 0.25612667202949524, -0.18871696293354034, -0.1728912889957428, 0.047343965619802475, -0.567805290222168, 0.04299679398536682, 0.22471469640731812, 0.3802029490470886, 0.0019911527633666992, -0.3246406018733978, 0.11342761665582657, 0.017567642033100128, 0.7097476124763489, -0.36139047145843506, 0.013717620633542538, 0.10009372234344482, -0.1863449215888977, -0.17769989371299744, 0.05086314678192139, 0.11834606528282166, 0.4292789697647095, 0.0321895033121109, 0.25453734397888184, -0.2013237029314041, -0.061671093106269836, -0.3634176552295685, 0.15588781237602234, -0.04272943735122681, -0.2000342309474945, -0.12891674041748047, -0.2244747281074524, -0.14565280079841614, -0.10929626226425171, 0.09387858957052231, -0.15859301388263702, 0.27868178486824036, 0.03940398246049881, -0.3719232678413391, 0.26270508766174316, -0.06592196971178055, 0.04229053109884262, 0.4610210061073303, -0.050074707716703415, 0.5249897241592407, 0.17242342233657837, -0.013776449486613274, 0.07085459679365158, 0.31498417258262634, -0.11317721009254456, -0.10537542402744293, -0.18704232573509216, -0.16704615950584412, -0.1797371208667755, 0.04209186136722565, -0.16678673028945923, -0.1302947700023651, 0.0015668012201786041, -0.11292877793312073, -0.335658460855484, -0.06118539720773697, 0.19790375232696533, -0.0029082559049129486, -0.3587567210197449, -0.6778022646903992, 0.3913254737854004, 0.30366241931915283, -0.15431036055088043, 0.7219331860542297, -0.1896042823791504, -0.3434208035469055, 0.5192737579345703, 0.05094140022993088, 0.7406356334686279, -0.15053987503051758, 0.34253132343292236, 0.17550557851791382, 0.2157924473285675, 0.3519778847694397, 0.025561489164829254, 0.33879685401916504, -0.3021748661994934, -0.14145132899284363, -0.004319261759519577, -0.09584445506334305, -0.01700860634446144, 0.025209302082657814, -0.17039981484413147, -0.05482436716556549, -0.12866701185703278, 0.4431878924369812, 0.026133261620998383, -0.18803346157073975, 0.07215160876512527, -0.3062746524810791, -0.018195750191807747, 0.21834522485733032, 0.023072347044944763, 0.10376101732254028, 0.025505445897579193, 0.08700202405452728, -0.368861585855484, -0.10685036331415176, -0.07535497844219208, 0.0404316708445549, -0.39412039518356323, 0.5163034796714783, -0.002240661531686783, 0.1117834746837616, -0.29270708560943604, 0.4724947214126587, 0.2228674590587616, 0.08874553442001343, -0.22437630593776703, 0.07575270533561707, 0.29543256759643555, 0.27138739824295044, 0.07111074775457382, -0.1912817358970642, 0.41243258118629456, 0.12589286267757416, -0.09335805475711823, 0.022874435409903526, -0.3030585050582886, -0.2389296144247055, -0.051319852471351624, 0.09313862770795822, 0.049157630652189255, -0.22017985582351685, -0.24324555695056915, 0.19258469343185425, -0.10147837549448013, -0.05050021409988403, 0.2088051438331604, 0.15400739014148712, -0.050128329545259476, 0.3252924680709839, -0.2168477177619934, -0.21249008178710938, -0.01649777963757515, 0.5444863438606262, 0.24211043119430542, 0.12015523761510849, 0.3985134959220886, -0.15605369210243225, -0.22553184628486633, -0.09255240112543106, -0.039246901869773865, -0.017898648977279663, -0.1986076682806015, 0.1775713711977005, -0.09305057674646378, -0.009917497634887695, -0.01203170046210289, 0.06842769682407379, 0.02625983953475952, 0.041963107883930206, 0.00582394003868103, -0.14643186330795288, -0.600839376449585, -0.0014540180563926697, -0.12336967885494232, 0.11329905688762665, 0.12578082084655762, 0.07108143717050552, -0.017095137387514114, 0.1819080263376236, -0.3294941186904907, 0.008358743041753769, -0.054005853831768036, 0.06380768865346909, -0.018544001504778862, 0.32389992475509644, 0.2657213807106018, -0.22512462735176086, 0.11574925482273102, 0.24017713963985443, -0.29539236426353455, -0.28430771827697754, -0.050189606845378876, 0.10011205822229385, 0.18971799314022064, -0.20330673456192017, -0.10723196715116501, -0.2720860540866852, -0.05076615512371063, -0.4358441233634949, 0.05525396019220352, 0.35150402784347534, -0.07679235935211182, 0.15472312271595, 0.4053804278373718, 0.17837241291999817, -0.21137619018554688, 0.12521392107009888, -0.22184282541275024, -0.16314297914505005, -0.28445154428482056, -0.007097357884049416, -0.0683542937040329, 0.0861344188451767, -0.06599944084882736, -0.11142153292894363, -0.21764704585075378, -0.038757503032684326, 0.432736873626709, -0.32528913021087646, -0.00228823721408844, 0.4707127809524536, 0.11547571420669556, -0.08111836016178131, -0.287146657705307, -0.020196665078401566, 0.16264161467552185, 0.22816301882266998, -0.11007817089557648, 0.022188711911439896, 0.2654915452003479, -0.039304155856370926, 0.11538845300674438, 0.05868995189666748, 0.09512852877378464, 0.06305772066116333, -0.19046862423419952, 0.0682574063539505, 0.369209885597229, -0.5863870978355408, 0.2773577570915222, 0.21638435125350952, 0.14151999354362488, 0.21376603841781616, 0.25482842326164246, 0.2606315016746521, -0.1115124374628067, 0.512829065322876, 0.3891136348247528, 0.36986175179481506, -0.0028026090003550053, -0.1247750073671341, -0.3134920001029968, -0.3049462139606476, 0.2304757833480835, 0.31923413276672363, -0.43142688274383545, 0.15231961011886597, 0.023091163486242294, 0.0936141163110733, -0.11703964322805405, -0.22359761595726013, -0.09558548033237457, -0.1398717761039734, -0.22753706574440002, -0.00974312424659729, 0.23137569427490234, -0.010118909180164337, 0.07403922080993652, -0.07096138596534729, 0.03141767531633377, -0.043670471757650375, 0.6468969583511353, 0.02846662700176239, -0.028760287910699844, -0.1354251205921173, -0.021371666342020035, 0.12098418176174164, 0.41842934489250183, -0.24838869273662567, -0.014699626713991165, -0.225286066532135, -0.29593414068222046, -0.24815252423286438, 0.32222679257392883, 0.25459158420562744, 0.2903780937194824, -0.2138366401195526, 0.19031323492527008, 0.11679332703351974, -0.12561161816120148, -0.09853995591402054, 0.5323585867881775, 0.11725899577140808, -0.2996920049190521, -0.012398295104503632, 0.14635507762432098, -0.11300254613161087, 0.17272652685642242, 0.1911851465702057, 0.34598076343536377, -0.24048233032226562, 0.0527862086892128, -0.25783878564834595, -0.19684746861457825, 0.16856281459331512, 0.07290557026863098, -0.19644194841384888, 0.045546747744083405, 0.156048983335495, -0.08435586094856262, 0.20793189108371735, -0.2939803898334503, 0.10591284930706024, 0.12429442256689072, 0.351737380027771, 0.27253884077072144, 0.02931993082165718, -0.24133756756782532, -0.187578484416008, -0.7007567286491394, 0.04002692177891731, -0.12919500470161438, 0.09237482398748398, -0.046008870005607605, 0.19254498183727264, -0.16058319807052612, 0.009549228474497795, -0.1135159507393837, -0.025200460106134415, -0.07558833807706833, 0.0652143806219101, -0.3328482508659363, -0.4400860369205475, -0.29319316148757935, -0.0825420543551445, 0.0028017908334732056, -0.5512081384658813, 0.04582072049379349, -0.03252337872982025, 0.18259622156620026, -0.1753825694322586, -0.04830092564225197, 0.1346360146999359, 0.25085678696632385, 0.5129265189170837, 0.30506664514541626, 0.046147484332323074, -0.0741366446018219, -0.046490684151649475, -0.17682933807373047, -0.1363368034362793, -0.06526258587837219, 0.031219713389873505, -0.025719337165355682, 0.33970481157302856, -0.39729931950569153, -0.2888929843902588, -0.1296669989824295, -0.009789563715457916, 0.12354200333356857, -0.1302800476551056, -0.2576068043708801, -0.17694512009620667, -0.07106906175613403, -0.04294769465923309, 0.1654655933380127, 0.45105668902397156, -0.20494000613689423, 0.38455235958099365, -0.19693303108215332, -0.24675685167312622, 0.31147491931915283, -0.5152311325073242, -0.07064765691757202, -0.21019241213798523, 0.09402759373188019, 0.13091716170310974, -0.20080561935901642, -0.2998456656932831, 0.009737923741340637, 0.3611472547054291, -0.062085941433906555, -0.3764100968837738, 0.16973333060741425, -0.12438438832759857, 0.21195852756500244, -0.09938853234052658, 0.4475541412830353, -0.07168011367321014, -0.12844808399677277, 0.2755305767059326, -0.04769665002822876 ]
https://github.com/huggingface/datasets/issues/6109
Thanks for reporting, @610v4nn1. Indeed, the source data files are no longer available. We have contacted the authors of the dataset and they report that Amazon has decided to stop distributing the multilingual reviews dataset. We are adding a notification about this issue to the dataset card. See: https://huggingface.co/datasets/amazon_reviews_multi/discussions/4#64c3898db63057f1fd3ce1a0
Problems in downloading Amazon reviews from HF
### Describe the bug I have a script downloading `amazon_reviews_multi`. When the download starts, I get ``` Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data: 243B [00:00, 1.43MB/s] Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.54s/it] Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 842.40it/s] Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data: 243B [00:00, 928kB/s] Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.42s/it] Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 832.70it/s] Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data: 243B [00:00, 1.81MB/s] Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.40s/it] Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 1294.14it/s] Generating train split: 0%| | 0/200000 [00:00<?, ? examples/s] ``` the file is clearly too small to contain the requested dataset, in fact it contains en error message: ``` <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>AGJWSY3ZADT2QVWE</RequestId><HostId>Gx1O2KXnxtQFqvzDLxyVSTq3+TTJuTnuVFnJL3SP89Yp8UzvYLPTVwd1PpniE4EvQzT3tCaqEJw=</HostId></Error> ``` obviously the script fails: ``` > raise DatasetGenerationError("An error occurred while generating the dataset") from e E datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. load_dataset("amazon_reviews_multi", name="en", split="train", cache_dir="ADDYOURPATHHERE") ### Expected behavior I would expect the dataset to be downloaded and processed ### Environment info * The problem is present with both datasets 2.12.0 and 2.14.2 * python version 3.10.12
49
Problems in downloading Amazon reviews from HF ### Describe the bug I have a script downloading `amazon_reviews_multi`. When the download starts, I get ``` Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data: 243B [00:00, 1.43MB/s] Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.54s/it] Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 842.40it/s] Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data: 243B [00:00, 928kB/s] Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.42s/it] Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 832.70it/s] Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data: 243B [00:00, 1.81MB/s] Downloading data files: 100%|██████████| 1/1 [00:01<00:00, 1.40s/it] Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 1294.14it/s] Generating train split: 0%| | 0/200000 [00:00<?, ? examples/s] ``` the file is clearly too small to contain the requested dataset, in fact it contains en error message: ``` <?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>AGJWSY3ZADT2QVWE</RequestId><HostId>Gx1O2KXnxtQFqvzDLxyVSTq3+TTJuTnuVFnJL3SP89Yp8UzvYLPTVwd1PpniE4EvQzT3tCaqEJw=</HostId></Error> ``` obviously the script fails: ``` > raise DatasetGenerationError("An error occurred while generating the dataset") from e E datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. load_dataset("amazon_reviews_multi", name="en", split="train", cache_dir="ADDYOURPATHHERE") ### Expected behavior I would expect the dataset to be downloaded and processed ### Environment info * The problem is present with both datasets 2.12.0 and 2.14.2 * python version 3.10.12 Thanks for reporting, @610v4nn1. Indeed, the source data files are no longer available. We have contacted the authors of the dataset and they report that Amazon has decided to stop distributing the multilingual reviews dataset. We are adding a notification about this issue to the dataset card. See: https://huggingface.co/datasets/amazon_reviews_multi/discussions/4#64c3898db63057f1fd3ce1a0
[ -0.29059678316116333, -0.1834934800863266, -0.09265191853046417, 0.35295364260673523, 0.05249357968568802, 0.12003567814826965, 0.03875169903039932, 0.39338797330856323, 0.084026038646698, 0.16796791553497314, -0.14502131938934326, -0.6513493657112122, 0.15460199117660522, 0.09386534243822098, -0.18958109617233276, -0.008602917194366455, -0.105964794754982, -0.0752456858754158, 0.03300466760993004, -0.18369218707084656, -0.21405424177646637, 0.051720455288887024, 0.013040900230407715, 0.04117198288440704, -0.19802923500537872, -0.015437539666891098, 0.03935018926858902, 0.24922195076942444, -0.28285712003707886, -0.13387973606586456, 0.08649145811796188, 0.14033037424087524, 0.19396990537643433, 0.22594690322875977, -0.00011434435145929456, -0.06572553515434265, 0.1908978521823883, 0.01169152557849884, -0.1842169612646103, -0.17742764949798584, 0.07147026062011719, -0.26218000054359436, -0.1818351149559021, -0.12243406474590302, 0.189649760723114, -0.2047736942768097, 0.08184061199426651, 0.008664898574352264, 0.2667081654071808, 0.37748008966445923, 0.2057209312915802, 0.022222012281417847, 0.010608434677124023, -0.11416906118392944, 0.9337689280509949, 0.2891175448894501, -0.1301327496767044, 0.12822593748569489, 0.15235619246959686, 0.07908739894628525, -0.03352833911776543, 0.18176156282424927, 0.1598173975944519, 0.08629061281681061, 0.06029343977570534, -0.1675586998462677, 0.21852776408195496, -0.08032113313674927, 0.22395433485507965, 0.5639256834983826, 0.5057367086410522, 0.04573560506105423, -0.45911097526550293, 0.028731197118759155, -0.005704969167709351, -0.13370007276535034, -0.012415435165166855, 0.5637856721878052, -0.058036841452121735, 0.11063145101070404, -0.2912915050983429, -0.028739508241415024, -0.23787476122379303, 0.3864065706729889, -0.11463793367147446, 0.24377967417240143, 0.1728792041540146, 0.019352002069354057, 0.14665499329566956, -0.01195824146270752, 0.23606067895889282, 0.0030772294849157333, -0.10247482359409332, 0.05992545187473297, -0.1753578931093216, 0.029861420392990112, -0.05491616949439049, -0.18817123770713806, 0.29644685983657837, 0.3712688386440277, 0.03917507827281952, 0.17924220860004425, 0.16240361332893372, 0.050222430378198624, 0.0881357342004776, -0.029798978939652443, -0.20244550704956055, 0.1586916148662567, 0.19750933349132538, 0.5083174109458923, -0.07712964713573456, -0.1318185180425644, -0.1421043872833252, -0.1335882544517517, -0.1269582211971283, -0.085331991314888, -0.10193417221307755, -0.3426017165184021, -0.42748573422431946, 0.3714640438556671, -0.28826096653938293, 0.04524446278810501, 0.04422280192375183, 0.6523633599281311, -0.10123813152313232, 0.10443280637264252, 0.16158977150917053, 0.2901720404624939, -0.1903521865606308, 0.028188500553369522, -0.22919811308383942, 0.15242472290992737, -0.2044644057750702, -0.06601813435554504, 0.08138567209243774, 0.20453324913978577, 0.27739256620407104, -0.15146879851818085, 0.3730894923210144, -0.13339763879776, 0.07951653748750687, -0.5045193433761597, 0.1782643347978592, 0.47635212540626526, 0.3074098527431488, 0.17373202741146088, 0.015831168740987778, 0.23571375012397766, -0.03235568851232529, 0.02820858731865883, -0.2827410101890564, -0.08368899673223495, -0.3194229304790497, 0.22080199420452118, 0.104489266872406, 0.10919880867004395, -0.01546517014503479, -0.2986794710159302, 0.04406655207276344, -0.12931372225284576, 0.011838052421808243, -0.20297406613826752, -0.04176624119281769, -0.013039683923125267, -0.192583829164505, 0.40169429779052734, -0.19069214165210724, 0.17110799252986908, -0.44756925106048584, -0.014836897142231464, 0.40340447425842285, 0.3384799361228943, -0.2286120355129242, 0.2584250867366791, -0.2600548267364502, 0.3975748121738434, 0.22537019848823547, -0.2364446371793747, -0.3619146943092346, 0.8961067795753479, -0.16345392167568207, 0.05966594070196152, 0.2743932902812958, 0.07809289544820786, 0.17139282822608948, -0.11701172590255737, -0.1604377180337906, 0.10380531847476959, 0.09847370535135269, -0.058231815695762634, -0.3156728148460388, -0.2600436210632324, -0.14286550879478455, 0.10372115671634674, 0.411617249250412, -0.030565667897462845, 0.2645203471183777, 0.10935290902853012, 0.5048727989196777, 0.03455372527241707, 0.0771121233701706, 0.5003562569618225, 0.11605401337146759, 0.06553415954113007, -0.09718891978263855, 0.04041629284620285, -0.21370841562747955, 0.006865076720714569, -0.8297458291053772, -0.2425020933151245, 0.12037651985883713, -0.40504658222198486, -0.46587100625038147, -0.019534066319465637, 0.013748613186180592, -0.03491942211985588, 0.09005499631166458, 0.05704158544540405, -0.24469596147537231, -0.1057976484298706, 0.1727706789970398, 0.0186140276491642, -0.13132613897323608, 0.14535929262638092, 0.031703315675258636, 0.26090019941329956, -0.14481478929519653, -0.023280106484889984, 0.2837216258049011, -0.06399480998516083, 0.2728208899497986, -0.07344681024551392, 0.03322311118245125, 0.31208813190460205, -0.006448499858379364, 0.09034878760576248, -0.006407955661416054, -0.060575395822525024, 0.041595228016376495, 0.18914580345153809, 0.17172816395759583, 0.49603793025016785, 0.14497947692871094, -0.15768784284591675, -0.3857980966567993, 0.28070998191833496, 0.19879449903964996, -0.03670085594058037, 0.21999599039554596, -0.12013620883226395, 0.06766969710588455, -0.17063958942890167, 0.2703753411769867, -0.29886394739151, 0.3625558614730835, 0.06431809067726135, -0.03464020788669586, -0.2596239745616913, 0.020916879177093506, 0.15911895036697388, 0.5498411059379578, -0.029855862259864807, -0.005206659436225891, 0.26209601759910583, 0.09386561810970306, -0.03778497129678726, 0.18824902176856995, 0.2685723304748535, 0.2556697130203247, 0.24331742525100708, 0.09319620579481125, 0.13303916156291962, 0.05987504497170448, -0.32250720262527466, 0.12602706253528595, 0.025225315243005753, -0.16020111739635468, 0.4785504937171936, -0.0822666734457016, -0.1583787351846695, -0.2474118173122406, -0.25895601511001587, 0.048199087381362915, 0.22095464169979095, -0.4985475540161133, 0.13346800208091736, -0.45855796337127686, -0.21126264333724976, -0.2557985186576843, 0.3350752890110016, 0.01477411761879921, -0.4555792510509491, 0.2926456928253174, 0.4237241744995117, -0.3737380802631378, -0.23597243428230286, -0.5394412279129028, -0.14123192429542542, 0.04851878434419632, 0.041038572788238525, 0.09578655660152435, 0.11628517508506775, -0.4549717307090759, 0.1252865493297577, 0.3446458578109741, 0.07369887828826904, 0.2991979420185089, 0.08534522354602814, -0.006986849009990692, -0.3056269586086273, -0.06350153684616089, -0.02781347557902336, 0.18393249809741974, -0.07479483634233475, -0.05151858553290367, 0.14863379299640656, -0.2296353429555893, -0.1665450930595398, -0.1435869038105011, 0.14953398704528809, -0.13379721343517303, 0.1547776162624359, 0.024757441133260727, -0.16380618512630463, -0.0526118203997612, -0.49039918184280396, 0.052222006022930145, -0.4341996908187866, -0.0014030765742063522, -0.12102086842060089, 0.37287765741348267, -0.27889567613601685, 0.05494910851120949, 0.12597614526748657, -0.015620362013578415, -0.07550087571144104, -0.2207976132631302, -0.19826602935791016, 0.43090537190437317, -0.28273651003837585, -0.6037819385528564, 0.1411188393831253, 0.1276073008775711, -0.11078448593616486, 0.3542466461658478, -0.6307588219642639, 0.1597113013267517, -0.011700710281729698, -0.28761619329452515, -0.09860876202583313, -0.030463889241218567, 0.3241765797138214, -0.3649204671382904, -0.21159157156944275, 0.12727642059326172, 0.30588698387145996, -0.03594132140278816, -0.005241831764578819, 0.46022409200668335, -0.38801610469818115, 0.22787602245807648, 0.11624608933925629, 0.4918537139892578, 0.27119433879852295, 0.3150315284729004, 0.44812890887260437, 0.12416008859872818, 0.09279491752386093, 0.1768057644367218, 0.05732616037130356, 0.2756129503250122, -0.23853006958961487, 0.06542609632015228, 0.3437591791152954, -0.013848882168531418, -0.34058868885040283, 0.04799225926399231, 0.1322462260723114, -0.3157086968421936, -0.3513807952404022, 0.10841204971075058, -0.1886364370584488, 0.026197466999292374, 0.01580110192298889, 0.30814093351364136, 0.3004019558429718, -0.2528264820575714, 0.07012902200222015, 0.08632056415081024, -0.0778958797454834, 0.030099645256996155, -0.11955738812685013, -0.33569326996803284, -0.0016790255904197693, 0.4642600417137146, 0.2816082835197449, 0.31800219416618347, -0.3537389636039734, -0.05482356250286102, 0.24732650816440582, -0.2168973684310913, 0.5258404612541199, -0.24833464622497559, 0.24934449791908264, 0.11197479814291, 0.10170353949069977, -0.17623081803321838, -0.2115897387266159, -0.29194340109825134, 0.2674005627632141, 0.02459593117237091, 0.06523160636425018, -0.4936332106590271, 0.07795454561710358, 0.1623295396566391, -0.08889712393283844, -0.015781402587890625, -0.10165532678365707, -0.04979052022099495, -0.26597142219543457, -0.26902705430984497, 0.06970787048339844, 0.05415545403957367, 0.0030728094279766083, -0.3273218870162964, -0.1119227409362793, 0.06898830831050873, 0.1752711683511734, 0.13622550666332245, -0.15488164126873016, 0.15463605523109436, -0.24655792117118835, -0.08397328853607178, -0.14809544384479523, 0.06746365129947662, 0.4152309000492096, 0.8324218988418579, 0.20032353699207306, -0.08546251058578491, 0.2782391309738159, -0.29294297099113464, -0.12992136180400848, 0.5758121609687805, 0.17226473987102509, 0.03288348764181137, 0.4410470724105835, 0.3108188509941101, 0.12164811789989471, -0.02414369024336338, 0.4469645321369171, -0.4672318994998932, 0.07091984152793884, 0.01520741730928421, 0.26317381858825684, -0.1846422404050827, 0.16984795033931732, -0.011381312273442745, 0.16725938022136688, -0.0317959263920784, 0.0951724573969841, 0.16311800479888916, 1.1114484071731567, 0.15693776309490204, 0.1502400040626526, 0.17161031067371368, -0.40177595615386963, -0.31496164202690125, -0.6755847930908203, 0.045967914164066315, -0.3314664959907532, -0.02448316290974617, -0.17111662030220032, 0.08378211408853531, 0.11025725305080414, 0.30135661363601685, 0.03755959868431091, 0.243797168135643, -0.09157761931419373, 0.012551948428153992, -0.0384795255959034, 0.21878351271152496, -0.48835259675979614, -0.16134175658226013, 0.1439889818429947, 0.18068532645702362, 0.03317664563655853, 0.2140045017004013, -0.17065081000328064, -0.16949298977851868, -0.12181304395198822, -0.3472205400466919, -0.38266050815582275, 0.1663692593574524, -0.1887669861316681, 0.03630930557847023, -0.0793524831533432, -0.18140962719917297, 0.013293027877807617, -0.28495243191719055, -0.3418901264667511, 0.30021077394485474, -0.17538321018218994, 0.12698450684547424, 0.04209053888916969, -0.031406670808792114, 0.023293856531381607, -0.04697059094905853, 0.4824070632457733, -0.2921733260154724, -0.34112560749053955, -0.024583447724580765, 0.15288609266281128, -0.015509769320487976, 0.1413128525018692, 0.11467942595481873, -0.2757921814918518, -0.2915157973766327, -0.24277274310588837, -0.11628332734107971, -0.3791612386703491, -0.20236358046531677, 0.1016329899430275, -0.10747739672660828, -0.124803826212883, 0.09382196515798569, 0.22549505531787872, -0.17498993873596191, -0.2210623025894165, 0.7728506326675415, 0.09756383299827576, -0.1755756437778473, 0.33950260281562805, 0.15470479428768158, -0.44028612971305847, -0.3768557012081146, 0.11229439824819565, 0.16216926276683807, -0.6941574811935425, -0.09494906663894653, -0.29568204283714294, -0.04014669358730316, 0.04647616669535637, -0.1657916009426117, 0.0469864085316658, 0.0905308872461319, -0.020052894949913025, -0.4293634295463562, 0.12261299788951874, 0.3077881634235382, 0.09163898974657059, 0.1329604834318161, -0.2479642927646637, -0.05847104266285896, 0.2042180597782135, 0.08056381344795227, -0.297078400850296, 0.1509137600660324, -0.20510676503181458, -0.1107388585805893, -0.11791764199733734, -0.014524547383189201, 0.12348917126655579, 0.00032111629843711853, 0.0518544539809227, 0.21232151985168457, -0.2953409254550934, -0.1600298434495926, -0.2648893892765045, 0.13159173727035522, 0.11330749094486237, -0.060357466340065, 0.2592580020427704, -0.2536877393722534, -0.11296908557415009, 0.043658409267663956, 0.22035086154937744, -0.005690827965736389, -0.0326320119202137, -0.009555652737617493, 0.19502726197242737, 0.044882409274578094, -0.30379417538642883, 0.038147568702697754, -0.1385992169380188, 0.40235090255737305, -0.025055918842554092, -0.06884319335222244, 0.19851680099964142, -0.13450731337070465, -0.3658265769481659, -0.15397696197032928, 0.33559802174568176, 0.08614517003297806, 0.5655426979064941, -0.25499841570854187, -0.0442645363509655, 0.08446547389030457, 0.3110116124153137, 0.23145991563796997, 0.0020875073969364166, -0.3006271421909332, 0.2442026138305664, 0.1798325777053833, -0.2866918444633484, -0.1572147011756897, -0.213151752948761, -0.10842889547348022, -0.0681273490190506, -0.055392876267433167, 0.18371501564979553, -0.10872974246740341, 0.13690093159675598, 0.17942416667938232, -0.018437962979078293, -0.02184297703206539, -0.3116913437843323, 0.3337753713130951, -0.20996227860450745, 0.18453098833560944, -0.10982340574264526, -0.011031059548258781, 0.2762950360774994, 0.2587958872318268, 0.2533521056175232, 0.2669423222541809, 0.14389105141162872, 0.24994203448295593, -0.24909910559654236, -0.5769544839859009, -0.2181786298751831, 0.16492237150669098, 0.14518994092941284, 0.2932286858558655, 0.09197056293487549, 0.17937776446342468, 0.4452064335346222, 0.07301269471645355, -0.4242871105670929, 0.023836947977542877, 0.019571559503674507, 0.08417682349681854, -0.139398992061615, -0.07482631504535675, -0.6165836453437805, -0.029555335640907288, -0.08073844015598297, -0.03570228070020676, 0.10386709868907928, 0.29211655259132385, -0.03644581884145737, -0.1537788212299347, 0.007795339450240135, -0.3640671670436859, 0.19053909182548523, -0.5319126844406128, 0.008991269394755363, 0.5135347247123718, 0.11209432035684586, 0.1682564616203308, 0.027234898880124092, 0.36687254905700684, 0.009197451174259186, -0.08469797670841217, -0.20583966374397278, -0.026602042838931084, -0.08959644287824631, 0.015628330409526825, 0.21619047224521637, 0.3830827474594116, 0.2183830738067627, 0.38220953941345215, 0.08844422549009323, -0.20457690954208374, 0.4647533893585205, -0.07066422700881958, 0.16337616741657257, -0.08424434065818787, 0.33854109048843384, -0.17004963755607605, -0.08310279250144958, -0.27419576048851013, -0.38258275389671326, -0.4799203872680664, -0.1642978936433792, 0.14733479917049408, -0.1033681258559227, 0.22057871520519257, -0.15166831016540527, 0.07377037405967712, -0.07079069316387177, 0.5904346704483032, 0.29319244623184204, -0.17849521338939667, -0.25412291288375854, 0.1408250331878662, -0.4163462519645691, 0.23509147763252258, -0.5206596851348877, 0.005807533860206604, 0.12583370506763458, 0.38580045104026794, -0.15384671092033386, 0.08801911771297455, 0.32764753699302673, -0.4486352205276489, -0.05222166329622269, 0.6807409524917603, -0.19117242097854614, -0.15491099655628204, 0.14737287163734436, 0.041116863489151, -0.03200910612940788, -0.4964263141155243, 0.16370166838169098, -0.07299783825874329, -0.03247030824422836, -0.0483364462852478, -0.4198454022407532, 0.036538660526275635, -0.18232005834579468, 0.2879316508769989, -0.010828734375536442, 0.18920043110847473, -0.285836398601532, -0.1200137585401535, -0.31714341044425964, 0.11654417216777802, 0.032300423830747604, 0.10075028240680695, 0.2481670379638672, 0.544520914554596, 0.1555073857307434, 0.0010783788748085499, -0.040979791432619095, 0.3652639389038086, -0.18601903319358826, -0.10206350684165955, -0.034434691071510315, -0.008561987429857254, -0.17503851652145386, -0.0379665307700634, 0.2543603777885437, 0.11586058139801025, 0.0127025805413723, -0.1280706226825714, -0.08933882415294647, -0.49536120891571045, 0.5308541059494019, 0.413886159658432, -0.07826894521713257, 0.02531694993376732, 0.617139458656311, 0.025981925427913666, 0.054712675511837006, -0.3365750312805176, 0.2798466384410858, 0.016684606671333313, 0.005248667672276497, 0.0662568211555481, 0.1941070705652237, -0.11397229880094528, -0.20256158709526062, -0.05460493266582489, 0.20529215037822723, -0.06948016583919525, -0.21426773071289062, -0.002216830849647522, -0.21903035044670105 ]
https://github.com/huggingface/datasets/issues/6108
Yesterday I waited for more than 12 hours to make sure it was really **stuck** instead of proceeding too slow.
Loading local datasets got strangely stuck
### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2
20
Loading local datasets got strangely stuck ### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2 Yesterday I waited for more than 12 hours to make sure it was really **stuck** instead of proceeding too slow.
[ -0.24503090977668762, -0.018570467829704285, -0.02903907559812069, 0.2270108461380005, -0.018362440168857574, 0.05931895971298218, 0.2687035799026489, 0.23350246250629425, 0.12182816863059998, 0.18180540204048157, 0.0590432733297348, 0.5354204773902893, -0.11318369209766388, -0.09281224012374878, -0.0934063047170639, -0.04633789509534836, -0.01936904713511467, -0.0019202902913093567, 0.459880530834198, -0.05822746455669403, -0.23490609228610992, 0.19181278347969055, -0.19052350521087646, 0.0126716960221529, -0.29522740840911865, 0.02383113093674183, 0.125636488199234, 0.3863019049167633, 0.4537752866744995, -0.48997774720191956, 0.22632159292697906, -0.0007872506976127625, 0.16353976726531982, 0.4604818522930145, -0.00012564609642140567, 0.09652862697839737, 0.2871282398700714, 0.19761820137500763, -0.579081118106842, -0.14129507541656494, -0.09272775053977966, -0.2988988757133484, 0.2696419954299927, -0.2219139039516449, 0.2325998693704605, -0.06351856142282486, 0.09661800414323807, -0.5447632670402527, 0.20530100166797638, 0.16495193541049957, 0.07028139382600784, 0.43889278173446655, -0.4506288468837738, 0.18530766665935516, 0.01673169434070587, 0.0740278959274292, -0.02011117711663246, 0.4390155076980591, 0.6115700006484985, -0.19813945889472961, 0.020339099690318108, -0.17534798383712769, -0.16963323950767517, -0.08954977989196777, -0.17692063748836517, 0.032292407006025314, 0.3357584476470947, -0.5173730254173279, 0.18696917593479156, 0.21311286091804504, 0.006808336824178696, -0.007232848554849625, -0.06317970156669617, -0.6782644391059875, 0.06354793906211853, -0.2525230646133423, 0.037639111280441284, 0.28413626551628113, -0.37633004784584045, 0.14321257174015045, -0.27517950534820557, 0.10261741280555725, 0.01632167398929596, 0.05074901133775711, -0.01492871344089508, 0.18201220035552979, 0.05727282539010048, 0.2914443910121918, 0.06341585516929626, 0.3648519217967987, 0.05916835740208626, -0.19847072660923004, 0.2161903977394104, 0.20921757817268372, -0.3701484203338623, 0.31480544805526733, 0.2066442221403122, -0.08737711608409882, -0.04657287150621414, -0.1296619474887848, 0.02739030495285988, 0.05878216400742531, -0.007316868752241135, 0.23466438055038452, 0.4341602027416229, 0.018132135272026062, -0.08012911677360535, 0.04159818962216377, 0.44266828894615173, -0.062090255320072174, -0.12069446593523026, 0.24303457140922546, -0.1822364181280136, -0.1472683995962143, 0.19630958139896393, 0.03548255190253258, 0.05812753736972809, -0.013800077140331268, -0.4037393033504486, 0.19677594304084778, -0.2712756395339966, 0.05061415582895279, 0.30407875776290894, 0.3775843679904938, 0.021334614604711533, 0.4825482964515686, -0.11471869051456451, -0.12123221904039383, -0.3468611538410187, 0.2851457893848419, -0.0073275454342365265, -0.32440048456192017, -0.21037213504314423, -0.08484653383493423, 0.3076636791229248, -0.20122191309928894, 0.08891905099153519, 0.21543069183826447, -0.0601469948887825, -0.13656462728977203, 0.1739872545003891, -0.34400609135627747, 0.018868809565901756, 0.28348761796951294, 0.05656997859477997, 0.2572927176952362, -0.08146287500858307, -0.22868606448173523, -0.21536774933338165, 0.3986060917377472, -0.22930681705474854, -0.24533608555793762, -0.13200774788856506, 0.01302036177366972, -0.11796284466981888, 0.16528178751468658, -0.20990294218063354, 0.12425273656845093, 0.25848910212516785, -0.009480543434619904, 0.12627819180488586, -0.4081161618232727, -0.2387227565050125, -0.16167642176151276, 0.12969867885112762, 0.5087119340896606, -0.6662941575050354, -0.029202334582805634, -0.04381188750267029, -0.152022585272789, 0.3554225564002991, 0.42606279253959656, -0.27567529678344727, 0.4720778465270996, -0.504848062992096, 0.10139288008213043, 0.07319954037666321, -0.21501506865024567, -0.2010425627231598, 0.5996190309524536, -0.36454081535339355, 0.31364119052886963, -0.008196156471967697, 0.015220455825328827, -0.006595529615879059, -0.0775795578956604, 0.5145036578178406, 0.3418304920196533, -0.019011342898011208, 0.2720308005809784, -0.19226135313510895, -0.18121609091758728, 0.05343823879957199, 0.26356184482574463, -0.13445723056793213, 0.0783894956111908, 0.08923044800758362, -0.17111769318580627, 0.601753830909729, -0.11879418790340424, 0.08426662534475327, 0.3413355052471161, 0.08835352212190628, 0.04691200703382492, -0.042562730610370636, -0.0777355283498764, -0.6965600848197937, 0.4013170599937439, 0.017941392958164215, -0.21079589426517487, -0.21448856592178345, 0.108411505818367, -0.11555603891611099, 0.2392064332962036, -0.23254333436489105, 0.15605491399765015, -0.099142886698246, 0.17067784070968628, -0.11217792332172394, 0.06920729577541351, -0.0958162173628807, 0.4483773410320282, -0.0045052096247673035, -0.1617567390203476, -0.35923272371292114, 0.24985447525978088, 0.0680844858288765, -0.14159350097179413, -0.1605014204978943, 0.1063460111618042, 0.07836645841598511, -0.24856506288051605, -0.1437816023826599, 0.1929836869239807, -0.1169041097164154, 0.16763627529144287, -0.23676618933677673, -0.1271367222070694, 0.12416714429855347, 0.3593362867832184, -0.043003179132938385, -0.11117839813232422, 0.09294385462999344, -0.18415510654449463, 0.04998801648616791, 0.3427119255065918, -0.10864086449146271, 0.4850924611091614, 0.01941876858472824, -0.25242137908935547, 0.3767440915107727, -0.06637266278266907, 0.08320625126361847, 0.07552605122327805, 0.6670228242874146, 0.4249246120452881, 0.736285924911499, 0.1444288194179535, -0.4537842869758606, 0.2158767580986023, 0.4971393048763275, 0.007549643516540527, -0.10384762287139893, 0.15359656512737274, 0.15525977313518524, 0.09875116497278214, 0.11121322214603424, 0.1515865921974182, 0.43603286147117615, 0.14865067601203918, -0.17097675800323486, -0.05937153100967407, -0.1292506456375122, -0.2718510627746582, -0.03260454535484314, 0.18726596236228943, 0.155839741230011, 0.49461373686790466, 0.3027156889438629, -0.11256624758243561, -0.2710462212562561, -0.43627047538757324, 0.15031489729881287, 0.24172556400299072, -0.30522555112838745, 0.468244343996048, -0.28184351325035095, 0.21470950543880463, -0.384070485830307, -0.03273841738700867, -0.11337155103683472, -0.2653958201408386, -0.25936761498451233, 0.28988921642303467, 0.039504796266555786, -0.03728068619966507, -0.15264278650283813, 0.38655370473861694, -0.18447110056877136, -0.12960121035575867, -0.3505040407180786, -0.15792548656463623, -0.46664392948150635, -0.16876725852489471, 0.47517770528793335, 0.09388850629329681, 0.18671563267707825, 0.20034973323345184, -0.42620569467544556, 0.15047675371170044, 0.15843504667282104, 0.09711064398288727, -0.1102355569601059, 0.3848576247692108, 0.007513206452131271, 0.27393868565559387, -0.11267977952957153, -0.27488332986831665, 0.09002487361431122, -0.11491517722606659, 0.009581148624420166, -0.017411217093467712, -0.03068537823855877, -0.17475678026676178, -0.22733144462108612, -0.022299859672784805, -0.5508553981781006, -0.31863585114479065, 0.4618632197380066, -0.021901607513427734, 0.2194148600101471, 0.10206648707389832, -0.03693029284477234, 0.27796438336372375, 0.3065280318260193, -0.16031572222709656, -0.0875856876373291, -0.2529546618461609, -0.016483960673213005, -0.0722891241312027, -0.12909896671772003, -0.28081417083740234, -0.04656238108873367, -0.10550357401371002, -0.05015760287642479, -0.44561299681663513, 0.4484734535217285, -0.4072372317314148, 0.41109499335289, -0.17156678438186646, -0.1060076504945755, 0.12369753420352936, -0.04909195750951767, 0.05476190894842148, -0.002225808799266815, -0.17108623683452606, 0.20208610594272614, 0.0170101597905159, 0.0643562376499176, -0.026995845139026642, 0.24562610685825348, -0.06465167552232742, 0.5921217203140259, -0.006754450500011444, -0.2360386997461319, 0.28225311636924744, -0.045087896287441254, 0.15382035076618195, -0.16515299677848816, -0.2721273601055145, -0.02530737593770027, -0.1276538372039795, -0.41864147782325745, 0.09504112601280212, -0.046965092420578, -0.3201781213283539, -0.040812406688928604, 0.07937218993902206, -0.13495884835720062, -0.2962687611579895, 0.2827531099319458, -0.11319299042224884, -0.03839598968625069, -0.07552457600831985, -0.06774630397558212, -0.12160135060548782, -0.07737056165933609, -0.22271081805229187, 0.15848807990550995, 0.09392639249563217, -0.27021676301956177, -0.5513702034950256, -0.20280671119689941, -0.6572021842002869, 0.14514482021331787, 0.09639915823936462, 0.4645669758319855, -0.12286048382520676, 0.008058272302150726, 0.2461146116256714, -0.23898373544216156, 1.0183742046356201, 0.09834728389978409, 0.18800459802150726, 0.31486019492149353, 0.11449277400970459, -0.4659084975719452, -0.23756921291351318, -0.026384584605693817, 0.4269142150878906, 0.4973560571670532, 0.5276718139648438, -0.21254101395606995, -0.12948021292686462, -0.03939373791217804, 0.12209698557853699, -0.223072350025177, -0.4376458525657654, -0.4356280565261841, -0.10170239955186844, -0.25470587611198425, 0.08372589945793152, -0.047716595232486725, 0.060881972312927246, -0.4239758253097534, -0.3893817067146301, 0.07506302744150162, 0.035835832357406616, -0.019222117960453033, -0.01773814484477043, -0.17338210344314575, 0.28369927406311035, 0.3091053068637848, 0.06568965315818787, 0.40374383330345154, 0.18025431036949158, 0.21506471931934357, -0.28491154313087463, -0.03180733695626259, 0.35692229866981506, -0.002773478627204895, 0.33755403757095337, 0.6597993969917297, 0.001017298549413681, 0.22286853194236755, 0.23759834468364716, 0.3647741973400116, -0.030164934694767, 0.07540750503540039, 0.1931966245174408, 0.1160978376865387, -0.3292321264743805, -0.4299934506416321, 0.3786565661430359, 0.12474827468395233, -0.1952911913394928, 0.3014637231826782, -0.6321588754653931, -0.12117603421211243, 0.32383570075035095, -0.16599097847938538, 0.9280341267585754, -0.19756674766540527, 0.21224603056907654, 0.16786202788352966, -0.16276392340660095, 0.32169604301452637, -0.08906228840351105, 0.09598366916179657, -0.4163469672203064, 0.2721562087535858, 0.09581974893808365, -0.2873101234436035, -0.0025557316839694977, 0.10617808997631073, 0.09246841818094254, 0.2503693103790283, -0.33307236433029175, -0.05819020792841911, -0.10349180549383163, 0.2913593351840973, 0.11607063561677933, -0.2531382441520691, -0.5245260000228882, -0.08417901396751404, 0.029087383300065994, 0.04704635590314865, -0.22380709648132324, 0.02655087038874626, -0.21172034740447998, 0.08707121014595032, -0.18321464955806732, 0.21917565166950226, -0.03674986958503723, 0.1786743402481079, 0.07008327543735504, -0.3035663962364197, -0.0729350596666336, 0.09661908447742462, -0.061049312353134155, -0.03671219199895859, -0.08549598604440689, 0.19912847876548767, 0.2159157246351242, 0.1027659922838211, 0.19405719637870789, -0.25970014929771423, 0.1344083845615387, 0.11273094266653061, -0.2824198007583618, -0.030676059424877167, -0.2532346844673157, -0.31737059354782104, 0.04697790741920471, 0.35681289434432983, 0.14197053015232086, 0.07813742756843567, -0.28865787386894226, 0.15654537081718445, 0.16173729300498962, -0.20116379857063293, -0.018486902117729187, 0.10137724131345749, -0.07416509091854095, 0.2349921315908432, -0.4114398658275604, -0.3218008875846863, -0.07375441491603851, 0.4018590748310089, -0.15644748508930206, 0.10199765861034393, 0.5607468485832214, 0.3765143156051636, -0.06144779920578003, -0.11039472371339798, 0.09708084166049957, 0.08901809900999069, -0.4868384897708893, 0.2545470893383026, -0.018442662432789803, -0.03703463077545166, 0.18717491626739502, 0.03973819315433502, -0.07784639298915863, -0.16413643956184387, -0.20975995063781738, -0.480294793844223, -0.4341728687286377, -0.32708898186683655, -0.021443527191877365, 0.10562777519226074, 0.16772189736366272, 0.1278790831565857, -0.11532926559448242, -0.027091341093182564, -0.13727684319019318, -0.07554276287555695, -0.5917837619781494, 0.1202239841222763, 0.09102919697761536, -0.15790271759033203, 0.04610907658934593, -0.11820745468139648, -0.013372592628002167, 0.12415184080600739, -0.0734194964170456, -0.12466514110565186, -0.1262572854757309, 0.19590480625629425, -0.013784541748464108, -0.1762695014476776, -0.0906640887260437, -0.2664434313774109, 0.18367569148540497, -0.04911421239376068, 0.12684017419815063, 0.04526646435260773, 0.06009793281555176, -0.038940057158470154, 0.21120989322662354, 0.222407728433609, 0.13811062276363373, 0.4756799638271332, -0.08004489541053772, 0.09450150281190872, 0.20826764404773712, 0.4452442526817322, -0.12196770310401917, 0.059275537729263306, -0.35141485929489136, -0.19108255207538605, 0.2062154859304428, 0.5880520343780518, -0.005489269271492958, -0.3035420775413513, -0.09526100754737854, -0.0405677929520607, 0.21859391033649445, 0.6138256788253784, -0.20290213823318481, -0.2042095959186554, 0.2563404142856598, 0.00728044006973505, 0.048442013561725616, -0.1886448860168457, 0.29622751474380493, 0.08852416276931763, -0.011000730097293854, 0.19760264456272125, 0.05745574086904526, -0.3458976447582245, -0.4280814230442047, 0.129216730594635, 0.34763601422309875, 0.06965403258800507, -0.24532990157604218, 0.40669015049934387, 0.24392478168010712, 0.1355973482131958, 0.06509373337030411, 0.11291922628879547, 0.2605099678039551, 0.42807719111442566, 0.14651109278202057, 0.02496550790965557, 0.15801551938056946, 0.46684297919273376, 0.02781812660396099, -0.445743203163147, 0.07264254987239838, 0.3738434910774231, -0.42496317625045776, 0.19273538887500763, 0.2114466279745102, 0.36857110261917114, -0.05489933490753174, -0.22775009274482727, -0.003399461507797241, 0.3910950720310211, -0.1808556169271469, -0.23238933086395264, -0.3527378439903259, -0.08021725714206696, 0.07665933668613434, 0.1382218301296234, -0.08905147016048431, 0.10141021013259888, -0.03598102554678917, 0.33433571457862854, 0.03742837905883789, -0.3472447395324707, -0.014475534670054913, 0.10639277845621109, 0.1434614509344101, -0.17825910449028015, 0.0007586590945720673, 0.1286739557981491, -0.06467075645923615, -0.15855282545089722, -0.07319427281618118, 0.41615843772888184, 0.453610360622406, -0.03897897154092789, 0.04730893671512604, 0.13603761792182922, 0.1400853842496872, -0.20416706800460815, 0.2941347062587738, -0.04237823560833931, 0.24055688083171844, 0.3269038796424866, -0.02486679144203663, -0.10898759961128235, 0.11507052928209305, 0.2854999601840973, 0.21540750563144684, -0.29414963722229004, 0.4277312755584717, 0.10172706842422485, -0.304467111825943, -0.040853939950466156, 0.03758564218878746, -0.15888985991477966, 0.12911394238471985, 0.4260285198688507, -0.3421753942966461, 0.22952476143836975, -0.059429340064525604, 0.010937068611383438, -0.34719565510749817, 0.6160120368003845, 0.210429385304451, 0.34700340032577515, -0.18143713474273682, 0.010435923933982849, -0.6169217824935913, 0.04547085613012314, -0.20624397695064545, 0.0620909109711647, 0.06909693777561188, 0.25392118096351624, -0.21517744660377502, 0.055237267166376114, -0.13321377336978912, 0.3224862515926361, 0.050949759781360626, 0.5011716485023499, -0.32874542474746704, -0.10315725207328796, -0.2048649787902832, -0.09657551348209381, -0.07908248901367188, -0.5112425088882446, 0.313877671957016, -0.08022990822792053, -0.09770727902650833, -0.11538451164960861, -0.27193009853363037, 0.12608478963375092, 0.22765494883060455, 0.34329622983932495, 0.16425836086273193, 0.20238928496837616, -0.048283178359270096, -0.10008877515792847, -0.22999005019664764, 0.0043055154383182526, 0.04189937561750412, -0.06288469582796097, -0.021493813022971153, 0.11762489378452301, -0.3844679594039917, 0.4330427646636963, -0.2691423296928406, -0.14293988049030304, 0.026626944541931152, 0.08420783281326294, -0.03456606715917587, -0.22435975074768066, -0.10446815937757492, 0.293850839138031, 0.006114475429058075, 0.3783755302429199, 0.2134964019060135, 0.027883857488632202, -0.3000328838825226, 0.11826881021261215, 0.21001841127872467, -0.5380436182022095, -0.34327876567840576, -0.22207537293434143, 0.2601051330566406, -0.18671561777591705, -0.07339468598365784, 0.08720415830612183, -0.27399933338165283, 0.4156044125556946, -0.29029327630996704, -0.42224037647247314, 0.15101100504398346, -0.24210801720619202, -0.05769655108451843, -0.0630071684718132, -0.08060165494680405, 0.2700447142124176, -0.24287071824073792, 0.21398413181304932, -0.25309133529663086 ]
https://github.com/huggingface/datasets/issues/6108
I've had similar weird issues with `load_dataset` as well. Not multiple files, but dataset is quite big, about 50G.
Loading local datasets got strangely stuck
### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2
19
Loading local datasets got strangely stuck ### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2 I've had similar weird issues with `load_dataset` as well. Not multiple files, but dataset is quite big, about 50G.
[ -0.24503090977668762, -0.018570467829704285, -0.02903907559812069, 0.2270108461380005, -0.018362440168857574, 0.05931895971298218, 0.2687035799026489, 0.23350246250629425, 0.12182816863059998, 0.18180540204048157, 0.0590432733297348, 0.5354204773902893, -0.11318369209766388, -0.09281224012374878, -0.0934063047170639, -0.04633789509534836, -0.01936904713511467, -0.0019202902913093567, 0.459880530834198, -0.05822746455669403, -0.23490609228610992, 0.19181278347969055, -0.19052350521087646, 0.0126716960221529, -0.29522740840911865, 0.02383113093674183, 0.125636488199234, 0.3863019049167633, 0.4537752866744995, -0.48997774720191956, 0.22632159292697906, -0.0007872506976127625, 0.16353976726531982, 0.4604818522930145, -0.00012564609642140567, 0.09652862697839737, 0.2871282398700714, 0.19761820137500763, -0.579081118106842, -0.14129507541656494, -0.09272775053977966, -0.2988988757133484, 0.2696419954299927, -0.2219139039516449, 0.2325998693704605, -0.06351856142282486, 0.09661800414323807, -0.5447632670402527, 0.20530100166797638, 0.16495193541049957, 0.07028139382600784, 0.43889278173446655, -0.4506288468837738, 0.18530766665935516, 0.01673169434070587, 0.0740278959274292, -0.02011117711663246, 0.4390155076980591, 0.6115700006484985, -0.19813945889472961, 0.020339099690318108, -0.17534798383712769, -0.16963323950767517, -0.08954977989196777, -0.17692063748836517, 0.032292407006025314, 0.3357584476470947, -0.5173730254173279, 0.18696917593479156, 0.21311286091804504, 0.006808336824178696, -0.007232848554849625, -0.06317970156669617, -0.6782644391059875, 0.06354793906211853, -0.2525230646133423, 0.037639111280441284, 0.28413626551628113, -0.37633004784584045, 0.14321257174015045, -0.27517950534820557, 0.10261741280555725, 0.01632167398929596, 0.05074901133775711, -0.01492871344089508, 0.18201220035552979, 0.05727282539010048, 0.2914443910121918, 0.06341585516929626, 0.3648519217967987, 0.05916835740208626, -0.19847072660923004, 0.2161903977394104, 0.20921757817268372, -0.3701484203338623, 0.31480544805526733, 0.2066442221403122, -0.08737711608409882, -0.04657287150621414, -0.1296619474887848, 0.02739030495285988, 0.05878216400742531, -0.007316868752241135, 0.23466438055038452, 0.4341602027416229, 0.018132135272026062, -0.08012911677360535, 0.04159818962216377, 0.44266828894615173, -0.062090255320072174, -0.12069446593523026, 0.24303457140922546, -0.1822364181280136, -0.1472683995962143, 0.19630958139896393, 0.03548255190253258, 0.05812753736972809, -0.013800077140331268, -0.4037393033504486, 0.19677594304084778, -0.2712756395339966, 0.05061415582895279, 0.30407875776290894, 0.3775843679904938, 0.021334614604711533, 0.4825482964515686, -0.11471869051456451, -0.12123221904039383, -0.3468611538410187, 0.2851457893848419, -0.0073275454342365265, -0.32440048456192017, -0.21037213504314423, -0.08484653383493423, 0.3076636791229248, -0.20122191309928894, 0.08891905099153519, 0.21543069183826447, -0.0601469948887825, -0.13656462728977203, 0.1739872545003891, -0.34400609135627747, 0.018868809565901756, 0.28348761796951294, 0.05656997859477997, 0.2572927176952362, -0.08146287500858307, -0.22868606448173523, -0.21536774933338165, 0.3986060917377472, -0.22930681705474854, -0.24533608555793762, -0.13200774788856506, 0.01302036177366972, -0.11796284466981888, 0.16528178751468658, -0.20990294218063354, 0.12425273656845093, 0.25848910212516785, -0.009480543434619904, 0.12627819180488586, -0.4081161618232727, -0.2387227565050125, -0.16167642176151276, 0.12969867885112762, 0.5087119340896606, -0.6662941575050354, -0.029202334582805634, -0.04381188750267029, -0.152022585272789, 0.3554225564002991, 0.42606279253959656, -0.27567529678344727, 0.4720778465270996, -0.504848062992096, 0.10139288008213043, 0.07319954037666321, -0.21501506865024567, -0.2010425627231598, 0.5996190309524536, -0.36454081535339355, 0.31364119052886963, -0.008196156471967697, 0.015220455825328827, -0.006595529615879059, -0.0775795578956604, 0.5145036578178406, 0.3418304920196533, -0.019011342898011208, 0.2720308005809784, -0.19226135313510895, -0.18121609091758728, 0.05343823879957199, 0.26356184482574463, -0.13445723056793213, 0.0783894956111908, 0.08923044800758362, -0.17111769318580627, 0.601753830909729, -0.11879418790340424, 0.08426662534475327, 0.3413355052471161, 0.08835352212190628, 0.04691200703382492, -0.042562730610370636, -0.0777355283498764, -0.6965600848197937, 0.4013170599937439, 0.017941392958164215, -0.21079589426517487, -0.21448856592178345, 0.108411505818367, -0.11555603891611099, 0.2392064332962036, -0.23254333436489105, 0.15605491399765015, -0.099142886698246, 0.17067784070968628, -0.11217792332172394, 0.06920729577541351, -0.0958162173628807, 0.4483773410320282, -0.0045052096247673035, -0.1617567390203476, -0.35923272371292114, 0.24985447525978088, 0.0680844858288765, -0.14159350097179413, -0.1605014204978943, 0.1063460111618042, 0.07836645841598511, -0.24856506288051605, -0.1437816023826599, 0.1929836869239807, -0.1169041097164154, 0.16763627529144287, -0.23676618933677673, -0.1271367222070694, 0.12416714429855347, 0.3593362867832184, -0.043003179132938385, -0.11117839813232422, 0.09294385462999344, -0.18415510654449463, 0.04998801648616791, 0.3427119255065918, -0.10864086449146271, 0.4850924611091614, 0.01941876858472824, -0.25242137908935547, 0.3767440915107727, -0.06637266278266907, 0.08320625126361847, 0.07552605122327805, 0.6670228242874146, 0.4249246120452881, 0.736285924911499, 0.1444288194179535, -0.4537842869758606, 0.2158767580986023, 0.4971393048763275, 0.007549643516540527, -0.10384762287139893, 0.15359656512737274, 0.15525977313518524, 0.09875116497278214, 0.11121322214603424, 0.1515865921974182, 0.43603286147117615, 0.14865067601203918, -0.17097675800323486, -0.05937153100967407, -0.1292506456375122, -0.2718510627746582, -0.03260454535484314, 0.18726596236228943, 0.155839741230011, 0.49461373686790466, 0.3027156889438629, -0.11256624758243561, -0.2710462212562561, -0.43627047538757324, 0.15031489729881287, 0.24172556400299072, -0.30522555112838745, 0.468244343996048, -0.28184351325035095, 0.21470950543880463, -0.384070485830307, -0.03273841738700867, -0.11337155103683472, -0.2653958201408386, -0.25936761498451233, 0.28988921642303467, 0.039504796266555786, -0.03728068619966507, -0.15264278650283813, 0.38655370473861694, -0.18447110056877136, -0.12960121035575867, -0.3505040407180786, -0.15792548656463623, -0.46664392948150635, -0.16876725852489471, 0.47517770528793335, 0.09388850629329681, 0.18671563267707825, 0.20034973323345184, -0.42620569467544556, 0.15047675371170044, 0.15843504667282104, 0.09711064398288727, -0.1102355569601059, 0.3848576247692108, 0.007513206452131271, 0.27393868565559387, -0.11267977952957153, -0.27488332986831665, 0.09002487361431122, -0.11491517722606659, 0.009581148624420166, -0.017411217093467712, -0.03068537823855877, -0.17475678026676178, -0.22733144462108612, -0.022299859672784805, -0.5508553981781006, -0.31863585114479065, 0.4618632197380066, -0.021901607513427734, 0.2194148600101471, 0.10206648707389832, -0.03693029284477234, 0.27796438336372375, 0.3065280318260193, -0.16031572222709656, -0.0875856876373291, -0.2529546618461609, -0.016483960673213005, -0.0722891241312027, -0.12909896671772003, -0.28081417083740234, -0.04656238108873367, -0.10550357401371002, -0.05015760287642479, -0.44561299681663513, 0.4484734535217285, -0.4072372317314148, 0.41109499335289, -0.17156678438186646, -0.1060076504945755, 0.12369753420352936, -0.04909195750951767, 0.05476190894842148, -0.002225808799266815, -0.17108623683452606, 0.20208610594272614, 0.0170101597905159, 0.0643562376499176, -0.026995845139026642, 0.24562610685825348, -0.06465167552232742, 0.5921217203140259, -0.006754450500011444, -0.2360386997461319, 0.28225311636924744, -0.045087896287441254, 0.15382035076618195, -0.16515299677848816, -0.2721273601055145, -0.02530737593770027, -0.1276538372039795, -0.41864147782325745, 0.09504112601280212, -0.046965092420578, -0.3201781213283539, -0.040812406688928604, 0.07937218993902206, -0.13495884835720062, -0.2962687611579895, 0.2827531099319458, -0.11319299042224884, -0.03839598968625069, -0.07552457600831985, -0.06774630397558212, -0.12160135060548782, -0.07737056165933609, -0.22271081805229187, 0.15848807990550995, 0.09392639249563217, -0.27021676301956177, -0.5513702034950256, -0.20280671119689941, -0.6572021842002869, 0.14514482021331787, 0.09639915823936462, 0.4645669758319855, -0.12286048382520676, 0.008058272302150726, 0.2461146116256714, -0.23898373544216156, 1.0183742046356201, 0.09834728389978409, 0.18800459802150726, 0.31486019492149353, 0.11449277400970459, -0.4659084975719452, -0.23756921291351318, -0.026384584605693817, 0.4269142150878906, 0.4973560571670532, 0.5276718139648438, -0.21254101395606995, -0.12948021292686462, -0.03939373791217804, 0.12209698557853699, -0.223072350025177, -0.4376458525657654, -0.4356280565261841, -0.10170239955186844, -0.25470587611198425, 0.08372589945793152, -0.047716595232486725, 0.060881972312927246, -0.4239758253097534, -0.3893817067146301, 0.07506302744150162, 0.035835832357406616, -0.019222117960453033, -0.01773814484477043, -0.17338210344314575, 0.28369927406311035, 0.3091053068637848, 0.06568965315818787, 0.40374383330345154, 0.18025431036949158, 0.21506471931934357, -0.28491154313087463, -0.03180733695626259, 0.35692229866981506, -0.002773478627204895, 0.33755403757095337, 0.6597993969917297, 0.001017298549413681, 0.22286853194236755, 0.23759834468364716, 0.3647741973400116, -0.030164934694767, 0.07540750503540039, 0.1931966245174408, 0.1160978376865387, -0.3292321264743805, -0.4299934506416321, 0.3786565661430359, 0.12474827468395233, -0.1952911913394928, 0.3014637231826782, -0.6321588754653931, -0.12117603421211243, 0.32383570075035095, -0.16599097847938538, 0.9280341267585754, -0.19756674766540527, 0.21224603056907654, 0.16786202788352966, -0.16276392340660095, 0.32169604301452637, -0.08906228840351105, 0.09598366916179657, -0.4163469672203064, 0.2721562087535858, 0.09581974893808365, -0.2873101234436035, -0.0025557316839694977, 0.10617808997631073, 0.09246841818094254, 0.2503693103790283, -0.33307236433029175, -0.05819020792841911, -0.10349180549383163, 0.2913593351840973, 0.11607063561677933, -0.2531382441520691, -0.5245260000228882, -0.08417901396751404, 0.029087383300065994, 0.04704635590314865, -0.22380709648132324, 0.02655087038874626, -0.21172034740447998, 0.08707121014595032, -0.18321464955806732, 0.21917565166950226, -0.03674986958503723, 0.1786743402481079, 0.07008327543735504, -0.3035663962364197, -0.0729350596666336, 0.09661908447742462, -0.061049312353134155, -0.03671219199895859, -0.08549598604440689, 0.19912847876548767, 0.2159157246351242, 0.1027659922838211, 0.19405719637870789, -0.25970014929771423, 0.1344083845615387, 0.11273094266653061, -0.2824198007583618, -0.030676059424877167, -0.2532346844673157, -0.31737059354782104, 0.04697790741920471, 0.35681289434432983, 0.14197053015232086, 0.07813742756843567, -0.28865787386894226, 0.15654537081718445, 0.16173729300498962, -0.20116379857063293, -0.018486902117729187, 0.10137724131345749, -0.07416509091854095, 0.2349921315908432, -0.4114398658275604, -0.3218008875846863, -0.07375441491603851, 0.4018590748310089, -0.15644748508930206, 0.10199765861034393, 0.5607468485832214, 0.3765143156051636, -0.06144779920578003, -0.11039472371339798, 0.09708084166049957, 0.08901809900999069, -0.4868384897708893, 0.2545470893383026, -0.018442662432789803, -0.03703463077545166, 0.18717491626739502, 0.03973819315433502, -0.07784639298915863, -0.16413643956184387, -0.20975995063781738, -0.480294793844223, -0.4341728687286377, -0.32708898186683655, -0.021443527191877365, 0.10562777519226074, 0.16772189736366272, 0.1278790831565857, -0.11532926559448242, -0.027091341093182564, -0.13727684319019318, -0.07554276287555695, -0.5917837619781494, 0.1202239841222763, 0.09102919697761536, -0.15790271759033203, 0.04610907658934593, -0.11820745468139648, -0.013372592628002167, 0.12415184080600739, -0.0734194964170456, -0.12466514110565186, -0.1262572854757309, 0.19590480625629425, -0.013784541748464108, -0.1762695014476776, -0.0906640887260437, -0.2664434313774109, 0.18367569148540497, -0.04911421239376068, 0.12684017419815063, 0.04526646435260773, 0.06009793281555176, -0.038940057158470154, 0.21120989322662354, 0.222407728433609, 0.13811062276363373, 0.4756799638271332, -0.08004489541053772, 0.09450150281190872, 0.20826764404773712, 0.4452442526817322, -0.12196770310401917, 0.059275537729263306, -0.35141485929489136, -0.19108255207538605, 0.2062154859304428, 0.5880520343780518, -0.005489269271492958, -0.3035420775413513, -0.09526100754737854, -0.0405677929520607, 0.21859391033649445, 0.6138256788253784, -0.20290213823318481, -0.2042095959186554, 0.2563404142856598, 0.00728044006973505, 0.048442013561725616, -0.1886448860168457, 0.29622751474380493, 0.08852416276931763, -0.011000730097293854, 0.19760264456272125, 0.05745574086904526, -0.3458976447582245, -0.4280814230442047, 0.129216730594635, 0.34763601422309875, 0.06965403258800507, -0.24532990157604218, 0.40669015049934387, 0.24392478168010712, 0.1355973482131958, 0.06509373337030411, 0.11291922628879547, 0.2605099678039551, 0.42807719111442566, 0.14651109278202057, 0.02496550790965557, 0.15801551938056946, 0.46684297919273376, 0.02781812660396099, -0.445743203163147, 0.07264254987239838, 0.3738434910774231, -0.42496317625045776, 0.19273538887500763, 0.2114466279745102, 0.36857110261917114, -0.05489933490753174, -0.22775009274482727, -0.003399461507797241, 0.3910950720310211, -0.1808556169271469, -0.23238933086395264, -0.3527378439903259, -0.08021725714206696, 0.07665933668613434, 0.1382218301296234, -0.08905147016048431, 0.10141021013259888, -0.03598102554678917, 0.33433571457862854, 0.03742837905883789, -0.3472447395324707, -0.014475534670054913, 0.10639277845621109, 0.1434614509344101, -0.17825910449028015, 0.0007586590945720673, 0.1286739557981491, -0.06467075645923615, -0.15855282545089722, -0.07319427281618118, 0.41615843772888184, 0.453610360622406, -0.03897897154092789, 0.04730893671512604, 0.13603761792182922, 0.1400853842496872, -0.20416706800460815, 0.2941347062587738, -0.04237823560833931, 0.24055688083171844, 0.3269038796424866, -0.02486679144203663, -0.10898759961128235, 0.11507052928209305, 0.2854999601840973, 0.21540750563144684, -0.29414963722229004, 0.4277312755584717, 0.10172706842422485, -0.304467111825943, -0.040853939950466156, 0.03758564218878746, -0.15888985991477966, 0.12911394238471985, 0.4260285198688507, -0.3421753942966461, 0.22952476143836975, -0.059429340064525604, 0.010937068611383438, -0.34719565510749817, 0.6160120368003845, 0.210429385304451, 0.34700340032577515, -0.18143713474273682, 0.010435923933982849, -0.6169217824935913, 0.04547085613012314, -0.20624397695064545, 0.0620909109711647, 0.06909693777561188, 0.25392118096351624, -0.21517744660377502, 0.055237267166376114, -0.13321377336978912, 0.3224862515926361, 0.050949759781360626, 0.5011716485023499, -0.32874542474746704, -0.10315725207328796, -0.2048649787902832, -0.09657551348209381, -0.07908248901367188, -0.5112425088882446, 0.313877671957016, -0.08022990822792053, -0.09770727902650833, -0.11538451164960861, -0.27193009853363037, 0.12608478963375092, 0.22765494883060455, 0.34329622983932495, 0.16425836086273193, 0.20238928496837616, -0.048283178359270096, -0.10008877515792847, -0.22999005019664764, 0.0043055154383182526, 0.04189937561750412, -0.06288469582796097, -0.021493813022971153, 0.11762489378452301, -0.3844679594039917, 0.4330427646636963, -0.2691423296928406, -0.14293988049030304, 0.026626944541931152, 0.08420783281326294, -0.03456606715917587, -0.22435975074768066, -0.10446815937757492, 0.293850839138031, 0.006114475429058075, 0.3783755302429199, 0.2134964019060135, 0.027883857488632202, -0.3000328838825226, 0.11826881021261215, 0.21001841127872467, -0.5380436182022095, -0.34327876567840576, -0.22207537293434143, 0.2601051330566406, -0.18671561777591705, -0.07339468598365784, 0.08720415830612183, -0.27399933338165283, 0.4156044125556946, -0.29029327630996704, -0.42224037647247314, 0.15101100504398346, -0.24210801720619202, -0.05769655108451843, -0.0630071684718132, -0.08060165494680405, 0.2700447142124176, -0.24287071824073792, 0.21398413181304932, -0.25309133529663086 ]
https://github.com/huggingface/datasets/issues/6108
We use a generic multiprocessing code, so there is little we can do about this - unfortunately, turning off multiprocessing seems to be the only solution. Multithreading would make our code easier to maintain and (most likely) avoid issues such as this one, but we cannot use it until the GIL is dropped (no-GIL Python should be released in 2024, so we can start exploring this then)
Loading local datasets got strangely stuck
### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2
67
Loading local datasets got strangely stuck ### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2 We use a generic multiprocessing code, so there is little we can do about this - unfortunately, turning off multiprocessing seems to be the only solution. Multithreading would make our code easier to maintain and (most likely) avoid issues such as this one, but we cannot use it until the GIL is dropped (no-GIL Python should be released in 2024, so we can start exploring this then)
[ -0.24503090977668762, -0.018570467829704285, -0.02903907559812069, 0.2270108461380005, -0.018362440168857574, 0.05931895971298218, 0.2687035799026489, 0.23350246250629425, 0.12182816863059998, 0.18180540204048157, 0.0590432733297348, 0.5354204773902893, -0.11318369209766388, -0.09281224012374878, -0.0934063047170639, -0.04633789509534836, -0.01936904713511467, -0.0019202902913093567, 0.459880530834198, -0.05822746455669403, -0.23490609228610992, 0.19181278347969055, -0.19052350521087646, 0.0126716960221529, -0.29522740840911865, 0.02383113093674183, 0.125636488199234, 0.3863019049167633, 0.4537752866744995, -0.48997774720191956, 0.22632159292697906, -0.0007872506976127625, 0.16353976726531982, 0.4604818522930145, -0.00012564609642140567, 0.09652862697839737, 0.2871282398700714, 0.19761820137500763, -0.579081118106842, -0.14129507541656494, -0.09272775053977966, -0.2988988757133484, 0.2696419954299927, -0.2219139039516449, 0.2325998693704605, -0.06351856142282486, 0.09661800414323807, -0.5447632670402527, 0.20530100166797638, 0.16495193541049957, 0.07028139382600784, 0.43889278173446655, -0.4506288468837738, 0.18530766665935516, 0.01673169434070587, 0.0740278959274292, -0.02011117711663246, 0.4390155076980591, 0.6115700006484985, -0.19813945889472961, 0.020339099690318108, -0.17534798383712769, -0.16963323950767517, -0.08954977989196777, -0.17692063748836517, 0.032292407006025314, 0.3357584476470947, -0.5173730254173279, 0.18696917593479156, 0.21311286091804504, 0.006808336824178696, -0.007232848554849625, -0.06317970156669617, -0.6782644391059875, 0.06354793906211853, -0.2525230646133423, 0.037639111280441284, 0.28413626551628113, -0.37633004784584045, 0.14321257174015045, -0.27517950534820557, 0.10261741280555725, 0.01632167398929596, 0.05074901133775711, -0.01492871344089508, 0.18201220035552979, 0.05727282539010048, 0.2914443910121918, 0.06341585516929626, 0.3648519217967987, 0.05916835740208626, -0.19847072660923004, 0.2161903977394104, 0.20921757817268372, -0.3701484203338623, 0.31480544805526733, 0.2066442221403122, -0.08737711608409882, -0.04657287150621414, -0.1296619474887848, 0.02739030495285988, 0.05878216400742531, -0.007316868752241135, 0.23466438055038452, 0.4341602027416229, 0.018132135272026062, -0.08012911677360535, 0.04159818962216377, 0.44266828894615173, -0.062090255320072174, -0.12069446593523026, 0.24303457140922546, -0.1822364181280136, -0.1472683995962143, 0.19630958139896393, 0.03548255190253258, 0.05812753736972809, -0.013800077140331268, -0.4037393033504486, 0.19677594304084778, -0.2712756395339966, 0.05061415582895279, 0.30407875776290894, 0.3775843679904938, 0.021334614604711533, 0.4825482964515686, -0.11471869051456451, -0.12123221904039383, -0.3468611538410187, 0.2851457893848419, -0.0073275454342365265, -0.32440048456192017, -0.21037213504314423, -0.08484653383493423, 0.3076636791229248, -0.20122191309928894, 0.08891905099153519, 0.21543069183826447, -0.0601469948887825, -0.13656462728977203, 0.1739872545003891, -0.34400609135627747, 0.018868809565901756, 0.28348761796951294, 0.05656997859477997, 0.2572927176952362, -0.08146287500858307, -0.22868606448173523, -0.21536774933338165, 0.3986060917377472, -0.22930681705474854, -0.24533608555793762, -0.13200774788856506, 0.01302036177366972, -0.11796284466981888, 0.16528178751468658, -0.20990294218063354, 0.12425273656845093, 0.25848910212516785, -0.009480543434619904, 0.12627819180488586, -0.4081161618232727, -0.2387227565050125, -0.16167642176151276, 0.12969867885112762, 0.5087119340896606, -0.6662941575050354, -0.029202334582805634, -0.04381188750267029, -0.152022585272789, 0.3554225564002991, 0.42606279253959656, -0.27567529678344727, 0.4720778465270996, -0.504848062992096, 0.10139288008213043, 0.07319954037666321, -0.21501506865024567, -0.2010425627231598, 0.5996190309524536, -0.36454081535339355, 0.31364119052886963, -0.008196156471967697, 0.015220455825328827, -0.006595529615879059, -0.0775795578956604, 0.5145036578178406, 0.3418304920196533, -0.019011342898011208, 0.2720308005809784, -0.19226135313510895, -0.18121609091758728, 0.05343823879957199, 0.26356184482574463, -0.13445723056793213, 0.0783894956111908, 0.08923044800758362, -0.17111769318580627, 0.601753830909729, -0.11879418790340424, 0.08426662534475327, 0.3413355052471161, 0.08835352212190628, 0.04691200703382492, -0.042562730610370636, -0.0777355283498764, -0.6965600848197937, 0.4013170599937439, 0.017941392958164215, -0.21079589426517487, -0.21448856592178345, 0.108411505818367, -0.11555603891611099, 0.2392064332962036, -0.23254333436489105, 0.15605491399765015, -0.099142886698246, 0.17067784070968628, -0.11217792332172394, 0.06920729577541351, -0.0958162173628807, 0.4483773410320282, -0.0045052096247673035, -0.1617567390203476, -0.35923272371292114, 0.24985447525978088, 0.0680844858288765, -0.14159350097179413, -0.1605014204978943, 0.1063460111618042, 0.07836645841598511, -0.24856506288051605, -0.1437816023826599, 0.1929836869239807, -0.1169041097164154, 0.16763627529144287, -0.23676618933677673, -0.1271367222070694, 0.12416714429855347, 0.3593362867832184, -0.043003179132938385, -0.11117839813232422, 0.09294385462999344, -0.18415510654449463, 0.04998801648616791, 0.3427119255065918, -0.10864086449146271, 0.4850924611091614, 0.01941876858472824, -0.25242137908935547, 0.3767440915107727, -0.06637266278266907, 0.08320625126361847, 0.07552605122327805, 0.6670228242874146, 0.4249246120452881, 0.736285924911499, 0.1444288194179535, -0.4537842869758606, 0.2158767580986023, 0.4971393048763275, 0.007549643516540527, -0.10384762287139893, 0.15359656512737274, 0.15525977313518524, 0.09875116497278214, 0.11121322214603424, 0.1515865921974182, 0.43603286147117615, 0.14865067601203918, -0.17097675800323486, -0.05937153100967407, -0.1292506456375122, -0.2718510627746582, -0.03260454535484314, 0.18726596236228943, 0.155839741230011, 0.49461373686790466, 0.3027156889438629, -0.11256624758243561, -0.2710462212562561, -0.43627047538757324, 0.15031489729881287, 0.24172556400299072, -0.30522555112838745, 0.468244343996048, -0.28184351325035095, 0.21470950543880463, -0.384070485830307, -0.03273841738700867, -0.11337155103683472, -0.2653958201408386, -0.25936761498451233, 0.28988921642303467, 0.039504796266555786, -0.03728068619966507, -0.15264278650283813, 0.38655370473861694, -0.18447110056877136, -0.12960121035575867, -0.3505040407180786, -0.15792548656463623, -0.46664392948150635, -0.16876725852489471, 0.47517770528793335, 0.09388850629329681, 0.18671563267707825, 0.20034973323345184, -0.42620569467544556, 0.15047675371170044, 0.15843504667282104, 0.09711064398288727, -0.1102355569601059, 0.3848576247692108, 0.007513206452131271, 0.27393868565559387, -0.11267977952957153, -0.27488332986831665, 0.09002487361431122, -0.11491517722606659, 0.009581148624420166, -0.017411217093467712, -0.03068537823855877, -0.17475678026676178, -0.22733144462108612, -0.022299859672784805, -0.5508553981781006, -0.31863585114479065, 0.4618632197380066, -0.021901607513427734, 0.2194148600101471, 0.10206648707389832, -0.03693029284477234, 0.27796438336372375, 0.3065280318260193, -0.16031572222709656, -0.0875856876373291, -0.2529546618461609, -0.016483960673213005, -0.0722891241312027, -0.12909896671772003, -0.28081417083740234, -0.04656238108873367, -0.10550357401371002, -0.05015760287642479, -0.44561299681663513, 0.4484734535217285, -0.4072372317314148, 0.41109499335289, -0.17156678438186646, -0.1060076504945755, 0.12369753420352936, -0.04909195750951767, 0.05476190894842148, -0.002225808799266815, -0.17108623683452606, 0.20208610594272614, 0.0170101597905159, 0.0643562376499176, -0.026995845139026642, 0.24562610685825348, -0.06465167552232742, 0.5921217203140259, -0.006754450500011444, -0.2360386997461319, 0.28225311636924744, -0.045087896287441254, 0.15382035076618195, -0.16515299677848816, -0.2721273601055145, -0.02530737593770027, -0.1276538372039795, -0.41864147782325745, 0.09504112601280212, -0.046965092420578, -0.3201781213283539, -0.040812406688928604, 0.07937218993902206, -0.13495884835720062, -0.2962687611579895, 0.2827531099319458, -0.11319299042224884, -0.03839598968625069, -0.07552457600831985, -0.06774630397558212, -0.12160135060548782, -0.07737056165933609, -0.22271081805229187, 0.15848807990550995, 0.09392639249563217, -0.27021676301956177, -0.5513702034950256, -0.20280671119689941, -0.6572021842002869, 0.14514482021331787, 0.09639915823936462, 0.4645669758319855, -0.12286048382520676, 0.008058272302150726, 0.2461146116256714, -0.23898373544216156, 1.0183742046356201, 0.09834728389978409, 0.18800459802150726, 0.31486019492149353, 0.11449277400970459, -0.4659084975719452, -0.23756921291351318, -0.026384584605693817, 0.4269142150878906, 0.4973560571670532, 0.5276718139648438, -0.21254101395606995, -0.12948021292686462, -0.03939373791217804, 0.12209698557853699, -0.223072350025177, -0.4376458525657654, -0.4356280565261841, -0.10170239955186844, -0.25470587611198425, 0.08372589945793152, -0.047716595232486725, 0.060881972312927246, -0.4239758253097534, -0.3893817067146301, 0.07506302744150162, 0.035835832357406616, -0.019222117960453033, -0.01773814484477043, -0.17338210344314575, 0.28369927406311035, 0.3091053068637848, 0.06568965315818787, 0.40374383330345154, 0.18025431036949158, 0.21506471931934357, -0.28491154313087463, -0.03180733695626259, 0.35692229866981506, -0.002773478627204895, 0.33755403757095337, 0.6597993969917297, 0.001017298549413681, 0.22286853194236755, 0.23759834468364716, 0.3647741973400116, -0.030164934694767, 0.07540750503540039, 0.1931966245174408, 0.1160978376865387, -0.3292321264743805, -0.4299934506416321, 0.3786565661430359, 0.12474827468395233, -0.1952911913394928, 0.3014637231826782, -0.6321588754653931, -0.12117603421211243, 0.32383570075035095, -0.16599097847938538, 0.9280341267585754, -0.19756674766540527, 0.21224603056907654, 0.16786202788352966, -0.16276392340660095, 0.32169604301452637, -0.08906228840351105, 0.09598366916179657, -0.4163469672203064, 0.2721562087535858, 0.09581974893808365, -0.2873101234436035, -0.0025557316839694977, 0.10617808997631073, 0.09246841818094254, 0.2503693103790283, -0.33307236433029175, -0.05819020792841911, -0.10349180549383163, 0.2913593351840973, 0.11607063561677933, -0.2531382441520691, -0.5245260000228882, -0.08417901396751404, 0.029087383300065994, 0.04704635590314865, -0.22380709648132324, 0.02655087038874626, -0.21172034740447998, 0.08707121014595032, -0.18321464955806732, 0.21917565166950226, -0.03674986958503723, 0.1786743402481079, 0.07008327543735504, -0.3035663962364197, -0.0729350596666336, 0.09661908447742462, -0.061049312353134155, -0.03671219199895859, -0.08549598604440689, 0.19912847876548767, 0.2159157246351242, 0.1027659922838211, 0.19405719637870789, -0.25970014929771423, 0.1344083845615387, 0.11273094266653061, -0.2824198007583618, -0.030676059424877167, -0.2532346844673157, -0.31737059354782104, 0.04697790741920471, 0.35681289434432983, 0.14197053015232086, 0.07813742756843567, -0.28865787386894226, 0.15654537081718445, 0.16173729300498962, -0.20116379857063293, -0.018486902117729187, 0.10137724131345749, -0.07416509091854095, 0.2349921315908432, -0.4114398658275604, -0.3218008875846863, -0.07375441491603851, 0.4018590748310089, -0.15644748508930206, 0.10199765861034393, 0.5607468485832214, 0.3765143156051636, -0.06144779920578003, -0.11039472371339798, 0.09708084166049957, 0.08901809900999069, -0.4868384897708893, 0.2545470893383026, -0.018442662432789803, -0.03703463077545166, 0.18717491626739502, 0.03973819315433502, -0.07784639298915863, -0.16413643956184387, -0.20975995063781738, -0.480294793844223, -0.4341728687286377, -0.32708898186683655, -0.021443527191877365, 0.10562777519226074, 0.16772189736366272, 0.1278790831565857, -0.11532926559448242, -0.027091341093182564, -0.13727684319019318, -0.07554276287555695, -0.5917837619781494, 0.1202239841222763, 0.09102919697761536, -0.15790271759033203, 0.04610907658934593, -0.11820745468139648, -0.013372592628002167, 0.12415184080600739, -0.0734194964170456, -0.12466514110565186, -0.1262572854757309, 0.19590480625629425, -0.013784541748464108, -0.1762695014476776, -0.0906640887260437, -0.2664434313774109, 0.18367569148540497, -0.04911421239376068, 0.12684017419815063, 0.04526646435260773, 0.06009793281555176, -0.038940057158470154, 0.21120989322662354, 0.222407728433609, 0.13811062276363373, 0.4756799638271332, -0.08004489541053772, 0.09450150281190872, 0.20826764404773712, 0.4452442526817322, -0.12196770310401917, 0.059275537729263306, -0.35141485929489136, -0.19108255207538605, 0.2062154859304428, 0.5880520343780518, -0.005489269271492958, -0.3035420775413513, -0.09526100754737854, -0.0405677929520607, 0.21859391033649445, 0.6138256788253784, -0.20290213823318481, -0.2042095959186554, 0.2563404142856598, 0.00728044006973505, 0.048442013561725616, -0.1886448860168457, 0.29622751474380493, 0.08852416276931763, -0.011000730097293854, 0.19760264456272125, 0.05745574086904526, -0.3458976447582245, -0.4280814230442047, 0.129216730594635, 0.34763601422309875, 0.06965403258800507, -0.24532990157604218, 0.40669015049934387, 0.24392478168010712, 0.1355973482131958, 0.06509373337030411, 0.11291922628879547, 0.2605099678039551, 0.42807719111442566, 0.14651109278202057, 0.02496550790965557, 0.15801551938056946, 0.46684297919273376, 0.02781812660396099, -0.445743203163147, 0.07264254987239838, 0.3738434910774231, -0.42496317625045776, 0.19273538887500763, 0.2114466279745102, 0.36857110261917114, -0.05489933490753174, -0.22775009274482727, -0.003399461507797241, 0.3910950720310211, -0.1808556169271469, -0.23238933086395264, -0.3527378439903259, -0.08021725714206696, 0.07665933668613434, 0.1382218301296234, -0.08905147016048431, 0.10141021013259888, -0.03598102554678917, 0.33433571457862854, 0.03742837905883789, -0.3472447395324707, -0.014475534670054913, 0.10639277845621109, 0.1434614509344101, -0.17825910449028015, 0.0007586590945720673, 0.1286739557981491, -0.06467075645923615, -0.15855282545089722, -0.07319427281618118, 0.41615843772888184, 0.453610360622406, -0.03897897154092789, 0.04730893671512604, 0.13603761792182922, 0.1400853842496872, -0.20416706800460815, 0.2941347062587738, -0.04237823560833931, 0.24055688083171844, 0.3269038796424866, -0.02486679144203663, -0.10898759961128235, 0.11507052928209305, 0.2854999601840973, 0.21540750563144684, -0.29414963722229004, 0.4277312755584717, 0.10172706842422485, -0.304467111825943, -0.040853939950466156, 0.03758564218878746, -0.15888985991477966, 0.12911394238471985, 0.4260285198688507, -0.3421753942966461, 0.22952476143836975, -0.059429340064525604, 0.010937068611383438, -0.34719565510749817, 0.6160120368003845, 0.210429385304451, 0.34700340032577515, -0.18143713474273682, 0.010435923933982849, -0.6169217824935913, 0.04547085613012314, -0.20624397695064545, 0.0620909109711647, 0.06909693777561188, 0.25392118096351624, -0.21517744660377502, 0.055237267166376114, -0.13321377336978912, 0.3224862515926361, 0.050949759781360626, 0.5011716485023499, -0.32874542474746704, -0.10315725207328796, -0.2048649787902832, -0.09657551348209381, -0.07908248901367188, -0.5112425088882446, 0.313877671957016, -0.08022990822792053, -0.09770727902650833, -0.11538451164960861, -0.27193009853363037, 0.12608478963375092, 0.22765494883060455, 0.34329622983932495, 0.16425836086273193, 0.20238928496837616, -0.048283178359270096, -0.10008877515792847, -0.22999005019664764, 0.0043055154383182526, 0.04189937561750412, -0.06288469582796097, -0.021493813022971153, 0.11762489378452301, -0.3844679594039917, 0.4330427646636963, -0.2691423296928406, -0.14293988049030304, 0.026626944541931152, 0.08420783281326294, -0.03456606715917587, -0.22435975074768066, -0.10446815937757492, 0.293850839138031, 0.006114475429058075, 0.3783755302429199, 0.2134964019060135, 0.027883857488632202, -0.3000328838825226, 0.11826881021261215, 0.21001841127872467, -0.5380436182022095, -0.34327876567840576, -0.22207537293434143, 0.2601051330566406, -0.18671561777591705, -0.07339468598365784, 0.08720415830612183, -0.27399933338165283, 0.4156044125556946, -0.29029327630996704, -0.42224037647247314, 0.15101100504398346, -0.24210801720619202, -0.05769655108451843, -0.0630071684718132, -0.08060165494680405, 0.2700447142124176, -0.24287071824073792, 0.21398413181304932, -0.25309133529663086 ]
https://github.com/huggingface/datasets/issues/6108
The problem seems to be the `Generating train split`. Is it possible to avoid that? I have a dataset saved, just want to load it but somehow running into issues with that again.
Loading local datasets got strangely stuck
### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2
33
Loading local datasets got strangely stuck ### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2 The problem seems to be the `Generating train split`. Is it possible to avoid that? I have a dataset saved, just want to load it but somehow running into issues with that again.
[ -0.24503090977668762, -0.018570467829704285, -0.02903907559812069, 0.2270108461380005, -0.018362440168857574, 0.05931895971298218, 0.2687035799026489, 0.23350246250629425, 0.12182816863059998, 0.18180540204048157, 0.0590432733297348, 0.5354204773902893, -0.11318369209766388, -0.09281224012374878, -0.0934063047170639, -0.04633789509534836, -0.01936904713511467, -0.0019202902913093567, 0.459880530834198, -0.05822746455669403, -0.23490609228610992, 0.19181278347969055, -0.19052350521087646, 0.0126716960221529, -0.29522740840911865, 0.02383113093674183, 0.125636488199234, 0.3863019049167633, 0.4537752866744995, -0.48997774720191956, 0.22632159292697906, -0.0007872506976127625, 0.16353976726531982, 0.4604818522930145, -0.00012564609642140567, 0.09652862697839737, 0.2871282398700714, 0.19761820137500763, -0.579081118106842, -0.14129507541656494, -0.09272775053977966, -0.2988988757133484, 0.2696419954299927, -0.2219139039516449, 0.2325998693704605, -0.06351856142282486, 0.09661800414323807, -0.5447632670402527, 0.20530100166797638, 0.16495193541049957, 0.07028139382600784, 0.43889278173446655, -0.4506288468837738, 0.18530766665935516, 0.01673169434070587, 0.0740278959274292, -0.02011117711663246, 0.4390155076980591, 0.6115700006484985, -0.19813945889472961, 0.020339099690318108, -0.17534798383712769, -0.16963323950767517, -0.08954977989196777, -0.17692063748836517, 0.032292407006025314, 0.3357584476470947, -0.5173730254173279, 0.18696917593479156, 0.21311286091804504, 0.006808336824178696, -0.007232848554849625, -0.06317970156669617, -0.6782644391059875, 0.06354793906211853, -0.2525230646133423, 0.037639111280441284, 0.28413626551628113, -0.37633004784584045, 0.14321257174015045, -0.27517950534820557, 0.10261741280555725, 0.01632167398929596, 0.05074901133775711, -0.01492871344089508, 0.18201220035552979, 0.05727282539010048, 0.2914443910121918, 0.06341585516929626, 0.3648519217967987, 0.05916835740208626, -0.19847072660923004, 0.2161903977394104, 0.20921757817268372, -0.3701484203338623, 0.31480544805526733, 0.2066442221403122, -0.08737711608409882, -0.04657287150621414, -0.1296619474887848, 0.02739030495285988, 0.05878216400742531, -0.007316868752241135, 0.23466438055038452, 0.4341602027416229, 0.018132135272026062, -0.08012911677360535, 0.04159818962216377, 0.44266828894615173, -0.062090255320072174, -0.12069446593523026, 0.24303457140922546, -0.1822364181280136, -0.1472683995962143, 0.19630958139896393, 0.03548255190253258, 0.05812753736972809, -0.013800077140331268, -0.4037393033504486, 0.19677594304084778, -0.2712756395339966, 0.05061415582895279, 0.30407875776290894, 0.3775843679904938, 0.021334614604711533, 0.4825482964515686, -0.11471869051456451, -0.12123221904039383, -0.3468611538410187, 0.2851457893848419, -0.0073275454342365265, -0.32440048456192017, -0.21037213504314423, -0.08484653383493423, 0.3076636791229248, -0.20122191309928894, 0.08891905099153519, 0.21543069183826447, -0.0601469948887825, -0.13656462728977203, 0.1739872545003891, -0.34400609135627747, 0.018868809565901756, 0.28348761796951294, 0.05656997859477997, 0.2572927176952362, -0.08146287500858307, -0.22868606448173523, -0.21536774933338165, 0.3986060917377472, -0.22930681705474854, -0.24533608555793762, -0.13200774788856506, 0.01302036177366972, -0.11796284466981888, 0.16528178751468658, -0.20990294218063354, 0.12425273656845093, 0.25848910212516785, -0.009480543434619904, 0.12627819180488586, -0.4081161618232727, -0.2387227565050125, -0.16167642176151276, 0.12969867885112762, 0.5087119340896606, -0.6662941575050354, -0.029202334582805634, -0.04381188750267029, -0.152022585272789, 0.3554225564002991, 0.42606279253959656, -0.27567529678344727, 0.4720778465270996, -0.504848062992096, 0.10139288008213043, 0.07319954037666321, -0.21501506865024567, -0.2010425627231598, 0.5996190309524536, -0.36454081535339355, 0.31364119052886963, -0.008196156471967697, 0.015220455825328827, -0.006595529615879059, -0.0775795578956604, 0.5145036578178406, 0.3418304920196533, -0.019011342898011208, 0.2720308005809784, -0.19226135313510895, -0.18121609091758728, 0.05343823879957199, 0.26356184482574463, -0.13445723056793213, 0.0783894956111908, 0.08923044800758362, -0.17111769318580627, 0.601753830909729, -0.11879418790340424, 0.08426662534475327, 0.3413355052471161, 0.08835352212190628, 0.04691200703382492, -0.042562730610370636, -0.0777355283498764, -0.6965600848197937, 0.4013170599937439, 0.017941392958164215, -0.21079589426517487, -0.21448856592178345, 0.108411505818367, -0.11555603891611099, 0.2392064332962036, -0.23254333436489105, 0.15605491399765015, -0.099142886698246, 0.17067784070968628, -0.11217792332172394, 0.06920729577541351, -0.0958162173628807, 0.4483773410320282, -0.0045052096247673035, -0.1617567390203476, -0.35923272371292114, 0.24985447525978088, 0.0680844858288765, -0.14159350097179413, -0.1605014204978943, 0.1063460111618042, 0.07836645841598511, -0.24856506288051605, -0.1437816023826599, 0.1929836869239807, -0.1169041097164154, 0.16763627529144287, -0.23676618933677673, -0.1271367222070694, 0.12416714429855347, 0.3593362867832184, -0.043003179132938385, -0.11117839813232422, 0.09294385462999344, -0.18415510654449463, 0.04998801648616791, 0.3427119255065918, -0.10864086449146271, 0.4850924611091614, 0.01941876858472824, -0.25242137908935547, 0.3767440915107727, -0.06637266278266907, 0.08320625126361847, 0.07552605122327805, 0.6670228242874146, 0.4249246120452881, 0.736285924911499, 0.1444288194179535, -0.4537842869758606, 0.2158767580986023, 0.4971393048763275, 0.007549643516540527, -0.10384762287139893, 0.15359656512737274, 0.15525977313518524, 0.09875116497278214, 0.11121322214603424, 0.1515865921974182, 0.43603286147117615, 0.14865067601203918, -0.17097675800323486, -0.05937153100967407, -0.1292506456375122, -0.2718510627746582, -0.03260454535484314, 0.18726596236228943, 0.155839741230011, 0.49461373686790466, 0.3027156889438629, -0.11256624758243561, -0.2710462212562561, -0.43627047538757324, 0.15031489729881287, 0.24172556400299072, -0.30522555112838745, 0.468244343996048, -0.28184351325035095, 0.21470950543880463, -0.384070485830307, -0.03273841738700867, -0.11337155103683472, -0.2653958201408386, -0.25936761498451233, 0.28988921642303467, 0.039504796266555786, -0.03728068619966507, -0.15264278650283813, 0.38655370473861694, -0.18447110056877136, -0.12960121035575867, -0.3505040407180786, -0.15792548656463623, -0.46664392948150635, -0.16876725852489471, 0.47517770528793335, 0.09388850629329681, 0.18671563267707825, 0.20034973323345184, -0.42620569467544556, 0.15047675371170044, 0.15843504667282104, 0.09711064398288727, -0.1102355569601059, 0.3848576247692108, 0.007513206452131271, 0.27393868565559387, -0.11267977952957153, -0.27488332986831665, 0.09002487361431122, -0.11491517722606659, 0.009581148624420166, -0.017411217093467712, -0.03068537823855877, -0.17475678026676178, -0.22733144462108612, -0.022299859672784805, -0.5508553981781006, -0.31863585114479065, 0.4618632197380066, -0.021901607513427734, 0.2194148600101471, 0.10206648707389832, -0.03693029284477234, 0.27796438336372375, 0.3065280318260193, -0.16031572222709656, -0.0875856876373291, -0.2529546618461609, -0.016483960673213005, -0.0722891241312027, -0.12909896671772003, -0.28081417083740234, -0.04656238108873367, -0.10550357401371002, -0.05015760287642479, -0.44561299681663513, 0.4484734535217285, -0.4072372317314148, 0.41109499335289, -0.17156678438186646, -0.1060076504945755, 0.12369753420352936, -0.04909195750951767, 0.05476190894842148, -0.002225808799266815, -0.17108623683452606, 0.20208610594272614, 0.0170101597905159, 0.0643562376499176, -0.026995845139026642, 0.24562610685825348, -0.06465167552232742, 0.5921217203140259, -0.006754450500011444, -0.2360386997461319, 0.28225311636924744, -0.045087896287441254, 0.15382035076618195, -0.16515299677848816, -0.2721273601055145, -0.02530737593770027, -0.1276538372039795, -0.41864147782325745, 0.09504112601280212, -0.046965092420578, -0.3201781213283539, -0.040812406688928604, 0.07937218993902206, -0.13495884835720062, -0.2962687611579895, 0.2827531099319458, -0.11319299042224884, -0.03839598968625069, -0.07552457600831985, -0.06774630397558212, -0.12160135060548782, -0.07737056165933609, -0.22271081805229187, 0.15848807990550995, 0.09392639249563217, -0.27021676301956177, -0.5513702034950256, -0.20280671119689941, -0.6572021842002869, 0.14514482021331787, 0.09639915823936462, 0.4645669758319855, -0.12286048382520676, 0.008058272302150726, 0.2461146116256714, -0.23898373544216156, 1.0183742046356201, 0.09834728389978409, 0.18800459802150726, 0.31486019492149353, 0.11449277400970459, -0.4659084975719452, -0.23756921291351318, -0.026384584605693817, 0.4269142150878906, 0.4973560571670532, 0.5276718139648438, -0.21254101395606995, -0.12948021292686462, -0.03939373791217804, 0.12209698557853699, -0.223072350025177, -0.4376458525657654, -0.4356280565261841, -0.10170239955186844, -0.25470587611198425, 0.08372589945793152, -0.047716595232486725, 0.060881972312927246, -0.4239758253097534, -0.3893817067146301, 0.07506302744150162, 0.035835832357406616, -0.019222117960453033, -0.01773814484477043, -0.17338210344314575, 0.28369927406311035, 0.3091053068637848, 0.06568965315818787, 0.40374383330345154, 0.18025431036949158, 0.21506471931934357, -0.28491154313087463, -0.03180733695626259, 0.35692229866981506, -0.002773478627204895, 0.33755403757095337, 0.6597993969917297, 0.001017298549413681, 0.22286853194236755, 0.23759834468364716, 0.3647741973400116, -0.030164934694767, 0.07540750503540039, 0.1931966245174408, 0.1160978376865387, -0.3292321264743805, -0.4299934506416321, 0.3786565661430359, 0.12474827468395233, -0.1952911913394928, 0.3014637231826782, -0.6321588754653931, -0.12117603421211243, 0.32383570075035095, -0.16599097847938538, 0.9280341267585754, -0.19756674766540527, 0.21224603056907654, 0.16786202788352966, -0.16276392340660095, 0.32169604301452637, -0.08906228840351105, 0.09598366916179657, -0.4163469672203064, 0.2721562087535858, 0.09581974893808365, -0.2873101234436035, -0.0025557316839694977, 0.10617808997631073, 0.09246841818094254, 0.2503693103790283, -0.33307236433029175, -0.05819020792841911, -0.10349180549383163, 0.2913593351840973, 0.11607063561677933, -0.2531382441520691, -0.5245260000228882, -0.08417901396751404, 0.029087383300065994, 0.04704635590314865, -0.22380709648132324, 0.02655087038874626, -0.21172034740447998, 0.08707121014595032, -0.18321464955806732, 0.21917565166950226, -0.03674986958503723, 0.1786743402481079, 0.07008327543735504, -0.3035663962364197, -0.0729350596666336, 0.09661908447742462, -0.061049312353134155, -0.03671219199895859, -0.08549598604440689, 0.19912847876548767, 0.2159157246351242, 0.1027659922838211, 0.19405719637870789, -0.25970014929771423, 0.1344083845615387, 0.11273094266653061, -0.2824198007583618, -0.030676059424877167, -0.2532346844673157, -0.31737059354782104, 0.04697790741920471, 0.35681289434432983, 0.14197053015232086, 0.07813742756843567, -0.28865787386894226, 0.15654537081718445, 0.16173729300498962, -0.20116379857063293, -0.018486902117729187, 0.10137724131345749, -0.07416509091854095, 0.2349921315908432, -0.4114398658275604, -0.3218008875846863, -0.07375441491603851, 0.4018590748310089, -0.15644748508930206, 0.10199765861034393, 0.5607468485832214, 0.3765143156051636, -0.06144779920578003, -0.11039472371339798, 0.09708084166049957, 0.08901809900999069, -0.4868384897708893, 0.2545470893383026, -0.018442662432789803, -0.03703463077545166, 0.18717491626739502, 0.03973819315433502, -0.07784639298915863, -0.16413643956184387, -0.20975995063781738, -0.480294793844223, -0.4341728687286377, -0.32708898186683655, -0.021443527191877365, 0.10562777519226074, 0.16772189736366272, 0.1278790831565857, -0.11532926559448242, -0.027091341093182564, -0.13727684319019318, -0.07554276287555695, -0.5917837619781494, 0.1202239841222763, 0.09102919697761536, -0.15790271759033203, 0.04610907658934593, -0.11820745468139648, -0.013372592628002167, 0.12415184080600739, -0.0734194964170456, -0.12466514110565186, -0.1262572854757309, 0.19590480625629425, -0.013784541748464108, -0.1762695014476776, -0.0906640887260437, -0.2664434313774109, 0.18367569148540497, -0.04911421239376068, 0.12684017419815063, 0.04526646435260773, 0.06009793281555176, -0.038940057158470154, 0.21120989322662354, 0.222407728433609, 0.13811062276363373, 0.4756799638271332, -0.08004489541053772, 0.09450150281190872, 0.20826764404773712, 0.4452442526817322, -0.12196770310401917, 0.059275537729263306, -0.35141485929489136, -0.19108255207538605, 0.2062154859304428, 0.5880520343780518, -0.005489269271492958, -0.3035420775413513, -0.09526100754737854, -0.0405677929520607, 0.21859391033649445, 0.6138256788253784, -0.20290213823318481, -0.2042095959186554, 0.2563404142856598, 0.00728044006973505, 0.048442013561725616, -0.1886448860168457, 0.29622751474380493, 0.08852416276931763, -0.011000730097293854, 0.19760264456272125, 0.05745574086904526, -0.3458976447582245, -0.4280814230442047, 0.129216730594635, 0.34763601422309875, 0.06965403258800507, -0.24532990157604218, 0.40669015049934387, 0.24392478168010712, 0.1355973482131958, 0.06509373337030411, 0.11291922628879547, 0.2605099678039551, 0.42807719111442566, 0.14651109278202057, 0.02496550790965557, 0.15801551938056946, 0.46684297919273376, 0.02781812660396099, -0.445743203163147, 0.07264254987239838, 0.3738434910774231, -0.42496317625045776, 0.19273538887500763, 0.2114466279745102, 0.36857110261917114, -0.05489933490753174, -0.22775009274482727, -0.003399461507797241, 0.3910950720310211, -0.1808556169271469, -0.23238933086395264, -0.3527378439903259, -0.08021725714206696, 0.07665933668613434, 0.1382218301296234, -0.08905147016048431, 0.10141021013259888, -0.03598102554678917, 0.33433571457862854, 0.03742837905883789, -0.3472447395324707, -0.014475534670054913, 0.10639277845621109, 0.1434614509344101, -0.17825910449028015, 0.0007586590945720673, 0.1286739557981491, -0.06467075645923615, -0.15855282545089722, -0.07319427281618118, 0.41615843772888184, 0.453610360622406, -0.03897897154092789, 0.04730893671512604, 0.13603761792182922, 0.1400853842496872, -0.20416706800460815, 0.2941347062587738, -0.04237823560833931, 0.24055688083171844, 0.3269038796424866, -0.02486679144203663, -0.10898759961128235, 0.11507052928209305, 0.2854999601840973, 0.21540750563144684, -0.29414963722229004, 0.4277312755584717, 0.10172706842422485, -0.304467111825943, -0.040853939950466156, 0.03758564218878746, -0.15888985991477966, 0.12911394238471985, 0.4260285198688507, -0.3421753942966461, 0.22952476143836975, -0.059429340064525604, 0.010937068611383438, -0.34719565510749817, 0.6160120368003845, 0.210429385304451, 0.34700340032577515, -0.18143713474273682, 0.010435923933982849, -0.6169217824935913, 0.04547085613012314, -0.20624397695064545, 0.0620909109711647, 0.06909693777561188, 0.25392118096351624, -0.21517744660377502, 0.055237267166376114, -0.13321377336978912, 0.3224862515926361, 0.050949759781360626, 0.5011716485023499, -0.32874542474746704, -0.10315725207328796, -0.2048649787902832, -0.09657551348209381, -0.07908248901367188, -0.5112425088882446, 0.313877671957016, -0.08022990822792053, -0.09770727902650833, -0.11538451164960861, -0.27193009853363037, 0.12608478963375092, 0.22765494883060455, 0.34329622983932495, 0.16425836086273193, 0.20238928496837616, -0.048283178359270096, -0.10008877515792847, -0.22999005019664764, 0.0043055154383182526, 0.04189937561750412, -0.06288469582796097, -0.021493813022971153, 0.11762489378452301, -0.3844679594039917, 0.4330427646636963, -0.2691423296928406, -0.14293988049030304, 0.026626944541931152, 0.08420783281326294, -0.03456606715917587, -0.22435975074768066, -0.10446815937757492, 0.293850839138031, 0.006114475429058075, 0.3783755302429199, 0.2134964019060135, 0.027883857488632202, -0.3000328838825226, 0.11826881021261215, 0.21001841127872467, -0.5380436182022095, -0.34327876567840576, -0.22207537293434143, 0.2601051330566406, -0.18671561777591705, -0.07339468598365784, 0.08720415830612183, -0.27399933338165283, 0.4156044125556946, -0.29029327630996704, -0.42224037647247314, 0.15101100504398346, -0.24210801720619202, -0.05769655108451843, -0.0630071684718132, -0.08060165494680405, 0.2700447142124176, -0.24287071824073792, 0.21398413181304932, -0.25309133529663086 ]
https://github.com/huggingface/datasets/issues/6108
Hey guys, recently I ran into this problem again and I spent one whole day trying to locate the problem. Finally I found the problem seems to be with `pyarrow`'s json parser, and it seems a long-existing problem. Similar issue can be found in #2181. Anyway, my solution is to adjust the `load_dataset`'s parameter `chunksize`. You can inspect the parameter set in `datasets/packaged_modules/json/json.py`, now the actual chunksize should be very small, and you can increase the value. For me, `chunksize=10<<23` could solve the stuck problem. But I also find that too big `chunksize`, like `10 << 30`, would also cause a stuck, which is rather weird. I think I may explore this when I am free. And hope this can help those who also encounter the same problem.
Loading local datasets got strangely stuck
### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2
128
Loading local datasets got strangely stuck ### Describe the bug I try to use `load_dataset()` to load several local `.jsonl` files as a dataset. Every line of these files is a json structure only containing one key `text` (yeah it is a dataset for NLP model). The code snippet is as: ```python ds = load_dataset("json", data_files=LIST_OF_FILE_PATHS, num_proc=16)['train'] ``` However, I found that the loading process can get stuck -- the progress bar `Generating train split` no more proceed. When I was trying to find the cause and solution, I found a really strange behavior. If I load the dataset in this way: ```python dlist = list() for _ in LIST_OF_FILE_PATHS: dlist.append(load_dataset("json", data_files=_)['train']) ds = concatenate_datasets(dlist) ``` I can actually successfully load all the files despite its slow speed. But if I load them in batch like above, things go wrong. I did try to use Control-C to trace the stuck point but the program cannot be terminated in this way when `num_proc` is set to `None`. The only thing I can do is use Control-Z to hang it up then kill it. If I use more than 2 cpus, a Control-C would simply cause the following error: ```bash ^C Process ForkPoolWorker-1: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 314, in _bootstrap self.run() File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 114, in worker task = get() File "/usr/local/lib/python3.10/dist-packages/multiprocess/queues.py", line 368, in get res = self._reader.recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 224, in recv_bytes buf = self._recv_bytes(maxlength) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt Generating train split: 92431 examples [01:23, 1104.25 examples/s] Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1373, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/usr/local/lib/python3.10/dist-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/usr/local/lib/python3.10/dist-packages/multiprocess/connection.py", line 387, in _recv chunk = read(handle, remaining) KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/mnt/data/liyongyuan/source/batch_load.py", line 11, in <module> a = load_dataset( File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2133, in load_dataset builder_instance.download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1842, in _prepare_split for job_id, done, content in iflatmap_unordered( File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/usr/local/lib/python3.10/dist-packages/multiprocess/pool.py", line 770, in get raise TimeoutError multiprocess.context.TimeoutError ``` I have validated the basic correctness of these `.jsonl` files. They are correctly formatted (or they cannot be loaded singly by `load_dataset`) though some of the json may contain too long text (more than 1e7 characters). I do not know if this could be the problem. And there should not be any bottleneck in system's resource. The whole dataset is ~300GB, and I am using a cloud server with plenty of storage and 1TB ram. Thanks for your efforts and patience! Any suggestion or help would be appreciated. ### Steps to reproduce the bug 1. use load_dataset() with `data_files = LIST_OF_FILES` ### Expected behavior All the files should be smoothly loaded. ### Environment info - Datasets: A private dataset. ~2500 `.jsonl` files. ~300GB in total. Each json structure only contains one key: `text`. Format checked. - `datasets` version: 2.14.2 - Platform: Linux-4.19.91-014.kangaroo.alios7.x86_64-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.15.1 - PyArrow version: 10.0.1.dev0+ga6eabc2b.d20230609 - Pandas version: 1.5.2 Hey guys, recently I ran into this problem again and I spent one whole day trying to locate the problem. Finally I found the problem seems to be with `pyarrow`'s json parser, and it seems a long-existing problem. Similar issue can be found in #2181. Anyway, my solution is to adjust the `load_dataset`'s parameter `chunksize`. You can inspect the parameter set in `datasets/packaged_modules/json/json.py`, now the actual chunksize should be very small, and you can increase the value. For me, `chunksize=10<<23` could solve the stuck problem. But I also find that too big `chunksize`, like `10 << 30`, would also cause a stuck, which is rather weird. I think I may explore this when I am free. And hope this can help those who also encounter the same problem.
[ -0.24503090977668762, -0.018570467829704285, -0.02903907559812069, 0.2270108461380005, -0.018362440168857574, 0.05931895971298218, 0.2687035799026489, 0.23350246250629425, 0.12182816863059998, 0.18180540204048157, 0.0590432733297348, 0.5354204773902893, -0.11318369209766388, -0.09281224012374878, -0.0934063047170639, -0.04633789509534836, -0.01936904713511467, -0.0019202902913093567, 0.459880530834198, -0.05822746455669403, -0.23490609228610992, 0.19181278347969055, -0.19052350521087646, 0.0126716960221529, -0.29522740840911865, 0.02383113093674183, 0.125636488199234, 0.3863019049167633, 0.4537752866744995, -0.48997774720191956, 0.22632159292697906, -0.0007872506976127625, 0.16353976726531982, 0.4604818522930145, -0.00012564609642140567, 0.09652862697839737, 0.2871282398700714, 0.19761820137500763, -0.579081118106842, -0.14129507541656494, -0.09272775053977966, -0.2988988757133484, 0.2696419954299927, -0.2219139039516449, 0.2325998693704605, -0.06351856142282486, 0.09661800414323807, -0.5447632670402527, 0.20530100166797638, 0.16495193541049957, 0.07028139382600784, 0.43889278173446655, -0.4506288468837738, 0.18530766665935516, 0.01673169434070587, 0.0740278959274292, -0.02011117711663246, 0.4390155076980591, 0.6115700006484985, -0.19813945889472961, 0.020339099690318108, -0.17534798383712769, -0.16963323950767517, -0.08954977989196777, -0.17692063748836517, 0.032292407006025314, 0.3357584476470947, -0.5173730254173279, 0.18696917593479156, 0.21311286091804504, 0.006808336824178696, -0.007232848554849625, -0.06317970156669617, -0.6782644391059875, 0.06354793906211853, -0.2525230646133423, 0.037639111280441284, 0.28413626551628113, -0.37633004784584045, 0.14321257174015045, -0.27517950534820557, 0.10261741280555725, 0.01632167398929596, 0.05074901133775711, -0.01492871344089508, 0.18201220035552979, 0.05727282539010048, 0.2914443910121918, 0.06341585516929626, 0.3648519217967987, 0.05916835740208626, -0.19847072660923004, 0.2161903977394104, 0.20921757817268372, -0.3701484203338623, 0.31480544805526733, 0.2066442221403122, -0.08737711608409882, -0.04657287150621414, -0.1296619474887848, 0.02739030495285988, 0.05878216400742531, -0.007316868752241135, 0.23466438055038452, 0.4341602027416229, 0.018132135272026062, -0.08012911677360535, 0.04159818962216377, 0.44266828894615173, -0.062090255320072174, -0.12069446593523026, 0.24303457140922546, -0.1822364181280136, -0.1472683995962143, 0.19630958139896393, 0.03548255190253258, 0.05812753736972809, -0.013800077140331268, -0.4037393033504486, 0.19677594304084778, -0.2712756395339966, 0.05061415582895279, 0.30407875776290894, 0.3775843679904938, 0.021334614604711533, 0.4825482964515686, -0.11471869051456451, -0.12123221904039383, -0.3468611538410187, 0.2851457893848419, -0.0073275454342365265, -0.32440048456192017, -0.21037213504314423, -0.08484653383493423, 0.3076636791229248, -0.20122191309928894, 0.08891905099153519, 0.21543069183826447, -0.0601469948887825, -0.13656462728977203, 0.1739872545003891, -0.34400609135627747, 0.018868809565901756, 0.28348761796951294, 0.05656997859477997, 0.2572927176952362, -0.08146287500858307, -0.22868606448173523, -0.21536774933338165, 0.3986060917377472, -0.22930681705474854, -0.24533608555793762, -0.13200774788856506, 0.01302036177366972, -0.11796284466981888, 0.16528178751468658, -0.20990294218063354, 0.12425273656845093, 0.25848910212516785, -0.009480543434619904, 0.12627819180488586, -0.4081161618232727, -0.2387227565050125, -0.16167642176151276, 0.12969867885112762, 0.5087119340896606, -0.6662941575050354, -0.029202334582805634, -0.04381188750267029, -0.152022585272789, 0.3554225564002991, 0.42606279253959656, -0.27567529678344727, 0.4720778465270996, -0.504848062992096, 0.10139288008213043, 0.07319954037666321, -0.21501506865024567, -0.2010425627231598, 0.5996190309524536, -0.36454081535339355, 0.31364119052886963, -0.008196156471967697, 0.015220455825328827, -0.006595529615879059, -0.0775795578956604, 0.5145036578178406, 0.3418304920196533, -0.019011342898011208, 0.2720308005809784, -0.19226135313510895, -0.18121609091758728, 0.05343823879957199, 0.26356184482574463, -0.13445723056793213, 0.0783894956111908, 0.08923044800758362, -0.17111769318580627, 0.601753830909729, -0.11879418790340424, 0.08426662534475327, 0.3413355052471161, 0.08835352212190628, 0.04691200703382492, -0.042562730610370636, -0.0777355283498764, -0.6965600848197937, 0.4013170599937439, 0.017941392958164215, -0.21079589426517487, -0.21448856592178345, 0.108411505818367, -0.11555603891611099, 0.2392064332962036, -0.23254333436489105, 0.15605491399765015, -0.099142886698246, 0.17067784070968628, -0.11217792332172394, 0.06920729577541351, -0.0958162173628807, 0.4483773410320282, -0.0045052096247673035, -0.1617567390203476, -0.35923272371292114, 0.24985447525978088, 0.0680844858288765, -0.14159350097179413, -0.1605014204978943, 0.1063460111618042, 0.07836645841598511, -0.24856506288051605, -0.1437816023826599, 0.1929836869239807, -0.1169041097164154, 0.16763627529144287, -0.23676618933677673, -0.1271367222070694, 0.12416714429855347, 0.3593362867832184, -0.043003179132938385, -0.11117839813232422, 0.09294385462999344, -0.18415510654449463, 0.04998801648616791, 0.3427119255065918, -0.10864086449146271, 0.4850924611091614, 0.01941876858472824, -0.25242137908935547, 0.3767440915107727, -0.06637266278266907, 0.08320625126361847, 0.07552605122327805, 0.6670228242874146, 0.4249246120452881, 0.736285924911499, 0.1444288194179535, -0.4537842869758606, 0.2158767580986023, 0.4971393048763275, 0.007549643516540527, -0.10384762287139893, 0.15359656512737274, 0.15525977313518524, 0.09875116497278214, 0.11121322214603424, 0.1515865921974182, 0.43603286147117615, 0.14865067601203918, -0.17097675800323486, -0.05937153100967407, -0.1292506456375122, -0.2718510627746582, -0.03260454535484314, 0.18726596236228943, 0.155839741230011, 0.49461373686790466, 0.3027156889438629, -0.11256624758243561, -0.2710462212562561, -0.43627047538757324, 0.15031489729881287, 0.24172556400299072, -0.30522555112838745, 0.468244343996048, -0.28184351325035095, 0.21470950543880463, -0.384070485830307, -0.03273841738700867, -0.11337155103683472, -0.2653958201408386, -0.25936761498451233, 0.28988921642303467, 0.039504796266555786, -0.03728068619966507, -0.15264278650283813, 0.38655370473861694, -0.18447110056877136, -0.12960121035575867, -0.3505040407180786, -0.15792548656463623, -0.46664392948150635, -0.16876725852489471, 0.47517770528793335, 0.09388850629329681, 0.18671563267707825, 0.20034973323345184, -0.42620569467544556, 0.15047675371170044, 0.15843504667282104, 0.09711064398288727, -0.1102355569601059, 0.3848576247692108, 0.007513206452131271, 0.27393868565559387, -0.11267977952957153, -0.27488332986831665, 0.09002487361431122, -0.11491517722606659, 0.009581148624420166, -0.017411217093467712, -0.03068537823855877, -0.17475678026676178, -0.22733144462108612, -0.022299859672784805, -0.5508553981781006, -0.31863585114479065, 0.4618632197380066, -0.021901607513427734, 0.2194148600101471, 0.10206648707389832, -0.03693029284477234, 0.27796438336372375, 0.3065280318260193, -0.16031572222709656, -0.0875856876373291, -0.2529546618461609, -0.016483960673213005, -0.0722891241312027, -0.12909896671772003, -0.28081417083740234, -0.04656238108873367, -0.10550357401371002, -0.05015760287642479, -0.44561299681663513, 0.4484734535217285, -0.4072372317314148, 0.41109499335289, -0.17156678438186646, -0.1060076504945755, 0.12369753420352936, -0.04909195750951767, 0.05476190894842148, -0.002225808799266815, -0.17108623683452606, 0.20208610594272614, 0.0170101597905159, 0.0643562376499176, -0.026995845139026642, 0.24562610685825348, -0.06465167552232742, 0.5921217203140259, -0.006754450500011444, -0.2360386997461319, 0.28225311636924744, -0.045087896287441254, 0.15382035076618195, -0.16515299677848816, -0.2721273601055145, -0.02530737593770027, -0.1276538372039795, -0.41864147782325745, 0.09504112601280212, -0.046965092420578, -0.3201781213283539, -0.040812406688928604, 0.07937218993902206, -0.13495884835720062, -0.2962687611579895, 0.2827531099319458, -0.11319299042224884, -0.03839598968625069, -0.07552457600831985, -0.06774630397558212, -0.12160135060548782, -0.07737056165933609, -0.22271081805229187, 0.15848807990550995, 0.09392639249563217, -0.27021676301956177, -0.5513702034950256, -0.20280671119689941, -0.6572021842002869, 0.14514482021331787, 0.09639915823936462, 0.4645669758319855, -0.12286048382520676, 0.008058272302150726, 0.2461146116256714, -0.23898373544216156, 1.0183742046356201, 0.09834728389978409, 0.18800459802150726, 0.31486019492149353, 0.11449277400970459, -0.4659084975719452, -0.23756921291351318, -0.026384584605693817, 0.4269142150878906, 0.4973560571670532, 0.5276718139648438, -0.21254101395606995, -0.12948021292686462, -0.03939373791217804, 0.12209698557853699, -0.223072350025177, -0.4376458525657654, -0.4356280565261841, -0.10170239955186844, -0.25470587611198425, 0.08372589945793152, -0.047716595232486725, 0.060881972312927246, -0.4239758253097534, -0.3893817067146301, 0.07506302744150162, 0.035835832357406616, -0.019222117960453033, -0.01773814484477043, -0.17338210344314575, 0.28369927406311035, 0.3091053068637848, 0.06568965315818787, 0.40374383330345154, 0.18025431036949158, 0.21506471931934357, -0.28491154313087463, -0.03180733695626259, 0.35692229866981506, -0.002773478627204895, 0.33755403757095337, 0.6597993969917297, 0.001017298549413681, 0.22286853194236755, 0.23759834468364716, 0.3647741973400116, -0.030164934694767, 0.07540750503540039, 0.1931966245174408, 0.1160978376865387, -0.3292321264743805, -0.4299934506416321, 0.3786565661430359, 0.12474827468395233, -0.1952911913394928, 0.3014637231826782, -0.6321588754653931, -0.12117603421211243, 0.32383570075035095, -0.16599097847938538, 0.9280341267585754, -0.19756674766540527, 0.21224603056907654, 0.16786202788352966, -0.16276392340660095, 0.32169604301452637, -0.08906228840351105, 0.09598366916179657, -0.4163469672203064, 0.2721562087535858, 0.09581974893808365, -0.2873101234436035, -0.0025557316839694977, 0.10617808997631073, 0.09246841818094254, 0.2503693103790283, -0.33307236433029175, -0.05819020792841911, -0.10349180549383163, 0.2913593351840973, 0.11607063561677933, -0.2531382441520691, -0.5245260000228882, -0.08417901396751404, 0.029087383300065994, 0.04704635590314865, -0.22380709648132324, 0.02655087038874626, -0.21172034740447998, 0.08707121014595032, -0.18321464955806732, 0.21917565166950226, -0.03674986958503723, 0.1786743402481079, 0.07008327543735504, -0.3035663962364197, -0.0729350596666336, 0.09661908447742462, -0.061049312353134155, -0.03671219199895859, -0.08549598604440689, 0.19912847876548767, 0.2159157246351242, 0.1027659922838211, 0.19405719637870789, -0.25970014929771423, 0.1344083845615387, 0.11273094266653061, -0.2824198007583618, -0.030676059424877167, -0.2532346844673157, -0.31737059354782104, 0.04697790741920471, 0.35681289434432983, 0.14197053015232086, 0.07813742756843567, -0.28865787386894226, 0.15654537081718445, 0.16173729300498962, -0.20116379857063293, -0.018486902117729187, 0.10137724131345749, -0.07416509091854095, 0.2349921315908432, -0.4114398658275604, -0.3218008875846863, -0.07375441491603851, 0.4018590748310089, -0.15644748508930206, 0.10199765861034393, 0.5607468485832214, 0.3765143156051636, -0.06144779920578003, -0.11039472371339798, 0.09708084166049957, 0.08901809900999069, -0.4868384897708893, 0.2545470893383026, -0.018442662432789803, -0.03703463077545166, 0.18717491626739502, 0.03973819315433502, -0.07784639298915863, -0.16413643956184387, -0.20975995063781738, -0.480294793844223, -0.4341728687286377, -0.32708898186683655, -0.021443527191877365, 0.10562777519226074, 0.16772189736366272, 0.1278790831565857, -0.11532926559448242, -0.027091341093182564, -0.13727684319019318, -0.07554276287555695, -0.5917837619781494, 0.1202239841222763, 0.09102919697761536, -0.15790271759033203, 0.04610907658934593, -0.11820745468139648, -0.013372592628002167, 0.12415184080600739, -0.0734194964170456, -0.12466514110565186, -0.1262572854757309, 0.19590480625629425, -0.013784541748464108, -0.1762695014476776, -0.0906640887260437, -0.2664434313774109, 0.18367569148540497, -0.04911421239376068, 0.12684017419815063, 0.04526646435260773, 0.06009793281555176, -0.038940057158470154, 0.21120989322662354, 0.222407728433609, 0.13811062276363373, 0.4756799638271332, -0.08004489541053772, 0.09450150281190872, 0.20826764404773712, 0.4452442526817322, -0.12196770310401917, 0.059275537729263306, -0.35141485929489136, -0.19108255207538605, 0.2062154859304428, 0.5880520343780518, -0.005489269271492958, -0.3035420775413513, -0.09526100754737854, -0.0405677929520607, 0.21859391033649445, 0.6138256788253784, -0.20290213823318481, -0.2042095959186554, 0.2563404142856598, 0.00728044006973505, 0.048442013561725616, -0.1886448860168457, 0.29622751474380493, 0.08852416276931763, -0.011000730097293854, 0.19760264456272125, 0.05745574086904526, -0.3458976447582245, -0.4280814230442047, 0.129216730594635, 0.34763601422309875, 0.06965403258800507, -0.24532990157604218, 0.40669015049934387, 0.24392478168010712, 0.1355973482131958, 0.06509373337030411, 0.11291922628879547, 0.2605099678039551, 0.42807719111442566, 0.14651109278202057, 0.02496550790965557, 0.15801551938056946, 0.46684297919273376, 0.02781812660396099, -0.445743203163147, 0.07264254987239838, 0.3738434910774231, -0.42496317625045776, 0.19273538887500763, 0.2114466279745102, 0.36857110261917114, -0.05489933490753174, -0.22775009274482727, -0.003399461507797241, 0.3910950720310211, -0.1808556169271469, -0.23238933086395264, -0.3527378439903259, -0.08021725714206696, 0.07665933668613434, 0.1382218301296234, -0.08905147016048431, 0.10141021013259888, -0.03598102554678917, 0.33433571457862854, 0.03742837905883789, -0.3472447395324707, -0.014475534670054913, 0.10639277845621109, 0.1434614509344101, -0.17825910449028015, 0.0007586590945720673, 0.1286739557981491, -0.06467075645923615, -0.15855282545089722, -0.07319427281618118, 0.41615843772888184, 0.453610360622406, -0.03897897154092789, 0.04730893671512604, 0.13603761792182922, 0.1400853842496872, -0.20416706800460815, 0.2941347062587738, -0.04237823560833931, 0.24055688083171844, 0.3269038796424866, -0.02486679144203663, -0.10898759961128235, 0.11507052928209305, 0.2854999601840973, 0.21540750563144684, -0.29414963722229004, 0.4277312755584717, 0.10172706842422485, -0.304467111825943, -0.040853939950466156, 0.03758564218878746, -0.15888985991477966, 0.12911394238471985, 0.4260285198688507, -0.3421753942966461, 0.22952476143836975, -0.059429340064525604, 0.010937068611383438, -0.34719565510749817, 0.6160120368003845, 0.210429385304451, 0.34700340032577515, -0.18143713474273682, 0.010435923933982849, -0.6169217824935913, 0.04547085613012314, -0.20624397695064545, 0.0620909109711647, 0.06909693777561188, 0.25392118096351624, -0.21517744660377502, 0.055237267166376114, -0.13321377336978912, 0.3224862515926361, 0.050949759781360626, 0.5011716485023499, -0.32874542474746704, -0.10315725207328796, -0.2048649787902832, -0.09657551348209381, -0.07908248901367188, -0.5112425088882446, 0.313877671957016, -0.08022990822792053, -0.09770727902650833, -0.11538451164960861, -0.27193009853363037, 0.12608478963375092, 0.22765494883060455, 0.34329622983932495, 0.16425836086273193, 0.20238928496837616, -0.048283178359270096, -0.10008877515792847, -0.22999005019664764, 0.0043055154383182526, 0.04189937561750412, -0.06288469582796097, -0.021493813022971153, 0.11762489378452301, -0.3844679594039917, 0.4330427646636963, -0.2691423296928406, -0.14293988049030304, 0.026626944541931152, 0.08420783281326294, -0.03456606715917587, -0.22435975074768066, -0.10446815937757492, 0.293850839138031, 0.006114475429058075, 0.3783755302429199, 0.2134964019060135, 0.027883857488632202, -0.3000328838825226, 0.11826881021261215, 0.21001841127872467, -0.5380436182022095, -0.34327876567840576, -0.22207537293434143, 0.2601051330566406, -0.18671561777591705, -0.07339468598365784, 0.08720415830612183, -0.27399933338165283, 0.4156044125556946, -0.29029327630996704, -0.42224037647247314, 0.15101100504398346, -0.24210801720619202, -0.05769655108451843, -0.0630071684718132, -0.08060165494680405, 0.2700447142124176, -0.24287071824073792, 0.21398413181304932, -0.25309133529663086 ]
https://github.com/huggingface/datasets/issues/6106
Hi! We use PyArrow to read JSON files, and PyArrow doesn't allow different value types in the same column. #5776 should address this. In the meantime, you can combine `Dataset.from_generator` with the above code to cast the values to the same type.
load local json_file as dataset
### Describe the bug I tried to load local json file as dataset but failed to parsing json file because some columns are 'float' type. ### Steps to reproduce the bug 1. load json file with certain columns are 'float' type. For example `data = load_data("json", data_files=JSON_PATH)` 2. Then, the error will be triggered like `ArrowInvalid: Could not convert '-0.2253' with type str: tried to convert to double ### Expected behavior Should allow some columns are 'float' type, at least it should convert those columns to str type. I tried to avoid the error by naively convert the float item to str: ```python # if col type is not str, we need to convert it to str mapping = {} for col in keys: if isinstance(dataset[0][col], str): mapping[col] = [row.get(col) for row in dataset] else: mapping[col] = [str(row.get(col)) for row in dataset] ``` ### Environment info - `datasets` version: 2.14.2 - Platform: Linux-5.4.0-52-generic-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
42
load local json_file as dataset ### Describe the bug I tried to load local json file as dataset but failed to parsing json file because some columns are 'float' type. ### Steps to reproduce the bug 1. load json file with certain columns are 'float' type. For example `data = load_data("json", data_files=JSON_PATH)` 2. Then, the error will be triggered like `ArrowInvalid: Could not convert '-0.2253' with type str: tried to convert to double ### Expected behavior Should allow some columns are 'float' type, at least it should convert those columns to str type. I tried to avoid the error by naively convert the float item to str: ```python # if col type is not str, we need to convert it to str mapping = {} for col in keys: if isinstance(dataset[0][col], str): mapping[col] = [row.get(col) for row in dataset] else: mapping[col] = [str(row.get(col)) for row in dataset] ``` ### Environment info - `datasets` version: 2.14.2 - Platform: Linux-5.4.0-52-generic-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Hi! We use PyArrow to read JSON files, and PyArrow doesn't allow different value types in the same column. #5776 should address this. In the meantime, you can combine `Dataset.from_generator` with the above code to cast the values to the same type.
[ -0.208848237991333, 0.06968754529953003, -0.03522949293255806, 0.17629344761371613, 0.434946209192276, 0.08668085932731628, 0.3508772552013397, 0.6542973518371582, 0.14965468645095825, 0.050333864986896515, -0.15788719058036804, 0.867743730545044, 0.11829949170351028, 0.10017549246549606, -0.1807357668876648, -0.3510271906852722, 0.1466878205537796, 0.2084040641784668, -0.05132075026631355, 0.04479654133319855, -0.3630143702030182, 0.13941273093223572, -0.025589726865291595, 0.2123292237520218, 0.10863015055656433, -0.08369708806276321, 0.13558721542358398, 0.10366310179233551, -0.22509628534317017, -0.3463658094406128, 0.19767989218235016, -0.3501773178577423, 0.4630075991153717, 0.3400557041168213, -0.00010330048826290295, 0.2251804620027542, 0.3325127959251404, 0.06419862806797028, -0.16843098402023315, -0.41549965739250183, 0.022560857236385345, -0.19727347791194916, 0.39336520433425903, -0.2539469301700592, -0.08684451133012772, -0.6665700078010559, -0.24107035994529724, -0.3219100832939148, 0.5983428359031677, 0.3308137357234955, 0.26140281558036804, 0.050711169838905334, 0.12990550696849823, 0.09648457914590836, 0.24280142784118652, 0.16078099608421326, -0.1312754601240158, 0.5464576482772827, 0.17967632412910461, 0.13904212415218353, 0.03795049339532852, -0.017519768327474594, -0.24958151578903198, 0.14216308295726776, 0.07121691107749939, 0.21883556246757507, -0.04985484853386879, -0.01326623186469078, 0.054185543209314346, 0.1405145823955536, 0.3791075348854065, -0.29071328043937683, -0.3111957013607025, -0.05556295067071915, -0.1127864420413971, -0.05106640234589577, 0.1607367843389511, 0.21459433436393738, -0.22612060606479645, 0.4059790372848511, 0.1094028651714325, 0.0698133260011673, -0.20847350358963013, 0.19087080657482147, -0.12899453938007355, 0.17821025848388672, -0.1783713400363922, 0.13339650630950928, -0.10463263839483261, -0.10932683199644089, -0.048436008393764496, -0.11895895004272461, 0.01413983665406704, 0.15452808141708374, -0.2035420536994934, 0.04311921447515488, -0.0799417644739151, -0.4189266860485077, 0.12098592519760132, -0.145618736743927, 0.2254829704761505, 0.1459311544895172, -0.11154139041900635, 0.48377346992492676, 0.37272414565086365, 0.042914219200611115, -0.07674595713615417, 0.23060199618339539, 0.2375127375125885, 0.11169186234474182, 0.1243639588356018, -0.14085865020751953, -0.13064250349998474, -0.13519567251205444, 0.089289590716362, 0.0276540108025074, 0.3390852212905884, -0.3407772183418274, -0.21054930984973907, 0.014928501099348068, -0.42632102966308594, 0.054459307342767715, -0.08122465759515762, 0.31268760561943054, 0.07977133989334106, 0.4773002862930298, 0.15261006355285645, 0.4005972146987915, -0.01389305293560028, 0.019909147173166275, -0.059885427355766296, 0.08168510347604752, 0.18260397017002106, -0.27007195353507996, 0.18704316020011902, 0.0300711952149868, 0.1728004515171051, 0.33960190415382385, -0.29101479053497314, -0.16025134921073914, 0.22781607508659363, -0.043412212282419205, -0.07221505790948868, 0.21525514125823975, -0.05742691084742546, 0.04653052240610123, 0.09794573485851288, -0.47163790464401245, -0.2271454632282257, 0.3141742944717407, -0.24658820033073425, -0.162878155708313, -0.26010799407958984, 0.23535661399364471, 0.084275983273983, 0.08424768596887589, -0.4602000415325165, 0.009720316156744957, 0.15280070900917053, -0.11128781735897064, 0.0733308345079422, -0.23924021422863007, 0.056539639830589294, -0.28986603021621704, 0.08863704651594162, -0.014731518924236298, -0.6680148243904114, 0.017741739749908447, 0.05739781633019447, -0.14407028257846832, 0.2987000346183777, 0.21938556432724, -0.2955954074859619, 0.03477643430233002, -0.11889685690402985, 0.25090137124061584, 0.30785706639289856, -0.25121432542800903, -0.11704496294260025, 0.390346884727478, -0.19984310865402222, 0.05911615490913391, 0.06837345659732819, -0.2261073887348175, 0.08723234385251999, 0.05222730338573456, 0.3295406103134155, 0.44826066493988037, 0.04998931288719177, 0.22163791954517365, -0.35409295558929443, -0.21209029853343964, 0.11898726969957352, 0.2921485900878906, -0.3363315463066101, 0.12972302734851837, 0.23782193660736084, -0.14827954769134521, 0.2172968089580536, -0.23890873789787292, 0.19157513976097107, 0.1252116858959198, 0.19552212953567505, -0.19246242940425873, 0.1989203542470932, -0.13118135929107666, -0.3335830271244049, -0.06921613216400146, -0.05951038748025894, -0.0924549475312233, -0.3442710340023041, -0.1760701686143875, -0.3916228413581848, 0.02163916826248169, -0.12892378866672516, 0.13035602867603302, 0.2505650222301483, 0.05788874253630638, 0.10391569137573242, 0.2465796321630478, -0.21960309147834778, -0.1330573558807373, -0.05219627171754837, 0.025836266577243805, -0.3264494836330414, 0.2656182050704956, 0.06776615232229233, -0.255357027053833, 0.06956088542938232, -0.15082573890686035, 0.08625122904777527, -0.11318686604499817, -0.3606013357639313, 0.1975613832473755, -0.012885605916380882, 0.31354406476020813, -0.2020835280418396, 0.05401451140642166, 0.10228951275348663, -0.07717026770114899, -0.06154242902994156, 0.13796982169151306, 0.27554044127464294, 0.06122640520334244, -0.2502501904964447, 0.5856894254684448, -0.1827215999364853, 0.12149849534034729, -0.18145997822284698, -0.10190324485301971, 0.5907919406890869, -0.03251892700791359, -0.015071291476488113, -0.1021777093410492, -0.055805712938308716, 0.19881796836853027, 0.09939446300268173, 0.009567245841026306, -0.4736141264438629, -0.0019837655127048492, 0.33330267667770386, -0.17477062344551086, 0.12335476279258728, 0.17566823959350586, -0.12639212608337402, 0.08791662007570267, 0.2668599784374237, 0.2520437240600586, 0.3066747188568115, 0.17288467288017273, -0.013234864920377731, -0.04297453165054321, -0.056544795632362366, -0.19381560385227203, 0.10821135342121124, -0.05173042416572571, 0.21206650137901306, 0.30088531970977783, 0.37102773785591125, -0.15347614884376526, -0.3160938620567322, 0.15133564174175262, 0.02933897078037262, 0.32451024651527405, -0.40772342681884766, 0.11591387540102005, -0.4589698910713196, 0.2009238451719284, -0.23463784158229828, 0.12609915435314178, 0.21747806668281555, -0.17024677991867065, -0.09323641657829285, 0.29477134346961975, -0.3128235936164856, -0.045392729341983795, -0.0264604315161705, 0.06721711158752441, 0.07631045579910278, -0.35253840684890747, -0.38255423307418823, -0.08765695989131927, -0.33864232897758484, 0.13046158850193024, 0.40303802490234375, 0.15314653515815735, 0.07869874686002731, -0.03357287123799324, -0.1655755490064621, -0.06997381895780563, -0.12738622725009918, 0.13580672442913055, 0.006197765469551086, 0.4066094756126404, 0.04231828451156616, 0.27652639150619507, -0.2101856768131256, -0.12031442672014236, 0.401526540517807, -0.045371584594249725, -0.2173694223165512, 0.36230191588401794, -0.06246831640601158, 0.12240082770586014, -0.2609364986419678, -0.4740806221961975, -0.22268027067184448, -0.4131469130516052, 0.39731597900390625, -0.018740523606538773, 0.07859410345554352, -0.5344789624214172, 0.2164517492055893, 0.016690373420715332, -0.022487346082925797, 0.029888376593589783, -0.09693411737680435, -0.16213247179985046, 0.4039463996887207, -0.25056084990501404, -0.2893311381340027, -0.10635590553283691, -0.110239177942276, -0.11130668222904205, -0.1750658005475998, -0.21940231323242188, -0.10208843648433685, -0.12991391122341156, 0.32666441798210144, -0.1495760679244995, -0.11571235209703445, 0.05896397680044174, 0.11711320281028748, -0.1083143875002861, -0.134667307138443, 0.028692901134490967, 0.06329617649316788, 0.20107367634773254, -0.11935143917798996, 0.3687898516654968, 0.6601054668426514, -0.10161813348531723, 0.12890276312828064, -0.04257414489984512, -0.21675705909729004, 0.4079884886741638, -0.224929541349411, 0.033961690962314606, -0.27182894945144653, -0.10700724273920059, -0.1813856065273285, -0.07641363143920898, -0.26527541875839233, -0.06299547106027603, 0.03737953305244446, -0.33861401677131653, -0.1698201447725296, -0.12180724740028381, -0.43011850118637085, -0.17333479225635529, 0.18367601931095123, 0.14115722477436066, -0.20771931111812592, -0.059066470712423325, -0.046114448457956314, 0.009956225752830505, -0.017195209860801697, 0.19742947816848755, 0.16125164926052094, 0.013520319014787674, 0.01157715916633606, -0.28577515482902527, -0.25815272331237793, -0.4132107198238373, 0.3354102373123169, 0.1016402542591095, 0.44148218631744385, 0.13158075511455536, -0.05673195421695709, 0.22147181630134583, -0.2568877041339874, 0.548225998878479, -0.07655604928731918, 0.12808410823345184, 0.22817650437355042, 0.0017758011817932129, -0.4316995441913605, -0.03089813143014908, -0.284731924533844, 0.13104403018951416, 0.008104180917143822, 0.49908116459846497, -0.3589355945587158, -0.2294325828552246, 0.05064171552658081, 0.2253003716468811, -0.09476873278617859, -0.23265452682971954, -0.25113534927368164, -0.29748913645744324, -0.2256716787815094, -0.194047749042511, 0.09254004061222076, 0.3143780529499054, -0.11520013958215714, -0.32481813430786133, -0.12608899176120758, 0.041162870824337006, -0.00470365583896637, 0.15905334055423737, 0.3654121160507202, -0.16893921792507172, 0.025952473282814026, -0.013401048257946968, 0.21176746487617493, 0.3515219986438751, 0.5979446768760681, 0.2430133819580078, -0.17679616808891296, 0.09465231001377106, -0.07938075065612793, 0.06706015020608902, -0.11328970640897751, -0.26287734508514404, 0.01816713809967041, -0.022078294306993484, 0.20190048217773438, -0.1521848440170288, -0.16697242856025696, 0.11012538522481918, 0.01252724602818489, 0.11063279211521149, -0.2994813323020935, 0.6625778079032898, 0.00821184366941452, -0.08722274750471115, 0.25977611541748047, -0.17083865404129028, -0.1783623993396759, 0.5649000406265259, 0.18438871204853058, 0.6090022325515747, -0.22161658108234406, -0.017188366502523422, 0.5255060791969299, -0.3392029106616974, 0.49926525354385376, -0.5031957626342773, 0.035360679030418396, -0.47640740871429443, 0.3361460268497467, -0.04333190247416496, -0.1240997165441513, 0.17814448475837708, 0.15906751155853271, -0.24105900526046753, -0.04645398631691933, -0.3193662762641907, 0.2451639026403427, -0.052208974957466125, 0.24240896105766296, -0.13130173087120056, -0.10064010322093964, -0.435989648103714, 0.13359609246253967, -0.19517932832241058, -0.13462375104427338, 0.09366253018379211, -0.2769116163253784, -0.3212631940841675, -0.13928437232971191, -0.04241721332073212, 0.11272713541984558, 0.11519079655408859, 0.1672143042087555, 0.18256710469722748, -0.12011133134365082, -0.11423733830451965, 0.16455477476119995, 0.023144284263253212, -0.15829725563526154, -0.14027954638004303, 0.06327550113201141, -0.031018830835819244, 0.10279837995767593, 0.02280859649181366, -0.030514592304825783, 0.194313183426857, -0.0657353326678276, -0.26142871379852295, 0.12269651889801025, -0.22124265134334564, -0.2727113366127014, 0.04376070201396942, 0.15544135868549347, -0.04055503010749817, -0.34272512793540955, -0.2957489490509033, -0.2661621570587158, 0.20820558071136475, -0.1508248746395111, 0.22283807396888733, -0.033314432948827744, -0.04926250874996185, 0.024054409936070442, 0.12130378186702728, -0.36018648743629456, 0.014198873192071915, 0.37840598821640015, 0.030454952269792557, 0.1585487723350525, 0.568111777305603, 0.1317625641822815, -0.0568690188229084, -0.22147861123085022, 0.29338252544403076, 0.560089111328125, -0.24750970304012299, 0.18636178970336914, -0.15407833456993103, -0.06322784721851349, -0.009208083152770996, 0.1421402394771576, 0.17010809481143951, -0.04536427557468414, 0.03099803626537323, -0.5902856588363647, -0.20780622959136963, 0.1307486891746521, 0.28763076663017273, -0.0324769988656044, 0.2482987940311432, -0.0030020587146282196, -0.19581350684165955, -0.230755016207695, -0.370976984500885, 0.09184293448925018, -0.21335841715335846, 0.19110873341560364, -0.1529548019170761, 0.24607664346694946, -0.027429308742284775, 0.08719374239444733, 0.25883209705352783, 0.18843752145767212, -0.035216428339481354, -0.3018958866596222, -0.10538279265165329, 0.07659557461738586, 0.010332886129617691, -0.04517300799489021, -0.239280104637146, -0.15194009244441986, -0.27536582946777344, 0.010582849383354187, 0.02001795917749405, 0.11538919806480408, -0.0395229272544384, 0.26011067628860474, 0.1596553921699524, -0.08171974122524261, -0.09579483419656754, -0.06933426856994629, -0.25695890188217163, 0.17637622356414795, -0.188821941614151, 0.19199110567569733, 0.03957584127783775, 0.05347100645303726, -0.123195581138134, -0.033313605934381485, -0.19674506783485413, 0.20192065834999084, 0.3316298723220825, -0.3065246641635895, 0.0774354562163353, 0.020341448485851288, 0.3417639136314392, 0.39861437678337097, -0.3671237826347351, 0.20124778151512146, 0.16990962624549866, 0.26640456914901733, -0.16236445307731628, -0.12785860896110535, 0.23340587317943573, 0.007179688662290573, -0.0042418986558914185, 0.15970754623413086, 0.03465789556503296, -0.1715143322944641, -0.1236642599105835, -0.08845195919275284, 0.3657364845275879, -0.0451742485165596, -0.11055471003055573, 0.496208518743515, -0.15893210470676422, -0.032721105962991714, 0.10203985869884491, 0.11976315826177597, 0.3180369734764099, 0.34726476669311523, 0.025024857372045517, -0.07005316019058228, 0.08784271776676178, 0.32874932885169983, -0.16809499263763428, -0.3036760985851288, 0.388007253408432, 0.29667219519615173, -0.15078657865524292, 0.11578799784183502, 0.4482632577419281, 0.39570194482803345, 0.07922646403312683, -0.04479769244790077, -0.23340752720832825, 0.1907689869403839, -0.15770460665225983, -0.17018243670463562, -0.5914368033409119, -0.266176700592041, -0.17493245005607605, -0.01604006439447403, -0.13285358250141144, 0.1882142424583435, 0.20361852645874023, 0.2603191137313843, -0.03823933005332947, -0.26090890169143677, 0.2295723855495453, 0.04889388382434845, 0.0732831060886383, -0.24412858486175537, 0.2096068561077118, 0.27908509969711304, -0.1928444504737854, 0.10759929567575455, 0.020294303074479103, 0.35488346219062805, 0.4963781237602234, -0.1176309585571289, -0.14428487420082092, -0.22678638994693756, -0.13699686527252197, 0.030412454158067703, 0.27248287200927734, 0.1390250325202942, 0.01632627472281456, 0.26671820878982544, 0.2611904740333557, -0.22878393530845642, 0.16646745800971985, 0.02867274545133114, 0.3413456380367279, -0.17850960791110992, 0.09251442551612854, -0.06033753231167793, -0.14010430872440338, 0.04546082764863968, -0.3986331820487976, -0.23427660763263702, -0.0749850645661354, 0.05337386205792427, 0.05728325620293617, 0.2708313763141632, -0.054378461092710495, 0.12320253252983093, 0.011322077363729477, 0.18547864258289337, 0.07222584635019302, -0.06565345823764801, -0.05250149220228195, -0.012824803590774536, -0.42122820019721985, 0.13028547167778015, -0.035085976123809814, -0.1761152744293213, 0.21457639336585999, 0.18631353974342346, 0.14751648902893066, 0.35365480184555054, 0.010543689131736755, 0.23596999049186707, 0.0021618306636810303, 0.3266257047653198, -0.2170034497976303, -0.2583021819591522, 0.08299241960048676, 0.11184996366500854, -0.08658047020435333, -0.49925416707992554, 0.2567507028579712, -0.16556935012340546, 0.1687573343515396, -0.1864626705646515, -0.039895519614219666, -0.031428925693035126, -0.2448127418756485, 0.49565181136131287, 0.2600475549697876, -0.03696427494287491, -0.081746906042099, 0.02964302897453308, 0.11054404079914093, -0.22028833627700806, -0.2691265046596527, 0.36106953024864197, -0.4045483469963074, 0.5607337355613708, -0.09653832018375397, -0.16392841935157776, -0.30630794167518616, -0.13527511060237885, -0.3125587999820709, -0.2320348620414734, -0.2762417793273926, 0.23795469105243683, -0.10094110667705536, -0.121432825922966, -0.08858509361743927, 0.16239431500434875, 0.14255529642105103, 0.28120750188827515, -0.19992120563983917, -0.2790631651878357, 0.39923810958862305, -0.5345385670661926, -0.39257583022117615, 0.3290383815765381, 0.06220237910747528, 0.0342327356338501, -0.11606978625059128, -0.22249633073806763, 0.14425091445446014, 0.353389710187912, -0.017659960314631462, 0.053026601672172546, 0.0018991939723491669, 0.05276845768094063, 0.07203131914138794, -0.13481247425079346, 0.17709267139434814, 0.17443229258060455, 0.07719771564006805, -0.17977061867713928, -0.2684747278690338 ]
https://github.com/huggingface/datasets/issues/6099
Seems like the problem isn't with the library, but the dataset itself hosted on AWS S3. Its [homepage](https://s3.amazonaws.com/amazon-reviews-pds/readme.html) returns an `AccessDenied` XML response, which is the same thing you get if you try to log the `record` that triggers the exception ```python try: example = self.info.features.encode_example(record) if self.info.features is not None else record except Exception as e: print(record) ``` ⬇️ ``` {'<?xml version="1.0" encoding="UTF-8"?>': '<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>N2HFJ82ZV8SZW9BV</RequestId><HostId>Zw2DQ0V2GdRmvH5qWEpumK4uj5+W8YPcilQbN9fLBr3VqQOcKPHOhUZLG3LcM9X5fkOetxp48Os=</HostId></Error>'} ```
How do i get "amazon_us_reviews
### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data
67
How do i get "amazon_us_reviews ### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data Seems like the problem isn't with the library, but the dataset itself hosted on AWS S3. Its [homepage](https://s3.amazonaws.com/amazon-reviews-pds/readme.html) returns an `AccessDenied` XML response, which is the same thing you get if you try to log the `record` that triggers the exception ```python try: example = self.info.features.encode_example(record) if self.info.features is not None else record except Exception as e: print(record) ``` ⬇️ ``` {'<?xml version="1.0" encoding="UTF-8"?>': '<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>N2HFJ82ZV8SZW9BV</RequestId><HostId>Zw2DQ0V2GdRmvH5qWEpumK4uj5+W8YPcilQbN9fLBr3VqQOcKPHOhUZLG3LcM9X5fkOetxp48Os=</HostId></Error>'} ```
[ -0.046608902513980865, -0.2530131936073303, -0.28236865997314453, 0.24994568526744843, 0.29547378420829773, 0.42686212062835693, 0.3098292648792267, 0.08909308910369873, -0.06656547635793686, 0.20722495019435883, 0.0757707953453064, 0.04079410061240196, 0.20352010428905487, 0.36819255352020264, -0.12808920443058014, -0.015228133648633957, -0.03058839589357376, 0.1239573284983635, 0.16607515513896942, -0.02353750914335251, -0.2197568267583847, 0.2661455571651459, -0.2409200370311737, 0.10528970509767532, -0.2566760778427124, -0.0399424210190773, 0.08558105677366257, 0.04719587415456772, -0.27613943815231323, -0.17340824007987976, 0.2110467106103897, 0.10930492728948593, -0.11997595429420471, 0.07641930878162384, -0.0001143941844929941, -0.16595788300037384, 0.45642510056495667, -0.10461817681789398, -0.30486860871315, -0.4516846835613251, -0.08231265097856522, -0.5119820833206177, 0.16311438381671906, -0.29125797748565674, -0.19792252779006958, -0.26448604464530945, -0.08214783668518066, -0.1355411261320114, -0.22327381372451782, 0.24390128254890442, 0.20906756818294525, -0.12646007537841797, 0.13959215581417084, -0.27932608127593994, 0.29713523387908936, 0.026435840874910355, -0.0015953704714775085, 0.09458678960800171, 0.13082757592201233, -0.1577909290790558, 0.5084865093231201, 0.19967329502105713, 0.05712705850601196, -0.19955337047576904, -0.000665285624563694, 0.057430848479270935, 0.17844925820827484, 0.021850423887372017, 0.5014781355857849, 0.13716056942939758, 1.055943489074707, -0.07293520867824554, -0.2653680741786957, 0.06742936372756958, 0.11280351132154465, -0.07435853034257889, -0.06704401969909668, 0.014857258647680283, -0.052130959928035736, -0.005734254606068134, -0.348563551902771, -0.429650217294693, -0.24217009544372559, 0.3459935188293457, -0.167547807097435, 0.25328001379966736, -0.1055661141872406, -0.020010076463222504, -0.13383150100708008, -0.09268760681152344, 0.15826763212680817, 0.24242530763149261, 0.09668897837400436, -0.2312614619731903, -0.014673411846160889, 0.06443939357995987, 0.06622758507728577, -0.0633772760629654, 0.008363507688045502, 0.3301640748977661, 0.009998183697462082, -0.03906112536787987, 0.31574785709381104, 0.2630392014980316, 0.1262226700782776, 0.21564948558807373, 0.5167378187179565, 0.05136922374367714, -0.3151858448982239, 0.15826591849327087, -0.06682279706001282, -0.339805006980896, -0.11539358645677567, 0.23684535920619965, -0.20034322142601013, -0.11856874823570251, 0.14482147991657257, -0.46070489287376404, -0.2523907721042633, 0.1912010759115219, 0.1591799557209015, -0.153117835521698, 0.04077766835689545, 0.5733794569969177, -0.19215020537376404, 0.22519034147262573, 0.00785297155380249, 0.2361792027950287, 0.0928603932261467, -0.02791166678071022, -0.36986875534057617, 0.016894444823265076, -0.07930359244346619, -0.08100322633981705, 0.0595146045088768, 0.07822342216968536, 0.6891673803329468, -0.2848670184612274, 0.3777543902397156, -0.170050710439682, -0.04897410422563553, -0.13873529434204102, -0.0031952261924743652, 0.16050510108470917, -0.009283505380153656, -0.06250829994678497, 0.2626477777957916, 0.08466943353414536, -0.12384388595819473, 0.14593079686164856, 0.006421414203941822, -0.5592910051345825, -0.16287726163864136, 0.20188061892986298, -0.11722906678915024, -0.3631448447704315, 0.09780126810073853, 0.13625207543373108, 0.12341329455375671, -0.05610119551420212, -0.12104502320289612, 0.348403662443161, -0.09328097850084305, -0.12967771291732788, -0.0623699314892292, 0.2061142772436142, -0.6102626323699951, -0.12737397849559784, -0.3735906481742859, -0.09116604179143906, 0.08266115933656693, -0.20292386412620544, -0.3644247353076935, 0.2112847864627838, -0.08643193542957306, -0.030919715762138367, 0.5579186081886292, -0.09881819784641266, -0.18848377466201782, 0.37865233421325684, -0.16550017893314362, -0.2597185969352722, 0.37510597705841064, -0.03096272237598896, -0.39519649744033813, 0.22892871499061584, 0.10965165495872498, 0.1006525456905365, 0.054438382387161255, -0.3138413727283478, 0.09364158660173416, -0.22548547387123108, 0.4538995921611786, 0.3011993169784546, 0.036155469715595245, 0.1928992122411728, 0.034736987203359604, -0.07291129231452942, 0.3057626783847809, 0.21359720826148987, -0.43028244376182556, 0.4425097703933716, 0.14904236793518066, 0.6919842958450317, 0.10330460965633392, -0.04581098258495331, -0.34222686290740967, 0.10511160641908646, -0.1490248441696167, -0.2108915150165558, 0.0039556920528411865, -0.14425775408744812, -0.6515458226203918, 0.2857949137687683, 0.20844724774360657, 0.09193789958953857, 0.0969112291932106, 0.3459562361240387, -0.1585087776184082, -0.32673490047454834, -0.3093886375427246, -0.08853413164615631, -0.0614975243806839, -0.051436007022857666, -0.46625980734825134, 0.041666679084300995, -0.05229811370372772, 0.08256286382675171, 0.18940460681915283, 0.07780620455741882, 0.37054941058158875, 0.2192426323890686, 0.14171427488327026, 0.26996520161628723, -0.011768819764256477, 0.2564478814601898, -0.0075598219409585, 0.06377843022346497, -0.17307119071483612, -0.12848198413848877, 0.1503443568944931, 0.3368998169898987, 0.22017528116703033, -0.2008117139339447, -0.16159483790397644, 0.3789355754852295, 0.17980735003948212, 0.26371991634368896, 0.046701572835445404, 0.14315545558929443, -0.0027857497334480286, -0.10504808276891708, 0.18336805701255798, -0.3179762065410614, 0.34500691294670105, -0.3331306278705597, 0.032514072954654694, -0.1191788911819458, -0.178994283080101, 0.09325960278511047, 0.3408792018890381, 0.13094362616539001, -0.027705363929271698, 0.00890052318572998, 0.18657724559307098, -0.1409607231616974, 0.0847129076719284, -0.21198952198028564, 0.37823694944381714, 0.4847404956817627, -0.0034349430352449417, -0.17341940104961395, 0.12411671131849289, -0.21227335929870605, 0.42744240164756775, 0.15115594863891602, 0.03615334630012512, 0.13158589601516724, -0.0760556310415268, -0.3720066547393799, -0.023421160876750946, -0.20289427042007446, 0.2243119776248932, 0.08997653424739838, -0.3186149597167969, -0.01002059131860733, -0.15385618805885315, -0.0042524635791778564, -0.0716930478811264, -0.20119909942150116, -0.0407315194606781, -0.3449769616127014, 0.07880949229001999, 0.08907202631235123, -0.01294628530740738, -0.04098738729953766, -0.4688127040863037, 0.20461438596248627, -0.03163595870137215, -0.412212073802948, -0.18927264213562012, -0.2538032531738281, -0.2355743944644928, 0.13130606710910797, -0.28033384680747986, 0.1872653067111969, 0.21140462160110474, 0.08119647204875946, 0.21557867527008057, -0.17271803319454193, -0.19270452857017517, -0.03166510537266731, -0.02911684475839138, 0.31177979707717896, 0.3304227292537689, 0.10053405910730362, -0.036207884550094604, -0.2211315631866455, 0.30172300338745117, 0.3925619125366211, -0.1485947072505951, 0.032892294228076935, 0.13315612077713013, -0.13684609532356262, 0.21616210043430328, -0.6567659974098206, -0.0710652619600296, -0.30770617723464966, -0.07427111268043518, 0.07459062337875366, 0.15637685358524323, 0.0728771835565567, -0.10321560502052307, 0.07663759589195251, 0.2570054531097412, 0.40304020047187805, -0.27412572503089905, -0.2635927200317383, 0.23714175820350647, -0.2321995198726654, -0.07551659643650055, -0.059956882148981094, 0.27683767676353455, -0.23361092805862427, -0.02928452007472515, -0.5025726556777954, 0.1007586121559143, -0.1564100980758667, -0.0034032389521598816, -0.1002989262342453, 0.09049947559833527, 0.31200775504112244, 0.1726859211921692, -0.26878389716148376, -0.08843936771154404, -0.415269136428833, 0.26836326718330383, -0.057314466685056686, 0.49042701721191406, -0.0956725925207138, 0.16496771574020386, -0.2182355672121048, 0.3402361273765564, -0.06816752254962921, 0.2589094936847687, 0.20547452569007874, -0.09882507473230362, 0.07936899363994598, 0.10867875814437866, -0.48592570424079895, -0.1597248911857605, 0.12649571895599365, -0.0025003552436828613, 0.3683309257030487, -0.1013534814119339, -0.2681659460067749, -0.4198586642742157, -0.030454162508249283, -0.27735599875450134, 0.08731234073638916, 0.06717845797538757, -0.22161878645420074, 0.14845307171344757, -0.02559235319495201, 0.16225436329841614, -0.030958279967308044, -0.24218688905239105, 0.060926031321287155, -0.12813475728034973, -0.2625223398208618, -0.2060159146785736, -0.3826979398727417, -0.2597464323043823, 0.1380944699048996, 0.39061620831489563, 0.06799820065498352, 0.2854999303817749, -0.08768472075462341, -0.2014341652393341, -0.03949744254350662, 0.02071472629904747, 0.7801421880722046, -0.1004631444811821, 0.0968247503042221, 0.16085636615753174, -0.08064013719558716, 0.18385985493659973, 0.012768976390361786, -0.2740534543991089, 0.261764258146286, -0.23087775707244873, 0.28181153535842896, -0.3059740364551544, 0.05973023921251297, 0.24746790528297424, 0.16340336203575134, -0.31636983156204224, -0.13664788007736206, -0.16359110176563263, -0.29165711998939514, -0.006265692412853241, -0.20682837069034576, -0.3211756646633148, 0.5385579466819763, -0.011068843305110931, 0.08664551377296448, -0.11267291009426117, -0.35841232538223267, 0.30420470237731934, -0.2256242334842682, 0.18943540751934052, -0.17817436158657074, -0.024789899587631226, 0.1293586790561676, 0.0877700001001358, 0.06638234108686447, 0.5288668870925903, 0.16273604333400726, -0.34513264894485474, -0.10254192352294922, -0.15264570713043213, 0.5010108947753906, 0.3657718896865845, -0.0521668940782547, -0.011594559997320175, 0.2530365586280823, -0.0776965469121933, 0.2638590931892395, -0.2412148118019104, 0.052196815609931946, -0.2996912896633148, -0.02931058779358864, -0.24163204431533813, 0.3887373208999634, -0.1952599138021469, 0.06068149209022522, 0.0670374259352684, -0.02905258536338806, -0.2666320502758026, 0.29115450382232666, 0.026460371911525726, 1.0886259078979492, 0.4282439351081848, -0.15513908863067627, 0.13622689247131348, 0.022604122757911682, -0.004629421979188919, -0.2543867528438568, 0.13417091965675354, -0.20001854002475739, -0.2146841585636139, -0.05018395557999611, -0.00611867755651474, 0.22534483671188354, 0.5001620054244995, -0.091916024684906, 0.2566926181316376, -0.32796257734298706, 0.06938551366329193, 0.10134828090667725, 0.21779489517211914, -0.15080469846725464, 0.07050874829292297, -0.175140842795372, 0.001554057002067566, 0.025669457390904427, -0.006412274204194546, -0.21585708856582642, 0.0913582593202591, -0.056333065032958984, -0.3098578453063965, -0.3367885947227478, 0.07487121969461441, -0.20700187981128693, 0.3352386951446533, 0.17609992623329163, -0.4708123803138733, -0.1755184829235077, 0.29957106709480286, -0.03064611181616783, 0.37888211011886597, -0.290976345539093, 0.257091224193573, 0.21782875061035156, -0.25061240792274475, -0.1456935554742813, 0.051989924162626266, 0.10254993289709091, -0.17676395177841187, -0.37625980377197266, 0.0643666684627533, -0.003596629947423935, -0.13776351511478424, -0.18571338057518005, -0.03688616678118706, -0.013829071074724197, -0.4887954592704773, -0.4311654269695282, 0.08277472853660583, 0.1645672768354416, -0.27140769362449646, 0.11573316156864166, 0.14000347256660461, -0.48844456672668457, 0.07710263878107071, 0.3068851828575134, -0.049346789717674255, -0.23446205258369446, 0.3849155604839325, 0.17911578714847565, -0.3797421455383301, 0.5771918296813965, 0.3488723635673523, -0.2561803460121155, -0.36894333362579346, 0.2293923944234848, 0.14917093515396118, -0.08308357000350952, -0.07176476716995239, 0.1869526505470276, -0.023702159523963928, -0.11207666248083115, 0.2090742290019989, 0.22121186554431915, 0.20517681539058685, 0.05381539463996887, -0.5377473831176758, 0.11520839482545853, 0.273718923330307, 0.26356714963912964, 0.21940189599990845, -0.4858613908290863, -0.41051408648490906, 0.08736831694841385, 0.22545166313648224, -0.3360357880592346, 0.10602159798145294, -0.35489773750305176, 0.18318280577659607, 0.07753761857748032, 0.16922590136528015, 0.322207510471344, 0.21963408589363098, 0.3076057434082031, -0.2599433958530426, 0.021162409335374832, -0.22849415242671967, -0.003342673182487488, 0.16980226337909698, -0.07429884374141693, 0.30677467584609985, -0.15802839398384094, -0.1126146912574768, -0.2846762537956238, 0.10343118757009506, -0.0970902144908905, 0.18975085020065308, 0.15940190851688385, 0.3295302391052246, 0.007401713635772467, 0.19890375435352325, -0.33090806007385254, 0.03783245012164116, 0.02207426354289055, 0.4073725938796997, 0.1342782974243164, -0.05717569589614868, 0.05139227211475372, -0.09158258885145187, 0.05024958401918411, -0.011394660919904709, -0.07477879524230957, -0.023838169872760773, 0.2638459801673889, -0.09181708842515945, -0.06410790234804153, 0.1841379702091217, 0.1978502869606018, 0.3232933282852173, -0.16833630204200745, 0.1612672209739685, 0.35176315903663635, 0.2191147804260254, -0.41166791319847107, -0.2516937553882599, 0.09509807825088501, -0.21596671640872955, -0.07881587743759155, 0.26722168922424316, 0.007058940827846527, 0.13658060133457184, 0.2629530429840088, -0.09604842960834503, 0.12145939469337463, -0.021206779405474663, 0.056229546666145325, 0.23656883835792542, -0.044069115072488785, -0.04384163022041321, 0.07536741346120834, 0.7385468482971191, 0.0494583323597908, 0.36206135153770447, 0.06360578536987305, 0.13992653787136078, 0.10077957808971405, 0.21542862057685852, -0.05641112104058266, -0.3993435502052307, 0.4200454354286194, 0.07890230417251587, -0.0059384070336818695, 0.07708688080310822, -0.3086263835430145, 0.26899123191833496, 0.029980584979057312, 0.42783069610595703, -0.25086650252342224, -0.0929267555475235, -0.13024315237998962, -0.007827073335647583, -0.064748115837574, -0.2903832495212555, -0.41215890645980835, -0.11847580224275589, 0.3244851529598236, -0.4616892635822296, 0.017966236919164658, -0.08962096273899078, 0.047276318073272705, -0.4811754822731018, 0.37323710322380066, 0.11149948090314865, -0.004821173846721649, -0.44143354892730713, -0.028943998739123344, 0.07509578764438629, 0.05385219305753708, 0.3405991494655609, 0.2547428011894226, 0.15312448143959045, 0.10623720288276672, -0.014556912705302238, -0.041136734187603, -0.12890218198299408, -0.5027481913566589, -0.05007041245698929, 0.34455767273902893, 0.3150547444820404, -0.009398594498634338, 0.27651530504226685, 0.15632686018943787, -0.19497063755989075, 0.33904826641082764, 0.3271607756614685, 0.10635000467300415, -0.23678874969482422, 0.2234492003917694, -0.12828993797302246, -0.37417516112327576, -0.3007756471633911, -0.23953558504581451, -0.686646580696106, -0.35973140597343445, 0.47830578684806824, 0.28467491269111633, -0.018460843712091446, 0.12313167750835419, 0.1281808316707611, -0.06669878959655762, 0.39756372570991516, 0.20740026235580444, 0.3662636876106262, -0.2527186870574951, 0.04418405890464783, 0.03622595965862274, 0.015297655016183853, 0.47694334387779236, 0.045812442898750305, 0.3003016710281372, 0.1896970421075821, 0.17125487327575684, 0.2975001037120819, -0.21022343635559082, -0.1747041940689087, 0.043921150267124176, 0.5408065319061279, -0.22837862372398376, -0.2865350842475891, 0.508055567741394, 0.3126719892024994, -0.07067473232746124, -0.1509338766336441, -0.11125142127275467, -0.21393924951553345, 0.04931814223527908, -0.5560259222984314, -0.3782661557197571, 0.018154583871364594, 0.2081996500492096, 0.31917980313301086, -0.12528926134109497, 0.4286547303199768, -0.1458655446767807, 0.17347577214241028, -0.0038351863622665405, -0.2912942171096802, 0.06694643199443817, 0.1768633872270584, 0.4434421956539154, 0.1672224998474121, -0.13481485843658447, -0.06036804988980293, 0.031389154493808746, 0.1759146898984909, -0.19410130381584167, -0.38885390758514404, -0.1677507907152176, -0.24927562475204468, -0.1498420536518097, -0.2044699788093567, -0.03998672589659691, 0.015544937923550606, 0.030204521492123604, 0.091214120388031, -0.06428446620702744, -0.2256559431552887, 0.7753728628158569, 0.3773084878921509, -0.3974205255508423, -0.013798851519823074, 0.34406644105911255, 0.29504603147506714, -0.022431882098317146, -0.3239356279373169, 0.13448040187358856, 0.3464299142360687, 0.031223762780427933, 0.10370147228240967, 0.3147680163383484, 0.06829375773668289, 0.10053448379039764, -0.08659391850233078, 0.181051105260849, -0.11237430572509766, 0.02070191502571106, -0.5842387080192566, -0.1203804612159729 ]
https://github.com/huggingface/datasets/issues/6099
I have figured it out. there was an option of **parquet formated files** i downloaded some from there.
How do i get "amazon_us_reviews
### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data
18
How do i get "amazon_us_reviews ### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data I have figured it out. there was an option of **parquet formated files** i downloaded some from there.
[ -0.046608902513980865, -0.2530131936073303, -0.28236865997314453, 0.24994568526744843, 0.29547378420829773, 0.42686212062835693, 0.3098292648792267, 0.08909308910369873, -0.06656547635793686, 0.20722495019435883, 0.0757707953453064, 0.04079410061240196, 0.20352010428905487, 0.36819255352020264, -0.12808920443058014, -0.015228133648633957, -0.03058839589357376, 0.1239573284983635, 0.16607515513896942, -0.02353750914335251, -0.2197568267583847, 0.2661455571651459, -0.2409200370311737, 0.10528970509767532, -0.2566760778427124, -0.0399424210190773, 0.08558105677366257, 0.04719587415456772, -0.27613943815231323, -0.17340824007987976, 0.2110467106103897, 0.10930492728948593, -0.11997595429420471, 0.07641930878162384, -0.0001143941844929941, -0.16595788300037384, 0.45642510056495667, -0.10461817681789398, -0.30486860871315, -0.4516846835613251, -0.08231265097856522, -0.5119820833206177, 0.16311438381671906, -0.29125797748565674, -0.19792252779006958, -0.26448604464530945, -0.08214783668518066, -0.1355411261320114, -0.22327381372451782, 0.24390128254890442, 0.20906756818294525, -0.12646007537841797, 0.13959215581417084, -0.27932608127593994, 0.29713523387908936, 0.026435840874910355, -0.0015953704714775085, 0.09458678960800171, 0.13082757592201233, -0.1577909290790558, 0.5084865093231201, 0.19967329502105713, 0.05712705850601196, -0.19955337047576904, -0.000665285624563694, 0.057430848479270935, 0.17844925820827484, 0.021850423887372017, 0.5014781355857849, 0.13716056942939758, 1.055943489074707, -0.07293520867824554, -0.2653680741786957, 0.06742936372756958, 0.11280351132154465, -0.07435853034257889, -0.06704401969909668, 0.014857258647680283, -0.052130959928035736, -0.005734254606068134, -0.348563551902771, -0.429650217294693, -0.24217009544372559, 0.3459935188293457, -0.167547807097435, 0.25328001379966736, -0.1055661141872406, -0.020010076463222504, -0.13383150100708008, -0.09268760681152344, 0.15826763212680817, 0.24242530763149261, 0.09668897837400436, -0.2312614619731903, -0.014673411846160889, 0.06443939357995987, 0.06622758507728577, -0.0633772760629654, 0.008363507688045502, 0.3301640748977661, 0.009998183697462082, -0.03906112536787987, 0.31574785709381104, 0.2630392014980316, 0.1262226700782776, 0.21564948558807373, 0.5167378187179565, 0.05136922374367714, -0.3151858448982239, 0.15826591849327087, -0.06682279706001282, -0.339805006980896, -0.11539358645677567, 0.23684535920619965, -0.20034322142601013, -0.11856874823570251, 0.14482147991657257, -0.46070489287376404, -0.2523907721042633, 0.1912010759115219, 0.1591799557209015, -0.153117835521698, 0.04077766835689545, 0.5733794569969177, -0.19215020537376404, 0.22519034147262573, 0.00785297155380249, 0.2361792027950287, 0.0928603932261467, -0.02791166678071022, -0.36986875534057617, 0.016894444823265076, -0.07930359244346619, -0.08100322633981705, 0.0595146045088768, 0.07822342216968536, 0.6891673803329468, -0.2848670184612274, 0.3777543902397156, -0.170050710439682, -0.04897410422563553, -0.13873529434204102, -0.0031952261924743652, 0.16050510108470917, -0.009283505380153656, -0.06250829994678497, 0.2626477777957916, 0.08466943353414536, -0.12384388595819473, 0.14593079686164856, 0.006421414203941822, -0.5592910051345825, -0.16287726163864136, 0.20188061892986298, -0.11722906678915024, -0.3631448447704315, 0.09780126810073853, 0.13625207543373108, 0.12341329455375671, -0.05610119551420212, -0.12104502320289612, 0.348403662443161, -0.09328097850084305, -0.12967771291732788, -0.0623699314892292, 0.2061142772436142, -0.6102626323699951, -0.12737397849559784, -0.3735906481742859, -0.09116604179143906, 0.08266115933656693, -0.20292386412620544, -0.3644247353076935, 0.2112847864627838, -0.08643193542957306, -0.030919715762138367, 0.5579186081886292, -0.09881819784641266, -0.18848377466201782, 0.37865233421325684, -0.16550017893314362, -0.2597185969352722, 0.37510597705841064, -0.03096272237598896, -0.39519649744033813, 0.22892871499061584, 0.10965165495872498, 0.1006525456905365, 0.054438382387161255, -0.3138413727283478, 0.09364158660173416, -0.22548547387123108, 0.4538995921611786, 0.3011993169784546, 0.036155469715595245, 0.1928992122411728, 0.034736987203359604, -0.07291129231452942, 0.3057626783847809, 0.21359720826148987, -0.43028244376182556, 0.4425097703933716, 0.14904236793518066, 0.6919842958450317, 0.10330460965633392, -0.04581098258495331, -0.34222686290740967, 0.10511160641908646, -0.1490248441696167, -0.2108915150165558, 0.0039556920528411865, -0.14425775408744812, -0.6515458226203918, 0.2857949137687683, 0.20844724774360657, 0.09193789958953857, 0.0969112291932106, 0.3459562361240387, -0.1585087776184082, -0.32673490047454834, -0.3093886375427246, -0.08853413164615631, -0.0614975243806839, -0.051436007022857666, -0.46625980734825134, 0.041666679084300995, -0.05229811370372772, 0.08256286382675171, 0.18940460681915283, 0.07780620455741882, 0.37054941058158875, 0.2192426323890686, 0.14171427488327026, 0.26996520161628723, -0.011768819764256477, 0.2564478814601898, -0.0075598219409585, 0.06377843022346497, -0.17307119071483612, -0.12848198413848877, 0.1503443568944931, 0.3368998169898987, 0.22017528116703033, -0.2008117139339447, -0.16159483790397644, 0.3789355754852295, 0.17980735003948212, 0.26371991634368896, 0.046701572835445404, 0.14315545558929443, -0.0027857497334480286, -0.10504808276891708, 0.18336805701255798, -0.3179762065410614, 0.34500691294670105, -0.3331306278705597, 0.032514072954654694, -0.1191788911819458, -0.178994283080101, 0.09325960278511047, 0.3408792018890381, 0.13094362616539001, -0.027705363929271698, 0.00890052318572998, 0.18657724559307098, -0.1409607231616974, 0.0847129076719284, -0.21198952198028564, 0.37823694944381714, 0.4847404956817627, -0.0034349430352449417, -0.17341940104961395, 0.12411671131849289, -0.21227335929870605, 0.42744240164756775, 0.15115594863891602, 0.03615334630012512, 0.13158589601516724, -0.0760556310415268, -0.3720066547393799, -0.023421160876750946, -0.20289427042007446, 0.2243119776248932, 0.08997653424739838, -0.3186149597167969, -0.01002059131860733, -0.15385618805885315, -0.0042524635791778564, -0.0716930478811264, -0.20119909942150116, -0.0407315194606781, -0.3449769616127014, 0.07880949229001999, 0.08907202631235123, -0.01294628530740738, -0.04098738729953766, -0.4688127040863037, 0.20461438596248627, -0.03163595870137215, -0.412212073802948, -0.18927264213562012, -0.2538032531738281, -0.2355743944644928, 0.13130606710910797, -0.28033384680747986, 0.1872653067111969, 0.21140462160110474, 0.08119647204875946, 0.21557867527008057, -0.17271803319454193, -0.19270452857017517, -0.03166510537266731, -0.02911684475839138, 0.31177979707717896, 0.3304227292537689, 0.10053405910730362, -0.036207884550094604, -0.2211315631866455, 0.30172300338745117, 0.3925619125366211, -0.1485947072505951, 0.032892294228076935, 0.13315612077713013, -0.13684609532356262, 0.21616210043430328, -0.6567659974098206, -0.0710652619600296, -0.30770617723464966, -0.07427111268043518, 0.07459062337875366, 0.15637685358524323, 0.0728771835565567, -0.10321560502052307, 0.07663759589195251, 0.2570054531097412, 0.40304020047187805, -0.27412572503089905, -0.2635927200317383, 0.23714175820350647, -0.2321995198726654, -0.07551659643650055, -0.059956882148981094, 0.27683767676353455, -0.23361092805862427, -0.02928452007472515, -0.5025726556777954, 0.1007586121559143, -0.1564100980758667, -0.0034032389521598816, -0.1002989262342453, 0.09049947559833527, 0.31200775504112244, 0.1726859211921692, -0.26878389716148376, -0.08843936771154404, -0.415269136428833, 0.26836326718330383, -0.057314466685056686, 0.49042701721191406, -0.0956725925207138, 0.16496771574020386, -0.2182355672121048, 0.3402361273765564, -0.06816752254962921, 0.2589094936847687, 0.20547452569007874, -0.09882507473230362, 0.07936899363994598, 0.10867875814437866, -0.48592570424079895, -0.1597248911857605, 0.12649571895599365, -0.0025003552436828613, 0.3683309257030487, -0.1013534814119339, -0.2681659460067749, -0.4198586642742157, -0.030454162508249283, -0.27735599875450134, 0.08731234073638916, 0.06717845797538757, -0.22161878645420074, 0.14845307171344757, -0.02559235319495201, 0.16225436329841614, -0.030958279967308044, -0.24218688905239105, 0.060926031321287155, -0.12813475728034973, -0.2625223398208618, -0.2060159146785736, -0.3826979398727417, -0.2597464323043823, 0.1380944699048996, 0.39061620831489563, 0.06799820065498352, 0.2854999303817749, -0.08768472075462341, -0.2014341652393341, -0.03949744254350662, 0.02071472629904747, 0.7801421880722046, -0.1004631444811821, 0.0968247503042221, 0.16085636615753174, -0.08064013719558716, 0.18385985493659973, 0.012768976390361786, -0.2740534543991089, 0.261764258146286, -0.23087775707244873, 0.28181153535842896, -0.3059740364551544, 0.05973023921251297, 0.24746790528297424, 0.16340336203575134, -0.31636983156204224, -0.13664788007736206, -0.16359110176563263, -0.29165711998939514, -0.006265692412853241, -0.20682837069034576, -0.3211756646633148, 0.5385579466819763, -0.011068843305110931, 0.08664551377296448, -0.11267291009426117, -0.35841232538223267, 0.30420470237731934, -0.2256242334842682, 0.18943540751934052, -0.17817436158657074, -0.024789899587631226, 0.1293586790561676, 0.0877700001001358, 0.06638234108686447, 0.5288668870925903, 0.16273604333400726, -0.34513264894485474, -0.10254192352294922, -0.15264570713043213, 0.5010108947753906, 0.3657718896865845, -0.0521668940782547, -0.011594559997320175, 0.2530365586280823, -0.0776965469121933, 0.2638590931892395, -0.2412148118019104, 0.052196815609931946, -0.2996912896633148, -0.02931058779358864, -0.24163204431533813, 0.3887373208999634, -0.1952599138021469, 0.06068149209022522, 0.0670374259352684, -0.02905258536338806, -0.2666320502758026, 0.29115450382232666, 0.026460371911525726, 1.0886259078979492, 0.4282439351081848, -0.15513908863067627, 0.13622689247131348, 0.022604122757911682, -0.004629421979188919, -0.2543867528438568, 0.13417091965675354, -0.20001854002475739, -0.2146841585636139, -0.05018395557999611, -0.00611867755651474, 0.22534483671188354, 0.5001620054244995, -0.091916024684906, 0.2566926181316376, -0.32796257734298706, 0.06938551366329193, 0.10134828090667725, 0.21779489517211914, -0.15080469846725464, 0.07050874829292297, -0.175140842795372, 0.001554057002067566, 0.025669457390904427, -0.006412274204194546, -0.21585708856582642, 0.0913582593202591, -0.056333065032958984, -0.3098578453063965, -0.3367885947227478, 0.07487121969461441, -0.20700187981128693, 0.3352386951446533, 0.17609992623329163, -0.4708123803138733, -0.1755184829235077, 0.29957106709480286, -0.03064611181616783, 0.37888211011886597, -0.290976345539093, 0.257091224193573, 0.21782875061035156, -0.25061240792274475, -0.1456935554742813, 0.051989924162626266, 0.10254993289709091, -0.17676395177841187, -0.37625980377197266, 0.0643666684627533, -0.003596629947423935, -0.13776351511478424, -0.18571338057518005, -0.03688616678118706, -0.013829071074724197, -0.4887954592704773, -0.4311654269695282, 0.08277472853660583, 0.1645672768354416, -0.27140769362449646, 0.11573316156864166, 0.14000347256660461, -0.48844456672668457, 0.07710263878107071, 0.3068851828575134, -0.049346789717674255, -0.23446205258369446, 0.3849155604839325, 0.17911578714847565, -0.3797421455383301, 0.5771918296813965, 0.3488723635673523, -0.2561803460121155, -0.36894333362579346, 0.2293923944234848, 0.14917093515396118, -0.08308357000350952, -0.07176476716995239, 0.1869526505470276, -0.023702159523963928, -0.11207666248083115, 0.2090742290019989, 0.22121186554431915, 0.20517681539058685, 0.05381539463996887, -0.5377473831176758, 0.11520839482545853, 0.273718923330307, 0.26356714963912964, 0.21940189599990845, -0.4858613908290863, -0.41051408648490906, 0.08736831694841385, 0.22545166313648224, -0.3360357880592346, 0.10602159798145294, -0.35489773750305176, 0.18318280577659607, 0.07753761857748032, 0.16922590136528015, 0.322207510471344, 0.21963408589363098, 0.3076057434082031, -0.2599433958530426, 0.021162409335374832, -0.22849415242671967, -0.003342673182487488, 0.16980226337909698, -0.07429884374141693, 0.30677467584609985, -0.15802839398384094, -0.1126146912574768, -0.2846762537956238, 0.10343118757009506, -0.0970902144908905, 0.18975085020065308, 0.15940190851688385, 0.3295302391052246, 0.007401713635772467, 0.19890375435352325, -0.33090806007385254, 0.03783245012164116, 0.02207426354289055, 0.4073725938796997, 0.1342782974243164, -0.05717569589614868, 0.05139227211475372, -0.09158258885145187, 0.05024958401918411, -0.011394660919904709, -0.07477879524230957, -0.023838169872760773, 0.2638459801673889, -0.09181708842515945, -0.06410790234804153, 0.1841379702091217, 0.1978502869606018, 0.3232933282852173, -0.16833630204200745, 0.1612672209739685, 0.35176315903663635, 0.2191147804260254, -0.41166791319847107, -0.2516937553882599, 0.09509807825088501, -0.21596671640872955, -0.07881587743759155, 0.26722168922424316, 0.007058940827846527, 0.13658060133457184, 0.2629530429840088, -0.09604842960834503, 0.12145939469337463, -0.021206779405474663, 0.056229546666145325, 0.23656883835792542, -0.044069115072488785, -0.04384163022041321, 0.07536741346120834, 0.7385468482971191, 0.0494583323597908, 0.36206135153770447, 0.06360578536987305, 0.13992653787136078, 0.10077957808971405, 0.21542862057685852, -0.05641112104058266, -0.3993435502052307, 0.4200454354286194, 0.07890230417251587, -0.0059384070336818695, 0.07708688080310822, -0.3086263835430145, 0.26899123191833496, 0.029980584979057312, 0.42783069610595703, -0.25086650252342224, -0.0929267555475235, -0.13024315237998962, -0.007827073335647583, -0.064748115837574, -0.2903832495212555, -0.41215890645980835, -0.11847580224275589, 0.3244851529598236, -0.4616892635822296, 0.017966236919164658, -0.08962096273899078, 0.047276318073272705, -0.4811754822731018, 0.37323710322380066, 0.11149948090314865, -0.004821173846721649, -0.44143354892730713, -0.028943998739123344, 0.07509578764438629, 0.05385219305753708, 0.3405991494655609, 0.2547428011894226, 0.15312448143959045, 0.10623720288276672, -0.014556912705302238, -0.041136734187603, -0.12890218198299408, -0.5027481913566589, -0.05007041245698929, 0.34455767273902893, 0.3150547444820404, -0.009398594498634338, 0.27651530504226685, 0.15632686018943787, -0.19497063755989075, 0.33904826641082764, 0.3271607756614685, 0.10635000467300415, -0.23678874969482422, 0.2234492003917694, -0.12828993797302246, -0.37417516112327576, -0.3007756471633911, -0.23953558504581451, -0.686646580696106, -0.35973140597343445, 0.47830578684806824, 0.28467491269111633, -0.018460843712091446, 0.12313167750835419, 0.1281808316707611, -0.06669878959655762, 0.39756372570991516, 0.20740026235580444, 0.3662636876106262, -0.2527186870574951, 0.04418405890464783, 0.03622595965862274, 0.015297655016183853, 0.47694334387779236, 0.045812442898750305, 0.3003016710281372, 0.1896970421075821, 0.17125487327575684, 0.2975001037120819, -0.21022343635559082, -0.1747041940689087, 0.043921150267124176, 0.5408065319061279, -0.22837862372398376, -0.2865350842475891, 0.508055567741394, 0.3126719892024994, -0.07067473232746124, -0.1509338766336441, -0.11125142127275467, -0.21393924951553345, 0.04931814223527908, -0.5560259222984314, -0.3782661557197571, 0.018154583871364594, 0.2081996500492096, 0.31917980313301086, -0.12528926134109497, 0.4286547303199768, -0.1458655446767807, 0.17347577214241028, -0.0038351863622665405, -0.2912942171096802, 0.06694643199443817, 0.1768633872270584, 0.4434421956539154, 0.1672224998474121, -0.13481485843658447, -0.06036804988980293, 0.031389154493808746, 0.1759146898984909, -0.19410130381584167, -0.38885390758514404, -0.1677507907152176, -0.24927562475204468, -0.1498420536518097, -0.2044699788093567, -0.03998672589659691, 0.015544937923550606, 0.030204521492123604, 0.091214120388031, -0.06428446620702744, -0.2256559431552887, 0.7753728628158569, 0.3773084878921509, -0.3974205255508423, -0.013798851519823074, 0.34406644105911255, 0.29504603147506714, -0.022431882098317146, -0.3239356279373169, 0.13448040187358856, 0.3464299142360687, 0.031223762780427933, 0.10370147228240967, 0.3147680163383484, 0.06829375773668289, 0.10053448379039764, -0.08659391850233078, 0.181051105260849, -0.11237430572509766, 0.02070191502571106, -0.5842387080192566, -0.1203804612159729 ]
https://github.com/huggingface/datasets/issues/6099
Thanks for reporting, @IqraBaluch. We contacted the authors and unfortunately they reported that Amazon has decided to stop distributing this dataset.
How do i get "amazon_us_reviews
### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data
21
How do i get "amazon_us_reviews ### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data Thanks for reporting, @IqraBaluch. We contacted the authors and unfortunately they reported that Amazon has decided to stop distributing this dataset.
[ -0.046608902513980865, -0.2530131936073303, -0.28236865997314453, 0.24994568526744843, 0.29547378420829773, 0.42686212062835693, 0.3098292648792267, 0.08909308910369873, -0.06656547635793686, 0.20722495019435883, 0.0757707953453064, 0.04079410061240196, 0.20352010428905487, 0.36819255352020264, -0.12808920443058014, -0.015228133648633957, -0.03058839589357376, 0.1239573284983635, 0.16607515513896942, -0.02353750914335251, -0.2197568267583847, 0.2661455571651459, -0.2409200370311737, 0.10528970509767532, -0.2566760778427124, -0.0399424210190773, 0.08558105677366257, 0.04719587415456772, -0.27613943815231323, -0.17340824007987976, 0.2110467106103897, 0.10930492728948593, -0.11997595429420471, 0.07641930878162384, -0.0001143941844929941, -0.16595788300037384, 0.45642510056495667, -0.10461817681789398, -0.30486860871315, -0.4516846835613251, -0.08231265097856522, -0.5119820833206177, 0.16311438381671906, -0.29125797748565674, -0.19792252779006958, -0.26448604464530945, -0.08214783668518066, -0.1355411261320114, -0.22327381372451782, 0.24390128254890442, 0.20906756818294525, -0.12646007537841797, 0.13959215581417084, -0.27932608127593994, 0.29713523387908936, 0.026435840874910355, -0.0015953704714775085, 0.09458678960800171, 0.13082757592201233, -0.1577909290790558, 0.5084865093231201, 0.19967329502105713, 0.05712705850601196, -0.19955337047576904, -0.000665285624563694, 0.057430848479270935, 0.17844925820827484, 0.021850423887372017, 0.5014781355857849, 0.13716056942939758, 1.055943489074707, -0.07293520867824554, -0.2653680741786957, 0.06742936372756958, 0.11280351132154465, -0.07435853034257889, -0.06704401969909668, 0.014857258647680283, -0.052130959928035736, -0.005734254606068134, -0.348563551902771, -0.429650217294693, -0.24217009544372559, 0.3459935188293457, -0.167547807097435, 0.25328001379966736, -0.1055661141872406, -0.020010076463222504, -0.13383150100708008, -0.09268760681152344, 0.15826763212680817, 0.24242530763149261, 0.09668897837400436, -0.2312614619731903, -0.014673411846160889, 0.06443939357995987, 0.06622758507728577, -0.0633772760629654, 0.008363507688045502, 0.3301640748977661, 0.009998183697462082, -0.03906112536787987, 0.31574785709381104, 0.2630392014980316, 0.1262226700782776, 0.21564948558807373, 0.5167378187179565, 0.05136922374367714, -0.3151858448982239, 0.15826591849327087, -0.06682279706001282, -0.339805006980896, -0.11539358645677567, 0.23684535920619965, -0.20034322142601013, -0.11856874823570251, 0.14482147991657257, -0.46070489287376404, -0.2523907721042633, 0.1912010759115219, 0.1591799557209015, -0.153117835521698, 0.04077766835689545, 0.5733794569969177, -0.19215020537376404, 0.22519034147262573, 0.00785297155380249, 0.2361792027950287, 0.0928603932261467, -0.02791166678071022, -0.36986875534057617, 0.016894444823265076, -0.07930359244346619, -0.08100322633981705, 0.0595146045088768, 0.07822342216968536, 0.6891673803329468, -0.2848670184612274, 0.3777543902397156, -0.170050710439682, -0.04897410422563553, -0.13873529434204102, -0.0031952261924743652, 0.16050510108470917, -0.009283505380153656, -0.06250829994678497, 0.2626477777957916, 0.08466943353414536, -0.12384388595819473, 0.14593079686164856, 0.006421414203941822, -0.5592910051345825, -0.16287726163864136, 0.20188061892986298, -0.11722906678915024, -0.3631448447704315, 0.09780126810073853, 0.13625207543373108, 0.12341329455375671, -0.05610119551420212, -0.12104502320289612, 0.348403662443161, -0.09328097850084305, -0.12967771291732788, -0.0623699314892292, 0.2061142772436142, -0.6102626323699951, -0.12737397849559784, -0.3735906481742859, -0.09116604179143906, 0.08266115933656693, -0.20292386412620544, -0.3644247353076935, 0.2112847864627838, -0.08643193542957306, -0.030919715762138367, 0.5579186081886292, -0.09881819784641266, -0.18848377466201782, 0.37865233421325684, -0.16550017893314362, -0.2597185969352722, 0.37510597705841064, -0.03096272237598896, -0.39519649744033813, 0.22892871499061584, 0.10965165495872498, 0.1006525456905365, 0.054438382387161255, -0.3138413727283478, 0.09364158660173416, -0.22548547387123108, 0.4538995921611786, 0.3011993169784546, 0.036155469715595245, 0.1928992122411728, 0.034736987203359604, -0.07291129231452942, 0.3057626783847809, 0.21359720826148987, -0.43028244376182556, 0.4425097703933716, 0.14904236793518066, 0.6919842958450317, 0.10330460965633392, -0.04581098258495331, -0.34222686290740967, 0.10511160641908646, -0.1490248441696167, -0.2108915150165558, 0.0039556920528411865, -0.14425775408744812, -0.6515458226203918, 0.2857949137687683, 0.20844724774360657, 0.09193789958953857, 0.0969112291932106, 0.3459562361240387, -0.1585087776184082, -0.32673490047454834, -0.3093886375427246, -0.08853413164615631, -0.0614975243806839, -0.051436007022857666, -0.46625980734825134, 0.041666679084300995, -0.05229811370372772, 0.08256286382675171, 0.18940460681915283, 0.07780620455741882, 0.37054941058158875, 0.2192426323890686, 0.14171427488327026, 0.26996520161628723, -0.011768819764256477, 0.2564478814601898, -0.0075598219409585, 0.06377843022346497, -0.17307119071483612, -0.12848198413848877, 0.1503443568944931, 0.3368998169898987, 0.22017528116703033, -0.2008117139339447, -0.16159483790397644, 0.3789355754852295, 0.17980735003948212, 0.26371991634368896, 0.046701572835445404, 0.14315545558929443, -0.0027857497334480286, -0.10504808276891708, 0.18336805701255798, -0.3179762065410614, 0.34500691294670105, -0.3331306278705597, 0.032514072954654694, -0.1191788911819458, -0.178994283080101, 0.09325960278511047, 0.3408792018890381, 0.13094362616539001, -0.027705363929271698, 0.00890052318572998, 0.18657724559307098, -0.1409607231616974, 0.0847129076719284, -0.21198952198028564, 0.37823694944381714, 0.4847404956817627, -0.0034349430352449417, -0.17341940104961395, 0.12411671131849289, -0.21227335929870605, 0.42744240164756775, 0.15115594863891602, 0.03615334630012512, 0.13158589601516724, -0.0760556310415268, -0.3720066547393799, -0.023421160876750946, -0.20289427042007446, 0.2243119776248932, 0.08997653424739838, -0.3186149597167969, -0.01002059131860733, -0.15385618805885315, -0.0042524635791778564, -0.0716930478811264, -0.20119909942150116, -0.0407315194606781, -0.3449769616127014, 0.07880949229001999, 0.08907202631235123, -0.01294628530740738, -0.04098738729953766, -0.4688127040863037, 0.20461438596248627, -0.03163595870137215, -0.412212073802948, -0.18927264213562012, -0.2538032531738281, -0.2355743944644928, 0.13130606710910797, -0.28033384680747986, 0.1872653067111969, 0.21140462160110474, 0.08119647204875946, 0.21557867527008057, -0.17271803319454193, -0.19270452857017517, -0.03166510537266731, -0.02911684475839138, 0.31177979707717896, 0.3304227292537689, 0.10053405910730362, -0.036207884550094604, -0.2211315631866455, 0.30172300338745117, 0.3925619125366211, -0.1485947072505951, 0.032892294228076935, 0.13315612077713013, -0.13684609532356262, 0.21616210043430328, -0.6567659974098206, -0.0710652619600296, -0.30770617723464966, -0.07427111268043518, 0.07459062337875366, 0.15637685358524323, 0.0728771835565567, -0.10321560502052307, 0.07663759589195251, 0.2570054531097412, 0.40304020047187805, -0.27412572503089905, -0.2635927200317383, 0.23714175820350647, -0.2321995198726654, -0.07551659643650055, -0.059956882148981094, 0.27683767676353455, -0.23361092805862427, -0.02928452007472515, -0.5025726556777954, 0.1007586121559143, -0.1564100980758667, -0.0034032389521598816, -0.1002989262342453, 0.09049947559833527, 0.31200775504112244, 0.1726859211921692, -0.26878389716148376, -0.08843936771154404, -0.415269136428833, 0.26836326718330383, -0.057314466685056686, 0.49042701721191406, -0.0956725925207138, 0.16496771574020386, -0.2182355672121048, 0.3402361273765564, -0.06816752254962921, 0.2589094936847687, 0.20547452569007874, -0.09882507473230362, 0.07936899363994598, 0.10867875814437866, -0.48592570424079895, -0.1597248911857605, 0.12649571895599365, -0.0025003552436828613, 0.3683309257030487, -0.1013534814119339, -0.2681659460067749, -0.4198586642742157, -0.030454162508249283, -0.27735599875450134, 0.08731234073638916, 0.06717845797538757, -0.22161878645420074, 0.14845307171344757, -0.02559235319495201, 0.16225436329841614, -0.030958279967308044, -0.24218688905239105, 0.060926031321287155, -0.12813475728034973, -0.2625223398208618, -0.2060159146785736, -0.3826979398727417, -0.2597464323043823, 0.1380944699048996, 0.39061620831489563, 0.06799820065498352, 0.2854999303817749, -0.08768472075462341, -0.2014341652393341, -0.03949744254350662, 0.02071472629904747, 0.7801421880722046, -0.1004631444811821, 0.0968247503042221, 0.16085636615753174, -0.08064013719558716, 0.18385985493659973, 0.012768976390361786, -0.2740534543991089, 0.261764258146286, -0.23087775707244873, 0.28181153535842896, -0.3059740364551544, 0.05973023921251297, 0.24746790528297424, 0.16340336203575134, -0.31636983156204224, -0.13664788007736206, -0.16359110176563263, -0.29165711998939514, -0.006265692412853241, -0.20682837069034576, -0.3211756646633148, 0.5385579466819763, -0.011068843305110931, 0.08664551377296448, -0.11267291009426117, -0.35841232538223267, 0.30420470237731934, -0.2256242334842682, 0.18943540751934052, -0.17817436158657074, -0.024789899587631226, 0.1293586790561676, 0.0877700001001358, 0.06638234108686447, 0.5288668870925903, 0.16273604333400726, -0.34513264894485474, -0.10254192352294922, -0.15264570713043213, 0.5010108947753906, 0.3657718896865845, -0.0521668940782547, -0.011594559997320175, 0.2530365586280823, -0.0776965469121933, 0.2638590931892395, -0.2412148118019104, 0.052196815609931946, -0.2996912896633148, -0.02931058779358864, -0.24163204431533813, 0.3887373208999634, -0.1952599138021469, 0.06068149209022522, 0.0670374259352684, -0.02905258536338806, -0.2666320502758026, 0.29115450382232666, 0.026460371911525726, 1.0886259078979492, 0.4282439351081848, -0.15513908863067627, 0.13622689247131348, 0.022604122757911682, -0.004629421979188919, -0.2543867528438568, 0.13417091965675354, -0.20001854002475739, -0.2146841585636139, -0.05018395557999611, -0.00611867755651474, 0.22534483671188354, 0.5001620054244995, -0.091916024684906, 0.2566926181316376, -0.32796257734298706, 0.06938551366329193, 0.10134828090667725, 0.21779489517211914, -0.15080469846725464, 0.07050874829292297, -0.175140842795372, 0.001554057002067566, 0.025669457390904427, -0.006412274204194546, -0.21585708856582642, 0.0913582593202591, -0.056333065032958984, -0.3098578453063965, -0.3367885947227478, 0.07487121969461441, -0.20700187981128693, 0.3352386951446533, 0.17609992623329163, -0.4708123803138733, -0.1755184829235077, 0.29957106709480286, -0.03064611181616783, 0.37888211011886597, -0.290976345539093, 0.257091224193573, 0.21782875061035156, -0.25061240792274475, -0.1456935554742813, 0.051989924162626266, 0.10254993289709091, -0.17676395177841187, -0.37625980377197266, 0.0643666684627533, -0.003596629947423935, -0.13776351511478424, -0.18571338057518005, -0.03688616678118706, -0.013829071074724197, -0.4887954592704773, -0.4311654269695282, 0.08277472853660583, 0.1645672768354416, -0.27140769362449646, 0.11573316156864166, 0.14000347256660461, -0.48844456672668457, 0.07710263878107071, 0.3068851828575134, -0.049346789717674255, -0.23446205258369446, 0.3849155604839325, 0.17911578714847565, -0.3797421455383301, 0.5771918296813965, 0.3488723635673523, -0.2561803460121155, -0.36894333362579346, 0.2293923944234848, 0.14917093515396118, -0.08308357000350952, -0.07176476716995239, 0.1869526505470276, -0.023702159523963928, -0.11207666248083115, 0.2090742290019989, 0.22121186554431915, 0.20517681539058685, 0.05381539463996887, -0.5377473831176758, 0.11520839482545853, 0.273718923330307, 0.26356714963912964, 0.21940189599990845, -0.4858613908290863, -0.41051408648490906, 0.08736831694841385, 0.22545166313648224, -0.3360357880592346, 0.10602159798145294, -0.35489773750305176, 0.18318280577659607, 0.07753761857748032, 0.16922590136528015, 0.322207510471344, 0.21963408589363098, 0.3076057434082031, -0.2599433958530426, 0.021162409335374832, -0.22849415242671967, -0.003342673182487488, 0.16980226337909698, -0.07429884374141693, 0.30677467584609985, -0.15802839398384094, -0.1126146912574768, -0.2846762537956238, 0.10343118757009506, -0.0970902144908905, 0.18975085020065308, 0.15940190851688385, 0.3295302391052246, 0.007401713635772467, 0.19890375435352325, -0.33090806007385254, 0.03783245012164116, 0.02207426354289055, 0.4073725938796997, 0.1342782974243164, -0.05717569589614868, 0.05139227211475372, -0.09158258885145187, 0.05024958401918411, -0.011394660919904709, -0.07477879524230957, -0.023838169872760773, 0.2638459801673889, -0.09181708842515945, -0.06410790234804153, 0.1841379702091217, 0.1978502869606018, 0.3232933282852173, -0.16833630204200745, 0.1612672209739685, 0.35176315903663635, 0.2191147804260254, -0.41166791319847107, -0.2516937553882599, 0.09509807825088501, -0.21596671640872955, -0.07881587743759155, 0.26722168922424316, 0.007058940827846527, 0.13658060133457184, 0.2629530429840088, -0.09604842960834503, 0.12145939469337463, -0.021206779405474663, 0.056229546666145325, 0.23656883835792542, -0.044069115072488785, -0.04384163022041321, 0.07536741346120834, 0.7385468482971191, 0.0494583323597908, 0.36206135153770447, 0.06360578536987305, 0.13992653787136078, 0.10077957808971405, 0.21542862057685852, -0.05641112104058266, -0.3993435502052307, 0.4200454354286194, 0.07890230417251587, -0.0059384070336818695, 0.07708688080310822, -0.3086263835430145, 0.26899123191833496, 0.029980584979057312, 0.42783069610595703, -0.25086650252342224, -0.0929267555475235, -0.13024315237998962, -0.007827073335647583, -0.064748115837574, -0.2903832495212555, -0.41215890645980835, -0.11847580224275589, 0.3244851529598236, -0.4616892635822296, 0.017966236919164658, -0.08962096273899078, 0.047276318073272705, -0.4811754822731018, 0.37323710322380066, 0.11149948090314865, -0.004821173846721649, -0.44143354892730713, -0.028943998739123344, 0.07509578764438629, 0.05385219305753708, 0.3405991494655609, 0.2547428011894226, 0.15312448143959045, 0.10623720288276672, -0.014556912705302238, -0.041136734187603, -0.12890218198299408, -0.5027481913566589, -0.05007041245698929, 0.34455767273902893, 0.3150547444820404, -0.009398594498634338, 0.27651530504226685, 0.15632686018943787, -0.19497063755989075, 0.33904826641082764, 0.3271607756614685, 0.10635000467300415, -0.23678874969482422, 0.2234492003917694, -0.12828993797302246, -0.37417516112327576, -0.3007756471633911, -0.23953558504581451, -0.686646580696106, -0.35973140597343445, 0.47830578684806824, 0.28467491269111633, -0.018460843712091446, 0.12313167750835419, 0.1281808316707611, -0.06669878959655762, 0.39756372570991516, 0.20740026235580444, 0.3662636876106262, -0.2527186870574951, 0.04418405890464783, 0.03622595965862274, 0.015297655016183853, 0.47694334387779236, 0.045812442898750305, 0.3003016710281372, 0.1896970421075821, 0.17125487327575684, 0.2975001037120819, -0.21022343635559082, -0.1747041940689087, 0.043921150267124176, 0.5408065319061279, -0.22837862372398376, -0.2865350842475891, 0.508055567741394, 0.3126719892024994, -0.07067473232746124, -0.1509338766336441, -0.11125142127275467, -0.21393924951553345, 0.04931814223527908, -0.5560259222984314, -0.3782661557197571, 0.018154583871364594, 0.2081996500492096, 0.31917980313301086, -0.12528926134109497, 0.4286547303199768, -0.1458655446767807, 0.17347577214241028, -0.0038351863622665405, -0.2912942171096802, 0.06694643199443817, 0.1768633872270584, 0.4434421956539154, 0.1672224998474121, -0.13481485843658447, -0.06036804988980293, 0.031389154493808746, 0.1759146898984909, -0.19410130381584167, -0.38885390758514404, -0.1677507907152176, -0.24927562475204468, -0.1498420536518097, -0.2044699788093567, -0.03998672589659691, 0.015544937923550606, 0.030204521492123604, 0.091214120388031, -0.06428446620702744, -0.2256559431552887, 0.7753728628158569, 0.3773084878921509, -0.3974205255508423, -0.013798851519823074, 0.34406644105911255, 0.29504603147506714, -0.022431882098317146, -0.3239356279373169, 0.13448040187358856, 0.3464299142360687, 0.031223762780427933, 0.10370147228240967, 0.3147680163383484, 0.06829375773668289, 0.10053448379039764, -0.08659391850233078, 0.181051105260849, -0.11237430572509766, 0.02070191502571106, -0.5842387080192566, -0.1203804612159729 ]
https://github.com/huggingface/datasets/issues/6099
I noticed that some book data is missing, we can only get Books_v1_02 data. Is there any way we can get the Books_v1_00 and Books_v1_01? Really appreciate !!!
How do i get "amazon_us_reviews
### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data
28
How do i get "amazon_us_reviews ### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data I noticed that some book data is missing, we can only get Books_v1_02 data. Is there any way we can get the Books_v1_00 and Books_v1_01? Really appreciate !!!
[ -0.046608902513980865, -0.2530131936073303, -0.28236865997314453, 0.24994568526744843, 0.29547378420829773, 0.42686212062835693, 0.3098292648792267, 0.08909308910369873, -0.06656547635793686, 0.20722495019435883, 0.0757707953453064, 0.04079410061240196, 0.20352010428905487, 0.36819255352020264, -0.12808920443058014, -0.015228133648633957, -0.03058839589357376, 0.1239573284983635, 0.16607515513896942, -0.02353750914335251, -0.2197568267583847, 0.2661455571651459, -0.2409200370311737, 0.10528970509767532, -0.2566760778427124, -0.0399424210190773, 0.08558105677366257, 0.04719587415456772, -0.27613943815231323, -0.17340824007987976, 0.2110467106103897, 0.10930492728948593, -0.11997595429420471, 0.07641930878162384, -0.0001143941844929941, -0.16595788300037384, 0.45642510056495667, -0.10461817681789398, -0.30486860871315, -0.4516846835613251, -0.08231265097856522, -0.5119820833206177, 0.16311438381671906, -0.29125797748565674, -0.19792252779006958, -0.26448604464530945, -0.08214783668518066, -0.1355411261320114, -0.22327381372451782, 0.24390128254890442, 0.20906756818294525, -0.12646007537841797, 0.13959215581417084, -0.27932608127593994, 0.29713523387908936, 0.026435840874910355, -0.0015953704714775085, 0.09458678960800171, 0.13082757592201233, -0.1577909290790558, 0.5084865093231201, 0.19967329502105713, 0.05712705850601196, -0.19955337047576904, -0.000665285624563694, 0.057430848479270935, 0.17844925820827484, 0.021850423887372017, 0.5014781355857849, 0.13716056942939758, 1.055943489074707, -0.07293520867824554, -0.2653680741786957, 0.06742936372756958, 0.11280351132154465, -0.07435853034257889, -0.06704401969909668, 0.014857258647680283, -0.052130959928035736, -0.005734254606068134, -0.348563551902771, -0.429650217294693, -0.24217009544372559, 0.3459935188293457, -0.167547807097435, 0.25328001379966736, -0.1055661141872406, -0.020010076463222504, -0.13383150100708008, -0.09268760681152344, 0.15826763212680817, 0.24242530763149261, 0.09668897837400436, -0.2312614619731903, -0.014673411846160889, 0.06443939357995987, 0.06622758507728577, -0.0633772760629654, 0.008363507688045502, 0.3301640748977661, 0.009998183697462082, -0.03906112536787987, 0.31574785709381104, 0.2630392014980316, 0.1262226700782776, 0.21564948558807373, 0.5167378187179565, 0.05136922374367714, -0.3151858448982239, 0.15826591849327087, -0.06682279706001282, -0.339805006980896, -0.11539358645677567, 0.23684535920619965, -0.20034322142601013, -0.11856874823570251, 0.14482147991657257, -0.46070489287376404, -0.2523907721042633, 0.1912010759115219, 0.1591799557209015, -0.153117835521698, 0.04077766835689545, 0.5733794569969177, -0.19215020537376404, 0.22519034147262573, 0.00785297155380249, 0.2361792027950287, 0.0928603932261467, -0.02791166678071022, -0.36986875534057617, 0.016894444823265076, -0.07930359244346619, -0.08100322633981705, 0.0595146045088768, 0.07822342216968536, 0.6891673803329468, -0.2848670184612274, 0.3777543902397156, -0.170050710439682, -0.04897410422563553, -0.13873529434204102, -0.0031952261924743652, 0.16050510108470917, -0.009283505380153656, -0.06250829994678497, 0.2626477777957916, 0.08466943353414536, -0.12384388595819473, 0.14593079686164856, 0.006421414203941822, -0.5592910051345825, -0.16287726163864136, 0.20188061892986298, -0.11722906678915024, -0.3631448447704315, 0.09780126810073853, 0.13625207543373108, 0.12341329455375671, -0.05610119551420212, -0.12104502320289612, 0.348403662443161, -0.09328097850084305, -0.12967771291732788, -0.0623699314892292, 0.2061142772436142, -0.6102626323699951, -0.12737397849559784, -0.3735906481742859, -0.09116604179143906, 0.08266115933656693, -0.20292386412620544, -0.3644247353076935, 0.2112847864627838, -0.08643193542957306, -0.030919715762138367, 0.5579186081886292, -0.09881819784641266, -0.18848377466201782, 0.37865233421325684, -0.16550017893314362, -0.2597185969352722, 0.37510597705841064, -0.03096272237598896, -0.39519649744033813, 0.22892871499061584, 0.10965165495872498, 0.1006525456905365, 0.054438382387161255, -0.3138413727283478, 0.09364158660173416, -0.22548547387123108, 0.4538995921611786, 0.3011993169784546, 0.036155469715595245, 0.1928992122411728, 0.034736987203359604, -0.07291129231452942, 0.3057626783847809, 0.21359720826148987, -0.43028244376182556, 0.4425097703933716, 0.14904236793518066, 0.6919842958450317, 0.10330460965633392, -0.04581098258495331, -0.34222686290740967, 0.10511160641908646, -0.1490248441696167, -0.2108915150165558, 0.0039556920528411865, -0.14425775408744812, -0.6515458226203918, 0.2857949137687683, 0.20844724774360657, 0.09193789958953857, 0.0969112291932106, 0.3459562361240387, -0.1585087776184082, -0.32673490047454834, -0.3093886375427246, -0.08853413164615631, -0.0614975243806839, -0.051436007022857666, -0.46625980734825134, 0.041666679084300995, -0.05229811370372772, 0.08256286382675171, 0.18940460681915283, 0.07780620455741882, 0.37054941058158875, 0.2192426323890686, 0.14171427488327026, 0.26996520161628723, -0.011768819764256477, 0.2564478814601898, -0.0075598219409585, 0.06377843022346497, -0.17307119071483612, -0.12848198413848877, 0.1503443568944931, 0.3368998169898987, 0.22017528116703033, -0.2008117139339447, -0.16159483790397644, 0.3789355754852295, 0.17980735003948212, 0.26371991634368896, 0.046701572835445404, 0.14315545558929443, -0.0027857497334480286, -0.10504808276891708, 0.18336805701255798, -0.3179762065410614, 0.34500691294670105, -0.3331306278705597, 0.032514072954654694, -0.1191788911819458, -0.178994283080101, 0.09325960278511047, 0.3408792018890381, 0.13094362616539001, -0.027705363929271698, 0.00890052318572998, 0.18657724559307098, -0.1409607231616974, 0.0847129076719284, -0.21198952198028564, 0.37823694944381714, 0.4847404956817627, -0.0034349430352449417, -0.17341940104961395, 0.12411671131849289, -0.21227335929870605, 0.42744240164756775, 0.15115594863891602, 0.03615334630012512, 0.13158589601516724, -0.0760556310415268, -0.3720066547393799, -0.023421160876750946, -0.20289427042007446, 0.2243119776248932, 0.08997653424739838, -0.3186149597167969, -0.01002059131860733, -0.15385618805885315, -0.0042524635791778564, -0.0716930478811264, -0.20119909942150116, -0.0407315194606781, -0.3449769616127014, 0.07880949229001999, 0.08907202631235123, -0.01294628530740738, -0.04098738729953766, -0.4688127040863037, 0.20461438596248627, -0.03163595870137215, -0.412212073802948, -0.18927264213562012, -0.2538032531738281, -0.2355743944644928, 0.13130606710910797, -0.28033384680747986, 0.1872653067111969, 0.21140462160110474, 0.08119647204875946, 0.21557867527008057, -0.17271803319454193, -0.19270452857017517, -0.03166510537266731, -0.02911684475839138, 0.31177979707717896, 0.3304227292537689, 0.10053405910730362, -0.036207884550094604, -0.2211315631866455, 0.30172300338745117, 0.3925619125366211, -0.1485947072505951, 0.032892294228076935, 0.13315612077713013, -0.13684609532356262, 0.21616210043430328, -0.6567659974098206, -0.0710652619600296, -0.30770617723464966, -0.07427111268043518, 0.07459062337875366, 0.15637685358524323, 0.0728771835565567, -0.10321560502052307, 0.07663759589195251, 0.2570054531097412, 0.40304020047187805, -0.27412572503089905, -0.2635927200317383, 0.23714175820350647, -0.2321995198726654, -0.07551659643650055, -0.059956882148981094, 0.27683767676353455, -0.23361092805862427, -0.02928452007472515, -0.5025726556777954, 0.1007586121559143, -0.1564100980758667, -0.0034032389521598816, -0.1002989262342453, 0.09049947559833527, 0.31200775504112244, 0.1726859211921692, -0.26878389716148376, -0.08843936771154404, -0.415269136428833, 0.26836326718330383, -0.057314466685056686, 0.49042701721191406, -0.0956725925207138, 0.16496771574020386, -0.2182355672121048, 0.3402361273765564, -0.06816752254962921, 0.2589094936847687, 0.20547452569007874, -0.09882507473230362, 0.07936899363994598, 0.10867875814437866, -0.48592570424079895, -0.1597248911857605, 0.12649571895599365, -0.0025003552436828613, 0.3683309257030487, -0.1013534814119339, -0.2681659460067749, -0.4198586642742157, -0.030454162508249283, -0.27735599875450134, 0.08731234073638916, 0.06717845797538757, -0.22161878645420074, 0.14845307171344757, -0.02559235319495201, 0.16225436329841614, -0.030958279967308044, -0.24218688905239105, 0.060926031321287155, -0.12813475728034973, -0.2625223398208618, -0.2060159146785736, -0.3826979398727417, -0.2597464323043823, 0.1380944699048996, 0.39061620831489563, 0.06799820065498352, 0.2854999303817749, -0.08768472075462341, -0.2014341652393341, -0.03949744254350662, 0.02071472629904747, 0.7801421880722046, -0.1004631444811821, 0.0968247503042221, 0.16085636615753174, -0.08064013719558716, 0.18385985493659973, 0.012768976390361786, -0.2740534543991089, 0.261764258146286, -0.23087775707244873, 0.28181153535842896, -0.3059740364551544, 0.05973023921251297, 0.24746790528297424, 0.16340336203575134, -0.31636983156204224, -0.13664788007736206, -0.16359110176563263, -0.29165711998939514, -0.006265692412853241, -0.20682837069034576, -0.3211756646633148, 0.5385579466819763, -0.011068843305110931, 0.08664551377296448, -0.11267291009426117, -0.35841232538223267, 0.30420470237731934, -0.2256242334842682, 0.18943540751934052, -0.17817436158657074, -0.024789899587631226, 0.1293586790561676, 0.0877700001001358, 0.06638234108686447, 0.5288668870925903, 0.16273604333400726, -0.34513264894485474, -0.10254192352294922, -0.15264570713043213, 0.5010108947753906, 0.3657718896865845, -0.0521668940782547, -0.011594559997320175, 0.2530365586280823, -0.0776965469121933, 0.2638590931892395, -0.2412148118019104, 0.052196815609931946, -0.2996912896633148, -0.02931058779358864, -0.24163204431533813, 0.3887373208999634, -0.1952599138021469, 0.06068149209022522, 0.0670374259352684, -0.02905258536338806, -0.2666320502758026, 0.29115450382232666, 0.026460371911525726, 1.0886259078979492, 0.4282439351081848, -0.15513908863067627, 0.13622689247131348, 0.022604122757911682, -0.004629421979188919, -0.2543867528438568, 0.13417091965675354, -0.20001854002475739, -0.2146841585636139, -0.05018395557999611, -0.00611867755651474, 0.22534483671188354, 0.5001620054244995, -0.091916024684906, 0.2566926181316376, -0.32796257734298706, 0.06938551366329193, 0.10134828090667725, 0.21779489517211914, -0.15080469846725464, 0.07050874829292297, -0.175140842795372, 0.001554057002067566, 0.025669457390904427, -0.006412274204194546, -0.21585708856582642, 0.0913582593202591, -0.056333065032958984, -0.3098578453063965, -0.3367885947227478, 0.07487121969461441, -0.20700187981128693, 0.3352386951446533, 0.17609992623329163, -0.4708123803138733, -0.1755184829235077, 0.29957106709480286, -0.03064611181616783, 0.37888211011886597, -0.290976345539093, 0.257091224193573, 0.21782875061035156, -0.25061240792274475, -0.1456935554742813, 0.051989924162626266, 0.10254993289709091, -0.17676395177841187, -0.37625980377197266, 0.0643666684627533, -0.003596629947423935, -0.13776351511478424, -0.18571338057518005, -0.03688616678118706, -0.013829071074724197, -0.4887954592704773, -0.4311654269695282, 0.08277472853660583, 0.1645672768354416, -0.27140769362449646, 0.11573316156864166, 0.14000347256660461, -0.48844456672668457, 0.07710263878107071, 0.3068851828575134, -0.049346789717674255, -0.23446205258369446, 0.3849155604839325, 0.17911578714847565, -0.3797421455383301, 0.5771918296813965, 0.3488723635673523, -0.2561803460121155, -0.36894333362579346, 0.2293923944234848, 0.14917093515396118, -0.08308357000350952, -0.07176476716995239, 0.1869526505470276, -0.023702159523963928, -0.11207666248083115, 0.2090742290019989, 0.22121186554431915, 0.20517681539058685, 0.05381539463996887, -0.5377473831176758, 0.11520839482545853, 0.273718923330307, 0.26356714963912964, 0.21940189599990845, -0.4858613908290863, -0.41051408648490906, 0.08736831694841385, 0.22545166313648224, -0.3360357880592346, 0.10602159798145294, -0.35489773750305176, 0.18318280577659607, 0.07753761857748032, 0.16922590136528015, 0.322207510471344, 0.21963408589363098, 0.3076057434082031, -0.2599433958530426, 0.021162409335374832, -0.22849415242671967, -0.003342673182487488, 0.16980226337909698, -0.07429884374141693, 0.30677467584609985, -0.15802839398384094, -0.1126146912574768, -0.2846762537956238, 0.10343118757009506, -0.0970902144908905, 0.18975085020065308, 0.15940190851688385, 0.3295302391052246, 0.007401713635772467, 0.19890375435352325, -0.33090806007385254, 0.03783245012164116, 0.02207426354289055, 0.4073725938796997, 0.1342782974243164, -0.05717569589614868, 0.05139227211475372, -0.09158258885145187, 0.05024958401918411, -0.011394660919904709, -0.07477879524230957, -0.023838169872760773, 0.2638459801673889, -0.09181708842515945, -0.06410790234804153, 0.1841379702091217, 0.1978502869606018, 0.3232933282852173, -0.16833630204200745, 0.1612672209739685, 0.35176315903663635, 0.2191147804260254, -0.41166791319847107, -0.2516937553882599, 0.09509807825088501, -0.21596671640872955, -0.07881587743759155, 0.26722168922424316, 0.007058940827846527, 0.13658060133457184, 0.2629530429840088, -0.09604842960834503, 0.12145939469337463, -0.021206779405474663, 0.056229546666145325, 0.23656883835792542, -0.044069115072488785, -0.04384163022041321, 0.07536741346120834, 0.7385468482971191, 0.0494583323597908, 0.36206135153770447, 0.06360578536987305, 0.13992653787136078, 0.10077957808971405, 0.21542862057685852, -0.05641112104058266, -0.3993435502052307, 0.4200454354286194, 0.07890230417251587, -0.0059384070336818695, 0.07708688080310822, -0.3086263835430145, 0.26899123191833496, 0.029980584979057312, 0.42783069610595703, -0.25086650252342224, -0.0929267555475235, -0.13024315237998962, -0.007827073335647583, -0.064748115837574, -0.2903832495212555, -0.41215890645980835, -0.11847580224275589, 0.3244851529598236, -0.4616892635822296, 0.017966236919164658, -0.08962096273899078, 0.047276318073272705, -0.4811754822731018, 0.37323710322380066, 0.11149948090314865, -0.004821173846721649, -0.44143354892730713, -0.028943998739123344, 0.07509578764438629, 0.05385219305753708, 0.3405991494655609, 0.2547428011894226, 0.15312448143959045, 0.10623720288276672, -0.014556912705302238, -0.041136734187603, -0.12890218198299408, -0.5027481913566589, -0.05007041245698929, 0.34455767273902893, 0.3150547444820404, -0.009398594498634338, 0.27651530504226685, 0.15632686018943787, -0.19497063755989075, 0.33904826641082764, 0.3271607756614685, 0.10635000467300415, -0.23678874969482422, 0.2234492003917694, -0.12828993797302246, -0.37417516112327576, -0.3007756471633911, -0.23953558504581451, -0.686646580696106, -0.35973140597343445, 0.47830578684806824, 0.28467491269111633, -0.018460843712091446, 0.12313167750835419, 0.1281808316707611, -0.06669878959655762, 0.39756372570991516, 0.20740026235580444, 0.3662636876106262, -0.2527186870574951, 0.04418405890464783, 0.03622595965862274, 0.015297655016183853, 0.47694334387779236, 0.045812442898750305, 0.3003016710281372, 0.1896970421075821, 0.17125487327575684, 0.2975001037120819, -0.21022343635559082, -0.1747041940689087, 0.043921150267124176, 0.5408065319061279, -0.22837862372398376, -0.2865350842475891, 0.508055567741394, 0.3126719892024994, -0.07067473232746124, -0.1509338766336441, -0.11125142127275467, -0.21393924951553345, 0.04931814223527908, -0.5560259222984314, -0.3782661557197571, 0.018154583871364594, 0.2081996500492096, 0.31917980313301086, -0.12528926134109497, 0.4286547303199768, -0.1458655446767807, 0.17347577214241028, -0.0038351863622665405, -0.2912942171096802, 0.06694643199443817, 0.1768633872270584, 0.4434421956539154, 0.1672224998474121, -0.13481485843658447, -0.06036804988980293, 0.031389154493808746, 0.1759146898984909, -0.19410130381584167, -0.38885390758514404, -0.1677507907152176, -0.24927562475204468, -0.1498420536518097, -0.2044699788093567, -0.03998672589659691, 0.015544937923550606, 0.030204521492123604, 0.091214120388031, -0.06428446620702744, -0.2256559431552887, 0.7753728628158569, 0.3773084878921509, -0.3974205255508423, -0.013798851519823074, 0.34406644105911255, 0.29504603147506714, -0.022431882098317146, -0.3239356279373169, 0.13448040187358856, 0.3464299142360687, 0.031223762780427933, 0.10370147228240967, 0.3147680163383484, 0.06829375773668289, 0.10053448379039764, -0.08659391850233078, 0.181051105260849, -0.11237430572509766, 0.02070191502571106, -0.5842387080192566, -0.1203804612159729 ]
https://github.com/huggingface/datasets/issues/6099
@albertvillanova will this dataset be retired given the data are no longer hosted on S3? What is done in cases such as these?
How do i get "amazon_us_reviews
### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data
23
How do i get "amazon_us_reviews ### Feature request I have been trying to load 'amazon_us_dataset" but unable to do so. `amazon_us_reviews = load_dataset('amazon_us_reviews')` `print(amazon_us_reviews)` > [ValueError: Config name is missing. Please pick one among the available configs: ['Wireless_v1_00', 'Watches_v1_00', 'Video_Games_v1_00', 'Video_DVD_v1_00', 'Video_v1_00', 'Toys_v1_00', 'Tools_v1_00', 'Sports_v1_00', 'Software_v1_00', 'Shoes_v1_00', 'Pet_Products_v1_00', 'Personal_Care_Appliances_v1_00', 'PC_v1_00', 'Outdoors_v1_00', 'Office_Products_v1_00', 'Musical_Instruments_v1_00', 'Music_v1_00', 'Mobile_Electronics_v1_00', 'Mobile_Apps_v1_00', 'Major_Appliances_v1_00', 'Luggage_v1_00', 'Lawn_and_Garden_v1_00', 'Kitchen_v1_00', 'Jewelry_v1_00', 'Home_Improvement_v1_00', 'Home_Entertainment_v1_00', 'Home_v1_00', 'Health_Personal_Care_v1_00', 'Grocery_v1_00', 'Gift_Card_v1_00', 'Furniture_v1_00', 'Electronics_v1_00', 'Digital_Video_Games_v1_00', 'Digital_Video_Download_v1_00', 'Digital_Software_v1_00', 'Digital_Music_Purchase_v1_00', 'Digital_Ebook_Purchase_v1_00', 'Camera_v1_00', 'Books_v1_00', 'Beauty_v1_00', 'Baby_v1_00', 'Automotive_v1_00', 'Apparel_v1_00', 'Digital_Ebook_Purchase_v1_01', 'Books_v1_01', 'Books_v1_02'] Example of usage: `load_dataset('amazon_us_reviews', 'Wireless_v1_00')`] __________________________________________________________________________ `amazon_us_reviews = load_dataset('amazon_us_reviews', 'Watches_v1_00') print(amazon_us_reviews)` **ERROR** `Generating` train split: 0% 0/960872 [00:00<?, ? examples/s] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1692 ) -> 1693 example = self.info.features.encode_example(record) if self.info.features is not None else record 1694 writer.write(example, key) 11 frames KeyError: 'marketplace' The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1710 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1711 e = e.__context__ -> 1712 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1713 1714 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ### Motivation The dataset I'm using https://huggingface.co/datasets/amazon_us_reviews ### Your contribution What is the best way to load this data @albertvillanova will this dataset be retired given the data are no longer hosted on S3? What is done in cases such as these?
[ -0.046608902513980865, -0.2530131936073303, -0.28236865997314453, 0.24994568526744843, 0.29547378420829773, 0.42686212062835693, 0.3098292648792267, 0.08909308910369873, -0.06656547635793686, 0.20722495019435883, 0.0757707953453064, 0.04079410061240196, 0.20352010428905487, 0.36819255352020264, -0.12808920443058014, -0.015228133648633957, -0.03058839589357376, 0.1239573284983635, 0.16607515513896942, -0.02353750914335251, -0.2197568267583847, 0.2661455571651459, -0.2409200370311737, 0.10528970509767532, -0.2566760778427124, -0.0399424210190773, 0.08558105677366257, 0.04719587415456772, -0.27613943815231323, -0.17340824007987976, 0.2110467106103897, 0.10930492728948593, -0.11997595429420471, 0.07641930878162384, -0.0001143941844929941, -0.16595788300037384, 0.45642510056495667, -0.10461817681789398, -0.30486860871315, -0.4516846835613251, -0.08231265097856522, -0.5119820833206177, 0.16311438381671906, -0.29125797748565674, -0.19792252779006958, -0.26448604464530945, -0.08214783668518066, -0.1355411261320114, -0.22327381372451782, 0.24390128254890442, 0.20906756818294525, -0.12646007537841797, 0.13959215581417084, -0.27932608127593994, 0.29713523387908936, 0.026435840874910355, -0.0015953704714775085, 0.09458678960800171, 0.13082757592201233, -0.1577909290790558, 0.5084865093231201, 0.19967329502105713, 0.05712705850601196, -0.19955337047576904, -0.000665285624563694, 0.057430848479270935, 0.17844925820827484, 0.021850423887372017, 0.5014781355857849, 0.13716056942939758, 1.055943489074707, -0.07293520867824554, -0.2653680741786957, 0.06742936372756958, 0.11280351132154465, -0.07435853034257889, -0.06704401969909668, 0.014857258647680283, -0.052130959928035736, -0.005734254606068134, -0.348563551902771, -0.429650217294693, -0.24217009544372559, 0.3459935188293457, -0.167547807097435, 0.25328001379966736, -0.1055661141872406, -0.020010076463222504, -0.13383150100708008, -0.09268760681152344, 0.15826763212680817, 0.24242530763149261, 0.09668897837400436, -0.2312614619731903, -0.014673411846160889, 0.06443939357995987, 0.06622758507728577, -0.0633772760629654, 0.008363507688045502, 0.3301640748977661, 0.009998183697462082, -0.03906112536787987, 0.31574785709381104, 0.2630392014980316, 0.1262226700782776, 0.21564948558807373, 0.5167378187179565, 0.05136922374367714, -0.3151858448982239, 0.15826591849327087, -0.06682279706001282, -0.339805006980896, -0.11539358645677567, 0.23684535920619965, -0.20034322142601013, -0.11856874823570251, 0.14482147991657257, -0.46070489287376404, -0.2523907721042633, 0.1912010759115219, 0.1591799557209015, -0.153117835521698, 0.04077766835689545, 0.5733794569969177, -0.19215020537376404, 0.22519034147262573, 0.00785297155380249, 0.2361792027950287, 0.0928603932261467, -0.02791166678071022, -0.36986875534057617, 0.016894444823265076, -0.07930359244346619, -0.08100322633981705, 0.0595146045088768, 0.07822342216968536, 0.6891673803329468, -0.2848670184612274, 0.3777543902397156, -0.170050710439682, -0.04897410422563553, -0.13873529434204102, -0.0031952261924743652, 0.16050510108470917, -0.009283505380153656, -0.06250829994678497, 0.2626477777957916, 0.08466943353414536, -0.12384388595819473, 0.14593079686164856, 0.006421414203941822, -0.5592910051345825, -0.16287726163864136, 0.20188061892986298, -0.11722906678915024, -0.3631448447704315, 0.09780126810073853, 0.13625207543373108, 0.12341329455375671, -0.05610119551420212, -0.12104502320289612, 0.348403662443161, -0.09328097850084305, -0.12967771291732788, -0.0623699314892292, 0.2061142772436142, -0.6102626323699951, -0.12737397849559784, -0.3735906481742859, -0.09116604179143906, 0.08266115933656693, -0.20292386412620544, -0.3644247353076935, 0.2112847864627838, -0.08643193542957306, -0.030919715762138367, 0.5579186081886292, -0.09881819784641266, -0.18848377466201782, 0.37865233421325684, -0.16550017893314362, -0.2597185969352722, 0.37510597705841064, -0.03096272237598896, -0.39519649744033813, 0.22892871499061584, 0.10965165495872498, 0.1006525456905365, 0.054438382387161255, -0.3138413727283478, 0.09364158660173416, -0.22548547387123108, 0.4538995921611786, 0.3011993169784546, 0.036155469715595245, 0.1928992122411728, 0.034736987203359604, -0.07291129231452942, 0.3057626783847809, 0.21359720826148987, -0.43028244376182556, 0.4425097703933716, 0.14904236793518066, 0.6919842958450317, 0.10330460965633392, -0.04581098258495331, -0.34222686290740967, 0.10511160641908646, -0.1490248441696167, -0.2108915150165558, 0.0039556920528411865, -0.14425775408744812, -0.6515458226203918, 0.2857949137687683, 0.20844724774360657, 0.09193789958953857, 0.0969112291932106, 0.3459562361240387, -0.1585087776184082, -0.32673490047454834, -0.3093886375427246, -0.08853413164615631, -0.0614975243806839, -0.051436007022857666, -0.46625980734825134, 0.041666679084300995, -0.05229811370372772, 0.08256286382675171, 0.18940460681915283, 0.07780620455741882, 0.37054941058158875, 0.2192426323890686, 0.14171427488327026, 0.26996520161628723, -0.011768819764256477, 0.2564478814601898, -0.0075598219409585, 0.06377843022346497, -0.17307119071483612, -0.12848198413848877, 0.1503443568944931, 0.3368998169898987, 0.22017528116703033, -0.2008117139339447, -0.16159483790397644, 0.3789355754852295, 0.17980735003948212, 0.26371991634368896, 0.046701572835445404, 0.14315545558929443, -0.0027857497334480286, -0.10504808276891708, 0.18336805701255798, -0.3179762065410614, 0.34500691294670105, -0.3331306278705597, 0.032514072954654694, -0.1191788911819458, -0.178994283080101, 0.09325960278511047, 0.3408792018890381, 0.13094362616539001, -0.027705363929271698, 0.00890052318572998, 0.18657724559307098, -0.1409607231616974, 0.0847129076719284, -0.21198952198028564, 0.37823694944381714, 0.4847404956817627, -0.0034349430352449417, -0.17341940104961395, 0.12411671131849289, -0.21227335929870605, 0.42744240164756775, 0.15115594863891602, 0.03615334630012512, 0.13158589601516724, -0.0760556310415268, -0.3720066547393799, -0.023421160876750946, -0.20289427042007446, 0.2243119776248932, 0.08997653424739838, -0.3186149597167969, -0.01002059131860733, -0.15385618805885315, -0.0042524635791778564, -0.0716930478811264, -0.20119909942150116, -0.0407315194606781, -0.3449769616127014, 0.07880949229001999, 0.08907202631235123, -0.01294628530740738, -0.04098738729953766, -0.4688127040863037, 0.20461438596248627, -0.03163595870137215, -0.412212073802948, -0.18927264213562012, -0.2538032531738281, -0.2355743944644928, 0.13130606710910797, -0.28033384680747986, 0.1872653067111969, 0.21140462160110474, 0.08119647204875946, 0.21557867527008057, -0.17271803319454193, -0.19270452857017517, -0.03166510537266731, -0.02911684475839138, 0.31177979707717896, 0.3304227292537689, 0.10053405910730362, -0.036207884550094604, -0.2211315631866455, 0.30172300338745117, 0.3925619125366211, -0.1485947072505951, 0.032892294228076935, 0.13315612077713013, -0.13684609532356262, 0.21616210043430328, -0.6567659974098206, -0.0710652619600296, -0.30770617723464966, -0.07427111268043518, 0.07459062337875366, 0.15637685358524323, 0.0728771835565567, -0.10321560502052307, 0.07663759589195251, 0.2570054531097412, 0.40304020047187805, -0.27412572503089905, -0.2635927200317383, 0.23714175820350647, -0.2321995198726654, -0.07551659643650055, -0.059956882148981094, 0.27683767676353455, -0.23361092805862427, -0.02928452007472515, -0.5025726556777954, 0.1007586121559143, -0.1564100980758667, -0.0034032389521598816, -0.1002989262342453, 0.09049947559833527, 0.31200775504112244, 0.1726859211921692, -0.26878389716148376, -0.08843936771154404, -0.415269136428833, 0.26836326718330383, -0.057314466685056686, 0.49042701721191406, -0.0956725925207138, 0.16496771574020386, -0.2182355672121048, 0.3402361273765564, -0.06816752254962921, 0.2589094936847687, 0.20547452569007874, -0.09882507473230362, 0.07936899363994598, 0.10867875814437866, -0.48592570424079895, -0.1597248911857605, 0.12649571895599365, -0.0025003552436828613, 0.3683309257030487, -0.1013534814119339, -0.2681659460067749, -0.4198586642742157, -0.030454162508249283, -0.27735599875450134, 0.08731234073638916, 0.06717845797538757, -0.22161878645420074, 0.14845307171344757, -0.02559235319495201, 0.16225436329841614, -0.030958279967308044, -0.24218688905239105, 0.060926031321287155, -0.12813475728034973, -0.2625223398208618, -0.2060159146785736, -0.3826979398727417, -0.2597464323043823, 0.1380944699048996, 0.39061620831489563, 0.06799820065498352, 0.2854999303817749, -0.08768472075462341, -0.2014341652393341, -0.03949744254350662, 0.02071472629904747, 0.7801421880722046, -0.1004631444811821, 0.0968247503042221, 0.16085636615753174, -0.08064013719558716, 0.18385985493659973, 0.012768976390361786, -0.2740534543991089, 0.261764258146286, -0.23087775707244873, 0.28181153535842896, -0.3059740364551544, 0.05973023921251297, 0.24746790528297424, 0.16340336203575134, -0.31636983156204224, -0.13664788007736206, -0.16359110176563263, -0.29165711998939514, -0.006265692412853241, -0.20682837069034576, -0.3211756646633148, 0.5385579466819763, -0.011068843305110931, 0.08664551377296448, -0.11267291009426117, -0.35841232538223267, 0.30420470237731934, -0.2256242334842682, 0.18943540751934052, -0.17817436158657074, -0.024789899587631226, 0.1293586790561676, 0.0877700001001358, 0.06638234108686447, 0.5288668870925903, 0.16273604333400726, -0.34513264894485474, -0.10254192352294922, -0.15264570713043213, 0.5010108947753906, 0.3657718896865845, -0.0521668940782547, -0.011594559997320175, 0.2530365586280823, -0.0776965469121933, 0.2638590931892395, -0.2412148118019104, 0.052196815609931946, -0.2996912896633148, -0.02931058779358864, -0.24163204431533813, 0.3887373208999634, -0.1952599138021469, 0.06068149209022522, 0.0670374259352684, -0.02905258536338806, -0.2666320502758026, 0.29115450382232666, 0.026460371911525726, 1.0886259078979492, 0.4282439351081848, -0.15513908863067627, 0.13622689247131348, 0.022604122757911682, -0.004629421979188919, -0.2543867528438568, 0.13417091965675354, -0.20001854002475739, -0.2146841585636139, -0.05018395557999611, -0.00611867755651474, 0.22534483671188354, 0.5001620054244995, -0.091916024684906, 0.2566926181316376, -0.32796257734298706, 0.06938551366329193, 0.10134828090667725, 0.21779489517211914, -0.15080469846725464, 0.07050874829292297, -0.175140842795372, 0.001554057002067566, 0.025669457390904427, -0.006412274204194546, -0.21585708856582642, 0.0913582593202591, -0.056333065032958984, -0.3098578453063965, -0.3367885947227478, 0.07487121969461441, -0.20700187981128693, 0.3352386951446533, 0.17609992623329163, -0.4708123803138733, -0.1755184829235077, 0.29957106709480286, -0.03064611181616783, 0.37888211011886597, -0.290976345539093, 0.257091224193573, 0.21782875061035156, -0.25061240792274475, -0.1456935554742813, 0.051989924162626266, 0.10254993289709091, -0.17676395177841187, -0.37625980377197266, 0.0643666684627533, -0.003596629947423935, -0.13776351511478424, -0.18571338057518005, -0.03688616678118706, -0.013829071074724197, -0.4887954592704773, -0.4311654269695282, 0.08277472853660583, 0.1645672768354416, -0.27140769362449646, 0.11573316156864166, 0.14000347256660461, -0.48844456672668457, 0.07710263878107071, 0.3068851828575134, -0.049346789717674255, -0.23446205258369446, 0.3849155604839325, 0.17911578714847565, -0.3797421455383301, 0.5771918296813965, 0.3488723635673523, -0.2561803460121155, -0.36894333362579346, 0.2293923944234848, 0.14917093515396118, -0.08308357000350952, -0.07176476716995239, 0.1869526505470276, -0.023702159523963928, -0.11207666248083115, 0.2090742290019989, 0.22121186554431915, 0.20517681539058685, 0.05381539463996887, -0.5377473831176758, 0.11520839482545853, 0.273718923330307, 0.26356714963912964, 0.21940189599990845, -0.4858613908290863, -0.41051408648490906, 0.08736831694841385, 0.22545166313648224, -0.3360357880592346, 0.10602159798145294, -0.35489773750305176, 0.18318280577659607, 0.07753761857748032, 0.16922590136528015, 0.322207510471344, 0.21963408589363098, 0.3076057434082031, -0.2599433958530426, 0.021162409335374832, -0.22849415242671967, -0.003342673182487488, 0.16980226337909698, -0.07429884374141693, 0.30677467584609985, -0.15802839398384094, -0.1126146912574768, -0.2846762537956238, 0.10343118757009506, -0.0970902144908905, 0.18975085020065308, 0.15940190851688385, 0.3295302391052246, 0.007401713635772467, 0.19890375435352325, -0.33090806007385254, 0.03783245012164116, 0.02207426354289055, 0.4073725938796997, 0.1342782974243164, -0.05717569589614868, 0.05139227211475372, -0.09158258885145187, 0.05024958401918411, -0.011394660919904709, -0.07477879524230957, -0.023838169872760773, 0.2638459801673889, -0.09181708842515945, -0.06410790234804153, 0.1841379702091217, 0.1978502869606018, 0.3232933282852173, -0.16833630204200745, 0.1612672209739685, 0.35176315903663635, 0.2191147804260254, -0.41166791319847107, -0.2516937553882599, 0.09509807825088501, -0.21596671640872955, -0.07881587743759155, 0.26722168922424316, 0.007058940827846527, 0.13658060133457184, 0.2629530429840088, -0.09604842960834503, 0.12145939469337463, -0.021206779405474663, 0.056229546666145325, 0.23656883835792542, -0.044069115072488785, -0.04384163022041321, 0.07536741346120834, 0.7385468482971191, 0.0494583323597908, 0.36206135153770447, 0.06360578536987305, 0.13992653787136078, 0.10077957808971405, 0.21542862057685852, -0.05641112104058266, -0.3993435502052307, 0.4200454354286194, 0.07890230417251587, -0.0059384070336818695, 0.07708688080310822, -0.3086263835430145, 0.26899123191833496, 0.029980584979057312, 0.42783069610595703, -0.25086650252342224, -0.0929267555475235, -0.13024315237998962, -0.007827073335647583, -0.064748115837574, -0.2903832495212555, -0.41215890645980835, -0.11847580224275589, 0.3244851529598236, -0.4616892635822296, 0.017966236919164658, -0.08962096273899078, 0.047276318073272705, -0.4811754822731018, 0.37323710322380066, 0.11149948090314865, -0.004821173846721649, -0.44143354892730713, -0.028943998739123344, 0.07509578764438629, 0.05385219305753708, 0.3405991494655609, 0.2547428011894226, 0.15312448143959045, 0.10623720288276672, -0.014556912705302238, -0.041136734187603, -0.12890218198299408, -0.5027481913566589, -0.05007041245698929, 0.34455767273902893, 0.3150547444820404, -0.009398594498634338, 0.27651530504226685, 0.15632686018943787, -0.19497063755989075, 0.33904826641082764, 0.3271607756614685, 0.10635000467300415, -0.23678874969482422, 0.2234492003917694, -0.12828993797302246, -0.37417516112327576, -0.3007756471633911, -0.23953558504581451, -0.686646580696106, -0.35973140597343445, 0.47830578684806824, 0.28467491269111633, -0.018460843712091446, 0.12313167750835419, 0.1281808316707611, -0.06669878959655762, 0.39756372570991516, 0.20740026235580444, 0.3662636876106262, -0.2527186870574951, 0.04418405890464783, 0.03622595965862274, 0.015297655016183853, 0.47694334387779236, 0.045812442898750305, 0.3003016710281372, 0.1896970421075821, 0.17125487327575684, 0.2975001037120819, -0.21022343635559082, -0.1747041940689087, 0.043921150267124176, 0.5408065319061279, -0.22837862372398376, -0.2865350842475891, 0.508055567741394, 0.3126719892024994, -0.07067473232746124, -0.1509338766336441, -0.11125142127275467, -0.21393924951553345, 0.04931814223527908, -0.5560259222984314, -0.3782661557197571, 0.018154583871364594, 0.2081996500492096, 0.31917980313301086, -0.12528926134109497, 0.4286547303199768, -0.1458655446767807, 0.17347577214241028, -0.0038351863622665405, -0.2912942171096802, 0.06694643199443817, 0.1768633872270584, 0.4434421956539154, 0.1672224998474121, -0.13481485843658447, -0.06036804988980293, 0.031389154493808746, 0.1759146898984909, -0.19410130381584167, -0.38885390758514404, -0.1677507907152176, -0.24927562475204468, -0.1498420536518097, -0.2044699788093567, -0.03998672589659691, 0.015544937923550606, 0.030204521492123604, 0.091214120388031, -0.06428446620702744, -0.2256559431552887, 0.7753728628158569, 0.3773084878921509, -0.3974205255508423, -0.013798851519823074, 0.34406644105911255, 0.29504603147506714, -0.022431882098317146, -0.3239356279373169, 0.13448040187358856, 0.3464299142360687, 0.031223762780427933, 0.10370147228240967, 0.3147680163383484, 0.06829375773668289, 0.10053448379039764, -0.08659391850233078, 0.181051105260849, -0.11237430572509766, 0.02070191502571106, -0.5842387080192566, -0.1203804612159729 ]
https://github.com/huggingface/datasets/issues/6089
We could add a "threads" parallel backend to `datasets.parallel.parallel_backend` to support downloading with threads but note that `download_and_extract` also decompresses archives, and this is a CPU-intensive task, which is not ideal for (Python) threads (good for IO-intensive tasks).
AssertionError: daemonic processes are not allowed to have children
### Describe the bug When I load_dataset with num_proc > 0 in a deamon process, I got an error: ```python File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 564, in download_and_extract return self.extract(self.download(url_or_urls)) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 427, in download downloaded_path_or_paths = map_nested( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/py_utils.py", line 468, in map_nested mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/experimental.py", line 40, in _inner_fn return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 34, in parallel_map return _map_with_multiprocessing_pool( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 64, in _map_with_multiprocessing_pool with Pool(num_proc, initargs=initargs, initializer=initializer) as pool: ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 215, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 329, in _repopulate_pool_static w.start() File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), ^^^^^^^^^^^^^^^^^ AssertionError: daemonic processes are not allowed to have children ``` The download is io-intensive computing, may be datasets can replece the multi processing pool by a multi threading pool if in a deamon process. ### Steps to reproduce the bug 1. start a deamon process 2. run load_dataset with num_proc > 0 ### Expected behavior No error. ### Environment info Python 3.11.4 datasets latest master
38
AssertionError: daemonic processes are not allowed to have children ### Describe the bug When I load_dataset with num_proc > 0 in a deamon process, I got an error: ```python File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 564, in download_and_extract return self.extract(self.download(url_or_urls)) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 427, in download downloaded_path_or_paths = map_nested( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/py_utils.py", line 468, in map_nested mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/experimental.py", line 40, in _inner_fn return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 34, in parallel_map return _map_with_multiprocessing_pool( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 64, in _map_with_multiprocessing_pool with Pool(num_proc, initargs=initargs, initializer=initializer) as pool: ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 215, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 329, in _repopulate_pool_static w.start() File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), ^^^^^^^^^^^^^^^^^ AssertionError: daemonic processes are not allowed to have children ``` The download is io-intensive computing, may be datasets can replece the multi processing pool by a multi threading pool if in a deamon process. ### Steps to reproduce the bug 1. start a deamon process 2. run load_dataset with num_proc > 0 ### Expected behavior No error. ### Environment info Python 3.11.4 datasets latest master We could add a "threads" parallel backend to `datasets.parallel.parallel_backend` to support downloading with threads but note that `download_and_extract` also decompresses archives, and this is a CPU-intensive task, which is not ideal for (Python) threads (good for IO-intensive tasks).
[ -0.5046079158782959, -0.41358479857444763, -0.1501489281654358, 0.4784198999404907, 0.13185861706733704, -0.0063525959849357605, 0.2230970561504364, -0.05357125774025917, -0.024778857827186584, 0.07532692700624466, 0.1387217491865158, 0.24004274606704712, -0.2916397452354431, -0.12241742014884949, -0.30184826254844666, -0.07861825823783875, -0.02091187611222267, -0.11754240095615387, -0.22647902369499207, -0.01941194385290146, -0.4855174720287323, 0.2580856382846832, -0.10476341098546982, -0.03145353123545647, -0.04039518162608147, -0.44843611121177673, -0.0980900377035141, 0.8303664326667786, -0.39185214042663574, -0.5647456645965576, 0.000574648380279541, 0.09858749806880951, 0.03141603618860245, 0.9009891748428345, -0.00011535848898347467, -0.039103925228118896, 0.47987252473831177, 0.07222311943769455, -0.22917507588863373, 0.04047410935163498, -0.194169819355011, -0.053676504641771317, 0.15687939524650574, -0.1182817593216896, 0.37930452823638916, -0.04512205347418785, -0.09616204351186752, -0.4131331443786621, 0.3203524649143219, 0.2604917585849762, 0.17469455301761627, 0.23649141192436218, 0.06836263090372086, -0.2145429104566574, -0.4456835091114044, 0.0817236602306366, -0.05255287140607834, 0.7022659182548523, 0.09630315005779266, 0.043299317359924316, 0.27929043769836426, -0.23577386140823364, -0.26140764355659485, 0.06488335132598877, 0.020835507661104202, -0.3101224899291992, 0.40012186765670776, -0.5286168456077576, -0.010670630261301994, 0.2362023890018463, 0.2483222782611847, -0.2053016722202301, -0.28006309270858765, 0.13336388766765594, -0.2758296728134155, -0.426032692193985, 0.08083529770374298, 0.2632155120372772, -0.1883208453655243, 0.23991268873214722, 0.209743469953537, 0.03643446043133736, -0.04914981126785278, -0.18234969675540924, 0.017551377415657043, 0.3273869454860687, 0.19258494675159454, 0.011543549597263336, 0.09737391769886017, 0.2963278889656067, 0.032660629600286484, 0.26047641038894653, -0.09144112467765808, -0.0020391419529914856, -0.08354814350605011, 0.1160237044095993, -0.08203582465648651, -0.43092039227485657, 0.14596301317214966, 0.137043759226799, -0.19572734832763672, -0.14321017265319824, -0.05179861932992935, 0.26128262281417847, 0.04089388996362686, -0.13480806350708008, 0.05664902925491333, 0.40281450748443604, 0.1184847503900528, 0.11236368864774704, -0.017273083329200745, -0.024507887661457062, -0.17178431153297424, 0.005762066692113876, -0.025697816163301468, 0.15374958515167236, 0.3790781497955322, 0.0016459152102470398, -0.19631928205490112, 0.14626359939575195, 0.20676201581954956, 0.18369218707084656, 0.18499085307121277, 0.36337414383888245, 0.19534486532211304, 0.43399035930633545, 0.07049763947725296, 0.09979399293661118, -0.1650628298521042, 0.2677752673625946, -0.24064309895038605, 0.13831347227096558, 0.030298054218292236, 0.29226380586624146, -0.16264095902442932, 0.23572948575019836, 0.3596389591693878, 0.05761149898171425, -0.2139016091823578, -0.030977994203567505, 0.36219415068626404, -0.3815600872039795, -0.14284954965114594, 0.4691150486469269, -0.19004230201244354, -0.097208671271801, 0.24188101291656494, 0.16415081918239594, 0.12774163484573364, 0.21306192874908447, -0.07844646275043488, -0.28703445196151733, -0.3929487466812134, 0.2064145803451538, -0.15388983488082886, 0.255193829536438, -0.31242677569389343, 0.0664399266242981, 0.4429948925971985, -0.2519277036190033, 0.22149164974689484, -0.09740230441093445, -0.744114339351654, -0.23855969309806824, 0.0002993866801261902, 0.5459441542625427, -0.25871312618255615, -0.003538854420185089, -0.24778924882411957, -0.24505919218063354, 0.36456361413002014, 0.2787032127380371, 0.11514624953269958, 0.26048576831817627, -0.31085285544395447, 0.21564383804798126, -0.031283147633075714, -0.37374982237815857, -0.10036128759384155, 0.17350155115127563, -0.1887078583240509, 0.061305224895477295, 0.3367929756641388, -0.1525907814502716, 0.17825770378112793, -0.09383022040128708, 0.18643401563167572, 0.01880708709359169, 0.2092391401529312, 0.03316645324230194, -0.545901358127594, -0.206107035279274, 0.3021518290042877, -0.005090922117233276, 0.278957337141037, 0.5058115720748901, 0.13193729519844055, -0.11432047188282013, 0.2091803252696991, 0.05613954737782478, -0.13842034339904785, 0.17357027530670166, 0.2773613929748535, 0.03060876578092575, 0.027710869908332825, -0.3524700999259949, -0.0947219729423523, 0.24753421545028687, -0.28759467601776123, 0.3053937256336212, -0.02689535915851593, -0.07469838857650757, -0.10680042952299118, 0.16504891216754913, 0.015182267874479294, -0.08993223309516907, 0.17108464241027832, 0.06735321879386902, -0.1812998652458191, -0.061601053923368454, -0.15381820499897003, 0.43233543634414673, -0.20069192349910736, 0.14172253012657166, -0.10372412204742432, 0.00865938514471054, -0.18838874995708466, -0.23955892026424408, -0.10550205409526825, 0.0010148733854293823, 0.15922151505947113, 0.11520586907863617, -0.04580104723572731, 0.34247633814811707, 0.29698044061660767, 0.04851623997092247, 0.15696533024311066, -0.20893843472003937, 0.24551959335803986, 0.09076257050037384, -0.07971914857625961, 0.13193506002426147, 0.21814003586769104, -0.15871912240982056, 0.5451522469520569, -0.11503445357084274, 0.028577592223882675, 0.18136489391326904, 0.17182838916778564, -0.07661771774291992, 0.21720202267169952, -0.003008507192134857, 0.1903514564037323, 0.012611925601959229, 0.26200994849205017, 0.3306632936000824, 0.2138138711452484, -0.11851848661899567, -0.11966259032487869, -0.09230272471904755, -0.15922175347805023, 0.0907837301492691, 0.12068679928779602, -0.15487685799598694, 0.11037739366292953, 0.12904615700244904, 0.312125027179718, 0.06366650760173798, 0.7765316367149353, 0.20191289484500885, -0.04397501051425934, 0.24416962265968323, 0.037881795316934586, -0.10712635517120361, 0.21881058812141418, 0.4057520925998688, 0.3725658357143402, 0.28081074357032776, 0.1358048915863037, -0.00143350288271904, -0.4074653685092926, -0.4201224744319916, 0.07864909619092941, 0.5111542344093323, -0.41004472970962524, 0.021265633404254913, -0.0640818253159523, 0.4357772767543793, 0.21124576032161713, -0.00458667054772377, -0.03433751314878464, -0.1412442922592163, -0.19698983430862427, 0.6102403402328491, 0.03325264900922775, -0.06953442096710205, -0.3926317095756531, 0.09783503413200378, -0.060342639684677124, 0.24844929575920105, -0.4571782946586609, -0.10985769331455231, 0.06693319976329803, 0.006944134831428528, 0.4602115750312805, 0.17088910937309265, 0.4271620213985443, 0.10693421959877014, -0.4408299922943115, 0.2159024327993393, -0.1111382469534874, -0.03737466037273407, -0.05260073021054268, 0.2777974307537079, 0.18656232953071594, 0.4889628291130066, 0.02871188521385193, -0.48347121477127075, 0.12297360599040985, 0.011785976588726044, -0.2583291530609131, -0.23171842098236084, -0.014568807557225227, -0.18908846378326416, -0.3496067225933075, -0.26440003514289856, -0.5475120544433594, -0.5366697311401367, 0.34930214285850525, 0.08405511826276779, 0.28941619396209717, 0.13980259001255035, 0.057166460901498795, 0.03752782195806503, 0.2789178788661957, 0.1764357089996338, -0.18069331347942352, 0.10977831482887268, -0.1512008011341095, -0.2119734138250351, -0.10648040473461151, -0.03761850297451019, -0.10564476251602173, 0.18072283267974854, -0.1677863895893097, -0.25484538078308105, -0.4218549430370331, -0.2102896124124527, -0.033207084983587265, -0.3066955804824829, -0.35564330220222473, 0.381422758102417, 0.1750706285238266, -0.16488179564476013, -0.0015324130654335022, -0.02333822101354599, 0.15151476860046387, -0.1204669326543808, 0.035622015595436096, 0.01359274610877037, 0.49012744426727295, 0.1060660183429718, 0.20449474453926086, 0.15775924921035767, -0.082579605281353, 0.12469793856143951, -0.32692456245422363, 0.07391884922981262, 0.026980308815836906, -0.37839359045028687, 0.06559829413890839, 0.06712082028388977, -0.3000870943069458, 0.06255690008401871, -0.3010219931602478, 0.1152457520365715, -0.05586586892604828, 0.011505208909511566, -0.27104270458221436, 0.07983382046222687, -0.24933207035064697, -0.06772725284099579, 0.005798536352813244, -0.15247416496276855, -0.01401405781507492, 0.11456219851970673, 0.27717193961143494, -0.07195895910263062, 0.25380533933639526, -0.005684759467840195, -0.12298566102981567, -0.09821329265832901, 0.31434693932533264, -0.3831934630870819, 0.24003754556179047, 0.20762291550636292, 0.42202872037887573, -0.1759389042854309, 0.0398097038269043, -0.10282726585865021, -0.23141127824783325, 0.7300940752029419, -0.17631939053535461, 0.018304262310266495, 0.24201825261116028, -0.1765001118183136, -0.47764745354652405, -0.06741201877593994, -0.15229865908622742, 0.1844354271888733, 0.21277101337909698, 0.31468039751052856, -0.2901901304721832, 0.11926962435245514, 0.1295143961906433, -0.2696225941181183, 0.013116925954818726, -0.39981380105018616, -0.43894636631011963, -0.5271480679512024, -0.4468173682689667, 0.19017833471298218, -0.039160437881946564, 0.06976507604122162, -0.36103639006614685, -0.15369656682014465, -0.04128672927618027, -0.03346335515379906, 0.11834569275379181, -0.08606266975402832, 0.16827282309532166, -0.17048868536949158, 0.1613004058599472, -0.009798591956496239, 0.04548972472548485, 0.4208810031414032, 0.11789489537477493, 0.24238049983978271, -0.23181575536727905, -0.07538916915655136, 0.09220747649669647, -0.03541190177202225, 0.1172393411397934, 0.03277973085641861, 0.06001560389995575, 0.36652714014053345, 0.09532947838306427, 0.05486006289720535, 0.23304717242717743, 0.11567895859479904, -0.13205136358737946, -0.03778958320617676, -0.1542035937309265, 0.16202259063720703, 0.295207142829895, 0.07546262443065643, 0.3343898355960846, -0.6096514463424683, -0.305303156375885, -0.003894522786140442, 0.13954856991767883, 0.9121220707893372, -0.020983505994081497, -0.19106827676296234, 0.4774813652038574, -0.106157585978508, 0.03228488191962242, 0.17351102828979492, -0.21475106477737427, -0.3020585775375366, -0.07950769364833832, -0.06532444059848785, -0.10421765595674515, 0.22956107556819916, -0.17316526174545288, -0.37517789006233215, 0.051639121025800705, -0.1878538876771927, -0.11324601620435715, 0.1329846829175949, 0.29014599323272705, 0.036304228007793427, -0.09171754121780396, -0.03065032698214054, 0.09111402928829193, -0.05010395124554634, -0.2825217843055725, -0.34056541323661804, -0.17399999499320984, -0.06981874257326126, -0.2112797647714615, -0.2519398629665375, 0.047837868332862854, -0.5991790294647217, 0.3366395831108093, -0.30564624071121216, 0.022358432412147522, -0.1391679346561432, 0.04669683426618576, 0.08427239954471588, -0.012474496848881245, -0.08286876231431961, 0.029092181473970413, -0.1093907505273819, -0.01314028725028038, 0.16954806447029114, -0.054780859500169754, 0.1775301694869995, -0.22383204102516174, -0.32969528436660767, -0.1924205720424652, -0.30935657024383545, -0.1447235345840454, -0.16367006301879883, 0.26347506046295166, 0.19098490476608276, 0.1599389910697937, -0.018897444009780884, 0.1047365739941597, -0.387012243270874, -0.1996336430311203, 0.14380064606666565, 0.055626798421144485, -0.3096032440662384, 0.1935448944568634, -0.18755541741847992, -0.3747333884239197, -0.09504073113203049, 0.6572670936584473, 0.14735829830169678, -0.025582320988178253, 0.29811394214630127, 0.04362565279006958, -0.12166553735733032, -0.2738689184188843, -0.22643977403640747, -0.3012375831604004, 0.1388934999704361, 0.32308799028396606, 0.28772351145744324, -0.2202816754579544, -0.07395362854003906, -0.016885394230484962, 0.06795519590377808, 0.14387665688991547, -0.22242006659507751, -0.4624709486961365, -0.488525390625, 0.19827134907245636, -0.5827509164810181, 0.14425964653491974, 0.12463270127773285, 0.014933224767446518, -0.19607768952846527, -0.050321292132139206, -0.2844654619693756, -0.11097151041030884, -0.23528407514095306, -0.13296090066432953, 0.2222049981355667, -0.16286560893058777, -0.08300324529409409, -0.06494023650884628, 0.1774846762418747, 0.3653782308101654, -0.17029505968093872, -0.22258514165878296, -0.011240705847740173, 0.11669455468654633, 0.09151342511177063, -0.05889171361923218, -0.07504665851593018, -0.1528334617614746, -0.2658277153968811, 0.11000052094459534, -0.15295791625976562, 0.29421770572662354, -0.19467715919017792, -0.05015398561954498, 0.172083780169487, 0.4829341173171997, -0.22067563235759735, 0.422713041305542, 0.07712623476982117, -0.14351576566696167, -0.05835898965597153, 0.3281491696834564, 0.06202814728021622, -0.039663687348365784, 0.2570476830005646, -0.058588653802871704, 0.23123934864997864, 0.10392844676971436, 0.24077807366847992, -0.27090173959732056, -0.1084454357624054, -0.06904337555170059, 0.19267486035823822, 0.2859025001525879, 0.009549841284751892, 0.05614151060581207, -0.1514471173286438, 0.20079739391803741, -0.13771620392799377, -0.033608388155698776, 0.37454453110694885, -0.16782689094543457, -0.015616342425346375, 0.25251126289367676, -0.03407441824674606, -0.44169312715530396, -0.2231270670890808, 0.22115516662597656, 0.3172835111618042, -0.38447797298431396, 0.03630956634879112, -0.17100752890110016, -0.4378211498260498, 0.11139938235282898, 0.07792879641056061, 0.15880531072616577, 0.3234359920024872, 0.5661431550979614, 0.3024645447731018, 0.21562997996807098, -0.0573122538626194, -0.05705647170543671, 0.038880255073308945, -0.1640779972076416, -0.16626979410648346, 0.13669684529304504, 0.02805786393582821, 0.09609182178974152, 0.020925123244524002, 0.28420618176460266, -0.05119602382183075, -0.20819628238677979, -0.03721509501338005, -0.04812198132276535, -0.25675535202026367, 0.15105992555618286, -0.5365148782730103, 0.15028925240039825, 0.1463743895292282, -0.3577914834022522, 0.3584038317203522, -0.1478288471698761, 0.2369801551103592, 0.07208386063575745, -0.2791222929954529, -0.07801073789596558, -0.39967459440231323, 0.6140223741531372, -0.15897858142852783, -0.3779069185256958, 0.1427495777606964, 0.6060832142829895, -0.0877390056848526, -0.03927700221538544, 0.34080973267555237, 0.6808921098709106, 0.534267246723175, -0.10278037935495377, -0.11870481818914413, -0.0335853137075901, 0.035248734056949615, -0.17245522141456604, 0.2842082381248474, 0.025276966392993927, 0.4388881325721741, 0.09820462763309479, 0.15492349863052368, -0.1660832166671753, 0.0028643645346164703, 0.36129438877105713, 0.2694387137889862, -0.12067374587059021, 0.3556289076805115, -0.13597048819065094, -0.41137033700942993, 0.25702691078186035, 0.13614530861377716, -0.46327152848243713, 0.15202845633029938, 0.42092588543891907, -0.1247156411409378, 0.20774602890014648, 0.16777004301548004, 0.05487748235464096, -0.2723173201084137, 0.31484368443489075, 0.3056126534938812, -0.005052060820162296, -0.10461355745792389, 0.17520128190517426, -0.34483838081359863, 0.2518083155155182, 0.16260752081871033, -0.06968151032924652, -0.12650854885578156, 0.012586906552314758, 0.15599629282951355, 0.14421778917312622, -0.007144756615161896, -0.10354971885681152, 0.08746600896120071, 0.31394535303115845, -0.2600233852863312, 0.1562674343585968, -0.06606748700141907, -0.1259240210056305, 0.16578204929828644, -0.45290184020996094, 0.25093287229537964, -0.3748478889465332, 0.0530182346701622, 0.25912684202194214, -0.005519047379493713, -0.11725986748933792, -0.06938337534666061, 0.34282779693603516, 0.23688189685344696, 0.6181567907333374, -0.2820304334163666, 0.058511823415756226, -0.30735787749290466, -0.1531762331724167, -0.176494762301445, 0.23821085691452026, 0.1746980845928192, 0.23897354304790497, -0.16804686188697815, 0.05359891057014465, -0.11291245371103287, 0.4548916220664978, -0.04247128963470459, -0.08177699148654938, -0.3013153672218323, 0.13233605027198792, 0.09079202264547348, -0.038741178810596466, -0.22108963131904602, 0.07731030881404877, 0.1442861109972, 0.05794922262430191, -0.27123498916625977, -0.37067100405693054, 0.5982508659362793, -0.13302035629749298, -0.29420047998428345, -0.19656915962696075, 0.4296400547027588, 0.05458645522594452, 0.026379724964499474, 0.004602938890457153, -0.09056493639945984, 0.1886235475540161, -0.12179933488368988, -0.38427966833114624, 0.21194911003112793, -0.18974988162517548, -0.02005423605442047, -0.010049864649772644, -0.03525866940617561, -0.2235373705625534, -0.16856086254119873, 0.2710277736186981, 0.04564402252435684 ]
https://github.com/huggingface/datasets/issues/6089
> We could add a "threads" parallel backend to `datasets.parallel.parallel_backend` to support downloading with threads but note that `download_and_extract` also decompresses archives, and this is a CPU-intensive task, which is not ideal for (Python) threads (good for IO-intensive tasks). Great! Download takes more time than extract, multiple threads can download in parallel, which can speed up a lot.
AssertionError: daemonic processes are not allowed to have children
### Describe the bug When I load_dataset with num_proc > 0 in a deamon process, I got an error: ```python File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 564, in download_and_extract return self.extract(self.download(url_or_urls)) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 427, in download downloaded_path_or_paths = map_nested( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/py_utils.py", line 468, in map_nested mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/experimental.py", line 40, in _inner_fn return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 34, in parallel_map return _map_with_multiprocessing_pool( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 64, in _map_with_multiprocessing_pool with Pool(num_proc, initargs=initargs, initializer=initializer) as pool: ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 215, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 329, in _repopulate_pool_static w.start() File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), ^^^^^^^^^^^^^^^^^ AssertionError: daemonic processes are not allowed to have children ``` The download is io-intensive computing, may be datasets can replece the multi processing pool by a multi threading pool if in a deamon process. ### Steps to reproduce the bug 1. start a deamon process 2. run load_dataset with num_proc > 0 ### Expected behavior No error. ### Environment info Python 3.11.4 datasets latest master
58
AssertionError: daemonic processes are not allowed to have children ### Describe the bug When I load_dataset with num_proc > 0 in a deamon process, I got an error: ```python File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 564, in download_and_extract return self.extract(self.download(url_or_urls)) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/download/download_manager.py", line 427, in download downloaded_path_or_paths = map_nested( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/py_utils.py", line 468, in map_nested mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/utils/experimental.py", line 40, in _inner_fn return fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 34, in parallel_map return _map_with_multiprocessing_pool( ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/Work/datasets/src/datasets/parallel/parallel.py", line 64, in _map_with_multiprocessing_pool with Pool(num_proc, initargs=initargs, initializer=initializer) as pool: ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/context.py", line 119, in Pool return Pool(processes, initializer, initargs, maxtasksperchild, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 215, in __init__ self._repopulate_pool() ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 306, in _repopulate_pool return self._repopulate_pool_static(self._ctx, self.Process, ^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/pool.py", line 329, in _repopulate_pool_static w.start() File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), ^^^^^^^^^^^^^^^^^ AssertionError: daemonic processes are not allowed to have children ``` The download is io-intensive computing, may be datasets can replece the multi processing pool by a multi threading pool if in a deamon process. ### Steps to reproduce the bug 1. start a deamon process 2. run load_dataset with num_proc > 0 ### Expected behavior No error. ### Environment info Python 3.11.4 datasets latest master > We could add a "threads" parallel backend to `datasets.parallel.parallel_backend` to support downloading with threads but note that `download_and_extract` also decompresses archives, and this is a CPU-intensive task, which is not ideal for (Python) threads (good for IO-intensive tasks). Great! Download takes more time than extract, multiple threads can download in parallel, which can speed up a lot.
[ -0.5046079158782959, -0.41358479857444763, -0.1501489281654358, 0.4784198999404907, 0.13185861706733704, -0.0063525959849357605, 0.2230970561504364, -0.05357125774025917, -0.024778857827186584, 0.07532692700624466, 0.1387217491865158, 0.24004274606704712, -0.2916397452354431, -0.12241742014884949, -0.30184826254844666, -0.07861825823783875, -0.02091187611222267, -0.11754240095615387, -0.22647902369499207, -0.01941194385290146, -0.4855174720287323, 0.2580856382846832, -0.10476341098546982, -0.03145353123545647, -0.04039518162608147, -0.44843611121177673, -0.0980900377035141, 0.8303664326667786, -0.39185214042663574, -0.5647456645965576, 0.000574648380279541, 0.09858749806880951, 0.03141603618860245, 0.9009891748428345, -0.00011535848898347467, -0.039103925228118896, 0.47987252473831177, 0.07222311943769455, -0.22917507588863373, 0.04047410935163498, -0.194169819355011, -0.053676504641771317, 0.15687939524650574, -0.1182817593216896, 0.37930452823638916, -0.04512205347418785, -0.09616204351186752, -0.4131331443786621, 0.3203524649143219, 0.2604917585849762, 0.17469455301761627, 0.23649141192436218, 0.06836263090372086, -0.2145429104566574, -0.4456835091114044, 0.0817236602306366, -0.05255287140607834, 0.7022659182548523, 0.09630315005779266, 0.043299317359924316, 0.27929043769836426, -0.23577386140823364, -0.26140764355659485, 0.06488335132598877, 0.020835507661104202, -0.3101224899291992, 0.40012186765670776, -0.5286168456077576, -0.010670630261301994, 0.2362023890018463, 0.2483222782611847, -0.2053016722202301, -0.28006309270858765, 0.13336388766765594, -0.2758296728134155, -0.426032692193985, 0.08083529770374298, 0.2632155120372772, -0.1883208453655243, 0.23991268873214722, 0.209743469953537, 0.03643446043133736, -0.04914981126785278, -0.18234969675540924, 0.017551377415657043, 0.3273869454860687, 0.19258494675159454, 0.011543549597263336, 0.09737391769886017, 0.2963278889656067, 0.032660629600286484, 0.26047641038894653, -0.09144112467765808, -0.0020391419529914856, -0.08354814350605011, 0.1160237044095993, -0.08203582465648651, -0.43092039227485657, 0.14596301317214966, 0.137043759226799, -0.19572734832763672, -0.14321017265319824, -0.05179861932992935, 0.26128262281417847, 0.04089388996362686, -0.13480806350708008, 0.05664902925491333, 0.40281450748443604, 0.1184847503900528, 0.11236368864774704, -0.017273083329200745, -0.024507887661457062, -0.17178431153297424, 0.005762066692113876, -0.025697816163301468, 0.15374958515167236, 0.3790781497955322, 0.0016459152102470398, -0.19631928205490112, 0.14626359939575195, 0.20676201581954956, 0.18369218707084656, 0.18499085307121277, 0.36337414383888245, 0.19534486532211304, 0.43399035930633545, 0.07049763947725296, 0.09979399293661118, -0.1650628298521042, 0.2677752673625946, -0.24064309895038605, 0.13831347227096558, 0.030298054218292236, 0.29226380586624146, -0.16264095902442932, 0.23572948575019836, 0.3596389591693878, 0.05761149898171425, -0.2139016091823578, -0.030977994203567505, 0.36219415068626404, -0.3815600872039795, -0.14284954965114594, 0.4691150486469269, -0.19004230201244354, -0.097208671271801, 0.24188101291656494, 0.16415081918239594, 0.12774163484573364, 0.21306192874908447, -0.07844646275043488, -0.28703445196151733, -0.3929487466812134, 0.2064145803451538, -0.15388983488082886, 0.255193829536438, -0.31242677569389343, 0.0664399266242981, 0.4429948925971985, -0.2519277036190033, 0.22149164974689484, -0.09740230441093445, -0.744114339351654, -0.23855969309806824, 0.0002993866801261902, 0.5459441542625427, -0.25871312618255615, -0.003538854420185089, -0.24778924882411957, -0.24505919218063354, 0.36456361413002014, 0.2787032127380371, 0.11514624953269958, 0.26048576831817627, -0.31085285544395447, 0.21564383804798126, -0.031283147633075714, -0.37374982237815857, -0.10036128759384155, 0.17350155115127563, -0.1887078583240509, 0.061305224895477295, 0.3367929756641388, -0.1525907814502716, 0.17825770378112793, -0.09383022040128708, 0.18643401563167572, 0.01880708709359169, 0.2092391401529312, 0.03316645324230194, -0.545901358127594, -0.206107035279274, 0.3021518290042877, -0.005090922117233276, 0.278957337141037, 0.5058115720748901, 0.13193729519844055, -0.11432047188282013, 0.2091803252696991, 0.05613954737782478, -0.13842034339904785, 0.17357027530670166, 0.2773613929748535, 0.03060876578092575, 0.027710869908332825, -0.3524700999259949, -0.0947219729423523, 0.24753421545028687, -0.28759467601776123, 0.3053937256336212, -0.02689535915851593, -0.07469838857650757, -0.10680042952299118, 0.16504891216754913, 0.015182267874479294, -0.08993223309516907, 0.17108464241027832, 0.06735321879386902, -0.1812998652458191, -0.061601053923368454, -0.15381820499897003, 0.43233543634414673, -0.20069192349910736, 0.14172253012657166, -0.10372412204742432, 0.00865938514471054, -0.18838874995708466, -0.23955892026424408, -0.10550205409526825, 0.0010148733854293823, 0.15922151505947113, 0.11520586907863617, -0.04580104723572731, 0.34247633814811707, 0.29698044061660767, 0.04851623997092247, 0.15696533024311066, -0.20893843472003937, 0.24551959335803986, 0.09076257050037384, -0.07971914857625961, 0.13193506002426147, 0.21814003586769104, -0.15871912240982056, 0.5451522469520569, -0.11503445357084274, 0.028577592223882675, 0.18136489391326904, 0.17182838916778564, -0.07661771774291992, 0.21720202267169952, -0.003008507192134857, 0.1903514564037323, 0.012611925601959229, 0.26200994849205017, 0.3306632936000824, 0.2138138711452484, -0.11851848661899567, -0.11966259032487869, -0.09230272471904755, -0.15922175347805023, 0.0907837301492691, 0.12068679928779602, -0.15487685799598694, 0.11037739366292953, 0.12904615700244904, 0.312125027179718, 0.06366650760173798, 0.7765316367149353, 0.20191289484500885, -0.04397501051425934, 0.24416962265968323, 0.037881795316934586, -0.10712635517120361, 0.21881058812141418, 0.4057520925998688, 0.3725658357143402, 0.28081074357032776, 0.1358048915863037, -0.00143350288271904, -0.4074653685092926, -0.4201224744319916, 0.07864909619092941, 0.5111542344093323, -0.41004472970962524, 0.021265633404254913, -0.0640818253159523, 0.4357772767543793, 0.21124576032161713, -0.00458667054772377, -0.03433751314878464, -0.1412442922592163, -0.19698983430862427, 0.6102403402328491, 0.03325264900922775, -0.06953442096710205, -0.3926317095756531, 0.09783503413200378, -0.060342639684677124, 0.24844929575920105, -0.4571782946586609, -0.10985769331455231, 0.06693319976329803, 0.006944134831428528, 0.4602115750312805, 0.17088910937309265, 0.4271620213985443, 0.10693421959877014, -0.4408299922943115, 0.2159024327993393, -0.1111382469534874, -0.03737466037273407, -0.05260073021054268, 0.2777974307537079, 0.18656232953071594, 0.4889628291130066, 0.02871188521385193, -0.48347121477127075, 0.12297360599040985, 0.011785976588726044, -0.2583291530609131, -0.23171842098236084, -0.014568807557225227, -0.18908846378326416, -0.3496067225933075, -0.26440003514289856, -0.5475120544433594, -0.5366697311401367, 0.34930214285850525, 0.08405511826276779, 0.28941619396209717, 0.13980259001255035, 0.057166460901498795, 0.03752782195806503, 0.2789178788661957, 0.1764357089996338, -0.18069331347942352, 0.10977831482887268, -0.1512008011341095, -0.2119734138250351, -0.10648040473461151, -0.03761850297451019, -0.10564476251602173, 0.18072283267974854, -0.1677863895893097, -0.25484538078308105, -0.4218549430370331, -0.2102896124124527, -0.033207084983587265, -0.3066955804824829, -0.35564330220222473, 0.381422758102417, 0.1750706285238266, -0.16488179564476013, -0.0015324130654335022, -0.02333822101354599, 0.15151476860046387, -0.1204669326543808, 0.035622015595436096, 0.01359274610877037, 0.49012744426727295, 0.1060660183429718, 0.20449474453926086, 0.15775924921035767, -0.082579605281353, 0.12469793856143951, -0.32692456245422363, 0.07391884922981262, 0.026980308815836906, -0.37839359045028687, 0.06559829413890839, 0.06712082028388977, -0.3000870943069458, 0.06255690008401871, -0.3010219931602478, 0.1152457520365715, -0.05586586892604828, 0.011505208909511566, -0.27104270458221436, 0.07983382046222687, -0.24933207035064697, -0.06772725284099579, 0.005798536352813244, -0.15247416496276855, -0.01401405781507492, 0.11456219851970673, 0.27717193961143494, -0.07195895910263062, 0.25380533933639526, -0.005684759467840195, -0.12298566102981567, -0.09821329265832901, 0.31434693932533264, -0.3831934630870819, 0.24003754556179047, 0.20762291550636292, 0.42202872037887573, -0.1759389042854309, 0.0398097038269043, -0.10282726585865021, -0.23141127824783325, 0.7300940752029419, -0.17631939053535461, 0.018304262310266495, 0.24201825261116028, -0.1765001118183136, -0.47764745354652405, -0.06741201877593994, -0.15229865908622742, 0.1844354271888733, 0.21277101337909698, 0.31468039751052856, -0.2901901304721832, 0.11926962435245514, 0.1295143961906433, -0.2696225941181183, 0.013116925954818726, -0.39981380105018616, -0.43894636631011963, -0.5271480679512024, -0.4468173682689667, 0.19017833471298218, -0.039160437881946564, 0.06976507604122162, -0.36103639006614685, -0.15369656682014465, -0.04128672927618027, -0.03346335515379906, 0.11834569275379181, -0.08606266975402832, 0.16827282309532166, -0.17048868536949158, 0.1613004058599472, -0.009798591956496239, 0.04548972472548485, 0.4208810031414032, 0.11789489537477493, 0.24238049983978271, -0.23181575536727905, -0.07538916915655136, 0.09220747649669647, -0.03541190177202225, 0.1172393411397934, 0.03277973085641861, 0.06001560389995575, 0.36652714014053345, 0.09532947838306427, 0.05486006289720535, 0.23304717242717743, 0.11567895859479904, -0.13205136358737946, -0.03778958320617676, -0.1542035937309265, 0.16202259063720703, 0.295207142829895, 0.07546262443065643, 0.3343898355960846, -0.6096514463424683, -0.305303156375885, -0.003894522786140442, 0.13954856991767883, 0.9121220707893372, -0.020983505994081497, -0.19106827676296234, 0.4774813652038574, -0.106157585978508, 0.03228488191962242, 0.17351102828979492, -0.21475106477737427, -0.3020585775375366, -0.07950769364833832, -0.06532444059848785, -0.10421765595674515, 0.22956107556819916, -0.17316526174545288, -0.37517789006233215, 0.051639121025800705, -0.1878538876771927, -0.11324601620435715, 0.1329846829175949, 0.29014599323272705, 0.036304228007793427, -0.09171754121780396, -0.03065032698214054, 0.09111402928829193, -0.05010395124554634, -0.2825217843055725, -0.34056541323661804, -0.17399999499320984, -0.06981874257326126, -0.2112797647714615, -0.2519398629665375, 0.047837868332862854, -0.5991790294647217, 0.3366395831108093, -0.30564624071121216, 0.022358432412147522, -0.1391679346561432, 0.04669683426618576, 0.08427239954471588, -0.012474496848881245, -0.08286876231431961, 0.029092181473970413, -0.1093907505273819, -0.01314028725028038, 0.16954806447029114, -0.054780859500169754, 0.1775301694869995, -0.22383204102516174, -0.32969528436660767, -0.1924205720424652, -0.30935657024383545, -0.1447235345840454, -0.16367006301879883, 0.26347506046295166, 0.19098490476608276, 0.1599389910697937, -0.018897444009780884, 0.1047365739941597, -0.387012243270874, -0.1996336430311203, 0.14380064606666565, 0.055626798421144485, -0.3096032440662384, 0.1935448944568634, -0.18755541741847992, -0.3747333884239197, -0.09504073113203049, 0.6572670936584473, 0.14735829830169678, -0.025582320988178253, 0.29811394214630127, 0.04362565279006958, -0.12166553735733032, -0.2738689184188843, -0.22643977403640747, -0.3012375831604004, 0.1388934999704361, 0.32308799028396606, 0.28772351145744324, -0.2202816754579544, -0.07395362854003906, -0.016885394230484962, 0.06795519590377808, 0.14387665688991547, -0.22242006659507751, -0.4624709486961365, -0.488525390625, 0.19827134907245636, -0.5827509164810181, 0.14425964653491974, 0.12463270127773285, 0.014933224767446518, -0.19607768952846527, -0.050321292132139206, -0.2844654619693756, -0.11097151041030884, -0.23528407514095306, -0.13296090066432953, 0.2222049981355667, -0.16286560893058777, -0.08300324529409409, -0.06494023650884628, 0.1774846762418747, 0.3653782308101654, -0.17029505968093872, -0.22258514165878296, -0.011240705847740173, 0.11669455468654633, 0.09151342511177063, -0.05889171361923218, -0.07504665851593018, -0.1528334617614746, -0.2658277153968811, 0.11000052094459534, -0.15295791625976562, 0.29421770572662354, -0.19467715919017792, -0.05015398561954498, 0.172083780169487, 0.4829341173171997, -0.22067563235759735, 0.422713041305542, 0.07712623476982117, -0.14351576566696167, -0.05835898965597153, 0.3281491696834564, 0.06202814728021622, -0.039663687348365784, 0.2570476830005646, -0.058588653802871704, 0.23123934864997864, 0.10392844676971436, 0.24077807366847992, -0.27090173959732056, -0.1084454357624054, -0.06904337555170059, 0.19267486035823822, 0.2859025001525879, 0.009549841284751892, 0.05614151060581207, -0.1514471173286438, 0.20079739391803741, -0.13771620392799377, -0.033608388155698776, 0.37454453110694885, -0.16782689094543457, -0.015616342425346375, 0.25251126289367676, -0.03407441824674606, -0.44169312715530396, -0.2231270670890808, 0.22115516662597656, 0.3172835111618042, -0.38447797298431396, 0.03630956634879112, -0.17100752890110016, -0.4378211498260498, 0.11139938235282898, 0.07792879641056061, 0.15880531072616577, 0.3234359920024872, 0.5661431550979614, 0.3024645447731018, 0.21562997996807098, -0.0573122538626194, -0.05705647170543671, 0.038880255073308945, -0.1640779972076416, -0.16626979410648346, 0.13669684529304504, 0.02805786393582821, 0.09609182178974152, 0.020925123244524002, 0.28420618176460266, -0.05119602382183075, -0.20819628238677979, -0.03721509501338005, -0.04812198132276535, -0.25675535202026367, 0.15105992555618286, -0.5365148782730103, 0.15028925240039825, 0.1463743895292282, -0.3577914834022522, 0.3584038317203522, -0.1478288471698761, 0.2369801551103592, 0.07208386063575745, -0.2791222929954529, -0.07801073789596558, -0.39967459440231323, 0.6140223741531372, -0.15897858142852783, -0.3779069185256958, 0.1427495777606964, 0.6060832142829895, -0.0877390056848526, -0.03927700221538544, 0.34080973267555237, 0.6808921098709106, 0.534267246723175, -0.10278037935495377, -0.11870481818914413, -0.0335853137075901, 0.035248734056949615, -0.17245522141456604, 0.2842082381248474, 0.025276966392993927, 0.4388881325721741, 0.09820462763309479, 0.15492349863052368, -0.1660832166671753, 0.0028643645346164703, 0.36129438877105713, 0.2694387137889862, -0.12067374587059021, 0.3556289076805115, -0.13597048819065094, -0.41137033700942993, 0.25702691078186035, 0.13614530861377716, -0.46327152848243713, 0.15202845633029938, 0.42092588543891907, -0.1247156411409378, 0.20774602890014648, 0.16777004301548004, 0.05487748235464096, -0.2723173201084137, 0.31484368443489075, 0.3056126534938812, -0.005052060820162296, -0.10461355745792389, 0.17520128190517426, -0.34483838081359863, 0.2518083155155182, 0.16260752081871033, -0.06968151032924652, -0.12650854885578156, 0.012586906552314758, 0.15599629282951355, 0.14421778917312622, -0.007144756615161896, -0.10354971885681152, 0.08746600896120071, 0.31394535303115845, -0.2600233852863312, 0.1562674343585968, -0.06606748700141907, -0.1259240210056305, 0.16578204929828644, -0.45290184020996094, 0.25093287229537964, -0.3748478889465332, 0.0530182346701622, 0.25912684202194214, -0.005519047379493713, -0.11725986748933792, -0.06938337534666061, 0.34282779693603516, 0.23688189685344696, 0.6181567907333374, -0.2820304334163666, 0.058511823415756226, -0.30735787749290466, -0.1531762331724167, -0.176494762301445, 0.23821085691452026, 0.1746980845928192, 0.23897354304790497, -0.16804686188697815, 0.05359891057014465, -0.11291245371103287, 0.4548916220664978, -0.04247128963470459, -0.08177699148654938, -0.3013153672218323, 0.13233605027198792, 0.09079202264547348, -0.038741178810596466, -0.22108963131904602, 0.07731030881404877, 0.1442861109972, 0.05794922262430191, -0.27123498916625977, -0.37067100405693054, 0.5982508659362793, -0.13302035629749298, -0.29420047998428345, -0.19656915962696075, 0.4296400547027588, 0.05458645522594452, 0.026379724964499474, 0.004602938890457153, -0.09056493639945984, 0.1886235475540161, -0.12179933488368988, -0.38427966833114624, 0.21194911003112793, -0.18974988162517548, -0.02005423605442047, -0.010049864649772644, -0.03525866940617561, -0.2235373705625534, -0.16856086254119873, 0.2710277736186981, 0.04564402252435684 ]
https://github.com/huggingface/datasets/issues/6086
I'm assuming this should just cover `to_csv`, `to_parquet`, and `to_json`, right? As `to_list` and `to_dict` just return Python objects, `to_pandas` returns a `pandas.DataFrame` and `to_sql` just inserts into a SQL DB, is that right?
Support `fsspec` in `Dataset.to_<format>` methods
Supporting this should be fairly easy. Requested on the forum [here](https://discuss.huggingface.co/t/how-can-i-convert-a-loaded-dataset-in-to-a-parquet-file-and-save-it-to-the-s3/48353).
34
Support `fsspec` in `Dataset.to_<format>` methods Supporting this should be fairly easy. Requested on the forum [here](https://discuss.huggingface.co/t/how-can-i-convert-a-loaded-dataset-in-to-a-parquet-file-and-save-it-to-the-s3/48353). I'm assuming this should just cover `to_csv`, `to_parquet`, and `to_json`, right? As `to_list` and `to_dict` just return Python objects, `to_pandas` returns a `pandas.DataFrame` and `to_sql` just inserts into a SQL DB, is that right?
[ -0.228164941072464, -0.20701052248477936, -0.07345094531774521, 0.013687949627637863, 0.31308770179748535, -0.09484119713306427, -0.029511384665966034, 0.19544221460819244, -0.05052853375673294, -0.05537755787372589, -0.1205410361289978, 0.4630902111530304, 0.013808682560920715, 0.9158249497413635, 0.013949062675237656, 0.0983373373746872, 0.4865877330303192, 0.23047029972076416, -0.19432251155376434, 0.16499441862106323, -0.19849447906017303, 0.20148740708827972, 0.01325295865535736, -0.11980000138282776, 0.02930835261940956, 0.01307561807334423, -0.31987428665161133, 0.19463606178760529, -0.25918659567832947, -0.5768374800682068, 0.21066875755786896, 0.11546686291694641, 0.2224452942609787, 0.18429449200630188, -0.00011345015809638426, -0.27618080377578735, -0.02823679894208908, -0.13916678726673126, -0.29564446210861206, 0.0066026076674461365, -0.3404622972011566, -0.3424832224845886, 0.37125831842422485, -0.1456643044948578, -0.405556857585907, -0.16824844479560852, -0.06229972839355469, -0.183527410030365, 0.481076717376709, 0.5020653009414673, 0.1533304899930954, 0.06137211620807648, 0.09251144528388977, -0.11789338290691376, 0.31391993165016174, 0.27413418889045715, -0.14779970049858093, -0.18612685799598694, 0.22025960683822632, -0.010035831481218338, 0.3226391077041626, -0.08733133971691132, -0.01280132308602333, -0.07783723622560501, 0.23637057840824127, -0.11434032022953033, -0.2181340903043747, -0.3721138834953308, -0.19138690829277039, 0.04882851988077164, 0.5509034395217896, -0.34962198138237, -0.6135401129722595, -0.12159357964992523, -0.18530546128749847, -0.40243861079216003, -0.22580263018608093, -0.054553572088479996, 0.1734706163406372, 0.09084278345108032, 0.03571620211005211, -0.35871684551239014, -0.2286728471517563, -0.0318184569478035, -0.3366864323616028, -0.03823553025722504, -0.4009285867214203, -0.1827562153339386, 0.07881921529769897, -0.2826583981513977, -0.02899107150733471, -0.11423534154891968, 0.0670814961194992, -0.04350762814283371, -0.3338683843612671, -0.5811092257499695, -0.05750790983438492, 0.007134661078453064, -0.1302274465560913, 0.4432709515094757, -0.20691034197807312, 0.18535108864307404, 0.12167988717556, 0.12613949179649353, 0.23705486953258514, -0.379991739988327, 0.005591379478573799, 0.09261177480220795, 0.15535147488117218, -0.07859647274017334, 0.12679389119148254, -0.18305444717407227, 0.0524323433637619, -0.03628247231245041, -0.346253365278244, -0.041145775467157364, 0.22113025188446045, -0.40476560592651367, -0.22407209873199463, 0.06596352159976959, 0.46403834223747253, 0.14134855568408966, -0.3501630127429962, 0.29330623149871826, -0.06482188403606415, 0.43005114793777466, 0.027005635201931, 0.25180381536483765, -0.01690768450498581, -0.1550256907939911, -0.022724062204360962, 0.22509726881980896, -0.07864098995923996, -0.07704085111618042, -0.03020741418004036, -0.08496098220348358, -0.10031770914793015, 0.059252895414829254, 0.012107180431485176, 0.22680573165416718, -0.10778260231018066, 0.014588356018066406, 0.29577821493148804, 0.21587692201137543, -0.11908333003520966, -0.02371087670326233, 0.045775800943374634, -0.04370623826980591, -0.4339038133621216, -0.19667693972587585, -0.15713250637054443, -0.06230377033352852, -0.3000272214412689, 0.09213126450777054, 0.04180728644132614, -0.2757474482059479, -0.5219738483428955, 0.4358336925506592, -0.22484397888183594, -0.21888677775859833, -0.12432677298784256, -0.13480107486248016, -0.09034199267625809, -0.13685745000839233, -0.0346745140850544, 0.21338282525539398, -0.4076615869998932, 0.13452225923538208, 0.23140913248062134, -0.1425148844718933, 0.24637439846992493, 0.20122233033180237, 0.18945960700511932, -0.2424764335155487, -0.04185553640127182, 0.21204763650894165, 0.42204856872558594, -0.11149969696998596, 0.08590499311685562, 0.30236703157424927, 0.29229652881622314, -0.02295367792248726, 0.2266130894422531, -0.1412595957517624, 0.511838972568512, -0.22478124499320984, -0.09058192372322083, 0.3739795684814453, -0.20164908468723297, 0.1397637575864792, -0.08362501114606857, -0.04616262763738632, 0.30161044001579285, 0.0763034075498581, -0.15191690623760223, 0.24292899668216705, 0.26022154092788696, -0.04753177613019943, 0.021629808470606804, -0.4237886667251587, 0.030474066734313965, 0.07964801788330078, 0.4252881705760956, 0.3141804337501526, -0.18242302536964417, -0.27451953291893005, -0.3113803267478943, -0.021515443921089172, 0.12321527302265167, -0.02728595957159996, 0.03373650461435318, -0.2533732056617737, -0.05507941544055939, 0.07327183336019516, 0.10711032152175903, 0.0024186652153730392, 0.06831779330968857, 0.00846053659915924, 0.11778545379638672, -0.061407674103975296, -0.35368824005126953, 0.0018874574452638626, 0.05045276880264282, 0.22027403116226196, -0.1619633138179779, 0.1976451277732849, 0.12483479827642441, -0.20932108163833618, 0.44393011927604675, 0.25697582960128784, 0.1607709527015686, -0.2363916039466858, 0.22159746289253235, 0.20102453231811523, 0.6202337145805359, 0.05878880247473717, 0.1291954219341278, 0.4677940607070923, 0.12292612344026566, 0.044345006346702576, -0.010006237775087357, -0.0017014238983392715, 0.13876619935035706, 0.017317727208137512, -0.5469349026679993, 0.5195266604423523, 0.11494740098714828, 0.23331791162490845, 0.18646541237831116, -0.02772999182343483, 0.4472692012786865, 0.19819305837154388, -0.16923412680625916, 0.155412495136261, -0.24184373021125793, 0.22800806164741516, -0.18785084784030914, -0.0037017231807112694, -0.5660125017166138, 0.153268963098526, 0.40097567439079285, -0.17464222013950348, 0.041376374661922455, 0.2934100329875946, 0.1636972725391388, -0.3910672068595886, 0.3103451430797577, 0.08402873575687408, 0.11340244114398956, 0.3548719882965088, 0.15198536217212677, 0.0032855570316314697, -0.019064724445343018, 0.08892872929573059, 0.29412931203842163, -0.0403948538005352, 0.16706198453903198, -0.007850218564271927, 0.1940428763628006, 0.11115811765193939, -0.30326181650161743, -0.08496815711259842, -0.2620430290699005, 0.013899846002459526, -0.42629313468933105, 0.2509079873561859, -0.20050488412380219, -0.11768850684165955, 0.1263609528541565, 0.23747244477272034, -0.015146960504353046, -0.26017552614212036, -0.16007602214813232, 0.16157729923725128, -0.012132532894611359, -0.15776661038398743, -0.09982701390981674, 0.5549929141998291, 0.015311002731323242, -0.021802647039294243, -0.325803279876709, -0.14668984711170197, -0.028482090681791306, 0.11063994467258453, 0.2653578519821167, 0.08537769317626953, 0.37258413434028625, 0.02105003595352173, 0.185751274228096, -0.38911229372024536, -0.27999505400657654, 0.14804993569850922, -0.24837034940719604, 0.22245940566062927, 0.25209829211235046, 0.23070642352104187, 0.14080661535263062, 0.05351705104112625, -0.029149193316698074, -0.017578870058059692, -0.1639837920665741, 0.133146271109581, -0.2150753289461136, -0.1377788484096527, 0.08212354779243469, -0.1634952872991562, -0.2835305631160736, -0.3227236568927765, 0.4052759110927582, 0.023587405681610107, 0.04820322245359421, -0.298299640417099, 0.059968359768390656, -0.08700583130121231, -0.07689173519611359, 0.2803654372692108, -0.1601424217224121, -0.25645068287849426, 0.3290683329105377, -0.1414717584848404, -0.35513776540756226, 0.18230633437633514, 0.17051780223846436, 0.010334433987736702, 0.017544429749250412, -0.0734909176826477, -0.19295060634613037, -0.21649456024169922, -0.1425326019525528, 0.106695756316185, 0.21190109848976135, 0.4389556050300598, 0.022537443786859512, -0.13784745335578918, 0.01869167387485504, -0.20379865169525146, -0.16631758213043213, 0.37114232778549194, -0.10868644714355469, 0.019488103687763214, 0.4686545431613922, 0.06683774292469025, 0.3446493446826935, 0.1768229752779007, -0.12502244114875793, 0.42906123399734497, -0.11882961541414261, 0.3437013626098633, -0.11599660664796829, 0.07372694462537766, 0.02357916533946991, -0.5015184283256531, 0.038152121007442474, 0.1222195029258728, -0.06925619393587112, -0.00862867385149002, -0.10104953497648239, 0.26218098402023315, -0.42148834466934204, -0.0838342159986496, -0.05490903556346893, -0.19067715108394623, 0.16535378992557526, -0.15677186846733093, -0.10332247614860535, 0.20452618598937988, 0.24198400974273682, 0.18590283393859863, 0.21234187483787537, 0.348908394575119, -0.11494004726409912, -0.4409264624118805, -0.19128653407096863, -0.542165219783783, 0.28788140416145325, -0.0736166462302208, 0.2211919128894806, -0.10935503989458084, -0.12380550801753998, -0.0396842360496521, -0.3292542099952698, 0.69524747133255, -0.19507336616516113, -0.3397463858127594, 0.23231913149356842, -0.3577585220336914, -0.4083945155143738, 0.13667307794094086, -0.3854878842830658, -0.04594241827726364, -0.07375688850879669, 0.4325343072414398, -0.46387097239494324, -0.3184677064418793, -0.020380156114697456, -0.0928381010890007, -0.010349638760089874, 0.41187986731529236, -0.010068371891975403, -0.07515633851289749, -0.37517422437667847, 0.2189832627773285, 0.10427525639533997, -0.00848327949643135, -0.13521434366703033, -0.08096460998058319, -0.3853592872619629, 0.003937743604183197, 0.23656722903251648, 0.08632107079029083, 0.1613542139530182, 0.06493721902370453, -0.06560782343149185, -0.10471753776073456, 0.2937302887439728, 0.2707139253616333, 0.37513619661331177, -0.20018017292022705, -0.5464004874229431, 0.14741861820220947, 0.29155951738357544, 0.6233012676239014, 0.13870878517627716, 0.10539146512746811, 0.10185620188713074, -0.3764974772930145, 0.05117541551589966, -0.4685989320278168, 0.08035217225551605, 0.3016201853752136, 0.08398821949958801, -0.21333128213882446, -0.3346104621887207, 0.2773580551147461, -0.023870553821325302, 0.03684613108634949, -0.27162498235702515, 0.4853367209434509, -0.0903497189283371, 0.5561615824699402, 0.2482842057943344, 0.8483758568763733, -0.2538062334060669, 0.5087741613388062, 0.24230478703975677, -0.4728052616119385, 0.5475928783416748, -0.39919424057006836, -0.18754799664020538, -0.19021733105182648, 0.10511501133441925, -0.13557758927345276, 0.009813524782657623, 0.24494080245494843, 0.18849030137062073, -0.21454653143882751, 0.41316092014312744, 0.07801514863967896, -0.2008308619260788, 0.008181396871805191, 0.2882804870605469, 0.10939284414052963, -0.3175952732563019, -0.782730758190155, 0.2161288559436798, 0.027900438755750656, -0.42818647623062134, -0.07572402060031891, -0.22423310577869415, 0.07637807726860046, 0.18903523683547974, -0.08622480928897858, 0.21950243413448334, 0.12529286742210388, -0.09316974878311157, -0.037681132555007935, -0.18327023088932037, 0.24285688996315002, 0.20026320219039917, 0.1374933421611786, 0.10919517278671265, -0.1641480177640915, -0.2502998411655426, -0.0630340576171875, 0.2166227400302887, -0.05880839377641678, -0.1452213078737259, 0.3445747494697571, -0.05440274253487587, 0.32254672050476074, 0.1405825912952423, -0.01606372743844986, -0.23526160418987274, 0.37759947776794434, -0.13639545440673828, 0.2827197313308716, -0.3775920569896698, -0.356625497341156, 0.04993376508355141, -0.03890777379274368, -0.2231723666191101, 0.13086549937725067, 0.09451838582754135, -0.11471746861934662, 0.2749127149581909, -0.07679429650306702, 0.026750653982162476, -0.12595294415950775, 0.17046210169792175, -0.3901921808719635, 0.0013213381171226501, 0.11117500066757202, 0.19793832302093506, -0.4773187041282654, -0.2261144071817398, 0.0979938954114914, 0.18577490746974945, 0.17631110548973083, 0.22769831120967865, -0.019760653376579285, -0.18857812881469727, 0.0740557610988617, 0.30842405557632446, 0.10044054687023163, -0.3676566779613495, 0.028194792568683624, -0.1961325854063034, -0.035237111151218414, 0.016896972432732582, 0.1078544408082962, 0.4217454791069031, 0.3043912351131439, -0.10230323672294617, -0.32875096797943115, -0.20373684167861938, -0.2937956750392914, 0.0943397581577301, -0.04529346898198128, 0.2943788170814514, 0.43390950560569763, -0.0022067963145673275, -0.050143446773290634, -0.14773957431316376, 0.0689401850104332, 0.05776805430650711, -0.06959488987922668, -0.25957074761390686, -0.03364255279302597, 0.14413690567016602, 0.29105445742607117, -0.07392795383930206, 0.03753197193145752, 0.1450916826725006, -0.40281039476394653, -0.3182453513145447, -0.04177685081958771, 0.20368357002735138, -0.24189840257167816, 0.21551787853240967, 0.2685213088989258, -0.15126559138298035, 0.10364152491092682, 0.014619611203670502, 0.20404385030269623, 0.17833644151687622, -0.05852307751774788, 0.2764416038990021, -0.27477172017097473, -0.1690765917301178, 0.3016064167022705, 0.6260992288589478, 0.4903283417224884, -0.09698193520307541, 0.3716449737548828, -0.11221453547477722, -0.26786696910858154, 0.24433764815330505, 0.4754734933376312, 0.3384169638156891, -0.015317458659410477, 0.2737291157245636, 0.27634721994400024, 0.18439581990242004, -0.11761607229709625, -0.17914730310440063, 0.06581908464431763, -0.06527694314718246, -0.015137746930122375, 0.05397447198629379, 0.1703660786151886, 0.08138391375541687, 0.0396842323243618, -0.003764662891626358, -0.06551983207464218, 0.12820354104042053, 0.0773598849773407, -0.0379205122590065, 0.06741318851709366, 0.07909596711397171, 0.3462889790534973, 0.13287284970283508, 0.06650955975055695, 0.3468479514122009, 0.3301713168621063, 0.3302367627620697, 0.10569307953119278, 0.2820920944213867, 0.11755312979221344, -0.31991201639175415, 0.36349159479141235, -0.17716428637504578, 0.27971145510673523, 0.19305665791034698, 0.19686198234558105, -0.0008894540369510651, 0.12648694217205048, -0.42298173904418945, -0.040428198873996735, 0.44685009121894836, -0.08327224850654602, -0.2860628664493561, 0.3515061140060425, -0.04985135793685913, 0.16347134113311768, 0.17240984737873077, -0.3394833505153656, -0.3429219126701355, -0.014671489596366882, 0.07574810087680817, 0.5078291893005371, -0.1359250545501709, 0.042567163705825806, -0.1710084080696106, 0.2088959664106369, -0.05173636972904205, 0.20362257957458496, -0.1312393993139267, -0.1843736320734024, -0.00749522028490901, 0.026462724432349205, 0.436038613319397, 0.06150414049625397, -0.23173561692237854, 0.06912349164485931, -0.1254805326461792, -0.2055981159210205, 0.2650258243083954, 0.0659874975681305, -0.3109821379184723, 0.22575215995311737, 0.2527085244655609, 0.16185957193374634, -0.014686334878206253, -0.32210418581962585, -0.15514808893203735, -0.18186090886592865, -0.32060497999191284, 0.05110715702176094, 0.41745102405548096, -0.08446042239665985, -0.056564658880233765, 0.19108259677886963, -0.46026611328125, -0.36110931634902954, 0.3188142776489258, -0.09475141763687134, 0.23083850741386414, 0.16922172904014587, 0.10108142346143723, 0.3210347890853882, 0.20216649770736694, -0.028078444302082062, 0.15990370512008667, -0.18838472664356232, -0.11647724360227585, -0.09563348442316055, -0.2282785326242447, 0.28872162103652954, -0.07902669906616211, 0.08290323615074158, 0.35124292969703674, 0.263188898563385, 0.20275351405143738, -0.21625985205173492, 0.3635859787464142, -0.13819006085395813, 0.41348883509635925, 0.11136654019355774, 0.08991005271673203, -0.14950306713581085, 0.07956019788980484, -0.042759016156196594, -0.16353292763233185, 0.1909133940935135, 0.09206973761320114, 0.010913297533988953, -0.1316370815038681, 0.12855252623558044, -0.09517140686511993, -0.2852775454521179, 0.12129046022891998, 0.16899743676185608, 0.26920318603515625, -0.2625320553779602, -0.11077257245779037, 0.19812193512916565, -0.09046739339828491, -0.10106183588504791, 0.3674095571041107, -0.373090922832489, 0.05232410132884979, -0.09719841182231903, 0.025578685104846954, -0.15190955996513367, -0.029927674680948257, 0.01975955069065094, -0.22732898592948914, -0.25929927825927734, 0.27657198905944824, -0.23483149707317352, -0.03373807668685913, -0.06456609815359116, 0.16219143569469452, 0.004239203408360481, 0.013316139578819275, -0.07020755112171173, 0.00710383802652359, 0.037870608270168304, -0.43149763345718384, -0.264678955078125, -0.2319442331790924, 0.12760964035987854, -0.02065354958176613, 0.08167467266321182, -0.10357709228992462, 0.01596526801586151, 0.077848419547081, -0.19559800624847412, -0.14559060335159302, 0.4582432210445404, -0.1709739714860916, -0.16100507974624634, -0.40690380334854126, 0.3190097510814667, 0.1860569268465042, 0.11381017416715622, -0.3065606951713562, -0.6174050569534302 ]
https://github.com/huggingface/datasets/issues/6079
When the process starts to hang, can you interrupt it with CTRL + C and paste the error stack trace here?
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
21
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 When the process starts to hang, can you interrupt it with CTRL + C and paste the error stack trace here?
[ -0.12034130841493607, -0.06106951832771301, -0.053946372121572495, 0.2993975579738617, -0.007555797230452299, 0.1387968510389328, 0.3968624174594879, 0.2260725498199463, -0.03234650194644928, 0.242258220911026, 0.014716260135173798, 0.3595844805240631, -0.005156952887773514, 0.1901361346244812, -0.19140933454036713, 0.01733247935771942, 0.11034326255321503, 0.19251470267772675, 0.05634687840938568, -0.13046890497207642, 0.00715889036655426, 0.05956314504146576, -0.2614611089229584, -0.24115532636642456, -0.17238542437553406, -0.10497032105922699, 0.07371783256530762, -0.04959439858794212, 0.01646514981985092, -0.37040990591049194, 0.5836642980575562, 0.14477260410785675, 0.3255665898323059, 0.7392750978469849, -0.00012864323798567057, 0.10254821181297302, 0.2484433650970459, 0.043323367834091187, -0.5669705867767334, -0.28754734992980957, 0.07709796726703644, 0.028456181287765503, 0.1667819619178772, -0.14870953559875488, 0.06501761078834534, -0.16938982903957367, -0.11232583224773407, -0.31378859281539917, 0.06704875081777573, -0.01750320941209793, -0.007366780191659927, 0.03892362117767334, -0.14582039415836334, 0.022730939090251923, 0.18154792487621307, 0.1567234843969345, 0.002543613314628601, 0.2111324965953827, 0.32345154881477356, -0.2462070882320404, -0.191472589969635, 0.03814133629202843, 0.05925503373146057, 0.03677869215607643, 0.24797771871089935, -0.21990147233009338, 0.15155114233493805, -0.1516038328409195, 0.17197579145431519, 0.05214366689324379, 0.6349732875823975, -0.20515605807304382, -0.3116730749607086, -0.1874932199716568, 0.05711343511939049, -0.20668494701385498, 0.22093775868415833, 0.23906967043876648, -0.36529669165611267, -0.06721806526184082, 0.13023218512535095, -0.017412494868040085, -0.25586819648742676, 0.06313993036746979, -0.3261018395423889, 0.4725862145423889, -0.028254076838493347, 0.21908453106880188, 0.20120033621788025, -0.05168958008289337, 0.2011706680059433, 0.1509173959493637, 0.09443975985050201, -0.009111523628234863, -0.8740895986557007, 0.16843098402023315, 0.03486405313014984, -0.09667272120714188, -0.10910207033157349, 0.09376177191734314, -0.00518389418721199, 0.06792798638343811, 0.3463149070739746, 0.19931606948375702, 0.46078774333000183, -0.2793412208557129, 0.13229261338710785, 0.0296604186296463, 0.16796666383743286, 0.15225139260292053, -0.08464504033327103, 0.004782675765454769, -0.2842980623245239, -0.2816360592842102, 0.27368631958961487, -0.26657646894454956, 0.1299048662185669, -0.4193743169307709, -0.0409078411757946, 0.2169109433889389, -0.17517469823360443, -0.11186575889587402, 0.17135494947433472, 0.55696702003479, -0.24068230390548706, 0.1996026188135147, -0.020359613001346588, 0.1709393560886383, -0.03623610734939575, 0.07730201631784439, 0.11739960312843323, -0.13908930122852325, -0.17958401143550873, -0.05887088179588318, 0.09668076038360596, -0.44938287138938904, 0.03337801992893219, 0.1328079104423523, 0.2329583466053009, -0.1427006721496582, 0.09616471081972122, -0.2332109808921814, 0.11734381318092346, 0.2087407112121582, 0.012928329408168793, 0.11991839855909348, 0.07579830288887024, -0.13006070256233215, -0.24528680741786957, -0.006963174790143967, -0.1695335954427719, -0.021311581134796143, -0.23514780402183533, 0.0092358672991395, 0.13334359228610992, -0.173694908618927, -0.21858230233192444, -0.5035789012908936, 0.16486075520515442, 0.027003802359104156, 0.0838286280632019, -0.16777174174785614, 0.025776594877243042, 0.04704800993204117, 0.08268571645021439, 0.323590487241745, -0.6584925651550293, 0.35571885108947754, 0.10101400315761566, 0.1394370049238205, 0.16109904646873474, 0.08393517136573792, -0.31496095657348633, 0.3934612572193146, -0.3266684114933014, -0.43373340368270874, 0.4498477578163147, -0.3066417872905731, -0.0933913141489029, 0.5220128297805786, 0.05565379559993744, 0.22980856895446777, 0.2792142331600189, -0.2690499722957611, 0.06662829220294952, -0.09709855914115906, 0.23711974918842316, 0.11836889386177063, -0.02522287704050541, -0.010443948209285736, -0.1513182669878006, 0.11702703684568405, 0.08666758239269257, 0.39751961827278137, 0.14236438274383545, 0.18696844577789307, -0.18376396596431732, -0.2124788463115692, 0.407500296831131, -0.11451953649520874, -0.02553272806107998, 0.5652458667755127, 0.34367242455482483, 0.4750637412071228, 0.25390422344207764, -0.030042827129364014, -0.36975693702697754, 0.289451003074646, 0.08764025568962097, -0.026698384433984756, -0.10385246574878693, 0.1454509198665619, -0.11274944990873337, 0.3891126215457916, -0.3410995900630951, -0.03433942794799805, -0.11348980665206909, 0.303203821182251, 0.05994732677936554, -0.15840047597885132, -0.30777257680892944, 0.6052002310752869, -0.05788441002368927, 0.04694601893424988, -0.3146791458129883, 0.2098647654056549, 0.16851384937763214, -0.09245425462722778, -0.013506896793842316, -0.11716113984584808, 0.10137602686882019, -0.27514562010765076, -0.1092691719532013, 0.02024599350988865, 0.12762770056724548, 0.015507388859987259, -0.10508530586957932, -0.19679594039916992, -0.005833113566040993, 0.2401440590620041, 0.08615715801715851, -0.20454612374305725, 0.10715363919734955, -0.1568717509508133, 0.20699083805084229, 0.05903984606266022, 0.013609828427433968, 0.8269122242927551, -0.08546251058578491, -0.04999523609876633, 0.22375664114952087, 0.09098594635725021, 0.003619641065597534, 0.27124348282814026, 0.3690221607685089, -0.046148866415023804, 0.8012935519218445, -0.04375027120113373, -0.3187143802642822, 0.12877383828163147, 0.12530308961868286, 0.08137001097202301, -0.35633522272109985, 0.30676594376564026, 0.06225520744919777, 0.20613721013069153, 0.17596974968910217, 0.05113483965396881, 0.13064637780189514, 0.02873413637280464, 0.03638084605336189, -0.1123049333691597, -0.08721638470888138, 0.010778635740280151, -0.1384189873933792, 0.35818901658058167, 0.5623961687088013, 0.2582297623157501, 0.017739955335855484, -0.07933598756790161, -0.05912180244922638, -0.5250719785690308, -0.042209431529045105, 0.3343014419078827, -0.08200366050004959, 0.5696794390678406, -0.3426883816719055, 0.2476876676082611, -0.1605277955532074, -0.051674168556928635, -0.2887343764305115, -0.2719356417655945, -0.40860530734062195, 0.6014853715896606, 0.04834061861038208, 0.04622139781713486, 0.03763904422521591, 0.14569127559661865, 0.23470282554626465, -0.3842180371284485, -0.47259753942489624, -0.2938692271709442, -0.3315778076648712, -0.2216637283563614, 0.4596201777458191, -0.21125970780849457, 0.14619429409503937, -0.08082951605319977, -0.19700025022029877, -0.2575029730796814, -0.2080816924571991, 0.21392178535461426, -0.10003253817558289, 0.3148452639579773, 0.18239934742450714, 0.32633498311042786, -0.02976566180586815, -0.18348750472068787, 0.013212170451879501, 0.056724414229393005, 0.06809624284505844, 0.2952183783054352, 0.020864542573690414, 0.12024226784706116, 0.26489484310150146, 0.013918755576014519, -0.09302081912755966, -0.34831735491752625, 0.29245030879974365, -0.03395248204469681, 0.027126621454954147, -0.14691375195980072, 0.1528974175453186, 0.19091257452964783, -0.06400448083877563, 0.19507509469985962, 0.05007553473114967, -0.7142705321311951, 0.27789923548698425, -0.1319390833377838, -0.1829768419265747, 0.010369643568992615, -0.009190168231725693, 0.2904219329357147, 0.24714364111423492, -0.7194733619689941, 0.27001336216926575, -0.16969582438468933, -0.09022221714258194, -0.38439279794692993, -0.04389113932847977, 0.1099371612071991, 0.0023986399173736572, 0.09334983676671982, -0.009607888758182526, -0.09471151232719421, 0.26988157629966736, -0.027497820556163788, 0.13529075682163239, 0.1361575722694397, 0.5333306789398193, -0.036823924630880356, 0.3945220708847046, 0.222113698720932, -0.02985580824315548, 0.5339845418930054, 0.22895318269729614, 0.14361192286014557, -0.02126295492053032, -0.29347437620162964, -0.15117605030536652, -0.0919705331325531, -0.31045734882354736, 0.0625469908118248, -0.22162313759326935, -0.4197782874107361, -0.2214498519897461, -0.16646867990493774, 0.01878540962934494, -0.32258692383766174, 0.2637324035167694, -0.2683745324611664, 0.17963868379592896, -0.06883274763822556, 0.13470102846622467, -0.20850908756256104, 0.1204337626695633, 0.08343705534934998, 0.09479278326034546, 0.13439902663230896, -0.030412212014198303, -0.015959233045578003, 0.03956008329987526, -0.2541280686855316, 0.07966604828834534, -0.0005665235221385956, 0.5917280912399292, 0.05961792171001434, -0.21527691185474396, 0.16404074430465698, -0.4550536870956421, 1.125809669494629, -0.08207786083221436, 0.09000056982040405, 0.15774354338645935, -0.3745869994163513, -0.2748866677284241, -0.19099721312522888, 0.02827075868844986, 0.12183068692684174, 0.13253459334373474, 0.607277512550354, -0.2740652561187744, -0.5121185779571533, 0.13615386188030243, 0.07660099864006042, -0.2056770920753479, -0.41742509603500366, -0.37202608585357666, 0.09090786427259445, -0.3091863691806793, 0.13706713914871216, -0.24465973675251007, 0.19434836506843567, 0.1007794588804245, -0.06188178434967995, -0.2981575131416321, 0.05786804109811783, -0.05033201351761818, 0.09700128436088562, 0.07742522656917572, -0.19638484716415405, 0.5088986158370972, 0.09684595465660095, 0.331574410200119, 0.41019129753112793, 0.3915003836154938, 0.1806134730577469, -0.5782785415649414, 0.3797402083873749, 0.02695966139435768, 0.5014553070068359, 0.40764105319976807, -0.010872270911931992, -0.040600135922431946, -0.19405700266361237, 0.39975011348724365, -0.29865312576293945, 0.07488451898097992, 0.27923163771629333, 0.15450900793075562, -0.5815047025680542, -0.23671594262123108, 0.276655375957489, -0.02288356050848961, 0.16622036695480347, 0.37096312642097473, -0.0020160041749477386, 0.07901789247989655, 0.4444853961467743, 0.0013898201286792755, 0.8731951117515564, -0.1627865880727768, 0.15144716203212738, 0.12780365347862244, -0.31675583124160767, 0.010410986840724945, -0.7195468544960022, -0.04380820691585541, -0.3784850835800171, -0.1713939607143402, -0.005433134734630585, -0.3956400156021118, 0.27059733867645264, 0.07684183120727539, 0.24351292848587036, 0.28964489698410034, -0.2047874927520752, -0.092256098985672, 0.09164107590913773, 0.21977294981479645, -0.2187051922082901, -0.2903854250907898, -0.23824547231197357, -0.028101200237870216, -0.05109214782714844, 0.08153534680604935, -0.18317976593971252, -0.15133151412010193, 0.09454108774662018, 0.07842791080474854, -0.12124105542898178, 0.26836317777633667, 0.2582383155822754, -0.15523827075958252, 0.1757456660270691, -0.6000233888626099, 0.15930519998073578, 0.02007295936346054, -0.002355564385652542, 0.09627901017665863, -0.08349425345659256, 0.15460573136806488, -0.06824614107608795, -0.10482020676136017, 0.08946044743061066, -0.13897445797920227, 0.4496811330318451, 0.03492581844329834, -0.16668470203876495, 0.0387309193611145, -0.21873140335083008, -0.27362948656082153, 0.213069349527359, 0.20977243781089783, 0.20484822988510132, -0.10161872208118439, 0.10912461578845978, 0.18492232263088226, -0.07658176124095917, -0.23194721341133118, -0.004559104330837727, -0.05815156549215317, -0.2877088189125061, 0.15020495653152466, -0.24478460848331451, -0.36300522089004517, -0.14807362854480743, 0.5220641493797302, -0.0652436688542366, 0.03812289237976074, 0.7059681415557861, 0.3768422305583954, -0.31777364015579224, -0.1915406733751297, -0.23352062702178955, 0.1362592577934265, -0.42050701379776, 0.060623060911893845, -0.12048207968473434, 0.1632061004638672, 0.14718925952911377, -0.07310617715120316, -0.046592116355895996, -0.5454514622688293, -0.15253527462482452, -0.42694002389907837, -0.11685146391391754, -0.15250293910503387, -0.06778745353221893, 0.07129476964473724, 0.10949644446372986, 0.023965951055288315, -0.11394543945789337, 0.15053820610046387, -0.11834955215454102, -0.0812060683965683, -0.2745702266693115, 0.04845296964049339, -0.108885757625103, -0.20559313893318176, 0.06673070788383484, 0.010266896337270737, 0.012734729796648026, 0.22485870122909546, 0.1496300995349884, -0.09064720571041107, -0.2661876380443573, 0.17253223061561584, 0.03129666671156883, 0.17291420698165894, 0.12295091897249222, -0.2844606339931488, -0.14269134402275085, -0.10017038881778717, 0.17534789443016052, -0.2679752707481384, 0.03774914890527725, -0.06560967117547989, 0.36727458238601685, 0.1861458569765091, -0.1624666452407837, 0.04072333127260208, 0.35989412665367126, -0.2354620099067688, 0.14419656991958618, 0.2526533007621765, -0.23564191162586212, 0.06655906140804291, -0.16658741235733032, 0.10504107177257538, 0.18456585705280304, 0.0564405731856823, 0.46145305037498474, -0.49786683917045593, 0.0896901935338974, -0.06681039929389954, 0.3898220360279083, 0.7883562445640564, 0.10677739977836609, -0.2808014154434204, 0.6195483803749084, -0.014959493651986122, -0.20318293571472168, -0.14993776381015778, -0.10081055760383606, 0.05276629328727722, -0.025031328201293945, 0.2111562341451645, -0.16187061369419098, -0.15043319761753082, 0.2702632248401642, 0.16402879357337952, 0.15861296653747559, -0.08816490322351456, -0.0746767520904541, 0.13951438665390015, -0.06085069477558136, 0.0003321794793009758, 0.40811553597450256, 0.5040661692619324, 0.044270094484090805, 0.3111197352409363, 0.1280306577682495, 0.08732713758945465, -0.13816598057746887, 0.14193004369735718, -0.14695720374584198, -0.5513458251953125, 0.11849304288625717, 0.2030692994594574, 0.35762304067611694, 0.013086991384625435, -0.018716681748628616, 0.29675325751304626, 0.19233588874340057, -0.3570905327796936, -0.37753909826278687, 0.21752922236919403, -0.10528400540351868, 0.1505385935306549, 0.13739916682243347, -0.17486050724983215, -0.05497711896896362, 0.15254001319408417, 0.05549914017319679, -0.21180415153503418, 0.15200871229171753, 0.17851069569587708, 0.23425893485546112, -0.4782271683216095, -0.2284621000289917, -0.0709943100810051, 0.173942431807518, -0.0970965325832367, 0.12891969084739685, -0.035184986889362335, -0.19082164764404297, -0.32790297269821167, -0.13369545340538025, 0.2679755687713623, 0.40518030524253845, -0.09313558042049408, 0.035183269530534744, -0.0854496955871582, 0.016644857823848724, -0.01693163812160492, 0.10955412685871124, -0.27324315905570984, 0.2466297149658203, 0.44219422340393066, -0.07109860330820084, 0.01732199266552925, -0.04164982587099075, 0.03980036824941635, 0.26414188742637634, -0.2831565737724304, 0.14098083972930908, 0.3457298278808594, 0.03439489006996155, 0.010662432760000229, -0.1018320843577385, -0.5850304961204529, -0.02966976910829544, 0.2981838881969452, -0.10737357288599014, 0.01218770444393158, 0.03135315328836441, 0.009797614067792892, -0.09419336915016174, 0.6142703294754028, 0.25683894753456116, 0.27848801016807556, -0.2281348705291748, -0.17703190445899963, -0.3556425869464874, -0.009600289165973663, -0.33493590354919434, -0.06779665499925613, 0.3497077226638794, 0.31605517864227295, 0.35028037428855896, 0.05757115036249161, 0.20956721901893616, -0.11045384407043457, -0.2966086268424988, 0.6280046105384827, -0.4245748519897461, -0.23322895169258118, 0.09758961200714111, 0.1222686842083931, -0.167196124792099, -0.3827921748161316, 0.15384209156036377, -0.024739611893892288, -0.0502895787358284, -0.0415147989988327, -0.293423593044281, 0.23640690743923187, -0.5849083662033081, 0.3832551836967468, -0.27024394273757935, 0.07349437475204468, 0.1619177758693695, -0.18259578943252563, -0.2629902958869934, -0.12617389857769012, 0.0500015951693058, -0.005161577835679054, -0.09311740100383759, 0.08104275166988373, -0.20207764208316803, 0.005453594960272312, -0.4061242640018463, -0.048810675740242004, -0.07444240152835846, -0.07288366556167603, -0.0316741056740284, 0.14413881301879883, 0.13890643417835236, 0.30200380086898804, 0.10253763198852539, 0.21181939542293549, 0.25517433881759644, 0.18123039603233337, -0.4533480405807495, -0.0096774622797966, 0.42406216263771057, -0.3297923505306244, -0.5895320773124695, 0.21973752975463867, 0.09519865363836288, 0.13435958325862885, -0.08594710379838943, -0.3225008249282837, 0.2055833786725998, 0.1113736554980278, -0.0437280535697937, 0.026521757245063782, 0.2053423970937729, 0.14691558480262756, 0.11015211045742035, -0.3406694233417511, 0.18107284605503082, -0.029834453016519547, -0.10084176808595657, -0.04912467300891876, -0.10315580666065216 ]
https://github.com/huggingface/datasets/issues/6079
Thanks @mariosasko for your prompt response, here's the stack trace: ``` KeyboardInterrupt Traceback (most recent call last) Cell In[12], line 4 2 t = time.time() 3 iter_ = 0 ----> 4 for batch in train_dataloader: 5 #batch_proc = streaming_obj.collect_streaming_data_batch(batch) 6 iter_ += 1 8 if iter_ == 1: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:634, in _BaseDataLoaderIter.__next__(self) 631 if self._sampler_iter is None: 632 # TODO(https://github.com/pytorch/pytorch/issues/76750) 633 self._reset() # type: ignore[call-arg] --> 634 data = self._next_data() 635 self._num_yielded += 1 636 if self._dataset_kind == _DatasetKind.Iterable and \ 637 self._IterableDataset_len_called is not None and \ 638 self._num_yielded > self._IterableDataset_len_called: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:678, in _SingleProcessDataLoaderIter._next_data(self) 676 def _next_data(self): 677 index = self._next_index() # may raise StopIteration --> 678 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 679 if self._pin_memory: 680 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py:32, in _IterableDatasetFetcher.fetch(self, possibly_batched_index) 30 for _ in possibly_batched_index: 31 try: ---> 32 data.append(next(self.dataset_iter)) 33 except StopIteration: 34 self.ended = True File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:1353, in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:956, in BufferShuffledExamplesIterable.__iter__(self) 954 # this is the shuffle buffer that we keep in memory 955 mem_buffer = [] --> 956 for x in self.ex_iterable: 957 if len(mem_buffer) == buffer_size: # if the buffer is full, pick and example from it 958 i = next(indices_iterator) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:296, in ShuffledDataSourcesArrowExamplesIterable.__iter__(self) 294 for key, pa_table in self.generate_tables_fn(**kwargs_with_shuffled_shards): 295 for pa_subtable in pa_table.to_reader(max_chunksize=config.ARROW_READER_BATCH_SIZE_IN_DATASET_ITER): --> 296 formatted_batch = formatter.format_batch(pa_subtable) 297 for example in _batch_to_examples(formatted_batch): 298 yield key, example File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/formatting.py:448, in PythonFormatter.format_batch(self, pa_table) 446 if self.lazy: 447 return LazyBatch(pa_table, self) --> 448 batch = self.python_arrow_extractor().extract_batch(pa_table) 449 batch = self.python_features_decoder.decode_batch(batch) 450 return batch File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/formatting.py:150, in PythonArrowExtractor.extract_batch(self, pa_table) 149 def extract_batch(self, pa_table: pa.Table) -> dict: --> 150 return pa_table.to_pydict() KeyboardInterrupt: ```
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
308
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 Thanks @mariosasko for your prompt response, here's the stack trace: ``` KeyboardInterrupt Traceback (most recent call last) Cell In[12], line 4 2 t = time.time() 3 iter_ = 0 ----> 4 for batch in train_dataloader: 5 #batch_proc = streaming_obj.collect_streaming_data_batch(batch) 6 iter_ += 1 8 if iter_ == 1: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:634, in _BaseDataLoaderIter.__next__(self) 631 if self._sampler_iter is None: 632 # TODO(https://github.com/pytorch/pytorch/issues/76750) 633 self._reset() # type: ignore[call-arg] --> 634 data = self._next_data() 635 self._num_yielded += 1 636 if self._dataset_kind == _DatasetKind.Iterable and \ 637 self._IterableDataset_len_called is not None and \ 638 self._num_yielded > self._IterableDataset_len_called: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:678, in _SingleProcessDataLoaderIter._next_data(self) 676 def _next_data(self): 677 index = self._next_index() # may raise StopIteration --> 678 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 679 if self._pin_memory: 680 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py:32, in _IterableDatasetFetcher.fetch(self, possibly_batched_index) 30 for _ in possibly_batched_index: 31 try: ---> 32 data.append(next(self.dataset_iter)) 33 except StopIteration: 34 self.ended = True File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:1353, in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:956, in BufferShuffledExamplesIterable.__iter__(self) 954 # this is the shuffle buffer that we keep in memory 955 mem_buffer = [] --> 956 for x in self.ex_iterable: 957 if len(mem_buffer) == buffer_size: # if the buffer is full, pick and example from it 958 i = next(indices_iterator) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:296, in ShuffledDataSourcesArrowExamplesIterable.__iter__(self) 294 for key, pa_table in self.generate_tables_fn(**kwargs_with_shuffled_shards): 295 for pa_subtable in pa_table.to_reader(max_chunksize=config.ARROW_READER_BATCH_SIZE_IN_DATASET_ITER): --> 296 formatted_batch = formatter.format_batch(pa_subtable) 297 for example in _batch_to_examples(formatted_batch): 298 yield key, example File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/formatting.py:448, in PythonFormatter.format_batch(self, pa_table) 446 if self.lazy: 447 return LazyBatch(pa_table, self) --> 448 batch = self.python_arrow_extractor().extract_batch(pa_table) 449 batch = self.python_features_decoder.decode_batch(batch) 450 return batch File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/formatting.py:150, in PythonArrowExtractor.extract_batch(self, pa_table) 149 def extract_batch(self, pa_table: pa.Table) -> dict: --> 150 return pa_table.to_pydict() KeyboardInterrupt: ```
[ -0.11611773073673248, -0.08128432929515839, -0.03265766799449921, 0.27752193808555603, 0.00524074025452137, 0.10193176567554474, 0.417864590883255, 0.2360875904560089, -0.058897536247968674, 0.2419946938753128, 0.03315392881631851, 0.31277602910995483, -0.008137278258800507, 0.1814093142747879, -0.1685175895690918, 0.007712572813034058, 0.08212465047836304, 0.2733057737350464, 0.023139989003539085, -0.13803201913833618, 0.02817615121603012, 0.05369152873754501, -0.251620888710022, -0.25488948822021484, -0.15095770359039307, -0.083498015999794, 0.06863522529602051, -0.08840617537498474, 0.017149008810520172, -0.3563286364078522, 0.5631601810455322, 0.12643302977085114, 0.3440046012401581, 0.7400310635566711, -0.00012986869842279702, 0.09923424571752548, 0.25848817825317383, -0.004994027316570282, -0.5916675329208374, -0.29735463857650757, 0.1102549359202385, 0.0233146995306015, 0.15417562425136566, -0.18132875859737396, 0.017393872141838074, -0.17647996544837952, -0.09208426624536514, -0.3477409780025482, 0.06372427195310593, 0.008700080215930939, -0.007882710546255112, 0.07851342111825943, -0.16671589016914368, 0.0849902555346489, 0.1593162566423416, 0.15857242047786713, -0.03105654940009117, 0.19904658198356628, 0.36326777935028076, -0.24817197024822235, -0.1743641048669815, 0.07502739131450653, 0.03605291247367859, 0.0362689383327961, 0.2503209710121155, -0.19048182666301727, 0.16200853884220123, -0.16349728405475616, 0.17282715439796448, 0.0321580171585083, 0.576380729675293, -0.18930897116661072, -0.30561062693595886, -0.2624892592430115, 0.015723951160907745, -0.24970102310180664, 0.1737174689769745, 0.25530529022216797, -0.36777690052986145, -0.055500950664281845, 0.1228300929069519, 0.032394085079431534, -0.260556161403656, 0.09229424595832825, -0.2985929846763611, 0.48390811681747437, -0.027491506189107895, 0.22203460335731506, 0.2220224142074585, -0.0353364497423172, 0.22887688875198364, 0.1246163547039032, 0.10886067897081375, 0.0024433881044387817, -0.8359074592590332, 0.18220019340515137, 0.0649343803524971, -0.11116482317447662, -0.139399453997612, 0.14440730214118958, 0.04706750437617302, 0.07682827115058899, 0.3921275734901428, 0.1659354269504547, 0.45649397373199463, -0.2350519895553589, 0.16655157506465912, 0.029484931379556656, 0.1410207450389862, 0.19156700372695923, -0.09261263161897659, 0.00002515828236937523, -0.26111745834350586, -0.2582271099090576, 0.3417462110519409, -0.25653091073036194, 0.174221932888031, -0.3624251186847687, -0.03207709267735481, 0.19670754671096802, -0.1977522075176239, -0.12035854160785675, 0.18159686028957367, 0.5512440800666809, -0.20047545433044434, 0.22847087681293488, -0.05482965707778931, 0.20638331770896912, -0.06314443796873093, 0.06379595398902893, 0.12243068218231201, -0.18819501996040344, -0.19782939553260803, -0.0011628121137619019, 0.13851818442344666, -0.505329430103302, 0.06378262490034103, 0.12190317362546921, 0.1879948377609253, -0.11719007790088654, 0.08797045052051544, -0.2234286367893219, 0.15916061401367188, 0.18646106123924255, 0.01432647556066513, 0.15594814717769623, 0.10245057195425034, -0.15039600431919098, -0.23053783178329468, 0.025022143498063087, -0.13999153673648834, -0.0346265509724617, -0.18607266247272491, 0.013337886892259121, 0.1170259565114975, -0.19845451414585114, -0.20555178821086884, -0.4556727409362793, 0.18413759768009186, 0.0030875876545906067, 0.11632086336612701, -0.1850341260433197, -0.0013239160180091858, 0.06870700418949127, 0.07231836020946503, 0.32849931716918945, -0.6440967321395874, 0.34119975566864014, 0.15162251889705658, 0.1821456253528595, 0.224774569272995, 0.046692151576280594, -0.3353317379951477, 0.31833499670028687, -0.32032349705696106, -0.38863155245780945, 0.45053988695144653, -0.31646057963371277, -0.14021161198616028, 0.5002281665802002, 0.020796306431293488, 0.2473781704902649, 0.300895631313324, -0.22503316402435303, 0.11888571083545685, -0.07225833088159561, 0.23669256269931793, 0.14287135004997253, -0.013143847696483135, 0.013966217637062073, -0.16741764545440674, 0.13751552999019623, 0.08023123443126678, 0.3361779451370239, 0.1634555459022522, 0.2508029639720917, -0.14139272272586823, -0.23002256453037262, 0.39751341938972473, -0.13548490405082703, -0.0019512437283992767, 0.5439561605453491, 0.4011973440647125, 0.49640953540802, 0.2572874426841736, -0.009017087519168854, -0.37251806259155273, 0.30258697271347046, 0.11992769688367844, -0.060451727360486984, -0.08988317847251892, 0.1691458523273468, -0.0985005795955658, 0.3813115954399109, -0.35957077145576477, -0.08326883614063263, -0.12331335246562958, 0.35729894042015076, 0.060433149337768555, -0.20420970022678375, -0.32425981760025024, 0.6252357959747314, -0.0578865185379982, 0.029939521104097366, -0.3437526226043701, 0.25499749183654785, 0.16000398993492126, -0.15106770396232605, -0.04123265668749809, -0.12545499205589294, 0.16623160243034363, -0.25687357783317566, -0.10198880732059479, 0.010120188817381859, 0.1521996408700943, -0.02060544118285179, -0.15628600120544434, -0.18549224734306335, 0.02464819885790348, 0.21122285723686218, 0.07596899569034576, -0.1455523818731308, 0.11191074550151825, -0.1507381945848465, 0.2354918122291565, 0.1101633831858635, 0.038344599306583405, 0.8456951379776001, -0.08274268358945847, -0.05304494872689247, 0.21539762616157532, 0.08303020894527435, -0.05268891155719757, 0.25821688771247864, 0.35642462968826294, -0.08667503297328949, 0.7751634120941162, -0.01756601780653, -0.34903955459594727, 0.17309486865997314, 0.1410953551530838, 0.09935905039310455, -0.37064555287361145, 0.2952401340007782, 0.00581933930516243, 0.17156119644641876, 0.16172005236148834, 0.13158266246318817, 0.15555837750434875, 0.033579446375370026, 0.033873602747917175, -0.11867997795343399, -0.04761578142642975, -0.005555436015129089, -0.09676700830459595, 0.35077252984046936, 0.5436466336250305, 0.2728014290332794, 0.04424615576863289, -0.07813233882188797, -0.10181615501642227, -0.49952593445777893, -0.03985317796468735, 0.3091140389442444, -0.07729412615299225, 0.6018980145454407, -0.35949239134788513, 0.22961550951004028, -0.2145083248615265, -0.08855344355106354, -0.23150312900543213, -0.26849907636642456, -0.41917163133621216, 0.6434589624404907, 0.07582880556583405, 0.061246782541275024, 0.03424139320850372, 0.13346195220947266, 0.2028745710849762, -0.4113385081291199, -0.4522911310195923, -0.2907710671424866, -0.38658714294433594, -0.23573827743530273, 0.3728357255458832, -0.2323470413684845, 0.17782165110111237, -0.07226510345935822, -0.20073790848255157, -0.3121667504310608, -0.23243173956871033, 0.17337527871131897, -0.09315168112516403, 0.3127116560935974, 0.1127057671546936, 0.33850738406181335, 0.007348246872425079, -0.22051315009593964, 0.026512552052736282, 0.00602886825799942, 0.06992465257644653, 0.33434537053108215, 0.017774127423763275, 0.13830335438251495, 0.24540558457374573, 0.02416861057281494, -0.07268708944320679, -0.3182613253593445, 0.26569151878356934, -0.02883508801460266, 0.04210679233074188, -0.0670321136713028, 0.14608952403068542, 0.1878802329301834, -0.06138889491558075, 0.17629817128181458, 0.044616568833589554, -0.6645941138267517, 0.31995996832847595, -0.10345697402954102, -0.18862733244895935, -0.0045554786920547485, -0.03651411831378937, 0.27595531940460205, 0.28683263063430786, -0.6897562742233276, 0.2246963083744049, -0.1701500564813614, -0.07751361280679703, -0.3295864462852478, -0.03315739706158638, 0.12094072997570038, -0.0036165937781333923, 0.08798421174287796, -0.021655403077602386, -0.1260921210050583, 0.2511351704597473, 0.009152449667453766, 0.15201519429683685, 0.11106809228658676, 0.5458338260650635, -0.045370589941740036, 0.4528138339519501, 0.22398032248020172, -0.07795627415180206, 0.5503473877906799, 0.17947714030742645, 0.13759565353393555, -0.0459786094725132, -0.34792622923851013, -0.15194447338581085, -0.1367286741733551, -0.2870786488056183, 0.04787006974220276, -0.24949157238006592, -0.43425676226615906, -0.23570206761360168, -0.11293267458677292, -0.019599787890911102, -0.3139548897743225, 0.29470095038414, -0.28586623072624207, 0.18071803450584412, -0.06506046652793884, 0.18601982295513153, -0.23237815499305725, 0.08958306908607483, -0.00017425790429115295, 0.07534895837306976, 0.06669526547193527, 0.014872565865516663, 0.009288854897022247, 0.021713782101869583, -0.3285016715526581, 0.08245865255594254, -0.0021512918174266815, 0.6354808807373047, 0.07290185242891312, -0.24228119850158691, 0.1755894124507904, -0.4146019220352173, 1.0636944770812988, -0.05593576282262802, 0.130202516913414, 0.14712285995483398, -0.3789628744125366, -0.28573498129844666, -0.2325277328491211, 0.014072276651859283, 0.08376263082027435, 0.11829438805580139, 0.6062554121017456, -0.2768521308898926, -0.485385000705719, 0.10394875705242157, 0.04086790978908539, -0.1937398612499237, -0.3818455636501312, -0.39984703063964844, 0.0782698392868042, -0.2786448001861572, 0.1147422194480896, -0.21767020225524902, 0.21828757226467133, 0.09853538125753403, -0.06760482490062714, -0.26090437173843384, 0.039492905139923096, -0.009164005517959595, 0.08380642533302307, 0.07839968800544739, -0.10767350345849991, 0.5010775923728943, 0.09247709810733795, 0.3527590334415436, 0.3838481903076172, 0.3932898938655853, 0.18881183862686157, -0.5857114791870117, 0.41138648986816406, 0.02778404951095581, 0.4976605176925659, 0.4398481249809265, -0.011940356343984604, -0.039366550743579865, -0.15380971133708954, 0.3901958763599396, -0.28333529829978943, 0.07466207444667816, 0.27035483717918396, 0.13070067763328552, -0.5404491424560547, -0.30153191089630127, 0.26533788442611694, -0.05519471690058708, 0.18746483325958252, 0.4024510681629181, -0.03542996570467949, 0.07024101912975311, 0.4303295314311981, -0.0033630356192588806, 0.8676892518997192, -0.16171011328697205, 0.15492375195026398, 0.17881794273853302, -0.3315957188606262, 0.01494552195072174, -0.6646170020103455, -0.01062007062137127, -0.37505847215652466, -0.14385491609573364, -0.016991592943668365, -0.3848171830177307, 0.2210802137851715, 0.03946347162127495, 0.21901844441890717, 0.3137689530849457, -0.19077718257904053, -0.040649816393852234, 0.12111596763134003, 0.1678301990032196, -0.2476370632648468, -0.28362616896629333, -0.25343626737594604, -0.04103292152285576, -0.08592365682125092, 0.12692546844482422, -0.1675034612417221, -0.1786617934703827, 0.09302248060703278, 0.04309052973985672, -0.13120701909065247, 0.28921452164649963, 0.19787153601646423, -0.16101579368114471, 0.1362239569425583, -0.6383601427078247, 0.09807485342025757, 0.030933422967791557, -0.024130478501319885, 0.02005821280181408, -0.08490023761987686, 0.11199551075696945, -0.013212122023105621, -0.07896202802658081, 0.06953813135623932, -0.18433070182800293, 0.47786685824394226, 0.050597675144672394, -0.1828330159187317, 0.04477386921644211, -0.19545306265354156, -0.2773667573928833, 0.21696728467941284, 0.23106931149959564, 0.2319304198026657, -0.05973247066140175, 0.12796270847320557, 0.18555249273777008, -0.06303276121616364, -0.2521980106830597, -0.018560469150543213, -0.10398551821708679, -0.29239901900291443, 0.11957880109548569, -0.26246151328086853, -0.3692137598991394, -0.11766080558300018, 0.5325029492378235, -0.04892003908753395, 0.04233194887638092, 0.7469028830528259, 0.354555606842041, -0.30508995056152344, -0.184121772646904, -0.22112736105918884, 0.12365484237670898, -0.4373575747013092, 0.0538279227912426, -0.11087800562381744, 0.16700345277786255, 0.1457315981388092, -0.08022399246692657, -0.061498306691646576, -0.5722084641456604, -0.19312113523483276, -0.4096689820289612, -0.09106200188398361, -0.1776331663131714, -0.09761721640825272, 0.043613187968730927, 0.10547015070915222, 0.041517551988363266, -0.07363122701644897, 0.17463579773902893, -0.11581207811832428, -0.08930719643831253, -0.22561660408973694, 0.08073122799396515, -0.10673050582408905, -0.2349439114332199, 0.05104421451687813, 0.021539565175771713, -0.002035275101661682, 0.20672264695167542, 0.13396519422531128, -0.09447703510522842, -0.29795873165130615, 0.17041705548763275, 0.04265186935663223, 0.1873149573802948, 0.07875034213066101, -0.30068808794021606, -0.1563279926776886, -0.13445815443992615, 0.17875882983207703, -0.21756447851657867, 0.051886867731809616, -0.05168880149722099, 0.4111873507499695, 0.19724810123443604, -0.15326541662216187, -0.00232792180031538, 0.30584147572517395, -0.22311818599700928, 0.15954074263572693, 0.26085710525512695, -0.21537527441978455, 0.08080175518989563, -0.22883400321006775, 0.08769277483224869, 0.1737675964832306, 0.06938833743333817, 0.43982622027397156, -0.5329623818397522, 0.08658904582262039, -0.11690768599510193, 0.360749214887619, 0.7782010436058044, 0.10353204607963562, -0.3141537606716156, 0.5704091787338257, -0.01723906584084034, -0.20264557003974915, -0.12793807685375214, -0.11951044946908951, 0.10839363932609558, -0.001969359815120697, 0.22591951489448547, -0.13612142205238342, -0.18646281957626343, 0.2641233205795288, 0.10470545291900635, 0.1587499976158142, -0.07761996984481812, -0.036519862711429596, 0.1648382693529129, -0.016330763697624207, 0.016735412180423737, 0.40498417615890503, 0.5309309363365173, 0.022064130753278732, 0.27106672525405884, 0.10340151190757751, 0.11851725727319717, -0.16761347651481628, 0.1103098914027214, -0.21706557273864746, -0.5515328645706177, 0.0853862315416336, 0.14072933793067932, 0.32735446095466614, 0.024320878088474274, 0.00433383509516716, 0.34058842062950134, 0.1455833613872528, -0.31868216395378113, -0.3623027205467224, 0.174424946308136, -0.07480165362358093, 0.12689697742462158, 0.10392323136329651, -0.15685723721981049, -0.061100974678993225, 0.15681883692741394, 0.08461735397577286, -0.1704089641571045, 0.1409766972064972, 0.1816551238298416, 0.2051773965358734, -0.5014469027519226, -0.26264750957489014, -0.01107247918844223, 0.1703682243824005, -0.09766335040330887, 0.1936773806810379, -0.05409737303853035, -0.14553074538707733, -0.3209351599216461, -0.14959418773651123, 0.2619468867778778, 0.4146534204483032, -0.06961999088525772, 0.07908105850219727, -0.07894042134284973, 0.005509957671165466, -0.010849390178918839, 0.09199824929237366, -0.24038231372833252, 0.21356815099716187, 0.428311288356781, -0.07445725798606873, 0.012594189494848251, -0.016514677554368973, 0.047288671135902405, 0.24585166573524475, -0.2801888883113861, 0.1537572294473648, 0.33773478865623474, 0.05411466956138611, -0.022924691438674927, -0.08564423024654388, -0.565762996673584, 0.03119324892759323, 0.33927464485168457, -0.10616753995418549, 0.03796108439564705, 0.0306105799973011, 0.002129875123500824, -0.07016747444868088, 0.5910800099372864, 0.23755550384521484, 0.2290952056646347, -0.23523113131523132, -0.1647045612335205, -0.39351367950439453, 0.00791124626994133, -0.3446936011314392, -0.03882325068116188, 0.3506929576396942, 0.348761647939682, 0.3791467845439911, 0.04567871242761612, 0.23020091652870178, -0.08045120537281036, -0.32985344529151917, 0.6018741130828857, -0.43902963399887085, -0.26466527581214905, 0.0835476741194725, 0.1716475784778595, -0.1608283370733261, -0.3627817630767822, 0.132939875125885, -0.03661280497908592, -0.055209625512361526, -0.026815947145223618, -0.2768933176994324, 0.21202926337718964, -0.5866448283195496, 0.37569674849510193, -0.25990593433380127, 0.07523607462644577, 0.16346965730190277, -0.13836970925331116, -0.26760244369506836, -0.11214403808116913, 0.027034297585487366, -0.07709023356437683, -0.10608375072479248, 0.08444910496473312, -0.17160677909851074, -0.03552781045436859, -0.43609777092933655, -0.0033160075545310974, -0.019083984196186066, -0.13118985295295715, -0.011808030307292938, 0.17148366570472717, 0.13071556389331818, 0.3608754873275757, 0.07363918423652649, 0.21532268822193146, 0.2291513830423355, 0.2073843628168106, -0.46075281500816345, -0.04240456596016884, 0.443501740694046, -0.3774225115776062, -0.5973460674285889, 0.21783962845802307, 0.10967651009559631, 0.16941571235656738, -0.032342325896024704, -0.3182683289051056, 0.21857567131519318, 0.11330552399158478, -0.07502514123916626, 0.0027432963252067566, 0.2143392562866211, 0.11566821485757828, 0.1423729509115219, -0.3448388874530792, 0.16903924942016602, 0.03564387559890747, -0.09665518999099731, -0.06352709978818893, -0.12159618735313416 ]
https://github.com/huggingface/datasets/issues/6079
Update: If i let it run, it eventually fails with: ``` RuntimeError Traceback (most recent call last) Cell In[16], line 4 2 t = time.time() 3 iter_ = 0 ----> 4 for batch in train_dataloader: 5 #batch_proc = streaming_obj.collect_streaming_data_batch(batch) 6 iter_ += 1 8 if iter_ == 1: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:634, in _BaseDataLoaderIter.__next__(self) 631 if self._sampler_iter is None: 632 # TODO(https://github.com/pytorch/pytorch/issues/76750) 633 self._reset() # type: ignore[call-arg] --> 634 data = self._next_data() 635 self._num_yielded += 1 636 if self._dataset_kind == _DatasetKind.Iterable and \ 637 self._IterableDataset_len_called is not None and \ 638 self._num_yielded > self._IterableDataset_len_called: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:678, in _SingleProcessDataLoaderIter._next_data(self) 676 def _next_data(self): 677 index = self._next_index() # may raise StopIteration --> 678 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 679 if self._pin_memory: 680 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py:32, in _IterableDatasetFetcher.fetch(self, possibly_batched_index) 30 for _ in possibly_batched_index: 31 try: ---> 32 data.append(next(self.dataset_iter)) 33 except StopIteration: 34 self.ended = True File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:1360, in IterableDataset.__iter__(self) 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) -> 1360 yield format_dict(example) if format_dict else example File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/torch_formatter.py:85, in TorchFormatter.recursive_tensorize(self, data_struct) 84 def recursive_tensorize(self, data_struct: dict): ---> 85 return map_nested(self._recursive_tensorize, data_struct, map_list=False) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/utils/py_utils.py:463, in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, parallel_min_length, types, disable_tqdm, desc) 461 num_proc = 1 462 if num_proc != -1 and num_proc <= 1 or len(iterable) < parallel_min_length: --> 463 mapped = [ 464 _single_map_nested((function, obj, types, None, True, None)) 465 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 466 ] 467 else: 468 mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/utils/py_utils.py:464, in <listcomp>(.0) 461 num_proc = 1 462 if num_proc != -1 and num_proc <= 1 or len(iterable) < parallel_min_length: 463 mapped = [ --> 464 _single_map_nested((function, obj, types, None, True, None)) 465 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 466 ] 467 else: 468 mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/utils/py_utils.py:366, in _single_map_nested(args) 364 # Singleton first to spare some computation 365 if not isinstance(data_struct, dict) and not isinstance(data_struct, types): --> 366 return function(data_struct) 368 # Reduce logging to keep things readable in multiprocessing with tqdm 369 if rank is not None and logging.get_verbosity() < logging.WARNING: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/torch_formatter.py:82, in TorchFormatter._recursive_tensorize(self, data_struct) 80 elif isinstance(data_struct, (list, tuple)): 81 return self._consolidate([self.recursive_tensorize(substruct) for substruct in data_struct]) ---> 82 return self._tensorize(data_struct) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/torch_formatter.py:68, in TorchFormatter._tensorize(self, value) 66 if isinstance(value, PIL.Image.Image): 67 value = np.asarray(value) ---> 68 return torch.tensor(value, **{**default_dtype, **self.torch_tensor_kwargs}) RuntimeError: Could not infer dtype of decimal.Decimal ```
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
416
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 Update: If i let it run, it eventually fails with: ``` RuntimeError Traceback (most recent call last) Cell In[16], line 4 2 t = time.time() 3 iter_ = 0 ----> 4 for batch in train_dataloader: 5 #batch_proc = streaming_obj.collect_streaming_data_batch(batch) 6 iter_ += 1 8 if iter_ == 1: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:634, in _BaseDataLoaderIter.__next__(self) 631 if self._sampler_iter is None: 632 # TODO(https://github.com/pytorch/pytorch/issues/76750) 633 self._reset() # type: ignore[call-arg] --> 634 data = self._next_data() 635 self._num_yielded += 1 636 if self._dataset_kind == _DatasetKind.Iterable and \ 637 self._IterableDataset_len_called is not None and \ 638 self._num_yielded > self._IterableDataset_len_called: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/dataloader.py:678, in _SingleProcessDataLoaderIter._next_data(self) 676 def _next_data(self): 677 index = self._next_index() # may raise StopIteration --> 678 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 679 if self._pin_memory: 680 data = _utils.pin_memory.pin_memory(data, self._pin_memory_device) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py:32, in _IterableDatasetFetcher.fetch(self, possibly_batched_index) 30 for _ in possibly_batched_index: 31 try: ---> 32 data.append(next(self.dataset_iter)) 33 except StopIteration: 34 self.ended = True File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/iterable_dataset.py:1360, in IterableDataset.__iter__(self) 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) -> 1360 yield format_dict(example) if format_dict else example File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/torch_formatter.py:85, in TorchFormatter.recursive_tensorize(self, data_struct) 84 def recursive_tensorize(self, data_struct: dict): ---> 85 return map_nested(self._recursive_tensorize, data_struct, map_list=False) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/utils/py_utils.py:463, in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, parallel_min_length, types, disable_tqdm, desc) 461 num_proc = 1 462 if num_proc != -1 and num_proc <= 1 or len(iterable) < parallel_min_length: --> 463 mapped = [ 464 _single_map_nested((function, obj, types, None, True, None)) 465 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 466 ] 467 else: 468 mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/utils/py_utils.py:464, in <listcomp>(.0) 461 num_proc = 1 462 if num_proc != -1 and num_proc <= 1 or len(iterable) < parallel_min_length: 463 mapped = [ --> 464 _single_map_nested((function, obj, types, None, True, None)) 465 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 466 ] 467 else: 468 mapped = parallel_map(function, iterable, num_proc, types, disable_tqdm, desc, _single_map_nested) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/utils/py_utils.py:366, in _single_map_nested(args) 364 # Singleton first to spare some computation 365 if not isinstance(data_struct, dict) and not isinstance(data_struct, types): --> 366 return function(data_struct) 368 # Reduce logging to keep things readable in multiprocessing with tqdm 369 if rank is not None and logging.get_verbosity() < logging.WARNING: File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/torch_formatter.py:82, in TorchFormatter._recursive_tensorize(self, data_struct) 80 elif isinstance(data_struct, (list, tuple)): 81 return self._consolidate([self.recursive_tensorize(substruct) for substruct in data_struct]) ---> 82 return self._tensorize(data_struct) File ~/anaconda3/envs/pytorch_p310/lib/python3.10/site-packages/datasets/formatting/torch_formatter.py:68, in TorchFormatter._tensorize(self, value) 66 if isinstance(value, PIL.Image.Image): 67 value = np.asarray(value) ---> 68 return torch.tensor(value, **{**default_dtype, **self.torch_tensor_kwargs}) RuntimeError: Could not infer dtype of decimal.Decimal ```
[ -0.1563844233751297, -0.04011835157871246, -0.02611197903752327, 0.2762729823589325, 0.002015233039855957, 0.09724314510822296, 0.42567208409309387, 0.24761492013931274, -0.07167746126651764, 0.219465970993042, 0.021227151155471802, 0.3324207663536072, -0.023974724113941193, 0.18956053256988525, -0.1895071566104889, -0.002742947544902563, 0.08053477108478546, 0.26331043243408203, 0.014589888043701649, -0.10969798266887665, 0.0269194096326828, 0.05575147271156311, -0.24509723484516144, -0.25248438119888306, -0.13999125361442566, -0.11033621430397034, 0.05797933042049408, -0.0746699869632721, 0.0217316672205925, -0.3681347966194153, 0.5503675937652588, 0.10591594874858856, 0.3780271112918854, 0.7747952938079834, -0.00012928819342050701, 0.10943837463855743, 0.24179242551326752, -0.015691954642534256, -0.5798144340515137, -0.2899022698402405, 0.1198698878288269, 0.011587120592594147, 0.13718059659004211, -0.16414572298526764, 0.0253741517663002, -0.17333552241325378, -0.0947614386677742, -0.3518214225769043, 0.05980958417057991, 0.02092428132891655, -0.004289332777261734, 0.10893936455249786, -0.16864198446273804, 0.07944047451019287, 0.1715570092201233, 0.1490136682987213, -0.040241025388240814, 0.210598886013031, 0.34711119532585144, -0.2586277425289154, -0.17633594572544098, 0.06609287858009338, 0.03532564640045166, 0.04292822629213333, 0.25150787830352783, -0.18485428392887115, 0.1520778387784958, -0.1581592559814453, 0.128352552652359, 0.04087711498141289, 0.5616922378540039, -0.19915111362934113, -0.340681254863739, -0.2657358944416046, 0.001211073249578476, -0.27505239844322205, 0.17689606547355652, 0.2470122128725052, -0.350301057100296, -0.0771036297082901, 0.1264875829219818, 0.06730387359857559, -0.2617458999156952, 0.06924247741699219, -0.2975570559501648, 0.490560382604599, -0.023911718279123306, 0.21808168292045593, 0.24046409130096436, -0.027928577736020088, 0.22616121172904968, 0.12786465883255005, 0.0957958772778511, -0.0021268613636493683, -0.8375093340873718, 0.1597389578819275, 0.03688463941216469, -0.10997596383094788, -0.12934182584285736, 0.1420321762561798, 0.0799984484910965, 0.06386838853359222, 0.38615453243255615, 0.17944282293319702, 0.4551113247871399, -0.22528304159641266, 0.1688062846660614, 0.007767759263515472, 0.13158752024173737, 0.19983668625354767, -0.07749516516923904, -0.01155460812151432, -0.26915889978408813, -0.25890153646469116, 0.32036420702934265, -0.23780366778373718, 0.1577540934085846, -0.3406241238117218, -0.06311208009719849, 0.19090215861797333, -0.17865866422653198, -0.13816013932228088, 0.19015075266361237, 0.5388681292533875, -0.21734291315078735, 0.2096325159072876, -0.04668322950601578, 0.2133716642856598, -0.06198149546980858, 0.057282954454422, 0.11814099550247192, -0.1649170070886612, -0.1917780339717865, -0.01470218226313591, 0.1269846260547638, -0.5281552076339722, 0.08005513995885849, 0.10041061043739319, 0.18198911845684052, -0.09568169713020325, 0.0774245336651802, -0.2330160290002823, 0.1283007711172104, 0.19302910566329956, 0.013658598065376282, 0.1357485055923462, 0.11434558033943176, -0.1369587481021881, -0.22038120031356812, 0.010406743735074997, -0.13412189483642578, -0.0364483967423439, -0.17366471886634827, 0.01570223644375801, 0.09798974543809891, -0.18783648312091827, -0.19644412398338318, -0.4570772051811218, 0.21206402778625488, -0.007769420742988586, 0.10611657798290253, -0.19359628856182098, -0.014218524098396301, 0.05869036167860031, 0.07230015844106674, 0.3304528295993805, -0.6316619515419006, 0.34840697050094604, 0.15415997803211212, 0.19274073839187622, 0.2165224552154541, 0.030619259923696518, -0.3289874792098999, 0.3430003821849823, -0.32179903984069824, -0.39620137214660645, 0.4733574688434601, -0.3305593729019165, -0.10506709665060043, 0.4946849048137665, 0.02523057907819748, 0.2512853443622589, 0.29786062240600586, -0.2346317321062088, 0.12458070367574692, -0.0959240198135376, 0.2513723075389862, 0.15157899260520935, -0.018474183976650238, -0.004298865795135498, -0.1544927954673767, 0.13082733750343323, 0.09203411638736725, 0.33041897416114807, 0.16523927450180054, 0.25544965267181396, -0.14793650805950165, -0.23179230093955994, 0.3742852807044983, -0.1242421567440033, -0.01699509285390377, 0.5115294456481934, 0.3825574517250061, 0.4713033139705658, 0.2531821131706238, -0.003357633948326111, -0.3512423038482666, 0.314599871635437, 0.1169293001294136, -0.057690173387527466, -0.07513454556465149, 0.1696723848581314, -0.0820280984044075, 0.3927784562110901, -0.35019955039024353, -0.09316819906234741, -0.10995949804782867, 0.36729350686073303, 0.06121509522199631, -0.2000860571861267, -0.33355236053466797, 0.6228130459785461, -0.07857604324817657, 0.03920235484838486, -0.3477341830730438, 0.2516925632953644, 0.16078969836235046, -0.16602866351604462, -0.0173397958278656, -0.13433238863945007, 0.1560215801000595, -0.25200608372688293, -0.09893406927585602, 0.02465120144188404, 0.13578923046588898, -0.013130448758602142, -0.19901727139949799, -0.19753101468086243, 0.029301756992936134, 0.238302543759346, 0.06595265865325928, -0.13938963413238525, 0.10896215587854385, -0.1450476348400116, 0.24184533953666687, 0.11129932105541229, 0.018912043422460556, 0.8333184719085693, -0.07076957821846008, -0.05450255423784256, 0.21301934123039246, 0.08599144965410233, -0.054524410516023636, 0.25631651282310486, 0.33366426825523376, -0.07819433510303497, 0.7856042385101318, -0.05189722776412964, -0.33394336700439453, 0.16720999777317047, 0.1298486739397049, 0.11136814951896667, -0.36092275381088257, 0.28773730993270874, 0.02255154214799404, 0.18022951483726501, 0.191411554813385, 0.13022464513778687, 0.18937864899635315, 0.022269979119300842, 0.04649689793586731, -0.11738940328359604, -0.06920025497674942, 0.0038418956100940704, -0.08673293888568878, 0.3571842908859253, 0.5635451674461365, 0.287207692861557, 0.037356212735176086, -0.06437648832798004, -0.12479621171951294, -0.536243736743927, -0.04554247483611107, 0.32890599966049194, -0.08295904844999313, 0.6204966306686401, -0.34995344281196594, 0.23124884068965912, -0.21183206140995026, -0.08455009013414383, -0.2128249555826187, -0.26677799224853516, -0.41598454117774963, 0.665763795375824, 0.05189943313598633, 0.06587038934230804, 0.02933429926633835, 0.1362365484237671, 0.21088966727256775, -0.39849114418029785, -0.427578866481781, -0.2785571813583374, -0.3824080526828766, -0.22312459349632263, 0.3701913356781006, -0.24463236331939697, 0.18858517706394196, -0.09432441741228104, -0.19124527275562286, -0.3011293113231659, -0.2225334346294403, 0.19160796701908112, -0.09659852087497711, 0.3199854791164398, 0.1251363307237625, 0.32497936487197876, 0.01918651908636093, -0.2349603772163391, 0.035310421139001846, -0.000009201467037200928, 0.0814366415143013, 0.32486799359321594, 0.03119494765996933, 0.15249286592006683, 0.24637290835380554, 0.03075788915157318, -0.06503318250179291, -0.34378039836883545, 0.25198492407798767, -0.028060302138328552, 0.05908237025141716, -0.06262263655662537, 0.16593468189239502, 0.19196859002113342, -0.04640347510576248, 0.17584234476089478, 0.05143250897526741, -0.6687546372413635, 0.3127296268939972, -0.10804089903831482, -0.18635016679763794, 0.0021895989775657654, -0.030056223273277283, 0.28771650791168213, 0.30974626541137695, -0.6816555857658386, 0.19677898287773132, -0.1330006867647171, -0.09908445924520493, -0.31978118419647217, -0.023677457123994827, 0.12371187657117844, -0.010484650731086731, 0.08580055832862854, -0.02191121131181717, -0.10723038017749786, 0.24321502447128296, 0.008130520582199097, 0.16769219934940338, 0.1499144732952118, 0.5722652077674866, -0.037235159426927567, 0.43850022554397583, 0.248666450381279, -0.09896541386842728, 0.5681048631668091, 0.19291116297245026, 0.1650708019733429, -0.02327391877770424, -0.3377801179885864, -0.1599949598312378, -0.1361055076122284, -0.2899034917354584, 0.06061771884560585, -0.26277029514312744, -0.4144320487976074, -0.24684274196624756, -0.14154615998268127, 0.01650886982679367, -0.3024919033050537, 0.29939785599708557, -0.2916889786720276, 0.18983197212219238, -0.0984843298792839, 0.20031237602233887, -0.21866795420646667, 0.10950736701488495, -0.0058547742664813995, 0.07865897566080093, 0.08872455358505249, 0.02934280037879944, 0.00585387647151947, 0.013906806707382202, -0.34581345319747925, 0.07956099510192871, 0.001717299222946167, 0.6713668704032898, 0.07430039346218109, -0.2511548697948456, 0.14020420610904694, -0.41570907831192017, 1.0515446662902832, -0.08014896512031555, 0.1250629723072052, 0.15679681301116943, -0.3679986000061035, -0.28951019048690796, -0.24193958938121796, 0.009823381900787354, 0.09015972912311554, 0.12060214579105377, 0.5927044749259949, -0.2743132710456848, -0.463843435049057, 0.08882318437099457, 0.03505069762468338, -0.17756387591362, -0.37226805090904236, -0.3918219208717346, 0.05375434458255768, -0.2950185537338257, 0.1306721568107605, -0.2027369737625122, 0.2190985083580017, 0.10267515480518341, -0.06332743167877197, -0.2632278501987457, 0.0323137566447258, -0.002902187407016754, 0.09090355038642883, 0.07567478716373444, -0.11544589698314667, 0.4991406798362732, 0.08330167829990387, 0.32202011346817017, 0.3776441812515259, 0.41237765550613403, 0.16833394765853882, -0.5872925519943237, 0.41656842827796936, 0.05256814882159233, 0.4953373968601227, 0.4315457344055176, -0.015494007617235184, -0.05020276829600334, -0.1639057993888855, 0.37755268812179565, -0.27481377124786377, 0.07944408059120178, 0.27337130904197693, 0.11134804785251617, -0.5375155806541443, -0.29880332946777344, 0.26579779386520386, -0.05073188990354538, 0.20120520889759064, 0.4190133512020111, -0.07207785546779633, 0.06226351112127304, 0.4452269375324249, 0.02383953332901001, 0.8491886854171753, -0.12820708751678467, 0.15117132663726807, 0.20829229056835175, -0.3168536126613617, 0.029419902712106705, -0.6461663246154785, -0.0011827107518911362, -0.3765913248062134, -0.13430330157279968, -0.024632014334201813, -0.3796843886375427, 0.2312186062335968, 0.0411611944437027, 0.22518271207809448, 0.3298235833644867, -0.18330837786197662, -0.023107951506972313, 0.12256482988595963, 0.17707622051239014, -0.2524927258491516, -0.2973932921886444, -0.25766655802726746, -0.03725847229361534, -0.08522149920463562, 0.1124749556183815, -0.17918364703655243, -0.17745906114578247, 0.11681761592626572, 0.045897431671619415, -0.13334210216999054, 0.2849920094013214, 0.19020414352416992, -0.17274829745292664, 0.12252376973628998, -0.6697733402252197, 0.09554347395896912, 0.024982145056128502, 0.0018901918083429337, 0.0076938290148973465, -0.07759371399879456, 0.09767545014619827, -0.029309123754501343, -0.07983294129371643, 0.06813888251781464, -0.18374687433242798, 0.48421862721443176, 0.03274984657764435, -0.1592293083667755, 0.052731703966856, -0.19881464540958405, -0.29087960720062256, 0.23680925369262695, 0.23715712130069733, 0.2197798490524292, -0.07451290637254715, 0.13429343700408936, 0.1733511984348297, -0.05639506131410599, -0.2605198621749878, -0.012442564591765404, -0.09927009046077728, -0.28959909081459045, 0.13873858749866486, -0.26935088634490967, -0.36642009019851685, -0.12485155463218689, 0.5290637016296387, -0.0416746661067009, 0.06357111036777496, 0.7208549380302429, 0.36427879333496094, -0.3038623332977295, -0.17624372243881226, -0.23184823989868164, 0.11436322331428528, -0.43514254689216614, 0.04552449658513069, -0.11295601725578308, 0.15942344069480896, 0.14578622579574585, -0.07252377271652222, -0.0707898736000061, -0.5371661186218262, -0.17087450623512268, -0.42539435625076294, -0.07923226803541183, -0.1547980159521103, -0.10354556143283844, 0.05220160260796547, 0.11440706253051758, 0.036343298852443695, -0.09547676146030426, 0.17360924184322357, -0.12075859308242798, -0.10911628603935242, -0.2109217643737793, 0.06279155611991882, -0.11129085719585419, -0.21665970981121063, 0.04955403134226799, 0.04148630052804947, -0.00825938954949379, 0.2279384285211563, 0.11979633569717407, -0.09221326559782028, -0.2860736846923828, 0.1737079620361328, 0.04536906257271767, 0.1602899730205536, 0.09055675566196442, -0.3068373203277588, -0.17445167899131775, -0.145570307970047, 0.16423307359218597, -0.22287410497665405, 0.036440152674913406, -0.05462922528386116, 0.3866023123264313, 0.21357318758964539, -0.15294133126735687, -0.006105197127908468, 0.30934208631515503, -0.2177809774875641, 0.16454528272151947, 0.25825804471969604, -0.2299664318561554, 0.06693214178085327, -0.22680863738059998, 0.07607927918434143, 0.17202290892601013, 0.06461932510137558, 0.4501069486141205, -0.5281921625137329, 0.0815986841917038, -0.15055885910987854, 0.3589474856853485, 0.7618906497955322, 0.09428010880947113, -0.3080015480518341, 0.5624468326568604, -0.024828538298606873, -0.20700250566005707, -0.1558949053287506, -0.13883531093597412, 0.10363386571407318, -0.006739690899848938, 0.24660183489322662, -0.11340325325727463, -0.19193404912948608, 0.24935436248779297, 0.11307916790246964, 0.19114919006824493, -0.058438945561647415, -0.04420940577983856, 0.15365450084209442, -0.04284054413437843, 0.033752426505088806, 0.40242132544517517, 0.516518771648407, 0.045783355832099915, 0.24596010148525238, 0.09368391335010529, 0.12783724069595337, -0.167560413479805, 0.07785899937152863, -0.2305813729763031, -0.5865512490272522, 0.07684986293315887, 0.1292140781879425, 0.339681476354599, 0.03605728596448898, -0.014671381562948227, 0.3283163011074066, 0.11513711512088776, -0.3054913878440857, -0.36410611867904663, 0.1602632701396942, -0.06836022436618805, 0.1334562599658966, 0.08299334347248077, -0.16710716485977173, -0.045407213270664215, 0.1421596109867096, 0.09104553610086441, -0.18974089622497559, 0.13252267241477966, 0.16173449158668518, 0.19281621277332306, -0.47695815563201904, -0.2609584331512451, -0.004303760826587677, 0.1563197672367096, -0.1013346016407013, 0.21371601521968842, -0.03558476269245148, -0.14136791229248047, -0.31763163208961487, -0.13834185898303986, 0.28858280181884766, 0.40140289068222046, -0.04831833764910698, 0.08125697076320648, -0.09187506139278412, 0.022045671939849854, -0.008020330220460892, 0.08902078866958618, -0.26043564081192017, 0.19791662693023682, 0.4406421482563019, -0.0684671550989151, 0.010527923703193665, -0.01717977598309517, 0.03980298340320587, 0.22144488990306854, -0.27137672901153564, 0.16053712368011475, 0.3479575514793396, 0.06549526751041412, -0.001374509185552597, -0.0947674810886383, -0.5493527054786682, 0.03536433354020119, 0.35424578189849854, -0.1033640131354332, 0.03492572903633118, 0.03149521350860596, 0.0009171366691589355, -0.07720167934894562, 0.5896943807601929, 0.22778645157814026, 0.2187293916940689, -0.2281114161014557, -0.15391285717487335, -0.3945879638195038, 0.018383730202913284, -0.3657810091972351, -0.02422887459397316, 0.3637911379337311, 0.33081406354904175, 0.3753713071346283, 0.04763997718691826, 0.2388269007205963, -0.08520060032606125, -0.3414572477340698, 0.5784505009651184, -0.44121062755584717, -0.2872994840145111, 0.06261253356933594, 0.17969191074371338, -0.14807628095149994, -0.36583948135375977, 0.1401096135377884, -0.04404297098517418, -0.049903806298971176, -0.024064552038908005, -0.29316627979278564, 0.2214934378862381, -0.6123082041740417, 0.39421558380126953, -0.2691470682621002, 0.06083765625953674, 0.15851108729839325, -0.1307249367237091, -0.2799275517463684, -0.10572682321071625, 0.01779230311512947, -0.07102366536855698, -0.10901009291410446, 0.11015747487545013, -0.1739523559808731, -0.03454066812992096, -0.44822099804878235, 0.025006499141454697, -0.027674242854118347, -0.12652969360351562, -0.0023620203137397766, 0.19105426967144012, 0.11644599586725235, 0.35758668184280396, 0.09061464667320251, 0.215513676404953, 0.21844682097434998, 0.20828938484191895, -0.4758346378803253, -0.05313620716333389, 0.44956672191619873, -0.3914569914340973, -0.5857254862785339, 0.2087685912847519, 0.08348190784454346, 0.18429945409297943, 0.0016334839165210724, -0.3315635323524475, 0.21360769867897034, 0.1097642034292221, -0.07591405510902405, -0.009374789893627167, 0.1859256476163864, 0.10889846086502075, 0.13235333561897278, -0.32642456889152527, 0.16274181008338928, 0.003825906664133072, -0.11379493772983551, -0.043873194605112076, -0.11753113567829132 ]
https://github.com/huggingface/datasets/issues/6079
PyTorch tensors cannot store `Decimal` objects. Casting the column with decimals to `float` should fix the issue.
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
17
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 PyTorch tensors cannot store `Decimal` objects. Casting the column with decimals to `float` should fix the issue.
[ -0.09444306790828705, -0.06475421041250229, -0.029098311439156532, 0.34477677941322327, 0.047911591827869415, 0.09503510594367981, 0.4583494961261749, 0.25571954250335693, -0.07225597649812698, 0.282741904258728, -0.01944710873067379, 0.35102689266204834, -0.0015755146741867065, 0.12524184584617615, -0.20255741477012634, -0.0027667339891195297, 0.0465351939201355, 0.28917643427848816, 0.01663726381957531, -0.1865253448486328, 0.0206550732254982, 0.023115186020731926, -0.23363521695137024, -0.2601204812526703, -0.2048165500164032, -0.07497766613960266, 0.1049136221408844, -0.11993624269962311, -0.027142250910401344, -0.35620367527008057, 0.597611665725708, 0.055946070700883865, 0.3561246991157532, 0.7832592129707336, -0.00013099712668918073, 0.1411910206079483, 0.20855197310447693, 0.015895910561084747, -0.6036478281021118, -0.24625110626220703, 0.14538025856018066, -0.045182302594184875, 0.2080167531967163, -0.22915157675743103, -0.003807172179222107, -0.13199618458747864, -0.1231793463230133, -0.3129330277442932, 0.08795294910669327, 0.012765474617481232, -0.035913050174713135, 0.0946989580988884, -0.16642877459526062, 0.08354648947715759, 0.1923942267894745, 0.09663882851600647, -0.04712683707475662, 0.22772414982318878, 0.2756361961364746, -0.18553201854228973, -0.16516217589378357, 0.08074973523616791, 0.04874102771282196, 0.03932981565594673, 0.2418702244758606, -0.1707860380411148, 0.18328948318958282, -0.15151743590831757, 0.13219021260738373, 0.06936463713645935, 0.5465765595436096, -0.21470819413661957, -0.3018619418144226, -0.23058447241783142, -0.005734283477067947, -0.2945677638053894, 0.2087467461824417, 0.27214309573173523, -0.3267935812473297, -0.05193739011883736, 0.16367177665233612, -0.025177001953125, -0.29796692728996277, 0.15233395993709564, -0.4210265278816223, 0.4710613787174225, -0.04708100110292435, 0.21945151686668396, 0.18699942529201508, -0.05264385789632797, 0.1741657853126526, 0.16825972497463226, 0.18940547108650208, -0.0005687922239303589, -0.8054012656211853, 0.12935742735862732, 0.016373921185731888, -0.20540115237236023, -0.1320214569568634, 0.014132745563983917, 0.05706694722175598, 0.16003407537937164, 0.29203498363494873, 0.21162252128124237, 0.42913147807121277, -0.22672908008098602, 0.1295221596956253, 0.12917682528495789, 0.2232978641986847, 0.1328810751438141, -0.05810389295220375, 0.016093119978904724, -0.27060776948928833, -0.2669249475002289, 0.3138114809989929, -0.2733961343765259, 0.1386757493019104, -0.33880531787872314, -0.013446852564811707, 0.2713478207588196, -0.16453278064727783, -0.09476698935031891, 0.17572079598903656, 0.5118531584739685, -0.2741759717464447, 0.3109248876571655, 0.0034071654081344604, 0.1874360293149948, -0.08968157321214676, 0.12402366101741791, 0.12396128475666046, -0.09884078800678253, -0.1875336915254593, -0.052824392914772034, 0.12961255013942719, -0.43533188104629517, 0.026503004133701324, 0.1628967821598053, 0.2478271722793579, -0.12745757400989532, 0.12653815746307373, -0.23703765869140625, 0.155037522315979, 0.2325131595134735, -0.013674408197402954, 0.12008915096521378, 0.04751583933830261, -0.15358971059322357, -0.243840754032135, 0.03418489545583725, -0.24452896416187286, -0.013635173439979553, -0.1975151151418686, -0.016063958406448364, 0.15306082367897034, -0.2074585258960724, -0.19334712624549866, -0.46582522988319397, 0.25510305166244507, 0.04885809123516083, 0.11129865050315857, -0.23139742016792297, -0.07435561716556549, 0.029701553285121918, 0.10819049179553986, 0.2124212682247162, -0.6541256308555603, 0.3262150287628174, 0.18433551490306854, 0.2127426266670227, 0.18080177903175354, 0.1282627433538437, -0.3239213228225708, 0.2757987678050995, -0.2942625880241394, -0.41689610481262207, 0.5239505171775818, -0.3610863983631134, -0.13429775834083557, 0.43496930599212646, 0.08998376131057739, 0.1333058476448059, 0.21876969933509827, -0.23057910799980164, 0.15585078299045563, -0.03103528544306755, 0.27255457639694214, 0.07100000977516174, -0.0037941429764032364, -0.0009315758943557739, -0.1811417043209076, 0.10055040568113327, 0.1235366240143776, 0.382662296295166, 0.2231859266757965, 0.18767698109149933, -0.18135122954845428, -0.14923584461212158, 0.35510018467903137, -0.11133226752281189, 0.006459042429924011, 0.5498008131980896, 0.3589988350868225, 0.43696555495262146, 0.29558902978897095, -0.09111042320728302, -0.35082751512527466, 0.28922203183174133, 0.04808926582336426, 0.03275473788380623, -0.09134583175182343, 0.21586304903030396, -0.09843552112579346, 0.36681580543518066, -0.29651832580566406, -0.002973088063299656, -0.1408911794424057, 0.27860864996910095, 0.05940023064613342, -0.1329224854707718, -0.34065675735473633, 0.5239566564559937, -0.010961443185806274, 0.04553113132715225, -0.33779677748680115, 0.280329167842865, 0.18488900363445282, -0.15051905810832977, -0.1111651360988617, -0.07180396467447281, 0.14269979298114777, -0.25338518619537354, -0.08471712470054626, 0.015921682119369507, 0.15152446925640106, -0.07188565284013748, -0.17149367928504944, -0.07085554301738739, 0.16059546172618866, 0.2322191298007965, 0.10281731933355331, -0.1923922449350357, 0.05685458332300186, -0.12599176168441772, 0.22465263307094574, 0.16572794318199158, 0.08261432498693466, 0.7454348206520081, -0.08224724978208542, -0.06181859225034714, 0.2365180402994156, 0.06885521113872528, -0.05403231456875801, 0.20867060124874115, 0.32899895310401917, -0.08681946247816086, 0.7539049386978149, 0.008314989507198334, -0.3628239631652832, 0.11734946817159653, 0.16849501430988312, 0.08597725629806519, -0.2683011293411255, 0.30610835552215576, -0.01011667400598526, 0.2251468300819397, 0.11133936792612076, 0.021141424775123596, 0.09944653511047363, 0.0029961243271827698, 0.069612056016922, -0.11210864782333374, -0.14607785642147064, 0.00696495920419693, -0.15987764298915863, 0.35369616746902466, 0.5309146642684937, 0.2821601927280426, 0.10774422436952591, -0.035754356533288956, -0.13598476350307465, -0.38047555088996887, -0.0040516480803489685, 0.29713693261146545, -0.09373383969068527, 0.5861687660217285, -0.36225372552871704, 0.3654823303222656, -0.25318431854248047, -0.060902684926986694, -0.25221776962280273, -0.2534450888633728, -0.3545169532299042, 0.599635660648346, 0.07879506051540375, 0.06914951652288437, 0.0689084529876709, 0.17031607031822205, 0.24674482643604279, -0.37810108065605164, -0.4766989052295685, -0.26702409982681274, -0.38719692826271057, -0.25090891122817993, 0.31280043721199036, -0.24634753167629242, 0.18424050509929657, -0.09558092057704926, -0.28562092781066895, -0.21844106912612915, -0.32503175735473633, 0.2153354436159134, -0.02146128937602043, 0.29358500242233276, 0.12228597700595856, 0.32427358627319336, -0.08011671155691147, -0.14488983154296875, 0.08587048947811127, 0.041791483759880066, 0.09325074404478073, 0.3781808018684387, 0.004924416542053223, 0.1373230516910553, 0.22416990995407104, -0.041228070855140686, -0.07744967937469482, -0.3089112341403961, 0.23159123957157135, -0.02913558855652809, 0.059962205588817596, -0.15642720460891724, 0.17615099251270294, 0.21141773462295532, -0.07899774610996246, 0.20682401955127716, 0.03223797678947449, -0.6613261103630066, 0.399942010641098, -0.13659460842609406, -0.21718093752861023, -0.007846072316169739, -0.036063555628061295, 0.2244759202003479, 0.3025382459163666, -0.7120561003684998, 0.1864076852798462, -0.17814765870571136, -0.10707259178161621, -0.3286876082420349, 0.0209657009691, 0.1609974503517151, -0.02295534871518612, 0.09830926358699799, -0.019755229353904724, -0.10857770591974258, 0.2737988233566284, 0.061056509613990784, 0.1466541588306427, 0.11363871395587921, 0.5104572176933289, 0.02027447521686554, 0.4627111256122589, 0.18362709879875183, -0.15276183187961578, 0.4814566969871521, 0.13182607293128967, 0.14657960832118988, -0.014451570808887482, -0.345175564289093, -0.16727885603904724, -0.11172661930322647, -0.30838000774383545, 0.057116005569696426, -0.2235402911901474, -0.38317134976387024, -0.23751075565814972, -0.1427365392446518, 0.04499629884958267, -0.34215235710144043, 0.28672367334365845, -0.33386483788490295, 0.19999560713768005, -0.060100018978118896, 0.1944599151611328, -0.2463342398405075, 0.08520826697349548, 0.03816235810518265, 0.05564359575510025, 0.012964561581611633, -0.0007277056574821472, -0.025899037718772888, 0.003636658191680908, -0.32849425077438354, 0.06745044887065887, -0.01106896623969078, 0.6763702034950256, 0.10848595947027206, -0.1898840218782425, 0.21194669604301453, -0.3891840875148773, 1.084749698638916, -0.022042037919163704, 0.10445559024810791, 0.10052043199539185, -0.4544261693954468, -0.36577141284942627, -0.20312032103538513, -0.00656002014875412, 0.054066386073827744, 0.1303693801164627, 0.7068521976470947, -0.3261377215385437, -0.49611154198646545, 0.11745545268058777, 0.04963730275630951, -0.22886013984680176, -0.3233078420162201, -0.42982032895088196, 0.06121290475130081, -0.2865197956562042, 0.09640928357839584, -0.21242046356201172, 0.19861416518688202, 0.16088427603244781, -0.09696382284164429, -0.2825106084346771, 0.03145911544561386, -0.0033167004585266113, 0.06530925631523132, 0.07499191910028458, -0.10967151820659637, 0.4643533229827881, 0.08980706334114075, 0.38301706314086914, 0.4382900297641754, 0.41559481620788574, 0.15856635570526123, -0.620339572429657, 0.39832690358161926, 0.03246074169874191, 0.4589517116546631, 0.41774362325668335, -0.024218665435910225, -0.12039099633693695, -0.1480419635772705, 0.37480631470680237, -0.32711562514305115, 0.12512725591659546, 0.24423617124557495, 0.15510377287864685, -0.545267641544342, -0.21842369437217712, 0.30272290110588074, -0.044336020946502686, 0.2009269744157791, 0.33373722434043884, -0.0916312038898468, 0.07921397686004639, 0.4569557011127472, 0.10316891968250275, 0.8714700937271118, -0.2653561532497406, 0.19258694350719452, 0.21298763155937195, -0.2980146110057831, 0.1171407401561737, -0.7707138061523438, 0.0045647285878658295, -0.402163565158844, -0.10614782571792603, -0.0447227917611599, -0.39902931451797485, 0.1926216334104538, 0.04756138101220131, 0.21542325615882874, 0.25407662987709045, -0.14872056245803833, -0.07393045723438263, 0.06105636805295944, 0.20477904379367828, -0.17676463723182678, -0.29124656319618225, -0.19291183352470398, -0.04898843169212341, -0.12066449970006943, 0.10435844957828522, -0.17317283153533936, -0.1729343980550766, 0.041207313537597656, 0.02124546468257904, -0.09841861575841904, 0.26533243060112, 0.16687238216400146, -0.06316573917865753, 0.21779370307922363, -0.6088394522666931, 0.04854718595743179, 0.041678108274936676, 0.07724569737911224, 0.024505896493792534, -0.07860831916332245, 0.1023065596818924, -0.09897731244564056, -0.14531829953193665, 0.1720709651708603, -0.1404338926076889, 0.5264859199523926, 0.0563686341047287, -0.1890764981508255, 0.009899508208036423, -0.17254158854484558, -0.2599669098854065, 0.19734255969524384, 0.274865061044693, 0.21818774938583374, -0.10787177085876465, 0.149461030960083, 0.11417076736688614, -0.057900942862033844, -0.22560715675354004, -0.01678350195288658, -0.04541478678584099, -0.2753739356994629, 0.1861562877893448, -0.21017417311668396, -0.37696778774261475, -0.09959536790847778, 0.5609694123268127, -0.013888406567275524, 0.001451633870601654, 0.7198057174682617, 0.3743878901004791, -0.3043808937072754, -0.1701168417930603, -0.23392991721630096, 0.12458842992782593, -0.4108733534812927, 0.11369293183088303, -0.1409909725189209, 0.0943426787853241, 0.08427639305591583, -0.04413973167538643, -0.040328849107027054, -0.5776516199111938, -0.1657504439353943, -0.4094718098640442, -0.11728775501251221, -0.16430498659610748, -0.01602654904127121, 0.06961911916732788, 0.1815955936908722, 0.0706363171339035, -0.12793582677841187, 0.13308961689472198, -0.09871234744787216, -0.01333121582865715, -0.2679227888584137, 0.11212906241416931, -0.11617039889097214, -0.21728351712226868, 0.01999707892537117, 0.03082970529794693, -0.025599583983421326, 0.2146136313676834, 0.11162922531366348, -0.06896748393774033, -0.30609434843063354, 0.17114576697349548, 0.04865850880742073, 0.15391729772090912, 0.05503543093800545, -0.3535202145576477, -0.18225470185279846, -0.14645707607269287, 0.13476106524467468, -0.17641498148441315, 0.00782952830195427, 0.07047410309314728, 0.3295477032661438, 0.2265336513519287, -0.08789297938346863, 0.01000775396823883, 0.3391301929950714, -0.1906651258468628, 0.1553315818309784, 0.26302698254585266, -0.20497100055217743, 0.07878713309764862, -0.2716067135334015, 0.07351858913898468, 0.14339834451675415, -0.014837444759905338, 0.44241198897361755, -0.5359240174293518, 0.11535602062940598, -0.026252232491970062, 0.3623233735561371, 0.7729359865188599, 0.0361897349357605, -0.27758079767227173, 0.5638845562934875, -0.032813623547554016, -0.19340702891349792, -0.15589502453804016, -0.013876821845769882, 0.10127165913581848, -0.03630002588033676, 0.22828510403633118, -0.10332370549440384, -0.11036927253007889, 0.25996559858322144, 0.13097038865089417, 0.1160927414894104, -0.2048797309398651, -0.020351650193333626, 0.14502431452274323, -0.1054496094584465, -0.014025518670678139, 0.39919018745422363, 0.5295018553733826, 0.025416508316993713, 0.3790423572063446, 0.148214191198349, 0.08344966173171997, -0.18334627151489258, 0.07721476256847382, -0.2270449846982956, -0.4788419306278229, 0.09194140136241913, 0.18925949931144714, 0.3407989740371704, -0.011684074997901917, -0.00029027462005615234, 0.3180658221244812, 0.17670774459838867, -0.2884868383407593, -0.3732370138168335, 0.1844111680984497, -0.12846416234970093, 0.1157318502664566, 0.1004306972026825, -0.16790786385536194, -0.017177991569042206, 0.12897387146949768, 0.07541687786579132, -0.12699434161186218, 0.23284342885017395, 0.25394341349601746, 0.19318151473999023, -0.46483954787254333, -0.22758282721042633, 0.00865962728857994, 0.17736327648162842, -0.1065845862030983, 0.17008110880851746, -0.055817611515522, -0.19864574074745178, -0.3560180366039276, -0.175375834107399, 0.2550015151500702, 0.46738454699516296, -0.11123883724212646, 0.0755702406167984, -0.07774661481380463, 0.028978198766708374, -0.03953415900468826, 0.08901567757129669, -0.24000923335552216, 0.2538168132305145, 0.4079366624355316, -0.09085136651992798, 0.015706822276115417, -0.026265989989042282, -0.0021076342090964317, 0.2600843608379364, -0.3089158833026886, 0.16416680812835693, 0.3594355881214142, 0.03225620836019516, -0.012444454245269299, -0.13555844128131866, -0.5513194799423218, 0.021341953426599503, 0.32903197407722473, -0.07981452345848083, 0.07349055260419846, -0.0009671375155448914, -0.009408332407474518, -0.08988383412361145, 0.5833273530006409, 0.2758693993091583, 0.1817207634449005, -0.20734284818172455, -0.07838678359985352, -0.3495043218135834, 0.039413224905729294, -0.32048529386520386, -0.05369563028216362, 0.38178133964538574, 0.396520733833313, 0.3849511444568634, 0.03809355944395065, 0.19707326591014862, -0.21060165762901306, -0.2649001181125641, 0.5181780457496643, -0.40959590673446655, -0.24231256544589996, 0.01248966995626688, 0.17021408677101135, -0.10647054016590118, -0.394811749458313, 0.16370587050914764, -0.020332101732492447, -0.08789151906967163, -0.05628398805856705, -0.24768991768360138, 0.1516663134098053, -0.5446379780769348, 0.42182213068008423, -0.23659281432628632, 0.09661004692316055, 0.15069420635700226, -0.12656360864639282, -0.20675291121006012, -0.0769629031419754, -0.006628811359405518, -0.010949715971946716, -0.12476610392332077, 0.09555958211421967, -0.2680037021636963, -0.06822080910205841, -0.457060307264328, -0.07247619330883026, -0.05733288452029228, -0.18723540008068085, 0.024541817605495453, 0.21841034293174744, 0.1726577877998352, 0.3321305215358734, 0.1038728803396225, 0.240217924118042, 0.2811317443847656, 0.2205221801996231, -0.4396592080593109, -0.06875678896903992, 0.4039902091026306, -0.3313112258911133, -0.6204609274864197, 0.17002245783805847, 0.10082796216011047, 0.17963533103466034, -0.038108039647340775, -0.4544975757598877, 0.1792498528957367, 0.10753324627876282, -0.055539555847644806, -0.06117495149374008, 0.18437153100967407, 0.1860620230436325, 0.10838238149881363, -0.34733667969703674, 0.25904545187950134, 0.011268042027950287, -0.06518400460481644, -0.09828867763280869, -0.12423362582921982 ]
https://github.com/huggingface/datasets/issues/6079
I already have cast in collate_fn, in which I perform .astype(float) for each numerical field. On the same instance, I installed a conda env with python 3.6, and this works well. Sample: ``` def streaming_data_collate_fn(batch): df = pd.DataFrame.from_dict(batch) feat_vals = torch.FloatTensor(np.nan_to_num(np.array(df[feats].astype(float)))) ```
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
42
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 I already have cast in collate_fn, in which I perform .astype(float) for each numerical field. On the same instance, I installed a conda env with python 3.6, and this works well. Sample: ``` def streaming_data_collate_fn(batch): df = pd.DataFrame.from_dict(batch) feat_vals = torch.FloatTensor(np.nan_to_num(np.array(df[feats].astype(float)))) ```
[ -0.06654298305511475, -0.020897045731544495, -0.018205072730779648, 0.25953370332717896, 0.08013052493333817, 0.0900518000125885, 0.4737333357334137, 0.2349279224872589, -0.06655073910951614, 0.24055343866348267, -0.01982254534959793, 0.34102046489715576, 0.035222698003053665, 0.13594481348991394, -0.2277706414461136, 0.021456390619277954, 0.09272076189517975, 0.2636975049972534, 0.014105313457548618, -0.20109519362449646, 0.009751714766025543, -0.01179089117795229, -0.24572008848190308, -0.27611255645751953, -0.08044667541980743, -0.08472925424575806, 0.08444405347108841, -0.12441247701644897, -0.024462854489684105, -0.31221064925193787, 0.5938935875892639, 0.13728642463684082, 0.39242714643478394, 0.7136003971099854, -0.00012859425623901188, 0.10374204814434052, 0.2674587666988373, -0.015013128519058228, -0.5900668501853943, -0.2760493755340576, 0.18508096039295197, -0.030546417459845543, 0.21627172827720642, -0.19792845845222473, -0.027249131351709366, -0.22507628798484802, -0.12698164582252502, -0.33901160955429077, 0.04844535514712334, -0.009555861353874207, 0.00008313730359077454, 0.061683885753154755, -0.15213461220264435, 0.08234051614999771, 0.09359358251094818, 0.11129964143037796, -0.0562298558652401, 0.22527475655078888, 0.2640102207660675, -0.19433477520942688, -0.26421451568603516, 0.04746183753013611, 0.04293721914291382, 0.02727525308728218, 0.23128348588943481, -0.21060419082641602, 0.14007695019245148, -0.13898444175720215, 0.18896125257015228, 0.08321408182382584, 0.4409060478210449, -0.16500750184059143, -0.32640185952186584, -0.22520823776721954, 0.042927637696266174, -0.2321363389492035, 0.19490453600883484, 0.2420782446861267, -0.3120352625846863, -0.055178310722112656, 0.11374111473560333, 0.09220583736896515, -0.18330419063568115, 0.15208075940608978, -0.3529148995876312, 0.41887906193733215, -0.06979509443044662, 0.23363931477069855, 0.25802692770957947, -0.06253425776958466, 0.28443485498428345, 0.13708508014678955, 0.16206231713294983, 0.008653130382299423, -0.8546202778816223, 0.211533784866333, 0.11138765513896942, -0.15353113412857056, -0.16971050202846527, -0.009655673056840897, 0.05328996479511261, 0.13946053385734558, 0.32232728600502014, 0.18436717987060547, 0.47776928544044495, -0.20042917132377625, 0.1468612551689148, 0.029509156942367554, 0.19027945399284363, 0.20728757977485657, -0.04692919924855232, 0.02528446540236473, -0.26998579502105713, -0.21674159169197083, 0.2534734606742859, -0.3024672865867615, 0.09451763331890106, -0.38329243659973145, -0.0333746112883091, 0.22384527325630188, -0.13321062922477722, -0.08649733662605286, 0.16773290932178497, 0.537634551525116, -0.16630490124225616, 0.3127738833427429, -0.03889324888586998, 0.2256288230419159, -0.012107126414775848, 0.09975892305374146, 0.10768039524555206, -0.16675086319446564, -0.20544908940792084, -0.07964521646499634, 0.12629923224449158, -0.525071382522583, 0.03480840474367142, 0.1609726846218109, 0.15697404742240906, -0.07620210945606232, 0.04418451339006424, -0.22190774977207184, 0.19219517707824707, 0.18837624788284302, 0.0027679726481437683, 0.12981107831001282, 0.19864775240421295, -0.209696963429451, -0.23528733849525452, -0.06757543981075287, -0.09287267923355103, 0.02282310277223587, -0.22781385481357574, 0.0030164457857608795, 0.18788011372089386, -0.1527860164642334, -0.1822860985994339, -0.3975495994091034, 0.14918968081474304, 0.002923823893070221, 0.11264684796333313, -0.2652830183506012, -0.03443840146064758, 0.024860702455043793, 0.09042825549840927, 0.2857103943824768, -0.6211112141609192, 0.32273155450820923, 0.1170918196439743, 0.235342875123024, 0.21869629621505737, 0.12169621884822845, -0.344990611076355, 0.22553570568561554, -0.34610605239868164, -0.45049726963043213, 0.5026895403862, -0.2887957692146301, -0.08841678500175476, 0.4711695909500122, 0.06991792470216751, 0.24794018268585205, 0.24518689513206482, -0.24807949364185333, 0.15927718579769135, -0.06640228629112244, 0.3121722638607025, 0.17615652084350586, -0.029119940474629402, -0.005839265882968903, -0.15675824880599976, 0.12527745962142944, 0.11689896136522293, 0.3206544518470764, 0.09944825619459152, 0.2791695296764374, -0.10069599747657776, -0.26608508825302124, 0.2947475016117096, -0.14775578677654266, -0.01902886852622032, 0.5215672254562378, 0.3193870782852173, 0.392067015171051, 0.22971683740615845, 0.08080878853797913, -0.4074752926826477, 0.3053058981895447, 0.1795276552438736, -0.027739249169826508, -0.12119258940219879, 0.17678135633468628, -0.06732775270938873, 0.2857678532600403, -0.3115849494934082, -0.07633991539478302, -0.10993161797523499, 0.36523202061653137, 0.08949723839759827, -0.15624189376831055, -0.2979581356048584, 0.5527724027633667, -0.11718694120645523, -0.006454136222600937, -0.348117858171463, 0.20790351927280426, 0.17263971269130707, -0.16312801837921143, -0.042436227202415466, -0.09860345721244812, 0.1833312064409256, -0.2353661060333252, -0.11050879210233688, 0.029483342543244362, 0.10314922034740448, -0.042842622846364975, -0.16649112105369568, -0.14197909832000732, 0.07447655498981476, 0.25758442282676697, 0.08282342553138733, -0.18260696530342102, 0.06748516857624054, -0.16866075992584229, 0.24283544719219208, 0.18832671642303467, 0.06913595646619797, 0.8325304985046387, -0.051182497292757034, -0.002622179687023163, 0.26841557025909424, 0.13715149462223053, -0.025875937193632126, 0.21356984972953796, 0.3118310868740082, -0.09726126492023468, 0.7539976239204407, 0.002773987129330635, -0.37386417388916016, 0.16418004035949707, 0.11090371012687683, 0.09363207966089249, -0.33068567514419556, 0.3224713206291199, 0.00699920579791069, 0.15326562523841858, 0.1813347041606903, 0.13836553692817688, 0.13542592525482178, 0.02179213985800743, 0.056876275688409805, -0.11588776856660843, -0.10670539736747742, 0.04140688478946686, -0.14231126010417938, 0.3088730573654175, 0.49418213963508606, 0.29207831621170044, 0.08773338794708252, -0.018479356542229652, -0.148568794131279, -0.4351502060890198, -0.07018528878688812, 0.2942870557308197, -0.08080218732357025, 0.6000442504882812, -0.38746407628059387, 0.2760810852050781, -0.2349935919046402, -0.05127253755927086, -0.19208088517189026, -0.28295275568962097, -0.438790887594223, 0.5873829126358032, 0.025749430060386658, 0.11051089316606522, -0.019075941294431686, 0.08607622981071472, 0.24644339084625244, -0.42209839820861816, -0.47889551520347595, -0.22753015160560608, -0.3916202783584595, -0.24033021926879883, 0.35676756501197815, -0.23735268414020538, 0.16249053180217743, -0.04473843425512314, -0.24024373292922974, -0.32206031680107117, -0.3193668723106384, 0.21590006351470947, -0.10055683553218842, 0.34055718779563904, 0.15879857540130615, 0.3343050479888916, -0.08166433870792389, -0.2360336035490036, 0.06047610566020012, -0.022906120866537094, 0.07187992334365845, 0.37047266960144043, 0.03912327438592911, 0.16206929087638855, 0.21729934215545654, -0.022320035845041275, -0.0626743882894516, -0.36993733048439026, 0.22948819398880005, -0.08360084891319275, -0.02254185825586319, -0.1367942839860916, 0.1447838544845581, 0.21096637845039368, 0.007981669157743454, 0.23532840609550476, 0.030978672206401825, -0.5510842800140381, 0.35647496581077576, -0.0589749701321125, -0.20427678525447845, -0.0798700600862503, -0.09038365632295609, 0.2189510613679886, 0.32879510521888733, -0.7069647908210754, 0.17786931991577148, -0.1567889302968979, -0.07135237753391266, -0.3246043920516968, -0.010446608066558838, 0.13193631172180176, 0.0011898353695869446, 0.08412928879261017, -0.012237221002578735, -0.11581821739673615, 0.23517504334449768, 0.061482470482587814, 0.14530998468399048, 0.11011931300163269, 0.6345437169075012, -0.06940467655658722, 0.4122028946876526, 0.13128113746643066, -0.2054470181465149, 0.5629239082336426, 0.20100948214530945, 0.23397570848464966, -0.05016886442899704, -0.33951902389526367, -0.1370483934879303, -0.12271182984113693, -0.30136042833328247, 0.05163465067744255, -0.27379748225212097, -0.4776111841201782, -0.22792896628379822, -0.101605623960495, 0.029625318944454193, -0.31809961795806885, 0.3275182247161865, -0.2420838475227356, 0.19155313074588776, -0.09333030134439468, 0.1959567368030548, -0.11787644028663635, 0.0708526223897934, -0.01308884471654892, 0.049692023545503616, 0.03998801112174988, 0.028258461505174637, 0.08285267651081085, 0.017896242439746857, -0.32232558727264404, 0.10304690897464752, 0.011701446026563644, 0.6979996562004089, 0.12916530668735504, -0.2807062268257141, 0.16129307448863983, -0.363422691822052, 1.0772467851638794, -0.06730885058641434, 0.06997591257095337, 0.16298526525497437, -0.36107879877090454, -0.3385288715362549, -0.24015048146247864, 0.0003510788083076477, 0.03233282268047333, 0.1758802831172943, 0.6726388335227966, -0.2817724347114563, -0.4849203824996948, 0.12082206457853317, 0.058869682252407074, -0.15790338814258575, -0.33217936754226685, -0.41069456934928894, 0.023831546306610107, -0.279127836227417, 0.15059922635555267, -0.2041093409061432, 0.20998515188694, 0.07244828343391418, -0.05867685750126839, -0.31548163294792175, 0.034809596836566925, -0.01637483388185501, 0.07453124225139618, 0.10491687804460526, -0.08557511866092682, 0.5007957220077515, 0.09573870897293091, 0.4065665006637573, 0.36349403858184814, 0.4176526367664337, 0.1606009602546692, -0.5319432020187378, 0.4616062641143799, 0.07472814619541168, 0.4526495337486267, 0.4434499442577362, 0.008461199700832367, -0.04371573403477669, -0.18625149130821228, 0.3523003160953522, -0.2473403513431549, 0.06282290816307068, 0.2693723738193512, 0.07310647517442703, -0.5514347553253174, -0.25109511613845825, 0.320549339056015, -0.0885772556066513, 0.21412186324596405, 0.3246326446533203, -0.029905322939157486, 0.07086727023124695, 0.4760635197162628, 0.03417171537876129, 0.8705952167510986, -0.2426762878894806, 0.1735345721244812, 0.14302277565002441, -0.3377855718135834, 0.09399887919425964, -0.7046583890914917, -0.03679317235946655, -0.3951184153556824, -0.17244119942188263, -0.025769636034965515, -0.3663426339626312, 0.1847667396068573, 0.0349469855427742, 0.1930486261844635, 0.3650994598865509, -0.23521524667739868, -0.028946785256266594, 0.08999459445476532, 0.16733506321907043, -0.18935735523700714, -0.3333320617675781, -0.27424952387809753, -0.03717150539159775, -0.07643571496009827, 0.06806899607181549, -0.09715591371059418, -0.14161986112594604, 0.1158251166343689, 0.020700007677078247, -0.08260650932788849, 0.2893185019493103, 0.2087247371673584, -0.08805954456329346, 0.1842675507068634, -0.6233505010604858, 0.0846903920173645, 0.05396305024623871, 0.0004312898963689804, -0.0052565340884029865, -0.049610864371061325, 0.11137939989566803, 0.07084977626800537, -0.04483288899064064, 0.14977626502513885, -0.21336114406585693, 0.5097314715385437, 0.1286107450723648, -0.13438227772712708, 0.01058906689286232, -0.21906182169914246, -0.2553572654724121, 0.18809179961681366, 0.27484816312789917, 0.2096197009086609, -0.1113186925649643, 0.10542038083076477, 0.13644342124462128, -0.034732118248939514, -0.26375123858451843, -0.008869542740285397, -0.09912774711847305, -0.26528334617614746, 0.07433798909187317, -0.20421981811523438, -0.38435131311416626, -0.13205087184906006, 0.5401942133903503, -0.054237011820077896, 0.03250838816165924, 0.6898308992385864, 0.34207844734191895, -0.3044710159301758, -0.1613142043352127, -0.2729507088661194, 0.09093067049980164, -0.3698558211326599, 0.09076038002967834, -0.16474905610084534, 0.07851925492286682, 0.0791635513305664, -0.10130801051855087, -0.06664770841598511, -0.5634875297546387, -0.2242112159729004, -0.39455562829971313, -0.1030871719121933, -0.1776462197303772, -0.06821206957101822, 0.06825421750545502, 0.1312992125749588, -0.009022437036037445, -0.13222593069076538, 0.12034685909748077, -0.11498088389635086, -0.11254952847957611, -0.24857985973358154, 0.09562568366527557, -0.11686144769191742, -0.20512479543685913, 0.09828071296215057, 0.046688467264175415, 0.021571412682533264, 0.20670701563358307, 0.12592527270317078, -0.08399122953414917, -0.30289769172668457, 0.1691737025976181, 0.04146762937307358, 0.21970519423484802, 0.0750466138124466, -0.3276124596595764, -0.20625250041484833, -0.1963484287261963, 0.14621108770370483, -0.2543773651123047, 0.0420583114027977, -0.07283396273851395, 0.3077680468559265, 0.18680527806282043, -0.0420289970934391, -0.01390948984771967, 0.2907180190086365, -0.20924589037895203, 0.13657914102077484, 0.2664371132850647, -0.22106212377548218, 0.10524624586105347, -0.20366647839546204, 0.05983512103557587, 0.13045302033424377, 0.03582654893398285, 0.39465731382369995, -0.442821204662323, 0.04942037910223007, -0.13278712332248688, 0.3994401693344116, 0.7907024621963501, 0.016487300395965576, -0.3324844539165497, 0.5864157676696777, -0.02722044661641121, -0.16866609454154968, -0.08069262653589249, -0.08362296223640442, 0.09484787285327911, 0.018370307981967926, 0.24077925086021423, -0.11257975548505783, -0.19620124995708466, 0.2759546637535095, 0.09125084429979324, 0.14440575242042542, -0.16032826900482178, -0.022328104823827744, 0.12721320986747742, -0.05155801400542259, 0.0047424063086509705, 0.42106300592422485, 0.45286688208580017, 0.037928007543087006, 0.2722893953323364, 0.10225316882133484, -0.016048841178417206, -0.1793728619813919, 0.1296202540397644, -0.2117873579263687, -0.5464547872543335, 0.23666273057460785, 0.21036207675933838, 0.30116766691207886, 0.05045099928975105, 0.006807973608374596, 0.33789777755737305, 0.0998203307390213, -0.31202930212020874, -0.3815056085586548, 0.20768317580223083, -0.12425097823143005, 0.08381590247154236, 0.20595331490039825, -0.13481947779655457, -0.11137713491916656, 0.19807405769824982, 0.08423610031604767, -0.13443072140216827, 0.08534640073776245, 0.24498961865901947, 0.2157089114189148, -0.4886455535888672, -0.23423779010772705, -0.05375972017645836, 0.20472517609596252, -0.07698371261358261, 0.22551393508911133, -0.0361856184899807, -0.12160345911979675, -0.29420676827430725, -0.1924886852502823, 0.272984117269516, 0.4757356643676758, -0.08639213442802429, 0.024238672107458115, -0.03170341998338699, 0.0035041943192481995, -0.018888331949710846, 0.1305103898048401, -0.24989129602909088, 0.2596709728240967, 0.4303510785102844, -0.06363153457641602, -0.021906185895204544, -0.0718887522816658, -0.016741061583161354, 0.29372647404670715, -0.25670039653778076, 0.1987878382205963, 0.3534179925918579, 0.1332102119922638, -0.03314650431275368, -0.09757769107818604, -0.559174120426178, 0.05101580172777176, 0.33289453387260437, -0.11406023055315018, 0.08348045498132706, 0.048440758138895035, 0.011391773819923401, -0.028699610382318497, 0.5511322617530823, 0.2757294774055481, 0.17669174075126648, -0.20075565576553345, -0.15340685844421387, -0.3894816040992737, -0.002345304936170578, -0.2771433889865875, -0.09119021892547607, 0.36120250821113586, 0.3970239460468292, 0.4005504250526428, 0.035705339163541794, 0.1709090769290924, -0.1649121195077896, -0.2883465886116028, 0.5332809686660767, -0.35848239064216614, -0.3011513948440552, -0.028348702937364578, 0.12227465212345123, -0.1646748185157776, -0.40878725051879883, 0.09640736877918243, 0.031828250735998154, -0.039455994963645935, 0.00709150917828083, -0.25514161586761475, 0.1360229104757309, -0.6487048268318176, 0.3941541314125061, -0.24098150432109833, 0.09119212627410889, 0.16849733889102936, -0.14768441021442413, -0.25979992747306824, -0.14837650954723358, -0.01018071174621582, -0.05782165750861168, -0.14925996959209442, 0.13917505741119385, -0.16721686720848083, -0.08581118285655975, -0.47563695907592773, 0.04116320610046387, -0.01437050849199295, -0.15104365348815918, -0.01605144888162613, 0.22040846943855286, 0.1243571937084198, 0.33257976174354553, 0.034434348344802856, 0.21407005190849304, 0.2747594118118286, 0.28296107053756714, -0.3957247734069824, -0.09159666299819946, 0.43328702449798584, -0.40963315963745117, -0.5856462121009827, 0.27538368105888367, 0.06776420027017593, 0.15426096320152283, 0.0028769895434379578, -0.4142304062843323, 0.2177470177412033, 0.09099741280078888, -0.09660108387470245, -0.013558633625507355, 0.2128242552280426, 0.0742829218506813, 0.12169602513313293, -0.367454469203949, 0.11429275572299957, 0.0536397248506546, -0.08719483017921448, -0.05567274987697601, -0.09899663925170898 ]
https://github.com/huggingface/datasets/issues/6079
`collate_fn` is applied after the `torch` formatting step, so I think the only option when working with an `IterableDataset` is to remove the `with_format` call and perform the conversion from Python values to PyTorch tensors in `collate_fn`. The standard `Dataset` supports `with_format("numpy")`, which should make this conversion faster.
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
48
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 `collate_fn` is applied after the `torch` formatting step, so I think the only option when working with an `IterableDataset` is to remove the `with_format` call and perform the conversion from Python values to PyTorch tensors in `collate_fn`. The standard `Dataset` supports `with_format("numpy")`, which should make this conversion faster.
[ -0.09866748005151749, -0.05150717496871948, -0.006096921861171722, 0.2537921965122223, 0.03468204289674759, 0.1238858550786972, 0.5064867734909058, 0.27355968952178955, -0.14257553219795227, 0.21018093824386597, -0.02429894730448723, 0.3711855709552765, 0.0008320845663547516, 0.13665905594825745, -0.19797511398792267, 0.025907590985298157, 0.06172022596001625, 0.24372455477714539, 0.041447948664426804, -0.14032945036888123, -0.020195968449115753, 0.05664067715406418, -0.25773704051971436, -0.2889766991138458, -0.20135994255542755, -0.1248243972659111, 0.06400536000728607, -0.05956265330314636, 0.04773841053247452, -0.37540534138679504, 0.6273661255836487, 0.16596761345863342, 0.2872542142868042, 0.7220760583877563, -0.00013000910985283554, 0.11339613795280457, 0.20158763229846954, -0.016969595104455948, -0.5561367273330688, -0.2283773422241211, 0.1487552672624588, -0.028352156281471252, 0.13656577467918396, -0.22637143731117249, -0.03119838610291481, -0.2532844841480255, -0.14449471235275269, -0.3459761440753937, 0.09319441020488739, 0.03637414053082466, -0.024023346602916718, 0.07980059087276459, -0.14846102893352509, 0.09127435833215714, 0.10743852704763412, 0.14451520144939423, -0.057326316833496094, 0.20969431102275848, 0.32450398802757263, -0.19054698944091797, -0.18029926717281342, 0.0862845927476883, 0.03125758469104767, 0.04009081795811653, 0.2556338310241699, -0.18200257420539856, 0.06414468586444855, -0.09534822404384613, 0.1392715871334076, 0.06389378756284714, 0.5130343437194824, -0.22444288432598114, -0.31087616086006165, -0.3355443775653839, 0.0031216517090797424, -0.2911784052848816, 0.2407694160938263, 0.21541574597358704, -0.3218628168106079, -0.057024698704481125, 0.07721640914678574, 0.01097974181175232, -0.28088563680648804, 0.12795962393283844, -0.33549371361732483, 0.4021763503551483, -0.057515352964401245, 0.2104841023683548, 0.26209405064582825, -0.026880891993641853, 0.2893158793449402, 0.150803342461586, 0.13816845417022705, 0.03807634860277176, -0.8043258190155029, 0.12122803926467896, 0.04584599286317825, -0.21853560209274292, -0.10324470698833466, 0.06341008841991425, -0.007936447858810425, 0.12900471687316895, 0.2505932152271271, 0.2004956305027008, 0.4932253956794739, -0.2101868987083435, 0.07505016773939133, 0.051211804151535034, 0.20987188816070557, 0.12225505709648132, 0.003034554421901703, 0.05995630472898483, -0.25951099395751953, -0.27582329511642456, 0.32175132632255554, -0.2653083801269531, 0.15716154873371124, -0.3845878839492798, -0.0437217578291893, 0.2117166817188263, -0.23193103075027466, -0.09703344851732254, 0.11169326305389404, 0.4763823449611664, -0.20763958990573883, 0.20119619369506836, -0.0038236603140830994, 0.2053588330745697, -0.049887146800756454, 0.13561902940273285, 0.13666020333766937, -0.15605176985263824, -0.14570164680480957, -0.05390062928199768, 0.15671125054359436, -0.5025504231452942, 0.02203897386789322, 0.12160840630531311, 0.205618754029274, -0.129828080534935, 0.11498221009969711, -0.2105221003293991, 0.2633192539215088, 0.19303566217422485, -0.021990537643432617, 0.12915530800819397, 0.12191630899906158, -0.20142312347888947, -0.2624357044696808, 0.028958532959222794, -0.21740134060382843, -0.046995583921670914, -0.2071891725063324, -0.007639145478606224, 0.07724744081497192, -0.18721096217632294, -0.15304358303546906, -0.3964345157146454, 0.21027454733848572, 0.03566835820674896, 0.08639315515756607, -0.25429123640060425, -0.05553459748625755, 0.06119987741112709, 0.10357484221458435, 0.24536031484603882, -0.649132490158081, 0.27905499935150146, 0.19600649178028107, 0.20420020818710327, 0.19090911746025085, 0.13038331270217896, -0.33865517377853394, 0.3319161832332611, -0.31611087918281555, -0.40610432624816895, 0.49081677198410034, -0.22809456288814545, -0.1620362401008606, 0.44457176327705383, 0.09259357303380966, 0.318092942237854, 0.2055358737707138, -0.21597115695476532, 0.1234329342842102, -0.09481322765350342, 0.3008340001106262, 0.12916383147239685, -0.041964538395404816, -0.014012552797794342, -0.18651363253593445, 0.12112406641244888, 0.11608994007110596, 0.33832496404647827, 0.15198124945163727, 0.20379884541034698, -0.19803769886493683, -0.170689195394516, 0.3665149509906769, -0.1482415497303009, -0.008386682718992233, 0.5470355153083801, 0.34191176295280457, 0.4173920154571533, 0.3142947852611542, -0.01612573117017746, -0.40624338388442993, 0.28358834981918335, 0.08763213455677032, 0.004691923502832651, -0.1530366688966751, 0.10904666781425476, -0.08354564011096954, 0.31931355595588684, -0.3737378716468811, -0.07413232326507568, -0.12824702262878418, 0.3082183599472046, 0.0618809312582016, -0.19580745697021484, -0.37534379959106445, 0.5987236499786377, -0.07216683775186539, -0.01358078233897686, -0.36149346828460693, 0.21686425805091858, 0.20518283545970917, -0.16489043831825256, -0.0207427516579628, -0.008548110723495483, 0.14468148350715637, -0.3190101385116577, -0.10809843242168427, 0.025620965287089348, 0.1310170590877533, -0.0466008223593235, -0.24211561679840088, -0.07350746542215347, 0.11964933574199677, 0.2766718864440918, 0.02826879732310772, -0.16078975796699524, 0.04240773990750313, -0.1427522897720337, 0.16931144893169403, 0.19170184433460236, -0.013951517641544342, 0.8178402185440063, -0.07761918753385544, -0.036432065069675446, 0.2766302227973938, 0.08060435950756073, -0.05988925322890282, 0.21035891771316528, 0.2825424075126648, -0.09602822363376617, 0.6597731709480286, 0.0019129496067762375, -0.35483625531196594, 0.18189455568790436, 0.21890266239643097, 0.08957023918628693, -0.3274403214454651, 0.28298139572143555, -0.0047676824033260345, 0.15771658718585968, 0.15038467943668365, 0.06533606350421906, 0.11448168009519577, 0.012300018221139908, 0.03918946906924248, -0.04424507915973663, -0.1389031708240509, 0.020901788026094437, -0.11600098013877869, 0.3801925778388977, 0.5351850986480713, 0.26908278465270996, 0.06530974805355072, -0.04744291305541992, -0.14423683285713196, -0.45882171392440796, -0.04141153395175934, 0.3201219439506531, -0.11214976757764816, 0.6146441102027893, -0.405881404876709, 0.2554084062576294, -0.25121957063674927, -0.0617731511592865, -0.2164253294467926, -0.2974090278148651, -0.3567236661911011, 0.6690151691436768, 0.07406251132488251, 0.08866213262081146, 0.06536862254142761, 0.2154306024312973, 0.22551554441452026, -0.4365580976009369, -0.4590210020542145, -0.3077540993690491, -0.38524946570396423, -0.23252427577972412, 0.3593832850456238, -0.3618081510066986, 0.1947275996208191, -0.07763837277889252, -0.20992399752140045, -0.28338873386383057, -0.26553332805633545, 0.24039030075073242, -0.10012759268283844, 0.2651892900466919, 0.11871760338544846, 0.3255004584789276, -0.02878326177597046, -0.1924564242362976, 0.03732172027230263, 0.12647303938865662, 0.10987130552530289, 0.3528742492198944, -0.019810788333415985, 0.13789141178131104, 0.25528913736343384, -0.07837791740894318, -0.0340304970741272, -0.27886974811553955, 0.25596967339515686, -0.06432236731052399, 0.08879147469997406, -0.06327613443136215, 0.11700291931629181, 0.19588792324066162, -0.051040612161159515, 0.18273082375526428, 0.03336086496710777, -0.5982882976531982, 0.3892025053501129, -0.08125501126050949, -0.21322044730186462, -0.0313093438744545, -0.0566750094294548, 0.24934855103492737, 0.35479873418807983, -0.6761939525604248, 0.18092083930969238, -0.13437363505363464, -0.06829988211393356, -0.35602638125419617, -0.04129951074719429, 0.1649855673313141, 0.06089623644948006, 0.09121846407651901, -0.013983197510242462, -0.09746713191270828, 0.2870170772075653, 0.06574840098619461, 0.14784030616283417, 0.1343938112258911, 0.5564122200012207, 0.03460918366909027, 0.44170916080474854, 0.24461579322814941, -0.15070483088493347, 0.5232701897621155, 0.1989794820547104, 0.17561468482017517, -0.05080939829349518, -0.3498584032058716, -0.13301092386245728, -0.17130184173583984, -0.24746206402778625, 0.06465563923120499, -0.2449428290128708, -0.46352291107177734, -0.19256490468978882, -0.05951983854174614, 0.025667868554592133, -0.35324907302856445, 0.3323333263397217, -0.2191891372203827, 0.2523556351661682, -0.06263257563114166, 0.20407918095588684, -0.19143612682819366, 0.06266003847122192, 0.09613215923309326, 0.026535453274846077, 0.11191914975643158, 0.016717880964279175, 0.010326705873012543, -0.042731113731861115, -0.3005983829498291, 0.07078513503074646, 0.016879219561815262, 0.6481269001960754, 0.08373996615409851, -0.245591402053833, 0.18974600732326508, -0.4017554521560669, 1.1557410955429077, -0.032773975282907486, 0.0508386604487896, 0.20233508944511414, -0.35018831491470337, -0.3277859687805176, -0.21432872116565704, -0.009530767798423767, 0.13201479613780975, 0.15744665265083313, 0.7771092057228088, -0.2706897258758545, -0.5141989588737488, 0.16553129255771637, 0.08317630738019943, -0.22443994879722595, -0.29037120938301086, -0.3975629210472107, -0.003456622362136841, -0.3121943473815918, 0.1531393676996231, -0.1757134199142456, 0.23636813461780548, 0.1339285969734192, -0.10460612177848816, -0.3127174377441406, -0.008095018565654755, -0.02697649598121643, 0.12751507759094238, 0.08991405367851257, -0.05121257156133652, 0.4915120601654053, 0.16004304587841034, 0.42009595036506653, 0.3643806576728821, 0.3964534401893616, 0.1788294017314911, -0.5513399243354797, 0.37641802430152893, 0.008044160902500153, 0.48831307888031006, 0.4363957345485687, -0.02545083686709404, -0.05921584367752075, -0.17492321133613586, 0.33039575815200806, -0.33226653933525085, 0.10408496856689453, 0.2878642678260803, 0.14979287981987, -0.5691830515861511, -0.3082188367843628, 0.277170330286026, -0.0558479018509388, 0.19093391299247742, 0.39038896560668945, 0.013901762664318085, 0.08744417876005173, 0.47775328159332275, 0.034667108207941055, 0.8743616938591003, -0.2163114696741104, 0.13932962715625763, 0.16511842608451843, -0.34762346744537354, 0.04511205852031708, -0.7497524619102478, 0.03454960882663727, -0.35373520851135254, -0.19685477018356323, -0.02482808753848076, -0.378490686416626, 0.20003058016300201, 0.09509304165840149, 0.23250159621238708, 0.32363107800483704, -0.1479366421699524, -0.11603574454784393, 0.08512289077043533, 0.17022132873535156, -0.15632124245166779, -0.3134034276008606, -0.27479976415634155, -0.04030501842498779, -0.12001108378171921, 0.11850308626890182, -0.1207929402589798, -0.15211498737335205, 0.14687123894691467, 0.10514244437217712, -0.11463943868875504, 0.27227580547332764, 0.1640487164258957, -0.13172531127929688, 0.17782695591449738, -0.6451172232627869, 0.10407909750938416, 0.016919465735554695, 0.11240703612565994, 0.02278931625187397, -0.09394921362400055, 0.09709719568490982, -0.018100015819072723, -0.08817045390605927, 0.15403909981250763, -0.17961972951889038, 0.5126617550849915, 0.04164345562458038, -0.12511777877807617, 0.013746799901127815, -0.17830297350883484, -0.33715298771858215, 0.21621033549308777, 0.19033612310886383, 0.24225908517837524, -0.11232253909111023, 0.08647508919239044, 0.20524603128433228, -0.016545608639717102, -0.25022149085998535, -0.017102017998695374, -0.07147650420665741, -0.2489950805902481, 0.20256847143173218, -0.2868185043334961, -0.3827022910118103, -0.10011889040470123, 0.548977255821228, -0.017006272450089455, 0.0174381285905838, 0.7191883325576782, 0.3452690839767456, -0.3230138421058655, -0.1428704559803009, -0.28077930212020874, 0.1640137881040573, -0.42899858951568604, 0.08193424344062805, -0.13930562138557434, 0.1577821969985962, -0.02354193478822708, -0.03875541314482689, -0.0809217169880867, -0.5331926941871643, -0.2137470543384552, -0.3955552875995636, -0.10844935476779938, -0.17549638450145721, 0.004432648420333862, 0.09497220814228058, 0.20054450631141663, 0.021168429404497147, -0.17279338836669922, 0.12280622869729996, -0.1076551005244255, -0.0985071212053299, -0.21218031644821167, 0.095173180103302, -0.14484582841396332, -0.21149732172489166, 0.10692234337329865, -0.015912428498268127, -0.021029755473136902, 0.20546704530715942, 0.14961743354797363, -0.09279040992259979, -0.3231801390647888, 0.1684972047805786, 0.013826403766870499, 0.12438149005174637, 0.06481336057186127, -0.3263351023197174, -0.21343328058719635, -0.1796162724494934, 0.24114465713500977, -0.21049587428569794, 0.05035725608468056, -0.01065760850906372, 0.29363948106765747, 0.1334598809480667, -0.10131717473268509, -0.08114004135131836, 0.32858356833457947, -0.23910799622535706, 0.14183789491653442, 0.2309236377477646, -0.2515382468700409, 0.051810503005981445, -0.20705226063728333, 0.12699301540851593, 0.1798534095287323, 0.0013507381081581116, 0.4258630573749542, -0.5233979821205139, 0.05600319057703018, -0.06762749701738358, 0.3739950656890869, 0.7506064176559448, 0.05681023374199867, -0.3045477867126465, 0.5548614263534546, -0.04105232656002045, -0.22284579277038574, -0.19871988892555237, -0.11844440549612045, 0.0631839781999588, -0.0050465986132621765, 0.22355017066001892, -0.10269080847501755, -0.10066366195678711, 0.2857673764228821, 0.10166838020086288, 0.16686159372329712, -0.19437384605407715, -0.04291116073727608, 0.10656463354825974, -0.05026504397392273, 0.0016872221603989601, 0.3886898458003998, 0.45699387788772583, 0.051973141729831696, 0.23566612601280212, 0.1514720618724823, 0.11755789816379547, -0.035582005977630615, 0.0646868348121643, -0.14392611384391785, -0.5210022330284119, 0.06933868676424026, 0.10324711352586746, 0.37056049704551697, 0.06951916962862015, 0.02465984970331192, 0.2947450280189514, 0.13013052940368652, -0.34565970301628113, -0.3387877643108368, 0.1527288854122162, -0.09841321408748627, 0.1150333508849144, 0.16163459420204163, -0.16983066499233246, -0.08060812950134277, 0.15496504306793213, 0.03460884466767311, -0.2100526988506317, 0.11297100782394409, 0.18752053380012512, 0.19074909389019012, -0.48142462968826294, -0.19560374319553375, -0.060157254338264465, 0.25054845213890076, -0.07864393293857574, 0.19868344068527222, -0.06830200552940369, -0.1716320514678955, -0.3182617425918579, -0.15104225277900696, 0.23843726515769958, 0.40782952308654785, -0.11488007009029388, 0.051479946821928024, -0.11858902126550674, 0.005522251129150391, 0.01823659986257553, 0.12707246840000153, -0.3181717097759247, 0.1466764360666275, 0.4068882465362549, -0.086042121052742, 0.02146676927804947, -0.058619819581508636, 0.013491377234458923, 0.2451750636100769, -0.2679637372493744, 0.18757733702659607, 0.3388453722000122, 0.012006282806396484, 0.005520885810256004, -0.13643258810043335, -0.4458930492401123, -0.0671042948961258, 0.41349315643310547, -0.06614886969327927, 0.0755310207605362, 0.05090650916099548, 0.008114058524370193, -0.04337717592716217, 0.5865341424942017, 0.2368289679288864, 0.18187236785888672, -0.1938970386981964, -0.10167275369167328, -0.36229589581489563, 0.02469037100672722, -0.28606978058815, -0.030612625181674957, 0.41028061509132385, 0.3564322590827942, 0.3778133988380432, 0.07897583395242691, 0.22154277563095093, -0.14166094362735748, -0.20596706867218018, 0.5600926280021667, -0.3980069160461426, -0.2937210202217102, 0.06053835526108742, 0.1405574530363083, -0.15870976448059082, -0.41354840993881226, 0.1591644436120987, -0.02978130243718624, -0.07338445633649826, -0.002692224457859993, -0.29779380559921265, 0.1672215759754181, -0.5536544919013977, 0.3697058856487274, -0.22048892080783844, 0.068163201212883, 0.19151440262794495, -0.11528477072715759, -0.22854118049144745, -0.05168760567903519, 0.01293613389134407, 0.009492442943155766, -0.1472208946943283, 0.09052470326423645, -0.15508989989757538, -0.03867748752236366, -0.4393042027950287, 0.017334096133708954, 0.011057883501052856, -0.15410183370113373, -0.01760907471179962, 0.2404155433177948, 0.11096092313528061, 0.3588047921657562, 0.08783448487520218, 0.23681840300559998, 0.259225994348526, 0.25868016481399536, -0.4322262406349182, -0.03799496591091156, 0.45347487926483154, -0.3874223232269287, -0.605867326259613, 0.25149691104888916, 0.09288062155246735, 0.20305097103118896, -0.03394012898206711, -0.36311066150665283, 0.1279664933681488, 0.13334794342517853, -0.09242256730794907, -0.03635348379611969, 0.21335940062999725, 0.11953774094581604, 0.1164458766579628, -0.35177135467529297, 0.2749592661857605, 0.04023189842700958, -0.10179772973060608, -0.08941073715686798, -0.11239160597324371 ]
https://github.com/huggingface/datasets/issues/6079
Thanks! Python 3.10 conda-env: After replacing with_format("torch") with with_format("numpy"), the error went away. However, it was still taking over 2 minutes to load a very small batch of 64 samples with num_workers set to 32. Once I removed with_format call altogether, it is finishing in 11 seconds. Python 3.6 based conda-env: When I switch the kernel , neither of the above work, and with_format("torch") is the only thing that works, and executes in 1.6 seconds. I feel something else is also amiss here.
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
83
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 Thanks! Python 3.10 conda-env: After replacing with_format("torch") with with_format("numpy"), the error went away. However, it was still taking over 2 minutes to load a very small batch of 64 samples with num_workers set to 32. Once I removed with_format call altogether, it is finishing in 11 seconds. Python 3.6 based conda-env: When I switch the kernel , neither of the above work, and with_format("torch") is the only thing that works, and executes in 1.6 seconds. I feel something else is also amiss here.
[ -0.08759461343288422, -0.05146850645542145, -0.00822087749838829, 0.26277241110801697, 0.07494092732667923, 0.03287142515182495, 0.5292817950248718, 0.29862678050994873, -0.16207538545131683, 0.18641164898872375, -0.04850514233112335, 0.4207500219345093, -0.007070278748869896, 0.08174923062324524, -0.2115568220615387, 0.09538556635379791, 0.13751694560050964, 0.18895019590854645, 0.009223364293575287, -0.09641359746456146, -0.012771092355251312, 0.03667008876800537, -0.23501618206501007, -0.2509412169456482, -0.28608617186546326, -0.014174755662679672, 0.11479618400335312, -0.0367187038064003, 0.0027924105525016785, -0.4637414216995239, 0.6261831521987915, 0.08818618953227997, 0.30939701199531555, 0.7832278609275818, -0.00013008236419409513, 0.13682937622070312, 0.2875935137271881, -0.0015288814902305603, -0.5465434193611145, -0.22208863496780396, 0.10308003425598145, -0.08552704751491547, 0.19408784806728363, -0.1563107669353485, 0.0013771802186965942, -0.12070519477128983, -0.11437902599573135, -0.3439643979072571, 0.0378279983997345, 0.05493534728884697, -0.027402054518461227, 0.05966918170452118, -0.16564805805683136, 0.03089418262243271, 0.1204749047756195, 0.23448744416236877, -0.019706308841705322, 0.30722928047180176, 0.3882380425930023, -0.19762247800827026, -0.23063351213932037, 0.14277979731559753, -0.015150915831327438, 0.050113968551158905, 0.19603802263736725, -0.21031901240348816, 0.10491931438446045, -0.1074012815952301, 0.16991296410560608, 0.11969178915023804, 0.5104135870933533, -0.0910843014717102, -0.32291659712791443, -0.23589344322681427, -0.09694361686706543, -0.21399745345115662, 0.25260013341903687, 0.21765458583831787, -0.3621574640274048, -0.060459837317466736, 0.039514631032943726, 0.10895374417304993, -0.17907315492630005, 0.04062017798423767, -0.3182455599308014, 0.5012408494949341, 0.011232752352952957, 0.19958503544330597, 0.26868757605552673, 0.022448554635047913, 0.32809290289878845, 0.14105230569839478, 0.16293840110301971, 0.030253618955612183, -0.7949458360671997, 0.21059411764144897, 0.05816410854458809, -0.11980332434177399, -0.15799227356910706, -0.011075826361775398, -0.03229033201932907, 0.11429113149642944, 0.2685357630252838, 0.12041313946247101, 0.37797731161117554, -0.27336984872817993, 0.1737566590309143, 0.04276428371667862, 0.1131569892168045, 0.15943294763565063, -0.015386179089546204, 0.05988103896379471, -0.2422267496585846, -0.35960692167282104, 0.24267160892486572, -0.17984497547149658, 0.12577016651630402, -0.3473670482635498, -0.0849749818444252, 0.14190539717674255, -0.14490972459316254, -0.18062886595726013, 0.1301606148481369, 0.48195135593414307, -0.18292586505413055, 0.2846580445766449, -0.0033838674426078796, 0.17730651795864105, -0.11973617970943451, 0.12969282269477844, 0.16286127269268036, -0.11198229342699051, -0.28217431902885437, -0.06987644731998444, 0.14434556663036346, -0.5911123156547546, 0.10331633687019348, 0.1457153707742691, 0.22031770646572113, -0.036394260823726654, 0.012368150055408478, -0.2432587593793869, 0.13783356547355652, 0.13298025727272034, -0.1483975648880005, 0.2378033548593521, 0.1536330282688141, -0.08347638696432114, -0.25747472047805786, -0.02863059565424919, -0.14748793840408325, -0.08578106015920639, -0.19677214324474335, -0.01179993711411953, 0.1416744589805603, -0.06736090779304504, -0.045770496129989624, -0.5223288536071777, 0.18566852807998657, -0.05175679549574852, 0.09895080327987671, -0.22910018265247345, -0.0809832215309143, 0.03543662652373314, 0.07524798065423965, 0.3761204779148102, -0.668343722820282, 0.3167179226875305, 0.29812052845954895, 0.2238563746213913, 0.22548380494117737, 0.09131667017936707, -0.33758965134620667, 0.2842549979686737, -0.3561452627182007, -0.4647899270057678, 0.45171576738357544, -0.3167094886302948, -0.18016782402992249, 0.477641761302948, 0.057836055755615234, 0.2277369499206543, 0.26199620962142944, -0.22243458032608032, 0.06580483913421631, -0.1397591233253479, 0.31894898414611816, 0.12142381817102432, 0.023421207442879677, -0.022547245025634766, -0.24882489442825317, 0.02732895314693451, 0.05221373960375786, 0.3559509515762329, 0.0844053253531456, 0.16863912343978882, -0.20088784396648407, -0.2755863666534424, 0.3825705349445343, -0.10783560574054718, -0.02686452865600586, 0.49433478713035583, 0.24002796411514282, 0.40744850039482117, 0.23590996861457825, 0.07869543135166168, -0.3664543330669403, 0.3453901410102844, 0.11601316928863525, 0.023598019033670425, -0.06796195358037949, 0.16203734278678894, -0.11034035682678223, 0.3326127231121063, -0.3523775339126587, -0.17323777079582214, -0.160299152135849, 0.3327006697654724, 0.054231658577919006, -0.1438148319721222, -0.3412456512451172, 0.5778262615203857, 0.005842827260494232, 0.03302263468503952, -0.28858911991119385, 0.12144798785448074, 0.12544262409210205, -0.14746980369091034, -0.027820900082588196, -0.11095859855413437, 0.12089663743972778, -0.24868899583816528, -0.13878165185451508, -0.003088532481342554, 0.2013760805130005, -0.03262322396039963, -0.2749757468700409, -0.2505962550640106, 0.06444928050041199, 0.4176533818244934, 0.08052963763475418, -0.1770400106906891, 0.10390355437994003, -0.1016603484749794, 0.1358572542667389, 0.11919891834259033, 0.0014190543442964554, 0.7810065150260925, -0.1621139645576477, -0.021608419716358185, 0.2772024869918823, 0.09001532196998596, 0.010894648730754852, 0.1799614429473877, 0.4067268967628479, -0.02935565449297428, 0.7410804033279419, 0.01415124349296093, -0.28414255380630493, 0.18688471615314484, 0.1523435264825821, 0.07053228467702866, -0.37152060866355896, 0.30294543504714966, 0.03513837233185768, 0.1215905100107193, 0.1770051270723343, 0.049991220235824585, 0.23449648916721344, 0.006423346698284149, 0.06242660805583, -0.14399906992912292, -0.04969075322151184, -0.033890772610902786, -0.08253945410251617, 0.3011559545993805, 0.5943385362625122, 0.21108564734458923, -0.010473039001226425, -0.04497447609901428, -0.04125650227069855, -0.5201134085655212, -0.06372806429862976, 0.2466352880001068, -0.1142466738820076, 0.5818240642547607, -0.33287203311920166, 0.3628094494342804, -0.22942659258842468, -0.21168750524520874, -0.1608562469482422, -0.27675867080688477, -0.4120771884918213, 0.5215047597885132, 0.0633496567606926, 0.13940151035785675, 0.07293673604726791, 0.1014859601855278, 0.2356744110584259, -0.3859478235244751, -0.37585073709487915, -0.28078988194465637, -0.35979562997817993, -0.2557547688484192, 0.3889557719230652, -0.2749793529510498, 0.11891669034957886, -0.12581337988376617, -0.20094147324562073, -0.2125120311975479, -0.22735026478767395, 0.24278002977371216, -0.04121437296271324, 0.28843677043914795, 0.15389081835746765, 0.3332079350948334, 0.043102413415908813, -0.18342041969299316, 0.09424780309200287, 0.043489083647727966, 0.0816035196185112, 0.3225008249282837, -0.01941716857254505, 0.18650206923484802, 0.23341104388237, -0.034014590084552765, -0.1029953882098198, -0.37221235036849976, 0.1872188150882721, -0.09352933615446091, 0.034298673272132874, -0.09844474494457245, 0.2451152801513672, 0.248855322599411, -0.06823291629552841, 0.2037784457206726, 0.0231679268181324, -0.6360751986503601, 0.36484500765800476, -0.07409502565860748, -0.18942077457904816, -0.08986572921276093, -0.004946276545524597, 0.2718513011932373, 0.384594589471817, -0.6500179171562195, 0.08188651502132416, -0.19171883165836334, -0.144187793135643, -0.3296029567718506, 0.023539865389466286, 0.2176811397075653, 0.10693205893039703, 0.06472127884626389, 0.030248038470745087, -0.09513391554355621, 0.22468701004981995, -0.0914943516254425, 0.09183645993471146, 0.11927193403244019, 0.6572454571723938, 0.00222671777009964, 0.41389474272727966, 0.27242350578308105, -0.13026195764541626, 0.44035786390304565, 0.2854174077510834, 0.1931668072938919, -0.09715849161148071, -0.32519546151161194, -0.07580292969942093, -0.1336396336555481, -0.2392883598804474, 0.03760986030101776, -0.2817702293395996, -0.4064785838127136, -0.16910523176193237, -0.11514204740524292, -0.04169211909174919, -0.31641697883605957, 0.3946221172809601, -0.27565550804138184, 0.23265156149864197, -0.05473661422729492, 0.30081862211227417, -0.21935689449310303, 0.054694436490535736, -0.00968349352478981, 0.0382203534245491, 0.11455421894788742, -0.04301765561103821, -0.037705037742853165, 0.11039619147777557, -0.31717729568481445, 0.19048292934894562, 0.052749861031770706, 0.6484026312828064, 0.12076207995414734, -0.27904748916625977, 0.14420388638973236, -0.35734039545059204, 1.0860754251480103, 0.010568281635642052, 0.12097106873989105, 0.17671675980091095, -0.41720956563949585, -0.4147457480430603, -0.2671852707862854, 0.10038375109434128, 0.11787702143192291, 0.227751687169075, 0.6591967344284058, -0.248189777135849, -0.5271132588386536, 0.12165427207946777, 0.05416480451822281, -0.126864492893219, -0.36308273673057556, -0.3851208984851837, 0.052738338708877563, -0.3106893002986908, 0.152744323015213, -0.21810488402843475, 0.22894418239593506, 0.1043812707066536, -0.03234272822737694, -0.323214590549469, 0.0440305694937706, 0.010174337774515152, 0.053244467824697495, 0.08224223554134369, -0.1383742243051529, 0.4903188645839691, 0.1541697382926941, 0.3560885787010193, 0.34610432386398315, 0.3610042929649353, 0.05530053749680519, -0.4872760474681854, 0.37945157289505005, -0.025397129356861115, 0.3521324396133423, 0.575060248374939, 0.07627391815185547, -0.10045239329338074, -0.21379651129245758, 0.3643683195114136, -0.2997724413871765, 0.1086345762014389, 0.27712124586105347, 0.13455736637115479, -0.6556289196014404, -0.3523312211036682, 0.2774610221385956, -0.023839686065912247, 0.13996043801307678, 0.40575146675109863, -0.05502324923872948, 0.06502117216587067, 0.47978657484054565, 0.08763685822486877, 0.8756579160690308, -0.1315203458070755, 0.22372037172317505, 0.12371952831745148, -0.3423301875591278, 0.08246129006147385, -0.607761561870575, 0.04164646193385124, -0.3674892783164978, -0.19437071681022644, -0.009202633053064346, -0.43586114048957825, 0.18006710708141327, 0.12976542115211487, 0.2616112530231476, 0.28247931599617004, -0.24555304646492004, -0.039556462317705154, 0.03710394352674484, 0.10834413021802902, -0.18616634607315063, -0.30823081731796265, -0.25846946239471436, -0.056907862424850464, -0.07380761206150055, 0.11631955206394196, -0.11265136301517487, -0.12543849647045135, -0.04536572843790054, 0.06513608992099762, -0.05782049894332886, 0.25217047333717346, 0.17007023096084595, -0.030854186043143272, 0.1843852996826172, -0.727319598197937, 0.17805498838424683, 0.04901459813117981, 0.0894896611571312, 0.022888146340847015, -0.02429335191845894, 0.08691848069429398, -0.00931084156036377, -0.06251824647188187, 0.17698848247528076, -0.24086172878742218, 0.47339537739753723, 0.08552245795726776, -0.10921216011047363, -0.0028012823313474655, -0.25567251443862915, -0.2778015732765198, 0.18176113069057465, 0.3362381160259247, 0.2063301056623459, -0.14909768104553223, -0.04482425004243851, 0.17773732542991638, 0.03923264890909195, -0.19802400469779968, -0.030494648963212967, 0.01581745781004429, -0.2177223265171051, 0.2316521853208542, -0.24850736558437347, -0.3927718997001648, -0.07575277984142303, 0.525078296661377, -0.06690139323472977, -0.03545495867729187, 0.7066107988357544, 0.3550336956977844, -0.3581259250640869, -0.11135977506637573, -0.1777362823486328, 0.16471734642982483, -0.551540195941925, 0.06946805119514465, -0.11087650060653687, 0.08454592525959015, 0.07079190015792847, -0.09680064022541046, -0.11440552026033401, -0.4529842138290405, -0.12937627732753754, -0.4465697407722473, -0.11626848578453064, -0.15213683247566223, -0.16798943281173706, 0.06808920204639435, 0.09834839403629303, 0.03520076349377632, -0.11173714697360992, 0.1662188470363617, -0.10564346611499786, -0.012310875579714775, -0.22190338373184204, 0.10409614443778992, -0.08935926854610443, -0.2507023215293884, 0.10519762337207794, -0.007805131375789642, -0.03767351806163788, 0.23975691199302673, 0.09148436039686203, -0.06709735840559006, -0.33456680178642273, 0.17313022911548615, -0.016330402344465256, 0.11547767370939255, 0.1984441876411438, -0.3190847933292389, -0.1474885195493698, -0.15816688537597656, 0.11174322664737701, -0.16563399136066437, 0.05371952801942825, -0.13153603672981262, 0.25512880086898804, 0.2886490225791931, -0.07301782071590424, 0.054266270250082016, 0.2377302497625351, -0.17124807834625244, 0.20290133357048035, 0.22677172720432281, -0.1982254683971405, 0.12493259459733963, -0.15356726944446564, 0.1464221030473709, 0.1663617193698883, 0.06286179274320602, 0.3604031205177307, -0.5100667476654053, 0.151972696185112, -0.04255175217986107, 0.3440570831298828, 0.7364622354507446, 0.019141506403684616, -0.34856978058815, 0.5749956369400024, -0.05033859983086586, -0.17655983567237854, -0.23306052386760712, -0.08558187633752823, 0.06234977766871452, -0.015185654163360596, 0.23793359100818634, -0.11666885018348694, -0.14506743848323822, 0.2664746940135956, 0.201720729470253, 0.08831813931465149, -0.15983930230140686, -0.04453050345182419, 0.13542091846466064, -0.003307625651359558, 0.02472176030278206, 0.4934176802635193, 0.4131426513195038, 0.054693177342414856, 0.26600420475006104, 0.16696089506149292, 0.20481173694133759, -0.120002880692482, 0.13036735355854034, -0.19057926535606384, -0.6018973588943481, 0.05526240915060043, 0.1678047776222229, 0.25877901911735535, -0.02210146188735962, -0.026960447430610657, 0.292677104473114, -0.02219659462571144, -0.2872154712677002, -0.3057655692100525, 0.12184551358222961, -0.08517137169837952, 0.10459907352924347, 0.1964169293642044, -0.1683833748102188, -0.041929036378860474, 0.19262105226516724, -0.0261636134237051, -0.0986284390091896, 0.20740710198879242, 0.2128790020942688, 0.16476187109947205, -0.3363858163356781, -0.2077144831418991, -0.04504826292395592, 0.1540067195892334, -0.10140909999608994, 0.10325745493173599, -0.06220772862434387, -0.15922191739082336, -0.28176748752593994, -0.04339972883462906, 0.3273905813694, 0.46259254217147827, -0.10555794835090637, 0.012893397361040115, -0.11840130388736725, 0.0795663446187973, -0.002567015588283539, 0.11610671132802963, -0.2008994221687317, 0.1879531294107437, 0.38665884733200073, -0.08764991909265518, -0.021836409345269203, -0.10779739916324615, 0.036283932626247406, 0.20102442800998688, -0.20809295773506165, 0.15017175674438477, 0.3449246883392334, 0.022545933723449707, -0.020023221150040627, -0.06293344497680664, -0.5503422021865845, 0.00460975244641304, 0.2906302511692047, -0.013704609125852585, 0.07054290175437927, 0.060976698994636536, 0.0031189434230327606, -0.010442948900163174, 0.5134193897247314, 0.18543687462806702, 0.1791694462299347, -0.2111787348985672, -0.2053193598985672, -0.3587140738964081, -0.0696377158164978, -0.3410095274448395, 0.01367148756980896, 0.31902211904525757, 0.30740073323249817, 0.4035981297492981, 0.03698784112930298, 0.21119394898414612, -0.02087305672466755, -0.28363826870918274, 0.5718331933021545, -0.41291114687919617, -0.22876280546188354, 0.06663064658641815, 0.07539728283882141, -0.15737169981002808, -0.45673877000808716, 0.12409628927707672, -0.11906356364488602, -0.0395977683365345, -0.06507338583469391, -0.28278809785842896, 0.23494067788124084, -0.4589002728462219, 0.41487616300582886, -0.20669592916965485, 0.06981576234102249, 0.2476329654455185, -0.3129408657550812, -0.30733492970466614, -0.023650825023651123, 0.09906593710184097, -0.012815728783607483, -0.05211527645587921, 0.13647174835205078, -0.21641632914543152, -0.1243811696767807, -0.447457492351532, 0.17135481536388397, -0.15241745114326477, 0.009135067462921143, 0.00995558500289917, 0.19409659504890442, 0.08618335425853729, 0.313006728887558, 0.13143545389175415, 0.27661052346229553, 0.25763338804244995, 0.2541268467903137, -0.4929099678993225, -0.0731242448091507, 0.36765655875205994, -0.39377427101135254, -0.5985385775566101, 0.20905941724777222, 0.036811430007219315, 0.13250495493412018, 0.06443280726671219, -0.36505281925201416, 0.16788078844547272, 0.04500366002321243, -0.06774665415287018, -0.04959086701273918, 0.16057175397872925, 0.12210819125175476, 0.07058769464492798, -0.37350785732269287, 0.24266809225082397, 0.11226534843444824, -0.12955079972743988, -0.1273588240146637, -0.0898532122373581 ]
https://github.com/huggingface/datasets/issues/6079
Can you share the `datasets` and `torch` versions installed in these conda envs? > Once I removed with_format call altogether, it is finishing in 11 seconds. Hmm, that's surprising. What are your dataset's `.features`?
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
34
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 Can you share the `datasets` and `torch` versions installed in these conda envs? > Once I removed with_format call altogether, it is finishing in 11 seconds. Hmm, that's surprising. What are your dataset's `.features`?
[ -0.09469501674175262, -0.07855117321014404, -0.025267386808991432, 0.28239768743515015, -0.003546716645359993, 0.10885149240493774, 0.4346688985824585, 0.2694898247718811, -0.06672896444797516, 0.20156945288181305, -0.0014986991882324219, 0.3665720820426941, -0.001992490142583847, 0.19985619187355042, -0.23154613375663757, 0.013911784626543522, 0.1322961002588272, 0.21849748492240906, 0.05056038498878479, -0.14654068648815155, 0.02220819890499115, -0.00308951735496521, -0.22783543169498444, -0.2376720905303955, -0.1641646921634674, -0.071467824280262, 0.06464958935976028, -0.0932895690202713, -0.009176954627037048, -0.37360864877700806, 0.6123259663581848, 0.14226391911506653, 0.31743550300598145, 0.7592598795890808, -0.00012992812844458967, 0.08811343461275101, 0.263835608959198, 0.02361483871936798, -0.5803158283233643, -0.2428271472454071, 0.07830403745174408, -0.02817729115486145, 0.18095305562019348, -0.17419758439064026, 0.01756976544857025, -0.15936371684074402, -0.10620849579572678, -0.32011526823043823, 0.038078583776950836, -0.018305789679288864, -0.0066940076649188995, 0.0507565513253212, -0.14522138237953186, 0.031606342643499374, 0.19689448177814484, 0.2194867730140686, -0.030689150094985962, 0.20648430287837982, 0.37581244111061096, -0.24021077156066895, -0.2168637365102768, 0.09319357573986053, 0.035674042999744415, 0.01722780242562294, 0.26431143283843994, -0.22482088208198547, 0.12011797726154327, -0.1044018492102623, 0.18161103129386902, 0.07877105474472046, 0.6449950337409973, -0.17325907945632935, -0.35298633575439453, -0.23004361987113953, -0.030970562249422073, -0.1911642849445343, 0.22395487129688263, 0.22906571626663208, -0.33608993887901306, -0.07826080918312073, 0.0880400687456131, 0.008363686501979828, -0.21589773893356323, 0.03965537250041962, -0.309587687253952, 0.466247022151947, -0.017827380448579788, 0.2123042494058609, 0.1952950358390808, -0.035943176597356796, 0.2219589650630951, 0.12466856837272644, 0.12221294641494751, 0.0103815458714962, -0.8447636365890503, 0.1735975444316864, 0.06099219247698784, -0.08242097496986389, -0.11225156486034393, 0.16426442563533783, -0.04410035163164139, 0.07355975359678268, 0.3126838207244873, 0.1657150387763977, 0.4616200625896454, -0.24580338597297668, 0.162363201379776, 0.04667184501886368, 0.13961322605609894, 0.1395883411169052, -0.05537471920251846, 0.025390833616256714, -0.26141539216041565, -0.27033185958862305, 0.2740603983402252, -0.2584294080734253, 0.14358100295066833, -0.41063088178634644, -0.040792420506477356, 0.21344925463199615, -0.1573985517024994, -0.15444916486740112, 0.12001632153987885, 0.5102850198745728, -0.2273726463317871, 0.22273686528205872, -0.03700733929872513, 0.1720057725906372, -0.0701899603009224, 0.10970115661621094, 0.13684166967868805, -0.15963590145111084, -0.2262735217809677, -0.08587527275085449, 0.0971689522266388, -0.5080934166908264, 0.02879244089126587, 0.1490304172039032, 0.18326158821582794, -0.08208739757537842, 0.04259627312421799, -0.23069536685943604, 0.13348963856697083, 0.15217363834381104, -0.03931817412376404, 0.19318735599517822, 0.09183065593242645, -0.13848306238651276, -0.2815195322036743, -0.029376782476902008, -0.19741512835025787, -0.048586755990982056, -0.25111815333366394, 0.007248184643685818, 0.131196066737175, -0.14247572422027588, -0.14292486011981964, -0.499981164932251, 0.161298006772995, 0.01637488603591919, 0.10145238786935806, -0.18411174416542053, -0.013008475303649902, 0.07219896465539932, 0.06302084028720856, 0.3459628224372864, -0.6821314692497253, 0.3483073115348816, 0.224300354719162, 0.1905294507741928, 0.1873045265674591, 0.08407501876354218, -0.3274936079978943, 0.35814526677131653, -0.3469139635562897, -0.4891807734966278, 0.4630834460258484, -0.31409138441085815, -0.11854588240385056, 0.5044465661048889, 0.0394919216632843, 0.2629891633987427, 0.2879515290260315, -0.2615058720111847, 0.0703137218952179, -0.11919175088405609, 0.21215198934078217, 0.12322812527418137, -0.006202437914907932, -0.03365541249513626, -0.18804603815078735, 0.0865226611495018, 0.1352914720773697, 0.3356684446334839, 0.09945747256278992, 0.1920650154352188, -0.18908071517944336, -0.22732006013393402, 0.38093632459640503, -0.0907038003206253, -0.029120873659849167, 0.5439866781234741, 0.3300178050994873, 0.48571324348449707, 0.26603350043296814, 0.0388956293463707, -0.35357415676116943, 0.3113882839679718, 0.13025909662246704, -0.055731210857629776, -0.06470059603452682, 0.12681487202644348, -0.08696828037500381, 0.36976197361946106, -0.37681180238723755, -0.10185284912586212, -0.1361236274242401, 0.334075927734375, 0.04962649941444397, -0.19544750452041626, -0.3234907388687134, 0.5844672322273254, -0.038498200476169586, 0.024742446839809418, -0.34025129675865173, 0.17588752508163452, 0.15853330492973328, -0.08209129422903061, -0.010823331773281097, -0.10306099057197571, 0.13523155450820923, -0.2674403786659241, -0.11922191083431244, 0.013412284664809704, 0.1469017118215561, -0.00576675683259964, -0.10080841928720474, -0.1865157186985016, 0.034433647990226746, 0.27894362807273865, 0.07182618230581284, -0.18668773770332336, 0.09261900186538696, -0.14318236708641052, 0.11688631772994995, 0.07404141873121262, 0.032558757811784744, 0.8648569583892822, -0.09570864588022232, -0.06008410081267357, 0.2218010425567627, 0.08416653424501419, 0.0067123472690582275, 0.2568334937095642, 0.36992064118385315, -0.06785149872303009, 0.7652668952941895, 0.0034423675388097763, -0.3114132881164551, 0.16982606053352356, 0.15219290554523468, 0.08860237896442413, -0.3803872764110565, 0.3299061357975006, 0.03224124014377594, 0.16226674616336823, 0.15488402545452118, 0.013746008276939392, 0.08738299459218979, 0.046551160514354706, 0.048756908625364304, -0.1407247930765152, -0.0842617079615593, 0.01404980942606926, -0.11058694124221802, 0.3593103885650635, 0.4480811059474945, 0.24810928106307983, 0.03333587199449539, -0.06529608368873596, -0.06221361458301544, -0.5113166570663452, -0.07086289674043655, 0.2895008623600006, -0.08293615281581879, 0.6059718728065491, -0.3454795181751251, 0.26434430480003357, -0.20057030022144318, -0.10042811930179596, -0.24871647357940674, -0.27064839005470276, -0.3717429041862488, 0.5561204552650452, 0.05768226087093353, 0.07009079307317734, 0.03889303654432297, 0.15498946607112885, 0.23432835936546326, -0.4124918580055237, -0.4129363000392914, -0.27240461111068726, -0.4075319170951843, -0.2290039360523224, 0.3928232789039612, -0.25022098422050476, 0.18311375379562378, -0.09698747098445892, -0.13366231322288513, -0.28635159134864807, -0.24420438706874847, 0.20267319679260254, -0.08566305041313171, 0.30568936467170715, 0.16362005472183228, 0.32352566719055176, -0.00791485607624054, -0.19484053552150726, 0.04590597748756409, 0.06052778661251068, 0.07644874602556229, 0.30930331349372864, -0.005129009485244751, 0.14877918362617493, 0.27309125661849976, -0.003964554518461227, -0.027039460837841034, -0.30969780683517456, 0.26658254861831665, -0.03288913518190384, 0.04693509265780449, -0.11834117770195007, 0.1373746246099472, 0.19077832996845245, -0.09055444598197937, 0.2019134759902954, 0.034476518630981445, -0.7116597890853882, 0.3408685624599457, -0.05301407352089882, -0.172183096408844, -0.014576807618141174, -0.0009866878390312195, 0.23149314522743225, 0.29594361782073975, -0.684542179107666, 0.21231074631214142, -0.17009682953357697, -0.09899184107780457, -0.34747233986854553, 0.029397862032055855, 0.11806342005729675, 0.03538624569773674, 0.08845929056406021, 0.007205963134765625, -0.11629502475261688, 0.2796890139579773, -0.042595185339450836, 0.1389080137014389, 0.09716349095106125, 0.5652400851249695, -0.018932722508907318, 0.4017948508262634, 0.2238389551639557, -0.07090336829423904, 0.4978395104408264, 0.2500109076499939, 0.17818713188171387, -0.0790380984544754, -0.3301987051963806, -0.1075788289308548, -0.1269133985042572, -0.2748565077781677, 0.06340883672237396, -0.2146526575088501, -0.42137354612350464, -0.2021397203207016, -0.12067682296037674, 0.028114281594753265, -0.2974645793437958, 0.30270394682884216, -0.2843319773674011, 0.1725640892982483, -0.062324345111846924, 0.21125000715255737, -0.22890448570251465, 0.06533579528331757, 0.07927247881889343, 0.04689640551805496, 0.12354220449924469, 0.010519418865442276, -0.035582035779953, 0.032424625009298325, -0.24975869059562683, 0.08582112193107605, 0.013520576059818268, 0.5973131060600281, 0.09360476583242416, -0.25497695803642273, 0.16776323318481445, -0.39767852425575256, 1.1136302947998047, -0.039236705750226974, 0.11983267962932587, 0.15487465262413025, -0.3948524594306946, -0.2682534456253052, -0.24862584471702576, 0.06300733983516693, 0.12267068028450012, 0.12150644510984421, 0.6672095656394958, -0.270579069852829, -0.51148921251297, 0.12199888378381729, 0.0922277420759201, -0.19214588403701782, -0.3873387277126312, -0.3778994083404541, 0.11578495055437088, -0.280593603849411, 0.16522984206676483, -0.24378922581672668, 0.17085450887680054, 0.1074155867099762, -0.06915684044361115, -0.31518590450286865, 0.04131027311086655, -0.008018366992473602, 0.04574018344283104, 0.10060538351535797, -0.15345793962478638, 0.49378302693367004, 0.12082467973232269, 0.39233168959617615, 0.3706418573856354, 0.4271373748779297, 0.1370863914489746, -0.5193396210670471, 0.4006195068359375, -0.03332376852631569, 0.45496103167533875, 0.4881989359855652, 0.03870127722620964, -0.04450352117419243, -0.23593831062316895, 0.3891790807247162, -0.33314356207847595, 0.07132132351398468, 0.2777743935585022, 0.09803913533687592, -0.6348784565925598, -0.2904094457626343, 0.2770501375198364, -0.04724939912557602, 0.17446966469287872, 0.353759229183197, -0.0022949762642383575, 0.08136047422885895, 0.45015013217926025, 0.0025770477950572968, 0.9178192019462585, -0.1795690804719925, 0.1531091332435608, 0.08575808256864548, -0.359844446182251, 0.0536164790391922, -0.7519591450691223, -0.08601675927639008, -0.36351945996284485, -0.1946500837802887, -0.026242483407258987, -0.3857278823852539, 0.22837868332862854, 0.08138395845890045, 0.2760009467601776, 0.3377445638179779, -0.23135656118392944, 0.0064895544201135635, 0.09056827425956726, 0.1889171600341797, -0.1836923062801361, -0.27231866121292114, -0.2309875190258026, -0.047228775918483734, -0.052716221660375595, 0.09681791067123413, -0.12666696310043335, -0.16007457673549652, 0.07103904336690903, 0.05310915410518646, -0.09932491928339005, 0.2680259346961975, 0.24621570110321045, -0.14145725965499878, 0.1566084325313568, -0.6763057708740234, 0.14978128671646118, -0.0027367956936359406, -0.013719189912080765, 0.08454734086990356, -0.0754535123705864, 0.12575751543045044, 0.016770724207162857, -0.056532591581344604, 0.10045671463012695, -0.18543517589569092, 0.45677852630615234, 0.06689739227294922, -0.11146056652069092, 0.036563001573085785, -0.23311758041381836, -0.2749584913253784, 0.16004353761672974, 0.23380793631076813, 0.246893048286438, -0.09823168814182281, 0.05887991935014725, 0.16543783247470856, -0.0015180408954620361, -0.2235265076160431, -0.022770190611481667, -0.03888286277651787, -0.23117020726203918, 0.1463293582201004, -0.22805851697921753, -0.36422407627105713, -0.13610315322875977, 0.5222018957138062, -0.031847670674324036, 0.007262475788593292, 0.7095345854759216, 0.35203588008880615, -0.3531091511249542, -0.15587538480758667, -0.22107791900634766, 0.21517814695835114, -0.4836445152759552, 0.016715452075004578, -0.14388880133628845, 0.15435758233070374, 0.09806706011295319, -0.07736332714557648, -0.06649214029312134, -0.5792350769042969, -0.15071791410446167, -0.4279478192329407, -0.054995615035295486, -0.16701854765415192, -0.08835946768522263, 0.06375287473201752, 0.10697378218173981, 0.020030885934829712, -0.09533527493476868, 0.16902823746204376, -0.10882045328617096, -0.08594264835119247, -0.21648672223091125, 0.08920234441757202, -0.13801153004169464, -0.1857120543718338, 0.06890156865119934, -0.01030106469988823, -0.0071326084434986115, 0.19018672406673431, 0.12897330522537231, -0.08650043606758118, -0.3033524751663208, 0.17793254554271698, 0.02384287491440773, 0.17952466011047363, 0.11877791583538055, -0.2911335825920105, -0.14891523122787476, -0.14101824164390564, 0.13051827251911163, -0.22707144916057587, 0.054138608276844025, -0.10458408296108246, 0.34166350960731506, 0.18912279605865479, -0.14300617575645447, -0.013040546327829361, 0.34031519293785095, -0.2205376774072647, 0.1618574559688568, 0.21310031414031982, -0.23775269091129303, 0.08369462937116623, -0.19737328588962555, 0.12814448773860931, 0.16080652177333832, 0.07759979367256165, 0.4156106412410736, -0.5125520825386047, 0.09692355990409851, -0.051216308027505875, 0.38024836778640747, 0.8034195303916931, 0.08316902816295624, -0.3336876332759857, 0.5878565907478333, -0.02923119068145752, -0.20308613777160645, -0.21160365641117096, -0.10292258858680725, 0.07717989385128021, -0.030869778245687485, 0.2085399031639099, -0.11758919060230255, -0.13661587238311768, 0.25687941908836365, 0.13965633511543274, 0.1285249888896942, -0.11166881024837494, -0.03857863321900368, 0.18184423446655273, -0.012563422322273254, 0.013556122779846191, 0.4040394425392151, 0.5061876773834229, 0.022737763822078705, 0.29172971844673157, 0.17620323598384857, 0.13233795762062073, -0.05660564452409744, 0.14748606085777283, -0.1903320550918579, -0.5881164073944092, 0.07767993211746216, 0.15409182012081146, 0.39421674609184265, 0.013759946450591087, -0.004971273243427277, 0.30911070108413696, 0.15516157448291779, -0.34535282850265503, -0.3698570728302002, 0.13639403879642487, -0.06296518445014954, 0.12346693873405457, 0.2093164324760437, -0.18112969398498535, -0.07021847367286682, 0.1854451596736908, 0.017204847186803818, -0.15799057483673096, 0.15579678118228912, 0.15034806728363037, 0.24738240242004395, -0.4699658453464508, -0.1960352063179016, -0.07011652737855911, 0.19947704672813416, -0.1155725046992302, 0.1571662575006485, -0.06659812480211258, -0.17281386256217957, -0.30429038405418396, -0.1591321974992752, 0.24315623939037323, 0.42744192481040955, -0.09676855802536011, 0.013335924595594406, -0.12198785692453384, 0.02390962839126587, 0.0067595019936561584, 0.13255243003368378, -0.31069421768188477, 0.17143116891384125, 0.4364687204360962, -0.08237840980291367, 0.004566852003335953, -0.024674884974956512, 0.0026102345436811447, 0.2415386438369751, -0.30867117643356323, 0.13557134568691254, 0.365727961063385, 0.049110740423202515, -0.0029774047434329987, -0.09072063118219376, -0.5475209951400757, -0.04615381732583046, 0.2979204058647156, -0.0026340149343013763, 0.02256261184811592, 0.02083314210176468, 0.0061920881271362305, -0.0603756383061409, 0.5719752311706543, 0.27373144030570984, 0.2297402322292328, -0.20518288016319275, -0.15915502607822418, -0.34657803177833557, -0.01751314103603363, -0.34588220715522766, -0.02658701315522194, 0.3794410526752472, 0.339235782623291, 0.3835425078868866, 0.06233849748969078, 0.24323859810829163, -0.08602644503116608, -0.28174299001693726, 0.5948894023895264, -0.41536813974380493, -0.24462592601776123, 0.056352607905864716, 0.13600598275661469, -0.1813499927520752, -0.3932434916496277, 0.15308192372322083, -0.03234301507472992, -0.05816338211297989, -0.026030464097857475, -0.3087945580482483, 0.2642810344696045, -0.5324218273162842, 0.38337358832359314, -0.2663758397102356, 0.07334987819194794, 0.20551283657550812, -0.18705937266349792, -0.2649320363998413, -0.06114079803228378, 0.060063254088163376, -0.03402426466345787, -0.1081586480140686, 0.09633354097604752, -0.19412538409233093, -0.019911814481019974, -0.41115108132362366, 0.028702400624752045, -0.0764491930603981, -0.034881941974163055, -0.034408725798130035, 0.1628332883119583, 0.12552568316459656, 0.31240713596343994, 0.10392218828201294, 0.20721712708473206, 0.26633375883102417, 0.2163657695055008, -0.4365047812461853, -0.038388170301914215, 0.4101352393627167, -0.3422779440879822, -0.6099587678909302, 0.23231534659862518, 0.0899779200553894, 0.2106800228357315, -0.00882646068930626, -0.3627769947052002, 0.18398994207382202, 0.1028333455324173, -0.03808474913239479, 0.036938510835170746, 0.2098216414451599, 0.11699952930212021, 0.1374279111623764, -0.3574868440628052, 0.23167800903320312, 0.005084345117211342, -0.08665771037340164, -0.060396671295166016, -0.09021036326885223 ]
https://github.com/huggingface/datasets/issues/6079
Python 3.6: datasets.__version__ 2.4.0 torch.__version__ 1.10.1+cu102 Python 3.10: datasets.__version__ 2.14.0 torch.__version__ 2.0.0 Anonymized features are of the form (subset shown here): { 'string_feature_i': Value(dtype='string', id=None), 'numerical_feature_i': Value(dtype='decimal128(38, 0)', id=None), 'numerical_feature_series_i': Sequence(feature=Value(dtype='float64', id=None), length=-1, id=None), } There is no output from .features in python 3.6 kernel BTW.
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
46
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 Python 3.6: datasets.__version__ 2.4.0 torch.__version__ 1.10.1+cu102 Python 3.10: datasets.__version__ 2.14.0 torch.__version__ 2.0.0 Anonymized features are of the form (subset shown here): { 'string_feature_i': Value(dtype='string', id=None), 'numerical_feature_i': Value(dtype='decimal128(38, 0)', id=None), 'numerical_feature_series_i': Sequence(feature=Value(dtype='float64', id=None), length=-1, id=None), } There is no output from .features in python 3.6 kernel BTW.
[ -0.10414484143257141, -0.06336086988449097, -0.03020922653377056, 0.28839194774627686, 0.007552174851298332, 0.10713686048984528, 0.4424210488796234, 0.23903489112854004, -0.07540041953325272, 0.2319258153438568, 0.0046028196811676025, 0.3868003189563751, 0.022636670619249344, 0.16401970386505127, -0.1967855989933014, 0.04433060064911842, 0.0699826329946518, 0.23821115493774414, 0.036159440875053406, -0.1526889055967331, 0.03802762180566788, 0.03409489989280701, -0.23754869401454926, -0.22605443000793457, -0.18138526380062103, -0.09860184043645859, 0.09232986718416214, -0.05092843249440193, 0.01996694505214691, -0.35423028469085693, 0.5532748103141785, 0.1172536164522171, 0.35176488757133484, 0.7071788907051086, -0.00012922812311444432, 0.10497860610485077, 0.2590930759906769, -0.005603961646556854, -0.6045850515365601, -0.2840595245361328, 0.09072147309780121, 0.004780128598213196, 0.17519551515579224, -0.18622754514217377, -0.0017326921224594116, -0.16007515788078308, -0.14000830054283142, -0.34715887904167175, 0.04988463595509529, -0.0012595169246196747, -0.005964241921901703, 0.07209528982639313, -0.1345236450433731, 0.07299840450286865, 0.200002983212471, 0.1965368241071701, -0.04668506234884262, 0.17506206035614014, 0.3140814006328583, -0.2375549077987671, -0.1913377195596695, 0.06887266039848328, 0.06699854135513306, 0.035593368113040924, 0.2698177993297577, -0.19910608232021332, 0.1608392596244812, -0.10931313782930374, 0.178352490067482, 0.06678326427936554, 0.5646628737449646, -0.18114472925662994, -0.33879032731056213, -0.23536673188209534, -0.00009225308895111084, -0.23285552859306335, 0.20601171255111694, 0.26192355155944824, -0.3281376361846924, -0.04811469838023186, 0.12118688970804214, 0.013435911387205124, -0.20263713598251343, 0.0687522292137146, -0.3253172039985657, 0.46178296208381653, -0.03060985542833805, 0.21785137057304382, 0.19638502597808838, -0.0689520537853241, 0.19508999586105347, 0.1425008922815323, 0.1029207706451416, 0.017563391476869583, -0.8521959781646729, 0.17315460741519928, 0.06567198038101196, -0.10675667226314545, -0.11697894334793091, 0.13737808167934418, 0.04715006798505783, 0.1055540218949318, 0.3266274929046631, 0.16482068598270416, 0.43431347608566284, -0.2545825242996216, 0.18480810523033142, 0.04233188554644585, 0.15822456777095795, 0.16069316864013672, -0.08133130520582199, 0.00735888909548521, -0.2682192027568817, -0.24515590071678162, 0.3256095349788666, -0.2557099461555481, 0.15450456738471985, -0.3889692723751068, -0.061017587780952454, 0.22802969813346863, -0.15092237293720245, -0.14974403381347656, 0.1501774936914444, 0.534245491027832, -0.18983176350593567, 0.2055073380470276, -0.05492676794528961, 0.1895904392004013, -0.05550128221511841, 0.07400359213352203, 0.11466915160417557, -0.14741778373718262, -0.21530719101428986, -0.051047541201114655, 0.1084899753332138, -0.5102601647377014, 0.06233111023902893, 0.1250699758529663, 0.15935930609703064, -0.12063504755496979, 0.08978357911109924, -0.20067594945430756, 0.1307026594877243, 0.1669640988111496, -0.014724060893058777, 0.1413043886423111, 0.12394674867391586, -0.15403951704502106, -0.23662832379341125, -0.019186709076166153, -0.20016460120677948, -0.012452177703380585, -0.21208219230175018, 0.016119588166475296, 0.1382356584072113, -0.16393008828163147, -0.20103895664215088, -0.4687891900539398, 0.16536828875541687, 0.054443538188934326, 0.1205916702747345, -0.16510926187038422, -0.03002253919839859, 0.05581206828355789, 0.0723603293299675, 0.3309289515018463, -0.6496707201004028, 0.34610918164253235, 0.17628107964992523, 0.2035115510225296, 0.17993193864822388, 0.04055356606841087, -0.36195164918899536, 0.3060762286186218, -0.34508538246154785, -0.3995511531829834, 0.4881556034088135, -0.33037880063056946, -0.08840771019458771, 0.5122231841087341, 0.032311856746673584, 0.23113322257995605, 0.26907360553741455, -0.2747710347175598, 0.07928425073623657, -0.07643739879131317, 0.2380380481481552, 0.13504429161548615, 0.001880137249827385, -0.013450868427753448, -0.17801418900489807, 0.13086001574993134, 0.1227942705154419, 0.32749655842781067, 0.1475701481103897, 0.2355928122997284, -0.11120866239070892, -0.21834471821784973, 0.3926340639591217, -0.11495748162269592, -0.014032894745469093, 0.5614025592803955, 0.33396345376968384, 0.48862168192863464, 0.2666618824005127, 0.029684141278266907, -0.35536712408065796, 0.31251031160354614, 0.09073777496814728, -0.06078331917524338, -0.08939380943775177, 0.1582675278186798, -0.11638781428337097, 0.36830028891563416, -0.35268130898475647, -0.09151751548051834, -0.1160956472158432, 0.3727051615715027, 0.041431181132793427, -0.19741207361221313, -0.317457914352417, 0.6142503023147583, -0.049281708896160126, 0.040013205260038376, -0.34738704562187195, 0.2497626543045044, 0.18324925005435944, -0.12327809631824493, -0.034854620695114136, -0.11987054347991943, 0.1710970401763916, -0.26984909176826477, -0.11806733906269073, 0.021707696840167046, 0.1670040488243103, -0.013508126139640808, -0.11149586737155914, -0.19806444644927979, 0.04397798329591751, 0.24156031012535095, 0.08553371578454971, -0.17870940268039703, 0.10212332010269165, -0.14775586128234863, 0.20557495951652527, 0.1228267028927803, 0.058051373809576035, 0.8224566578865051, -0.10180532187223434, -0.04874737560749054, 0.20894044637680054, 0.0549435168504715, -0.024888940155506134, 0.25211474299430847, 0.32541465759277344, -0.03365755453705788, 0.7720398902893066, 0.006541980430483818, -0.34170353412628174, 0.17546480894088745, 0.1245322972536087, 0.09518907964229584, -0.35320526361465454, 0.28841519355773926, 0.03179827705025673, 0.1840079426765442, 0.1703067123889923, 0.06459624320268631, 0.11818201094865799, 0.03291942924261093, 0.04542163014411926, -0.1194794550538063, -0.07341888546943665, 0.029774248600006104, -0.13112366199493408, 0.33490413427352905, 0.532393217086792, 0.2756897807121277, 0.06044432148337364, -0.07811616361141205, -0.11913246661424637, -0.5008133053779602, -0.030420932918787003, 0.3027920722961426, -0.07872222363948822, 0.5910443663597107, -0.38929226994514465, 0.3304329514503479, -0.2026258409023285, -0.07961896806955338, -0.24445921182632446, -0.2705843448638916, -0.40140920877456665, 0.6186459064483643, 0.05657258629798889, 0.07446616142988205, 0.01506660133600235, 0.11088341474533081, 0.2288047969341278, -0.3969903588294983, -0.45319658517837524, -0.28099218010902405, -0.40173205733299255, -0.23292508721351624, 0.35315874218940735, -0.22415946424007416, 0.14078648388385773, -0.09654532372951508, -0.20754754543304443, -0.33802175521850586, -0.23982307314872742, 0.20973341166973114, -0.10133340954780579, 0.32995593547821045, 0.1309659481048584, 0.2773257791996002, -0.017758533358573914, -0.21292755007743835, 0.04267897829413414, 0.05281060189008713, 0.051487281918525696, 0.32847166061401367, 0.04597823694348335, 0.129213348031044, 0.25719547271728516, 0.000376727432012558, -0.04124918580055237, -0.3381344676017761, 0.25395089387893677, -0.02346392720937729, 0.044880881905555725, -0.11025990545749664, 0.125747948884964, 0.154120534658432, -0.05057990550994873, 0.21436607837677002, 0.03392957150936127, -0.699702262878418, 0.3396661877632141, -0.09818700700998306, -0.18852058053016663, -0.008709467947483063, -0.04252570495009422, 0.2737573981285095, 0.318854957818985, -0.684413731098175, 0.22370603680610657, -0.1508835107088089, -0.08893415331840515, -0.3526194393634796, -0.00710226409137249, 0.13113632798194885, 0.0003981739282608032, 0.08062082529067993, -0.004100210964679718, -0.13189232349395752, 0.2809988260269165, -0.005019675940275192, 0.16138452291488647, 0.12087450921535492, 0.547583281993866, -0.057287149131298065, 0.42256423830986023, 0.20262140035629272, -0.08127088844776154, 0.5674800872802734, 0.19293373823165894, 0.14636904001235962, -0.03606712073087692, -0.33834317326545715, -0.1623528152704239, -0.09938416630029678, -0.27159416675567627, 0.0699382871389389, -0.24409517645835876, -0.41014277935028076, -0.22699519991874695, -0.17575490474700928, 0.02109900861978531, -0.32484057545661926, 0.26848912239074707, -0.3088763952255249, 0.19889219105243683, -0.08728749305009842, 0.21215328574180603, -0.2342395782470703, 0.12461763620376587, 0.06077121943235397, 0.06097254157066345, 0.08176465332508087, -0.0002407655119895935, -0.027639493346214294, 0.10325198620557785, -0.27715036273002625, 0.0719648227095604, -0.014992795884609222, 0.6285836100578308, 0.08436644822359085, -0.271676629781723, 0.1580883413553238, -0.39611852169036865, 1.0789251327514648, -0.04786954075098038, 0.1734607070684433, 0.16518588364124298, -0.40845873951911926, -0.2918016314506531, -0.2561497092247009, 0.05043336749076843, 0.0732201635837555, 0.12087936699390411, 0.6670331954956055, -0.28525644540786743, -0.5099255442619324, 0.0974806398153305, 0.035111527889966965, -0.2120685875415802, -0.35642507672309875, -0.3818362355232239, 0.11158715188503265, -0.3029067814350128, 0.12696963548660278, -0.22963325679302216, 0.22042538225650787, 0.1308736354112625, -0.08431734144687653, -0.3202988803386688, 0.01591654121875763, 0.0028013475239276886, 0.08637045323848724, 0.0879935771226883, -0.1297350823879242, 0.5127695798873901, 0.06045190244913101, 0.3915463089942932, 0.3553563356399536, 0.44999971985816956, 0.2117151916027069, -0.6037524342536926, 0.38913607597351074, -0.008762728422880173, 0.48061051964759827, 0.4142986536026001, -0.0007994323968887329, -0.037725742906332016, -0.22279992699623108, 0.3673804998397827, -0.32730334997177124, 0.10161173343658447, 0.25030267238616943, 0.1117158755660057, -0.5557602643966675, -0.23339605331420898, 0.2874552011489868, -0.08287953585386276, 0.1853913962841034, 0.3438289165496826, -0.028598126024007797, 0.07068140804767609, 0.4480442404747009, 0.03713155910372734, 0.8597015142440796, -0.16168716549873352, 0.11523111909627914, 0.0962996706366539, -0.31940776109695435, 0.004799395799636841, -0.7176750302314758, -0.05291776731610298, -0.36758971214294434, -0.15233875811100006, -0.02420065924525261, -0.37901854515075684, 0.2240557074546814, 0.07281650602817535, 0.2826077342033386, 0.32609042525291443, -0.19424432516098022, -0.0775735154747963, 0.08861935138702393, 0.18793146312236786, -0.20047099888324738, -0.26805806159973145, -0.20579370856285095, -0.03898920863866806, -0.07978484034538269, 0.13854855298995972, -0.1319025158882141, -0.1991385519504547, 0.07652762532234192, 0.025649137794971466, -0.07895471900701523, 0.3033544719219208, 0.22141368687152863, -0.12991753220558167, 0.1919967383146286, -0.6729614734649658, 0.11377469450235367, 0.003662283532321453, 0.005890369415283203, 0.04294664412736893, -0.06094136834144592, 0.09198154509067535, -0.019096117466688156, -0.08263586461544037, 0.05387386307120323, -0.16614630818367004, 0.48615631461143494, 0.06585366278886795, -0.16571101546287537, 0.04080863296985626, -0.2112986445426941, -0.2651416063308716, 0.20014315843582153, 0.23575346171855927, 0.26065316796302795, -0.09279029071331024, 0.15426285564899445, 0.17252635955810547, -0.040958382189273834, -0.24868908524513245, -0.013988913968205452, -0.06042739376425743, -0.2797134220600128, 0.089545838534832, -0.22208932042121887, -0.3749306797981262, -0.11952827870845795, 0.5382049083709717, -0.05698738247156143, 0.05260458588600159, 0.7065871357917786, 0.33738142251968384, -0.29841476678848267, -0.17582248151302338, -0.25506478548049927, 0.16959449648857117, -0.40774786472320557, 0.05335196852684021, -0.12874481081962585, 0.1364109218120575, 0.11537978053092957, -0.03627532720565796, -0.05306173488497734, -0.5535839200019836, -0.15897217392921448, -0.4212835431098938, -0.09898413717746735, -0.1789076030254364, -0.12834204733371735, 0.06178100407123566, 0.1354249268770218, 0.024128511548042297, -0.10295429825782776, 0.16901135444641113, -0.11755967140197754, -0.06978090107440948, -0.24573740363121033, 0.09214457869529724, -0.10945606231689453, -0.22541707754135132, 0.007864739745855331, 0.04371669888496399, 0.015745237469673157, 0.17924067378044128, 0.12155324220657349, -0.09169206023216248, -0.30187591910362244, 0.1747596114873886, 0.02479957789182663, 0.1953214406967163, 0.08225922286510468, -0.302354097366333, -0.15181969106197357, -0.1578236222267151, 0.18077649176120758, -0.22523964941501617, 0.043647851794958115, -0.01620170846581459, 0.34269002079963684, 0.1704186499118805, -0.14561983942985535, -0.024312496185302734, 0.32735857367515564, -0.2543027698993683, 0.1438673734664917, 0.23130622506141663, -0.24003562331199646, 0.07425534725189209, -0.24120734632015228, 0.08749477565288544, 0.1453397572040558, 0.06423667818307877, 0.4256843328475952, -0.49333906173706055, 0.07271486520767212, -0.09185865521430969, 0.345505028963089, 0.7632798552513123, 0.09968496859073639, -0.30293020606040955, 0.5737642049789429, -0.008276769891381264, -0.2352713793516159, -0.17077504098415375, -0.10416068881750107, 0.1045791506767273, 0.01162884384393692, 0.21401798725128174, -0.09698224812746048, -0.19133643805980682, 0.2622511684894562, 0.09565293788909912, 0.14053726196289062, -0.11760532855987549, -0.053541749715805054, 0.15686525404453278, -0.05346549302339554, 0.0056442636996507645, 0.44743582606315613, 0.5113440752029419, 0.03798191621899605, 0.3106497526168823, 0.12404510378837585, 0.13477076590061188, -0.1537422090768814, 0.12130240350961685, -0.1972445696592331, -0.5850447416305542, 0.12631835043430328, 0.1399964839220047, 0.3732468783855438, 0.013176204636693, 0.008123911917209625, 0.3058610260486603, 0.2003144919872284, -0.31761085987091064, -0.35985851287841797, 0.17160573601722717, -0.10602833330631256, 0.10672283172607422, 0.1477147787809372, -0.1909925639629364, -0.07904435694217682, 0.17269772291183472, 0.07944878190755844, -0.16940458118915558, 0.17031240463256836, 0.17091111838817596, 0.22902511060237885, -0.4827505350112915, -0.21963125467300415, -0.03825272619724274, 0.1795618236064911, -0.11929269880056381, 0.17719843983650208, -0.08069156855344772, -0.1750684380531311, -0.2929719388484955, -0.17424741387367249, 0.236346036195755, 0.413202166557312, -0.052296075969934464, 0.03252926096320152, -0.07530391216278076, 0.020870976150035858, -0.005918394774198532, 0.09386485815048218, -0.32256174087524414, 0.23496794700622559, 0.4505433142185211, -0.0715702623128891, 0.007556945085525513, -0.033733777701854706, 0.00995652750134468, 0.2050701081752777, -0.2958264946937561, 0.15329693257808685, 0.3838804364204407, 0.06542323529720306, -0.015752095729112625, -0.08244723826646805, -0.512515664100647, -0.013934100046753883, 0.3334965407848358, -0.05671253427863121, 0.05364155024290085, 0.01814640685915947, 0.006332665681838989, -0.0952153429389, 0.5368874669075012, 0.2590610980987549, 0.1866842806339264, -0.22713534533977509, -0.13658422231674194, -0.36674216389656067, 0.04841694235801697, -0.31859511137008667, -0.07087256759405136, 0.3980042338371277, 0.35715895891189575, 0.39512714743614197, 0.03372827544808388, 0.22839631140232086, -0.11803924292325974, -0.30858078598976135, 0.5864704251289368, -0.4417839050292969, -0.2529866695404053, 0.07794763147830963, 0.14584818482398987, -0.1472877562046051, -0.36799514293670654, 0.14865949749946594, 0.007697250694036484, -0.04918351024389267, -0.03137410432100296, -0.30662333965301514, 0.20609819889068604, -0.6096030473709106, 0.41577279567718506, -0.27638450264930725, 0.06407307088375092, 0.1659565269947052, -0.10930724442005157, -0.2821653187274933, -0.07910783588886261, 0.0512031614780426, -0.054929398000240326, -0.10002852976322174, 0.08418919146060944, -0.17046399414539337, 0.007896834053099155, -0.450344979763031, 0.005549386143684387, -0.03987777233123779, -0.09869085997343063, -0.011378120630979538, 0.2041339874267578, 0.11962226033210754, 0.32039108872413635, 0.09072460234165192, 0.21262985467910767, 0.261701375246048, 0.21904483437538147, -0.42787694931030273, -0.06649434566497803, 0.43509286642074585, -0.3323099613189697, -0.6071888208389282, 0.21533790230751038, 0.10175187885761261, 0.2142944037914276, -0.034674420952796936, -0.3585512042045593, 0.1918112337589264, 0.1233951598405838, -0.06870739161968231, 0.013432398438453674, 0.18977907299995422, 0.12386693060398102, 0.13014383614063263, -0.33946171402931213, 0.18631088733673096, 0.004825158044695854, -0.051776107400655746, -0.07381628453731537, -0.11383914947509766 ]
https://github.com/huggingface/datasets/issues/6079
One more thing, in python 3.10 based kernel, interestingly increasing num_workers seem to be increasing the runtime of iterating I was trying out. In python 3.10 kernel execution, I do not even see multiple CPU cores spiking unlike in 3.6. 512 batch size on 32 workers executes in 2.4 seconds on python 3.6 kernel, while it takes ~118 seconds on 3.10!
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
61
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 One more thing, in python 3.10 based kernel, interestingly increasing num_workers seem to be increasing the runtime of iterating I was trying out. In python 3.10 kernel execution, I do not even see multiple CPU cores spiking unlike in 3.6. 512 batch size on 32 workers executes in 2.4 seconds on python 3.6 kernel, while it takes ~118 seconds on 3.10!
[ -0.16187193989753723, -0.116234689950943, -0.050730470567941666, 0.24418914318084717, -0.04789000749588013, 0.04484958201646805, 0.5003331899642944, 0.24632829427719116, -0.09249991178512573, 0.25677382946014404, 0.011409658938646317, 0.46527740359306335, -0.0470215380191803, 0.1486220359802246, -0.18198062479496002, 0.14048129320144653, 0.12657378613948822, 0.2034154236316681, 0.021680057048797607, -0.12567000091075897, -0.04159236326813698, 0.057016439735889435, -0.20565208792686462, -0.3150605857372284, -0.18829044699668884, -0.10061036795377731, 0.07566765695810318, -0.014600375667214394, 0.08693049103021622, -0.42743200063705444, 0.5890475511550903, 0.11758711189031601, 0.3839340806007385, 0.7320478558540344, -0.00012890355719719082, 0.07450015097856522, 0.2527213394641876, 0.0779925212264061, -0.5209648609161377, -0.19218039512634277, 0.05941787362098694, -0.07102571427822113, 0.15383513271808624, -0.16601264476776123, 0.079905204474926, -0.017835063859820366, -0.13168224692344666, -0.2738543450832367, 0.009935054928064346, -0.0267520509660244, -0.010273739695549011, 0.1368960738182068, -0.2311687022447586, 0.12070822715759277, 0.1963397115468979, 0.13378524780273438, -0.021441861987113953, 0.2797914743423462, 0.42006146907806396, -0.263968825340271, -0.18117189407348633, 0.10535818338394165, 0.09015755355358124, 0.06574760377407074, 0.26909250020980835, -0.17851853370666504, 0.1627597212791443, -0.20868411660194397, 0.1598530262708664, 0.14006678760051727, 0.4469500482082367, -0.14405053853988647, -0.33052515983581543, -0.2689836323261261, -0.06382690370082855, -0.2859436869621277, 0.266404390335083, 0.1856902539730072, -0.3676314055919647, -0.12309013307094574, 0.15527106821537018, 0.08731557428836823, -0.1959102600812912, 0.043049514293670654, -0.28312620520591736, 0.556054949760437, 0.000708896666765213, 0.156178817152977, 0.3108658790588379, -0.03421635553240776, 0.2513534128665924, 0.20522454380989075, 0.17461098730564117, -0.006654614582657814, -0.847475528717041, 0.09959721565246582, 0.09272655099630356, -0.08796647191047668, -0.1757049262523651, 0.06186850368976593, 0.0008193552494049072, 0.1264660358428955, 0.36051198840141296, 0.14019013941287994, 0.4054999351501465, -0.30205103754997253, 0.11495071649551392, 0.010549835860729218, 0.15496255457401276, 0.1803232729434967, -0.06934276968240738, 0.047515880316495895, -0.23838403820991516, -0.3072217106819153, 0.37352263927459717, -0.23584838211536407, 0.11422358453273773, -0.29121407866477966, -0.026746302843093872, 0.11912669241428375, -0.1394098550081253, -0.1638278216123581, 0.14556273818016052, 0.5171128511428833, -0.2471623718738556, 0.2682490646839142, -0.10589438676834106, 0.16043613851070404, -0.1568984091281891, 0.06175097078084946, 0.13807575404644012, -0.12856563925743103, -0.1739274561405182, -0.045007772743701935, 0.1416027545928955, -0.5804480910301208, 0.09637516736984253, 0.15351828932762146, 0.20273958146572113, -0.06961982697248459, 0.09074334800243378, -0.22018742561340332, 0.10422388464212418, 0.12683025002479553, -0.026997029781341553, 0.1607455611228943, 0.07880336046218872, -0.13994646072387695, -0.25211015343666077, 0.020777471363544464, -0.1463904082775116, -0.031169623136520386, -0.15448132157325745, 0.004610714502632618, 0.12087197601795197, -0.20704585313796997, -0.17177815735340118, -0.4776543974876404, 0.2262430340051651, 0.06430377066135406, 0.08579717576503754, -0.22302274405956268, -0.05531981959939003, 0.026542190462350845, 0.05867151916027069, 0.3087267279624939, -0.5949584245681763, 0.366746723651886, 0.13484106957912445, 0.2772738039493561, 0.2309475839138031, 0.06378789246082306, -0.25417205691337585, 0.33897489309310913, -0.31729656457901, -0.4109484553337097, 0.39635029435157776, -0.36046504974365234, -0.1705303192138672, 0.5212182998657227, 0.05964554846286774, 0.21894745528697968, 0.28789272904396057, -0.21931743621826172, 0.09892524033784866, -0.10593245923519135, 0.31528985500335693, 0.1019083559513092, 0.03645732253789902, 0.02541157603263855, -0.24083183705806732, 0.0627920851111412, -0.003995375707745552, 0.3539312779903412, 0.15292325615882874, 0.1740361452102661, -0.17734000086784363, -0.28428348898887634, 0.4416242241859436, -0.16880393028259277, -0.015451977029442787, 0.5505426526069641, 0.35689064860343933, 0.4330820143222809, 0.2546761631965637, -0.03597516939043999, -0.2896023690700531, 0.32849323749542236, -0.001516677439212799, 0.018811529502272606, 0.03158498927950859, 0.18077009916305542, -0.06696818768978119, 0.3503130376338959, -0.34071147441864014, -0.08159831166267395, -0.12096551060676575, 0.2856154441833496, 0.048897311091423035, -0.18075346946716309, -0.3265317380428314, 0.5754948258399963, -0.016963530331850052, 0.021871086210012436, -0.37980416417121887, 0.19590964913368225, 0.17365729808807373, -0.1367885172367096, -0.046930812299251556, -0.10578872263431549, 0.12183263897895813, -0.23799613118171692, -0.08350227773189545, -0.05735481530427933, 0.23817358911037445, -0.001926220953464508, -0.18992632627487183, -0.14777475595474243, 0.03357788920402527, 0.3683527708053589, 0.0890161320567131, -0.17194202542304993, 0.10662177205085754, -0.08534272015094757, 0.24600329995155334, 0.10913200676441193, -0.045859333127737045, 0.7491175532341003, -0.06474605947732925, -0.09689364582300186, 0.16300103068351746, 0.06254196166992188, -0.006510142236948013, 0.2523626983165741, 0.37092161178588867, -0.01891116239130497, 0.7655940055847168, -0.019350068643689156, -0.2833729684352875, 0.21070612967014313, 0.19056589901447296, 0.1087246835231781, -0.32137376070022583, 0.2889557480812073, 0.009497728198766708, 0.12173709273338318, 0.1916355937719345, 0.13818080723285675, 0.1474221795797348, 0.02160727232694626, 0.10468310862779617, -0.10021856427192688, -0.05194558948278427, 0.0044176653027534485, -0.06749902665615082, 0.35392993688583374, 0.6203134655952454, 0.20175671577453613, -0.006729915738105774, -0.06282109022140503, -0.08517330139875412, -0.5933944582939148, -0.10296125710010529, 0.32715874910354614, -0.1359652727842331, 0.5944819450378418, -0.3258873224258423, 0.34952813386917114, -0.1641691029071808, -0.07598556578159332, -0.2494921237230301, -0.30612021684646606, -0.4430472254753113, 0.6229493021965027, 0.06705239415168762, 0.02472422644495964, 0.06196117401123047, 0.08922363072633743, 0.1784687489271164, -0.29967138171195984, -0.41335737705230713, -0.24689702689647675, -0.3454691767692566, -0.2190193235874176, 0.3692222237586975, -0.27293866872787476, 0.134526327252388, -0.12314615398645401, -0.2517123222351074, -0.19079172611236572, -0.21334004402160645, 0.17405188083648682, -0.08564895391464233, 0.26395875215530396, 0.14671704173088074, 0.3184050917625427, -0.04665873572230339, -0.14697031676769257, 0.001088615506887436, -0.011109955608844757, 0.05861150473356247, 0.286002516746521, 0.017287615686655045, 0.19298061728477478, 0.3070034980773926, 0.01215275190770626, -0.07059191912412643, -0.3345629870891571, 0.3028135597705841, -0.0032711923122406006, 0.05959779769182205, -0.0025446414947509766, 0.1727447211742401, 0.1887700855731964, -0.0064423829317092896, 0.16777294874191284, 0.027517758309841156, -0.6874183416366577, 0.33370324969291687, -0.0790548250079155, -0.21468298137187958, -0.04487268254160881, -0.07571238279342651, 0.30484646558761597, 0.22914795577526093, -0.6630088686943054, 0.1271912157535553, -0.22673624753952026, -0.060947395861148834, -0.37745940685272217, 0.09583179652690887, 0.1323060393333435, 0.04703599587082863, 0.05589153617620468, -0.0009863153100013733, -0.06784547120332718, 0.21979255974292755, 0.018077224493026733, 0.08399845659732819, 0.18384049832820892, 0.577360212802887, -0.022151321172714233, 0.4374515414237976, 0.31756603717803955, -0.05728493258357048, 0.5106605887413025, 0.19643492996692657, 0.12847237288951874, -0.019273947924375534, -0.345025897026062, -0.1853766143321991, -0.10914979875087738, -0.26320773363113403, 0.07373597472906113, -0.2680968642234802, -0.37957510352134705, -0.14529432356357574, -0.14946287870407104, 0.05520191788673401, -0.2907063961029053, 0.3248935341835022, -0.3031923472881317, 0.17906856536865234, -0.01977723464369774, 0.23985981941223145, -0.28256842494010925, 0.05883125960826874, -0.03183785453438759, -0.012790221720933914, 0.07076380401849747, -0.05595005303621292, 0.04010985791683197, 0.024943053722381592, -0.4432384967803955, 0.08660385757684708, 0.06612308323383331, 0.6218000054359436, 0.17024365067481995, -0.2582993507385254, 0.20006096363067627, -0.41394299268722534, 1.1118344068527222, -0.14672408998012543, 0.16594550013542175, 0.17121604084968567, -0.4848082959651947, -0.4029228687286377, -0.1989506483078003, -0.0074905529618263245, 0.0214860662817955, 0.19442693889141083, 0.6014018654823303, -0.1952989101409912, -0.48942509293556213, 0.08492989093065262, -0.046235501766204834, -0.1796634942293167, -0.3766309320926666, -0.44798603653907776, -0.007917173206806183, -0.246143639087677, 0.15198484063148499, -0.19921928644180298, 0.22650200128555298, 0.12012120336294174, -0.04815656319260597, -0.2623694837093353, 0.03491963446140289, 0.048096343874931335, 0.14466938376426697, 0.019157774746418, -0.10961650311946869, 0.527704119682312, 0.046692244708538055, 0.318053662776947, 0.36494600772857666, 0.40531808137893677, 0.06398051977157593, -0.5422199964523315, 0.3553922176361084, -0.0004604756832122803, 0.45980897545814514, 0.48601797223091125, 0.033446453511714935, -0.030590541660785675, -0.13647031784057617, 0.41760021448135376, -0.3336861729621887, 0.003977783024311066, 0.2801892161369324, 0.18908661603927612, -0.5694273114204407, -0.27116867899894714, 0.2722994089126587, -0.012130167335271835, 0.1988459825515747, 0.32413890957832336, -0.13366155326366425, 0.08147044479846954, 0.4057278037071228, 0.08713045716285706, 0.8224068880081177, -0.13858537375926971, 0.1852664053440094, 0.15703991055488586, -0.27961456775665283, 0.09731322526931763, -0.6480473279953003, 0.04604579135775566, -0.42237526178359985, -0.22698616981506348, 0.04435109347105026, -0.3854244351387024, 0.1890210211277008, 0.11483587324619293, 0.23991043865680695, 0.26182079315185547, -0.1373588591814041, -0.09755183756351471, 0.06174376606941223, 0.22183167934417725, -0.2702695429325104, -0.2823857069015503, -0.2494506984949112, -0.03369557857513428, -0.01914089359343052, 0.09644133597612381, -0.1673431098461151, -0.16353189945220947, -0.01650042086839676, 0.0627058893442154, -0.08945939689874649, 0.24939711391925812, 0.23892827332019806, -0.08509107679128647, 0.21727366745471954, -0.6226944923400879, 0.16077731549739838, 0.024724474176764488, 0.09770266711711884, -0.010388342663645744, -0.05777838081121445, 0.04019171744585037, -0.08871644735336304, -0.06080828979611397, 0.18181340396404266, -0.17049118876457214, 0.465069055557251, -0.019919447600841522, -0.21237720549106598, -0.06110553443431854, -0.1633988618850708, -0.30556172132492065, 0.2122856080532074, 0.3353080451488495, 0.12196515500545502, -0.11467279493808746, 0.15136823058128357, 0.24375510215759277, -0.04616057127714157, -0.2454436719417572, -0.0119265615940094, -0.024277683347463608, -0.26985836029052734, 0.3004790246486664, -0.24332427978515625, -0.3650549650192261, -0.11606360971927643, 0.5141156911849976, -0.03519287705421448, 0.11594030261039734, 0.7194278836250305, 0.37381255626678467, -0.3570440411567688, -0.1546742022037506, -0.14338898658752441, 0.12859724462032318, -0.4640609920024872, 0.10341432690620422, -0.11599262058734894, 0.1528291553258896, 0.1144459918141365, -0.055003922432661057, -0.08451659232378006, -0.4986618459224701, -0.19313178956508636, -0.354329913854599, -0.07974889129400253, -0.15479233860969543, -0.08648476004600525, 0.021772107109427452, 0.046946264803409576, -0.01956331729888916, -0.12970121204853058, 0.15723396837711334, -0.12988750636577606, -0.07786327600479126, -0.22517389059066772, 0.018453963100910187, -0.15395298600196838, -0.3218876123428345, 0.11399348825216293, 0.0640869140625, -0.011989634484052658, 0.2113790363073349, 0.08986413478851318, -0.10803490877151489, -0.30079662799835205, 0.15365786850452423, -0.028168465942144394, 0.06752905249595642, 0.12935073673725128, -0.21057841181755066, -0.20336121320724487, -0.1689871847629547, 0.12015073001384735, -0.2310493290424347, 0.07077036798000336, -0.024396449327468872, 0.31702080368995667, 0.24425071477890015, -0.1109495460987091, 0.06010888144373894, 0.28601229190826416, -0.1994095742702484, 0.14735710620880127, 0.2983512580394745, -0.12136903405189514, 0.08831451833248138, -0.1424815058708191, 0.12998425960540771, 0.18554189801216125, -0.025788217782974243, 0.4013172686100006, -0.5497326254844666, 0.08975150436162949, -0.0777570828795433, 0.3413940966129303, 0.7738450169563293, 0.0969163328409195, -0.3321516215801239, 0.5302596092224121, -0.020271843299269676, -0.18308225274085999, -0.16922006011009216, -0.06775577366352081, 0.08864068984985352, -0.007148958742618561, 0.30267298221588135, -0.10090939700603485, -0.1459881067276001, 0.27046847343444824, 0.10622943937778473, 0.16512951254844666, -0.1421566605567932, -0.08314153552055359, 0.0411565899848938, -0.05343438312411308, 0.01680578663945198, 0.4790063500404358, 0.5187138915061951, 0.05569997802376747, 0.27175652980804443, 0.1952679455280304, 0.17554613947868347, -0.1752564162015915, 0.11154614388942719, -0.18380945920944214, -0.6079596877098083, 0.11702445149421692, 0.18584926426410675, 0.2439696192741394, -0.029085557907819748, 0.006658464670181274, 0.27456697821617126, 0.0763409435749054, -0.24809928238391876, -0.3711569309234619, 0.14894038438796997, -0.14007574319839478, 0.07181912660598755, 0.11067718267440796, -0.12843798100948334, -0.004816301167011261, 0.15586915612220764, 0.05851253122091293, -0.18294626474380493, 0.1463458091020584, 0.21144162118434906, 0.19650012254714966, -0.37641412019729614, -0.26253384351730347, -0.09077675640583038, 0.2410566210746765, -0.08509977161884308, 0.047972261905670166, -0.0885116383433342, -0.12567856907844543, -0.4011211693286896, -0.09522920846939087, 0.3539486825466156, 0.3889979124069214, -0.07238520681858063, 0.03157376870512962, -0.06695574522018433, 0.05899535119533539, -0.07680399715900421, 0.09427155554294586, -0.2491472363471985, 0.2797158658504486, 0.38953912258148193, -0.09842802584171295, 0.002898130565881729, -0.12114718556404114, 0.029200715944170952, 0.21386471390724182, -0.2467932105064392, 0.1451556384563446, 0.3297257721424103, 0.04171249270439148, 0.008409420028328896, -0.06608394533395767, -0.5343639254570007, 0.02093685045838356, 0.33972883224487305, -0.13586242496967316, 0.045292992144823074, -0.01183529943227768, 0.009629335254430771, -0.11864450573921204, 0.5528885126113892, 0.28592976927757263, 0.19740644097328186, -0.15978644788265228, -0.11258934438228607, -0.28011566400527954, -0.026377040892839432, -0.401329904794693, -0.06849780678749084, 0.3683992028236389, 0.36522912979125977, 0.31629350781440735, 0.027957092970609665, 0.2992699444293976, -0.08533061295747757, -0.35066622495651245, 0.6434947848320007, -0.4277189373970032, -0.2203005850315094, 0.07652706652879715, 0.08983255177736282, -0.12094302475452423, -0.4247918426990509, 0.16088558733463287, -0.14644169807434082, -0.05226275324821472, -0.1083570122718811, -0.25580018758773804, 0.2148813009262085, -0.586998462677002, 0.4256051778793335, -0.24148979783058167, 0.09144668281078339, 0.18530654907226562, -0.28844204545021057, -0.25829246640205383, -0.06420180201530457, 0.030385959893465042, 0.020887212827801704, -0.12919585406780243, 0.08772597461938858, -0.18061240017414093, -0.07252749055624008, -0.3923376500606537, 0.11880263686180115, -0.09137196838855743, -0.008677523583173752, 0.057026490569114685, 0.16280502080917358, 0.15791496634483337, 0.3563195466995239, 0.12130868434906006, 0.2288101762533188, 0.20771555602550507, 0.18921315670013428, -0.49273404479026794, -0.06910309940576553, 0.30668604373931885, -0.3984037935733795, -0.5961791276931763, 0.07368839532136917, 0.09664446115493774, 0.038254514336586, 0.002720605581998825, -0.2595638632774353, 0.17198020219802856, 0.07739999890327454, -0.06371093541383743, -0.050465572625398636, 0.24098430573940277, 0.08676314353942871, 0.11558493971824646, -0.3341928720474243, 0.16164568066596985, -0.002903945744037628, -0.09493017941713333, -0.07486773282289505, -0.12614980340003967 ]
https://github.com/huggingface/datasets/issues/6079
**Update**: It seems the latency part is more of a multiprocessing issue with torch and some host specific issue, and I had to scourge through relevant pytorch issues, when I stumbled across these threads: 1. https://github.com/pytorch/pytorch/issues/102494 2. https://github.com/pytorch/pytorch/issues/102269 3. https://github.com/pytorch/pytorch/issues/99625 Out of the suggested solutions, the one that worked in my case was: ``` os.environ['KMP_AFFINITY'] = "disabled" ``` It is working for now, though I have no clue why, just I hope it does not get stuck when I do actual model training, will update by tomorrow.
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
87
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 **Update**: It seems the latency part is more of a multiprocessing issue with torch and some host specific issue, and I had to scourge through relevant pytorch issues, when I stumbled across these threads: 1. https://github.com/pytorch/pytorch/issues/102494 2. https://github.com/pytorch/pytorch/issues/102269 3. https://github.com/pytorch/pytorch/issues/99625 Out of the suggested solutions, the one that worked in my case was: ``` os.environ['KMP_AFFINITY'] = "disabled" ``` It is working for now, though I have no clue why, just I hope it does not get stuck when I do actual model training, will update by tomorrow.
[ -0.12823417782783508, -0.16303879022598267, -0.033234819769859314, 0.22006091475486755, -0.08479107916355133, 0.04496645927429199, 0.4441736936569214, 0.23284724354743958, -0.08224606513977051, 0.19713343679904938, 0.04701315611600876, 0.3833542466163635, 0.02022908255457878, -0.0033660531044006348, -0.18859833478927612, -0.033799562603235245, 0.06023295223712921, 0.1957617700099945, -0.017360642552375793, -0.12104880064725876, 0.12533038854599, 0.003733525052666664, -0.2132294774055481, -0.22083455324172974, -0.28959518671035767, -0.09955739229917526, 0.004785902798175812, -0.08074094355106354, 0.11567361652851105, -0.3850100338459015, 0.5517264604568481, 0.14592745900154114, 0.21255379915237427, 0.7858378887176514, -0.00012740892998408526, 0.06073015183210373, 0.27372920513153076, 0.07730670273303986, -0.5201416611671448, -0.19899670779705048, 0.31565791368484497, -0.026708263903856277, 0.21664007008075714, -0.17172566056251526, -0.05352754145860672, -0.17657801508903503, -0.09129215776920319, -0.40182700753211975, 0.0005608946084976196, 0.009668935090303421, 0.002419792115688324, 0.24164117872714996, -0.23948943614959717, 0.07476472854614258, 0.1298355907201767, 0.17444771528244019, -0.010116368532180786, 0.16711418330669403, 0.47351378202438354, -0.22472147643566132, -0.348590224981308, 0.1061871200799942, 0.04298581928014755, 0.12596914172172546, 0.3343357443809509, -0.22182297706604004, -0.014465808868408203, -0.08843925595283508, 0.04113582521677017, 0.08584359288215637, 0.47932592034339905, -0.14764103293418884, -0.33275967836380005, -0.2682245969772339, -0.06434714794158936, -0.22489911317825317, 0.25235891342163086, 0.1504191756248474, -0.3533094823360443, -0.09734585881233215, 0.047217629849910736, 0.04071038216352463, -0.23455721139907837, 0.07779939472675323, -0.2832961976528168, 0.4450112283229828, 0.032288264483213425, 0.20183145999908447, 0.13903161883354187, -0.008285155519843102, 0.24971430003643036, 0.07591520249843597, 0.2579064667224884, 0.019696775823831558, -0.8287283182144165, 0.20607995986938477, 0.11865951120853424, -0.24626636505126953, -0.20483145117759705, 0.11061926931142807, 0.04565614089369774, 0.16164696216583252, 0.3271094262599945, 0.15889900922775269, 0.4116429388523102, -0.19735471904277802, 0.03512750566005707, 0.04848507046699524, 0.20777305960655212, 0.04415588080883026, -0.05405290797352791, 0.08104538917541504, -0.2005540281534195, -0.3174296021461487, 0.27833545207977295, -0.18553166091442108, 0.10573438555002213, -0.30457836389541626, -0.046679481863975525, 0.19204553961753845, -0.09650148451328278, -0.10240718722343445, 0.18416444957256317, 0.5119491815567017, -0.28244996070861816, 0.2856599688529968, 0.04447370767593384, 0.11646422743797302, -0.13516449928283691, 0.10792144387960434, 0.11812575161457062, -0.14263609051704407, -0.19851833581924438, -0.07583775371313095, 0.1457001268863678, -0.4650026261806488, 0.06128185987472534, 0.14106625318527222, 0.3725666105747223, -0.07190846651792526, 0.06310001760721207, -0.2411864548921585, 0.13647525012493134, 0.15168114006519318, -0.11350733041763306, 0.15532875061035156, 0.07621040940284729, 0.09051918983459473, -0.27067840099334717, -0.0133738424628973, -0.1700458824634552, -0.11367808282375336, -0.21094651520252228, 0.01813909411430359, 0.1343790590763092, -0.10786586999893188, -0.119747094810009, -0.5369676947593689, 0.19442218542099, 0.0224180668592453, 0.023219961673021317, -0.26045897603034973, -0.08370712399482727, 0.09937705844640732, 0.08837670087814331, 0.296006441116333, -0.5126632452011108, 0.2683594822883606, 0.18587665259838104, 0.26169928908348083, 0.15383237600326538, 0.13527902960777283, -0.3134448826313019, 0.3043297529220581, -0.30942612886428833, -0.3846186399459839, 0.4345482885837555, -0.3389453589916229, -0.05393026024103165, 0.5047905445098877, -0.035507701337337494, 0.23734523355960846, 0.27318280935287476, -0.12549430131912231, 0.10399769246578217, -0.06701602786779404, 0.32894885540008545, 0.19832755625247955, 0.0341569259762764, 0.07299605011940002, -0.19867761433124542, 0.11941854655742645, 0.0935012698173523, 0.42311179637908936, 0.11738061159849167, 0.08761180192232132, -0.2005440890789032, -0.27756866812705994, 0.4117308259010315, -0.14359253644943237, -0.04980041831731796, 0.622699499130249, 0.18969017267227173, 0.45224836468696594, 0.33909258246421814, 0.01015143096446991, -0.3021825850009918, 0.3201763927936554, 0.15101861953735352, 0.023170599713921547, -0.1319090574979782, 0.18242467939853668, 0.012946933507919312, 0.36516374349594116, -0.38013145327568054, -0.040437355637550354, -0.1255258023738861, 0.3213675618171692, 0.05428861081600189, -0.21533848345279694, -0.29624485969543457, 0.6006149053573608, -0.018036339432001114, -0.02830345183610916, -0.3398209810256958, 0.1587218940258026, 0.09854099899530411, -0.13364967703819275, 0.04771330952644348, -0.11855065822601318, 0.10106151551008224, -0.2806705832481384, -0.12449845671653748, 0.04281064495444298, 0.1584009826183319, 0.034330785274505615, -0.14000645279884338, -0.19398419559001923, 0.0742221251130104, 0.25745412707328796, 0.15614622831344604, -0.018499787896871567, 0.023957837373018265, -0.20852668583393097, 0.17128901183605194, 0.18467052280902863, 0.05149737000465393, 0.8057283759117126, -0.10135523229837418, -0.13761824369430542, 0.14723604917526245, 0.15652607381343842, -0.041742417961359024, 0.31719687581062317, 0.4886825382709503, -0.04876092076301575, 0.7915735244750977, -0.007832949981093407, -0.38464754819869995, 0.1778036653995514, 0.08786676824092865, 0.06231912970542908, -0.37325164675712585, 0.2674614191055298, 0.05580722540616989, 0.12192440032958984, 0.17607499659061432, -0.09710828959941864, 0.16152817010879517, 0.03185503929853439, 0.04351244121789932, -0.16969528794288635, -0.12918761372566223, -0.0030401870608329773, -0.1291731297969818, 0.3306775689125061, 0.48322999477386475, 0.23520693182945251, 0.07307817041873932, -0.028801726177334785, -0.09751806408166885, -0.5260417461395264, -0.05839252099394798, 0.14092960953712463, -0.0802699401974678, 0.669424295425415, -0.3479614555835724, 0.3091532588005066, -0.21922490000724792, -0.09348654001951218, -0.3079583942890167, -0.26563364267349243, -0.29572761058807373, 0.5695269107818604, 0.01453997939825058, 0.08793757855892181, 0.050716571509838104, 0.04658953845500946, 0.29995548725128174, -0.5311842560768127, -0.4011196196079254, -0.3319467306137085, -0.3443780243396759, -0.2165403813123703, 0.3255554735660553, -0.22306397557258606, 0.20545198023319244, -0.103289395570755, -0.18401917815208435, -0.23736071586608887, -0.19735506176948547, 0.1528034210205078, -0.07937785983085632, 0.21091724932193756, 0.0948454886674881, 0.22597858309745789, 0.07381811738014221, -0.22418609261512756, 0.11301984637975693, -0.08221493661403656, 0.061757124960422516, 0.31213074922561646, -0.01737283542752266, 0.10677774250507355, 0.25974607467651367, -0.026532620191574097, -0.04407694190740585, -0.28439760208129883, 0.19586028158664703, -0.04701513797044754, 0.04951930418610573, -0.15056346356868744, 0.17924264073371887, 0.12685641646385193, -0.04716585576534271, 0.31137946248054504, 0.10144736617803574, -0.658858060836792, 0.39224812388420105, -0.10958300530910492, -0.28002139925956726, -0.14981509745121002, -0.0052877068519592285, 0.24412637948989868, 0.32513055205345154, -0.6613538861274719, 0.13210085034370422, -0.22030392289161682, -0.00958162546157837, -0.36352014541625977, -0.07084587216377258, 0.20217303931713104, 0.032331157475709915, 0.03201564401388168, -0.01799042522907257, -0.12578685581684113, 0.18858632445335388, -0.014635179191827774, 0.12744703888893127, 0.08745989203453064, 0.46449053287506104, -0.004696249961853027, 0.5634546875953674, 0.13471299409866333, -0.18136876821517944, 0.5286005139350891, 0.18629644811153412, 0.12853924930095673, -0.07719637453556061, -0.3392423391342163, -0.11106503754854202, -0.2515263557434082, -0.2384287416934967, 0.04113810509443283, -0.25309625267982483, -0.44094035029411316, -0.23097415268421173, -0.13216546177864075, 0.11993271857500076, -0.2988501191139221, 0.3276839256286621, -0.329515278339386, 0.2237444370985031, -0.07160136103630066, 0.2675786018371582, -0.27721473574638367, 0.11326254904270172, 0.09486280381679535, -0.02879982441663742, 0.12316226959228516, -0.05866400524973869, 0.07145202159881592, 0.06018693372607231, -0.31668010354042053, 0.0919855386018753, 0.05341189354658127, 0.5590807199478149, 0.15632198750972748, -0.27515748143196106, 0.22127988934516907, -0.4462677240371704, 0.9339813590049744, 0.14962832629680634, 0.17429275810718536, 0.18395274877548218, -0.42529910802841187, -0.3698020875453949, -0.16727423667907715, 0.07634304463863373, 0.1749836653470993, 0.24018767476081848, 0.5403403639793396, -0.28013497591018677, -0.5825626850128174, 0.07475267350673676, 0.14859774708747864, -0.20711547136306763, -0.37103158235549927, -0.45170503854751587, 0.10398435592651367, -0.24756541848182678, 0.14712801575660706, -0.1826419234275818, 0.2604216933250427, 0.13505461812019348, -0.041056230664253235, -0.2462194561958313, 0.09158096462488174, -0.09038948267698288, 0.023516912013292313, 0.07811158895492554, -0.2792322039604187, 0.5323888063430786, 0.11548873782157898, 0.465528279542923, 0.33050230145454407, 0.375739187002182, 0.13342070579528809, -0.477771133184433, 0.4246267080307007, 0.07304377853870392, 0.4137275516986847, 0.5050265789031982, 0.08717992901802063, -0.07796327769756317, -0.22211521863937378, 0.42037010192871094, -0.3333038091659546, 0.11324118077754974, 0.32552221417427063, 0.10901762545108795, -0.5049716830253601, -0.25073084235191345, 0.22488215565681458, -0.030970193445682526, 0.18174469470977783, 0.40178900957107544, -0.12793773412704468, 0.18313288688659668, 0.4081380367279053, 0.08932492136955261, 0.9135493636131287, -0.16917206346988678, 0.24899238348007202, 0.08775517344474792, -0.33943766355514526, -0.053342871367931366, -0.7310381531715393, 0.031028680503368378, -0.3646177053451538, -0.13349415361881256, 0.044079892337322235, -0.40013954043388367, 0.16260382533073425, 0.07291267812252045, 0.27763622999191284, 0.3105155825614929, -0.09678760170936584, -0.06428959965705872, 0.05504181236028671, 0.28441792726516724, -0.18352290987968445, -0.2949770390987396, -0.16601377725601196, -0.027231985703110695, -0.09808871895074844, 0.19430920481681824, -0.12568272650241852, -0.16724589467048645, 0.06964699923992157, -0.012091018259525299, -0.08541803807020187, 0.25057852268218994, 0.20084097981452942, -0.07969068735837936, 0.08929528295993805, -0.7588245272636414, 0.051790013909339905, 0.018508130684494972, -0.10262888669967651, -0.04406905546784401, -0.03558037057518959, 0.12186184525489807, -0.03879845514893532, -0.01576010324060917, 0.0888853669166565, -0.31209081411361694, 0.36776888370513916, 0.0125216543674469, -0.08178484439849854, -0.02438555657863617, -0.24686162173748016, -0.3097463846206665, 0.2671707272529602, 0.30706551671028137, 0.17978276312351227, -0.007734242826700211, 0.2052721530199051, 0.1798645406961441, -0.002559281885623932, -0.2279386818408966, -0.004565287381410599, 0.0005205124616622925, -0.25195544958114624, 0.15937726199626923, -0.28235548734664917, -0.324255108833313, -0.12120877951383591, 0.5422453880310059, 0.004750009626150131, -0.0021673068404197693, 0.6889649629592896, 0.46349942684173584, -0.36391550302505493, -0.1303987354040146, -0.2012675702571869, 0.16748139262199402, -0.49374157190322876, 0.04840288311243057, -0.18122173845767975, 0.09677037596702576, 0.06654533743858337, -0.057101551443338394, -0.11519298702478409, -0.5163527131080627, -0.1811181902885437, -0.2950473427772522, -0.15290147066116333, -0.18394319713115692, -0.07970938086509705, 0.054390642791986465, 0.1332411766052246, 0.013354342430830002, -0.055766522884368896, 0.21725933253765106, -0.1190313771367073, -0.10261349380016327, -0.18701918423175812, 0.13146339356899261, -0.1088176742196083, -0.2420188933610916, 0.10366861522197723, 0.024306464940309525, -0.015010379254817963, 0.11516770720481873, 0.181649848818779, -0.08820436149835587, -0.2517678737640381, 0.16121624410152435, -0.0482039675116539, 0.14983969926834106, 0.06543372571468353, -0.2908557653427124, -0.10626784712076187, -0.18137414753437042, 0.16971427202224731, -0.1582815945148468, -0.0025798454880714417, -0.09596601128578186, 0.3347081243991852, 0.10987618565559387, -0.07123593240976334, -0.030092090368270874, 0.3150195777416229, -0.16270312666893005, 0.1397922933101654, 0.23899959027767181, -0.11980346590280533, 0.04166676104068756, -0.07535873353481293, 0.05462627485394478, 0.11332768201828003, -0.018285609781742096, 0.3875105082988739, -0.47368839383125305, 0.058906927704811096, -0.16433709859848022, 0.4484858512878418, 0.7816045880317688, 0.07098347693681717, -0.3125961720943451, 0.4629767835140228, -0.012630868703126907, -0.2104247808456421, -0.265394926071167, -0.10882796347141266, 0.010924164205789566, 0.029694661498069763, 0.12479060888290405, -0.1064038798213005, -0.01883600652217865, 0.3480466604232788, 0.15106303989887238, 0.13062450289726257, -0.15104718506336212, -0.08828116953372955, 0.1156826913356781, 0.07196872681379318, -0.0497162900865078, 0.4503243565559387, 0.4472848176956177, 0.03432774171233177, 0.2670271694660187, 0.13654451072216034, 0.23828519880771637, -0.012079701758921146, 0.12951776385307312, -0.14881208539009094, -0.4394436478614807, 0.029852017760276794, 0.04275305196642876, 0.37482911348342896, -0.05621388554573059, -0.01813369244337082, 0.36044836044311523, 0.04373558238148689, -0.35902515053749084, -0.3672618865966797, 0.20466813445091248, -0.10211651027202606, 0.1291542798280716, 0.19114556908607483, -0.13423219323158264, -0.026950933039188385, 0.16599898040294647, 0.07117953151464462, -0.049662038683891296, 0.16511142253875732, 0.20492470264434814, 0.22805877029895782, -0.4560891389846802, -0.2653893530368805, -0.11785577237606049, 0.21030078828334808, -0.042041778564453125, 0.15615229308605194, 0.012227997183799744, -0.15026700496673584, -0.30661579966545105, -0.10891003906726837, 0.3671523928642273, 0.35304102301597595, -0.19021452963352203, 0.09056110680103302, -0.12892559170722961, 0.00736420601606369, 0.008657552301883698, 0.15116411447525024, -0.3030390739440918, 0.13681870698928833, 0.47975850105285645, -0.07934035360813141, -0.01267785020172596, -0.03578827902674675, -0.044106706976890564, 0.17682155966758728, -0.24469414353370667, 0.2963917553424835, 0.23300009965896606, -0.05570607632398605, -0.06992632150650024, -0.053892120718955994, -0.5279351472854614, 0.02613168954849243, 0.37071505188941956, -0.08643728494644165, -0.0035550929605960846, -0.032034408301115036, 0.007402550429105759, -0.11151249706745148, 0.6506913900375366, 0.2361324578523636, 0.32912689447402954, -0.2349892556667328, -0.16660742461681366, -0.34138092398643494, 0.06796582788228989, -0.44696319103240967, -0.033684518188238144, 0.3175957500934601, 0.2890603244304657, 0.37967830896377563, 0.06738859415054321, 0.22457869350910187, -0.0893687903881073, -0.24986600875854492, 0.593071699142456, -0.45591408014297485, -0.15584418177604675, 0.003431001678109169, 0.14967037737369537, -0.14986124634742737, -0.3687235116958618, 0.10753519833087921, 0.0030609406530857086, -0.036077409982681274, -0.04622959345579147, -0.27975887060165405, 0.24444974958896637, -0.4340320825576782, 0.3582903742790222, -0.23033373057842255, 0.13699255883693695, 0.1990574300289154, -0.23889219760894775, -0.24692273139953613, -0.05913885310292244, 0.0625729188323021, -0.041633278131484985, -0.05223429203033447, 0.024004489183425903, -0.14911440014839172, -0.11041056364774704, -0.4598590135574341, 0.13143093883991241, -0.07287685573101044, -0.14558324217796326, 0.037099339067935944, 0.15123167634010315, 0.042724087834358215, 0.42197445034980774, 0.0761413723230362, 0.24497106671333313, 0.23035793006420135, 0.18016670644283295, -0.48245444893836975, -0.08907756954431534, 0.4052254557609558, -0.3417215645313263, -0.5525674819946289, 0.09836013615131378, 0.10873494297266006, 0.18227536976337433, 0.06126461178064346, -0.33912205696105957, 0.1826762706041336, 0.05231298878788948, 0.02081425115466118, 0.005142122507095337, 0.1852261871099472, 0.16614387929439545, 0.07856341451406479, -0.3599409759044647, 0.24524065852165222, -0.026386745274066925, -0.1072499230504036, -0.17912724614143372, -0.1352601945400238 ]
https://github.com/huggingface/datasets/issues/6079
I'm facing a similar situation in the local VS Code. Datasets version 2.14.4 Torch 2.0.1+cu118 Same code runs without issues in Colab ``` from datasets import load_dataset dataset = load_dataset("Supermaxman/esa-hubble", streaming=True) sample = next(iter(dataset["train"])) ``` is stuck for minutes. If I interrupt, I get ``` --------------------------------------------------------------------------- KeyboardInterrupt Traceback (most recent call last) Cell In[5], line 5 1 from datasets import load_dataset 3 dataset = load_dataset("Supermaxman/esa-hubble", streaming=True) ----> 5 sample = next(iter(dataset["train"])) 6 print(sample["text"]) 7 sample["image"] File [~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:1353](https://file+.vscode-resource.vscode-cdn.net/home/osanseviero/Desktop/workspace/genai/nbs/~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:1353), in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File [~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:255](https://file+.vscode-resource.vscode-cdn.net/home/osanseviero/Desktop/workspace/genai/nbs/~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:255), in ArrowExamplesIterable.__iter__(self) 253 def __iter__(self): 254 formatter = PythonFormatter() --> 255 for key, pa_table in self.generate_tables_fn(**self.kwargs): 256 for pa_subtable in pa_table.to_reader(max_chunksize=config.ARROW_READER_BATCH_SIZE_IN_DATASET_ITER): ... -> 1130 return self._sslobj.read(len, buffer) 1131 else: 1132 return self._sslobj.read(len) ```
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
155
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 I'm facing a similar situation in the local VS Code. Datasets version 2.14.4 Torch 2.0.1+cu118 Same code runs without issues in Colab ``` from datasets import load_dataset dataset = load_dataset("Supermaxman/esa-hubble", streaming=True) sample = next(iter(dataset["train"])) ``` is stuck for minutes. If I interrupt, I get ``` --------------------------------------------------------------------------- KeyboardInterrupt Traceback (most recent call last) Cell In[5], line 5 1 from datasets import load_dataset 3 dataset = load_dataset("Supermaxman/esa-hubble", streaming=True) ----> 5 sample = next(iter(dataset["train"])) 6 print(sample["text"]) 7 sample["image"] File [~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:1353](https://file+.vscode-resource.vscode-cdn.net/home/osanseviero/Desktop/workspace/genai/nbs/~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:1353), in IterableDataset.__iter__(self) 1350 yield formatter.format_row(pa_table) 1351 return -> 1353 for key, example in ex_iterable: 1354 if self.features: 1355 # `IterableDataset` automatically fills missing columns with None. 1356 # This is done with `_apply_feature_types_on_example`. 1357 example = _apply_feature_types_on_example( 1358 example, self.features, token_per_repo_id=self._token_per_repo_id 1359 ) File [~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:255](https://file+.vscode-resource.vscode-cdn.net/home/osanseviero/Desktop/workspace/genai/nbs/~/miniconda3/envs/book/lib/python3.10/site-packages/datasets/iterable_dataset.py:255), in ArrowExamplesIterable.__iter__(self) 253 def __iter__(self): 254 formatter = PythonFormatter() --> 255 for key, pa_table in self.generate_tables_fn(**self.kwargs): 256 for pa_subtable in pa_table.to_reader(max_chunksize=config.ARROW_READER_BATCH_SIZE_IN_DATASET_ITER): ... -> 1130 return self._sslobj.read(len, buffer) 1131 else: 1132 return self._sslobj.read(len) ```
[ -0.15123410522937775, -0.032595306634902954, -0.028455058112740517, 0.23572960495948792, -0.027845654636621475, 0.07383497804403305, 0.37743887305259705, 0.20796850323677063, -0.021897830069065094, 0.3850677013397217, -0.012812208384275436, 0.352201372385025, -0.008928308263421059, 0.163935124874115, -0.17049281299114227, 0.06709359586238861, 0.04939059168100357, 0.222742959856987, 0.10169419646263123, -0.130355566740036, 0.029487669467926025, 0.029950587078928947, -0.3097451329231262, -0.265944242477417, -0.18462342023849487, -0.036836057901382446, 0.12878626585006714, -0.05628598481416702, 0.02595234289765358, -0.38143205642700195, 0.6248168349266052, 0.16229769587516785, 0.3753358721733093, 0.7256149053573608, -0.00013134726032149047, 0.14277374744415283, 0.3356819450855255, 0.04886765778064728, -0.6637637615203857, -0.35898882150650024, 0.04356525093317032, 0.06522519886493683, 0.2619694471359253, -0.15577974915504456, -0.059441544115543365, -0.06394366174936295, -0.07916788011789322, -0.369910329580307, 0.05046719312667847, -0.01964164897799492, -0.03348350524902344, 0.08880476653575897, -0.28518325090408325, 0.04452228918671608, 0.22081930935382843, 0.22438357770442963, -0.11967525631189346, 0.1985461562871933, 0.38984739780426025, -0.15179409086704254, -0.19205635786056519, 0.07849552482366562, 0.08150526881217957, 0.1037154495716095, 0.2853449285030365, -0.19493898749351501, -0.012792836874723434, -0.08776330202817917, 0.19933122396469116, -0.00660865381360054, 0.543531596660614, -0.1905301958322525, -0.28082650899887085, -0.1588318943977356, 0.009333010762929916, -0.29366669058799744, 0.2816723883152008, 0.2376815378665924, -0.3664703369140625, -0.013070633634924889, 0.04404527693986893, 0.04722759872674942, -0.2369236946105957, 0.08813649415969849, -0.37277185916900635, 0.36040616035461426, -0.08875548839569092, 0.24707454442977905, 0.2356918305158615, -0.00028428900986909866, 0.41206204891204834, 0.06204776093363762, 0.1632576733827591, 0.0400974303483963, -0.8684036731719971, 0.22935879230499268, 0.059456855058670044, 0.06226319819688797, -0.21546979248523712, 0.06333862245082855, 0.09233100712299347, 0.0688469335436821, 0.28327852487564087, 0.18865707516670227, 0.3755178451538086, -0.18589244782924652, 0.18544235825538635, 0.11111930012702942, 0.2405148148536682, 0.19580738246440887, -0.18345533311367035, 0.020044827833771706, -0.25425878167152405, -0.27459731698036194, 0.14828705787658691, -0.1777874380350113, 0.15119785070419312, -0.44642892479896545, -0.05593854933977127, 0.2692316472530365, -0.25184744596481323, -0.10010550916194916, 0.20177771151065826, 0.465780109167099, -0.1702621579170227, 0.17156371474266052, -0.054932598024606705, 0.03519800677895546, -0.05996137484908104, 0.07592573761940002, 0.11021971702575684, -0.14919833838939667, -0.24018707871437073, 0.02519197016954422, 0.15736494958400726, -0.4738956689834595, 0.01637563854455948, 0.03656041994690895, 0.2200804352760315, -0.040186308324337006, 0.03933735191822052, -0.2740861773490906, 0.2444411814212799, 0.22338058054447174, -0.0007125958800315857, 0.19870218634605408, 0.05039447546005249, -0.18701490759849548, -0.27030980587005615, 0.02287072315812111, -0.11108412593603134, -0.0510052926838398, -0.18232734501361847, -0.03314061835408211, 0.044595472514629364, -0.08854430168867111, -0.20754019916057587, -0.44742825627326965, 0.11794934421777725, 0.0051963478326797485, 0.11940588057041168, -0.20231866836547852, -0.10491938889026642, 0.10703134536743164, 0.10973114520311356, 0.4381108283996582, -0.7472399473190308, 0.3302387595176697, 0.1328272968530655, 0.2631218433380127, 0.19523490965366364, 0.11407782137393951, -0.4000145494937897, 0.3365073800086975, -0.3485746383666992, -0.42557796835899353, 0.3863663971424103, -0.3628274202346802, -0.1725122332572937, 0.5592949390411377, 0.06826795637607574, 0.2612619400024414, 0.21544961631298065, -0.227319598197937, 0.0923171117901802, -0.10013725608587265, 0.2865486443042755, 0.16089202463626862, -0.052891217172145844, 0.0023761391639709473, -0.20182235538959503, 0.07363510131835938, 0.06555456668138504, 0.3734334111213684, 0.15602704882621765, 0.16692255437374115, -0.08668842166662216, -0.15488427877426147, 0.35984158515930176, -0.11591650545597076, 0.003392007201910019, 0.5571632385253906, 0.3055688738822937, 0.3711656928062439, 0.2236238718032837, -0.0024714916944503784, -0.3963924050331116, 0.30283883213996887, 0.17117628455162048, 0.01820812001824379, -0.12412731349468231, 0.10915157943964005, -0.14426784217357635, 0.3750932812690735, -0.37885338068008423, -0.11003461480140686, -0.15896189212799072, 0.378395140171051, 0.08572268486022949, -0.16749846935272217, -0.2627025246620178, 0.6112448573112488, -0.063496895134449, 0.00128231942653656, -0.3321759104728699, 0.2894880473613739, 0.14667893946170807, -0.17211683094501495, -0.07828859984874725, -0.11506907641887665, 0.10457540303468704, -0.3943931758403778, -0.18799155950546265, 0.025626564398407936, 0.14014944434165955, 0.054282281547784805, -0.046039678156375885, -0.13573606312274933, 0.13612526655197144, 0.20193150639533997, 0.05883149057626724, -0.14442315697669983, 0.13007138669490814, -0.11742724478244781, 0.10421637445688248, 0.0737961158156395, -0.018665427342057228, 0.8758010864257812, -0.14854754507541656, -0.12917865812778473, 0.19037076830863953, 0.053488969802856445, -0.08837710320949554, 0.2786233127117157, 0.3581756353378296, 0.026824649423360825, 0.8443772196769714, 0.03485406935214996, -0.32465171813964844, 0.18487736582756042, 0.14936837553977966, 0.09916628897190094, -0.4599718451499939, 0.31382161378860474, 0.0433720201253891, 0.17808231711387634, 0.2643295228481293, 0.06474228948354721, 0.14374929666519165, 0.007675953209400177, 0.05795719474554062, -0.1191207692027092, -0.0930229127407074, -0.033506736159324646, -0.12510836124420166, 0.3187398910522461, 0.49455586075782776, 0.2563633322715759, 0.052206072956323624, -0.054020922631025314, -0.13513082265853882, -0.4862893223762512, -0.07065559923648834, 0.3025239109992981, -0.02260681986808777, 0.6263386011123657, -0.40665102005004883, 0.17327570915222168, -0.2577996850013733, -0.058299630880355835, -0.17126774787902832, -0.2719878852367401, -0.4631521999835968, 0.6159794926643372, 0.04807007312774658, 0.11922726780176163, 0.07565310597419739, 0.13765482604503632, 0.24107694625854492, -0.40924981236457825, -0.44191914796829224, -0.2837449908256531, -0.35938408970832825, -0.24078382551670074, 0.44630226492881775, -0.24213998019695282, 0.12279390543699265, -0.1062815710902214, -0.1816708743572235, -0.25198304653167725, -0.2623182535171509, 0.3006323575973511, -0.08927057683467865, 0.4487830400466919, 0.10069312155246735, 0.20940113067626953, -0.11383272707462311, -0.1843462586402893, 0.05694013088941574, 0.017432138323783875, 0.10124305635690689, 0.1855074018239975, -0.05335645005106926, 0.04007839038968086, 0.22576384246349335, -0.050378769636154175, -0.14298416674137115, -0.35043418407440186, 0.23236192762851715, -0.095417819917202, 0.002885679714381695, -0.13541311025619507, 0.17770469188690186, 0.17289642989635468, 0.09226804226636887, 0.047512486577034, 0.06597739458084106, -0.7267880439758301, 0.29276368021965027, -0.19318898022174835, -0.19262556731700897, -0.07886073738336563, -0.030914079397916794, 0.2606046199798584, 0.29134485125541687, -0.6580796837806702, 0.27376896142959595, -0.2846600413322449, -0.02954448014497757, -0.28522399067878723, -0.017834680154919624, 0.12543939054012299, -0.024949893355369568, 0.09906435012817383, 0.013341188430786133, -0.22068071365356445, 0.2459384799003601, 0.10751105844974518, 0.10582873225212097, 0.19586460292339325, 0.43340879678726196, 0.01624402403831482, 0.47473856806755066, 0.17976585030555725, -0.15817926824092865, 0.5086104273796082, 0.2232479602098465, 0.17517352104187012, -0.11427919566631317, -0.3617187738418579, -0.001396574079990387, -0.08598443120718002, -0.4221622347831726, 0.09497126936912537, -0.2232210785150528, -0.4402369558811188, -0.21041184663772583, -0.20595267415046692, -0.02392825484275818, -0.39648616313934326, 0.27025067806243896, -0.22496959567070007, 0.2074773907661438, -0.052047111093997955, 0.1011742651462555, -0.18633192777633667, 0.047378286719322205, 0.06301749497652054, 0.12393909692764282, 0.08410212397575378, 0.02168337255716324, -0.0022842511534690857, 0.06519334018230438, -0.2978881299495697, 0.08223563432693481, 0.07879657298326492, 0.5406234264373779, 0.09952795505523682, -0.24798013269901276, 0.17584452033042908, -0.456867516040802, 1.0127153396606445, -0.049763135612010956, 0.14386038482189178, 0.16680116951465607, -0.3613804280757904, -0.21239516139030457, -0.255356103181839, 0.0665363073348999, 0.21336622536182404, 0.08802522718906403, 0.6111729145050049, -0.15136919915676117, -0.5169568061828613, 0.14848661422729492, 0.11051195114850998, -0.1753457486629486, -0.3720008134841919, -0.2777380049228668, 0.08670727908611298, -0.31187406182289124, 0.15852631628513336, -0.24279648065567017, 0.162083238363266, 0.06356600672006607, -0.16135188937187195, -0.2611123025417328, 0.05198754370212555, 0.03287878632545471, 0.14173436164855957, 0.02579289674758911, -0.10763710737228394, 0.522101104259491, 0.09015502035617828, 0.3601737916469574, 0.39976876974105835, 0.41280853748321533, 0.16169089078903198, -0.45784834027290344, 0.4395253360271454, -0.02309359982609749, 0.4330645501613617, 0.5286049842834473, -0.02898966707289219, -0.08878789842128754, -0.20772713422775269, 0.3347069025039673, -0.3261552155017853, 0.20650026202201843, 0.16217829287052155, 0.13573864102363586, -0.4720143973827362, -0.23380592465400696, 0.22483399510383606, 0.005922310054302216, 0.08066160976886749, 0.3046751022338867, 0.02927970141172409, 0.07188063859939575, 0.4109213054180145, 0.061971865594387054, 0.8707039952278137, -0.206582710146904, 0.11220583319664001, 0.026849236339330673, -0.28130704164505005, -0.006200037896633148, -0.6525919437408447, -0.006896164268255234, -0.37072670459747314, -0.205112487077713, -0.03824889287352562, -0.3703046441078186, 0.21436649560928345, -0.00829408410936594, 0.2386404275894165, 0.31605830788612366, -0.08456563949584961, 0.041435953229665756, 0.05147095024585724, 0.1387399286031723, -0.13306409120559692, -0.31315138936042786, -0.1446617841720581, -0.04883691668510437, -0.07769443094730377, 0.17065607011318207, -0.16231513023376465, -0.12262625247240067, 0.027537629008293152, 0.06644577533006668, -0.09615328907966614, 0.2986200749874115, 0.12679673731327057, -0.19762009382247925, 0.13406799733638763, -0.6676061153411865, 0.1104193702340126, -0.01496565155684948, 0.04877472668886185, 0.08614863455295563, -0.10146123915910721, 0.13532570004463196, -0.028981182724237442, -0.05863884463906288, 0.0278787724673748, -0.20946693420410156, 0.4296128451824188, 0.06882939487695694, -0.1235135942697525, -0.011587042361497879, -0.20792558789253235, -0.2934618294239044, 0.24188818037509918, 0.303095281124115, 0.3062565326690674, -0.012618407607078552, 0.1329478919506073, 0.15900428593158722, -0.03500709682703018, -0.218284010887146, -0.03421875089406967, -0.1741839051246643, -0.19341225922107697, 0.17766180634498596, -0.22668302059173584, -0.3782574534416199, -0.09905610978603363, 0.5633705854415894, -0.001119387336075306, -0.03738732263445854, 0.6309741139411926, 0.31877800822257996, -0.31086301803588867, -0.1653357744216919, -0.21060711145401, 0.10191408544778824, -0.4054316580295563, 0.09445320069789886, -0.1853197067975998, 0.0995669960975647, 0.19417798519134521, 0.08931101858615875, -0.044647958129644394, -0.5611213445663452, -0.22358545660972595, -0.3301197290420532, -0.09816894680261612, -0.19092325866222382, -0.0986425131559372, 0.10946673899888992, 0.12877777218818665, 0.128261536359787, -0.09313999116420746, 0.13073451817035675, -0.10283823311328888, -0.03781577944755554, -0.2790224850177765, 0.13929541409015656, -0.11162909120321274, -0.22875411808490753, 0.10168609023094177, 0.004802841693162918, -0.03578536584973335, 0.21978135406970978, 0.10351410508155823, -0.06954601407051086, -0.3115994930267334, 0.17598897218704224, 0.041502196341753006, 0.17278528213500977, 0.03606649488210678, -0.28578266501426697, -0.017481792718172073, -0.20333540439605713, 0.27270159125328064, -0.19297271966934204, 0.049729522317647934, -0.045861393213272095, 0.29807451367378235, 0.23641261458396912, -0.07639037072658539, 0.14026516675949097, 0.35658857226371765, -0.08849519491195679, 0.1518556773662567, 0.27312782406806946, -0.17937923967838287, 0.09521853923797607, -0.08337950706481934, 0.06931544840335846, 0.1607915312051773, 0.1585071086883545, 0.3723856806755066, -0.46180617809295654, 0.03604044020175934, -0.03142503276467323, 0.3446676433086395, 0.7160379886627197, 0.13960114121437073, -0.39531663060188293, 0.502780556678772, -0.052924755960702896, -0.13641366362571716, -0.17206738889217377, -0.08535696566104889, 0.049834299832582474, 0.034411460161209106, 0.2678971290588379, 0.009703025221824646, -0.18287625908851624, 0.3349777162075043, 0.09870399534702301, 0.24546094238758087, -0.048952922224998474, -0.07882887125015259, 0.17387181520462036, -0.0012568682432174683, 0.01808890327811241, 0.31344401836395264, 0.4034619927406311, 0.08241600543260574, 0.4002543091773987, 0.060623157769441605, 0.03596892207860947, -0.1096821054816246, 0.2277878224849701, -0.08693539351224899, -0.548607349395752, 0.18579332530498505, 0.12255758047103882, 0.3683982491493225, -0.009463191032409668, 0.05755571275949478, 0.3216947317123413, 0.1342816948890686, -0.34297293424606323, -0.34785890579223633, 0.16524285078048706, -0.051164016127586365, 0.07658538967370987, 0.12934762239456177, -0.18135114014148712, -0.13683976233005524, 0.20167510211467743, 0.05733982101082802, -0.0737680196762085, 0.26524046063423157, 0.16833242774009705, 0.2138424515724182, -0.32480865716934204, -0.23369638621807098, -0.06297034025192261, 0.1778811812400818, -0.07728508859872818, 0.2332862913608551, -0.11165431141853333, -0.17638590931892395, -0.3553183972835541, -0.1604917198419571, 0.20293305814266205, 0.4594152271747589, -0.16643939912319183, 0.007759079337120056, -0.03792524337768555, 0.032494984567165375, -0.03272659331560135, 0.052952442318201065, -0.3919292688369751, 0.21446850895881653, 0.4708268344402313, -0.09104926884174347, 0.02388778328895569, -0.0006143553182482719, -0.05605379864573479, 0.22024762630462646, -0.2620559334754944, 0.05699969083070755, 0.3631887137889862, 0.1348455399274826, 0.02914956957101822, -0.07037284970283508, -0.5633890628814697, 0.049178529530763626, 0.27388566732406616, -0.22649186849594116, 0.08469539135694504, 0.04151906818151474, -0.007500076666474342, -0.14775049686431885, 0.6253966689109802, 0.29690754413604736, 0.24603751301765442, -0.2677757740020752, -0.24052196741104126, -0.3392986059188843, 0.02467014268040657, -0.2798805832862854, 0.03187776356935501, 0.2752021253108978, 0.3687780499458313, 0.3186769187450409, 0.07796724885702133, 0.06422200798988342, -0.15962360799312592, -0.2880382835865021, 0.5284181237220764, -0.4072423279285431, -0.24542969465255737, 0.10934606194496155, -0.010331401601433754, -0.1676526516675949, -0.4535609483718872, 0.10535745322704315, -0.05116378888487816, -0.08913499861955643, -0.06499972939491272, -0.3586421608924866, 0.21442586183547974, -0.5870651006698608, 0.46426352858543396, -0.22487221658229828, 0.025308076292276382, 0.13669177889823914, -0.13931378722190857, -0.27838101983070374, -0.08795635402202606, 0.04203840345144272, -0.07392700016498566, -0.08227148652076721, 0.14532522857189178, -0.18046164512634277, 0.0487138070166111, -0.4520690143108368, -0.00646958127617836, 0.016570739448070526, 0.016381021589040756, 0.0747942253947258, 0.13310463726520538, -0.05222603678703308, 0.36551418900489807, 0.018138710409402847, 0.25727763772010803, 0.2709284722805023, 0.269273966550827, -0.42158210277557373, -0.08541417866945267, 0.47671154141426086, -0.2749618887901306, -0.5360978841781616, 0.18475721776485443, 0.016006115823984146, 0.2402380108833313, -0.06401696801185608, -0.33661651611328125, 0.16032207012176514, 0.08581770956516266, -0.14463387429714203, 0.014769718050956726, 0.25081461668014526, 0.19256380200386047, 0.16574223339557648, -0.4016338884830475, 0.16642415523529053, 0.09028951823711395, -0.06800670921802521, -0.13362330198287964, -0.12427779287099838 ]
https://github.com/huggingface/datasets/issues/6079
@osanseviero I assume the `self._sslobj.read(len, buffer)` line comes from the built-in `ssl` module, so this probably has something to do with your network. Please open a new issue with the full stack trace in case you haven't resolved this yet.
Iterating over DataLoader based on HF datasets is stuck forever
### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64
40
Iterating over DataLoader based on HF datasets is stuck forever ### Describe the bug I am using Amazon Sagemaker notebook (Amazon Linux 2) with python 3.10 based Conda environment. I have a dataset in parquet format locally. When I try to iterate over it, the loader is stuck forever. Note that the same code is working for python 3.6 based conda environment seamlessly. What should be my next steps here? ### Steps to reproduce the bug ``` train_dataset = load_dataset( "parquet", data_files = {'train': tr_data_path + '*.parquet'}, split = 'train', collate_fn = streaming_data_collate_fn, streaming = True ).with_format('torch') train_dataloader = DataLoader(train_dataset, batch_size = 2, num_workers = 0) t = time.time() iter_ = 0 for batch in train_dataloader: iter_ += 1 if iter_ == 1000: break print (time.time() - t) ``` ### Expected behavior The snippet should work normally and load the next batch of data. ### Environment info datasets: '2.14.0' pyarrow: '12.0.0' torch: '2.0.0' Python: 3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:08:06) [GCC 11.3.0] !uname -r 5.10.178-162.673.amzn2.x86_64 @osanseviero I assume the `self._sslobj.read(len, buffer)` line comes from the built-in `ssl` module, so this probably has something to do with your network. Please open a new issue with the full stack trace in case you haven't resolved this yet.
[ -0.08103133738040924, -0.013380050659179688, -0.03669363260269165, 0.27100300788879395, -0.03732560575008392, 0.08859400451183319, 0.4580969214439392, 0.205763578414917, -0.0007538571953773499, 0.2618662714958191, 0.038513414561748505, 0.2988518178462982, 0.03217682987451553, 0.21014851331710815, -0.18459320068359375, 0.08294213563203812, 0.07246321439743042, 0.22100156545639038, 0.015250180847942829, -0.1543101668357849, 0.026104629039764404, 0.010424366220831871, -0.23452717065811157, -0.2511744797229767, -0.12205033749341965, -0.10736808180809021, 0.054749101400375366, -0.07708804309368134, -0.030427655205130577, -0.3631840646266937, 0.6133174896240234, 0.11146050691604614, 0.36007159948349, 0.6758050322532654, -0.00012982926273252815, 0.15843097865581512, 0.2526197135448456, 0.01231294870376587, -0.5766763091087341, -0.293938547372818, 0.025765612721443176, -0.034758567810058594, 0.17682713270187378, -0.20119421184062958, 0.04090134799480438, -0.1974019855260849, -0.09514510631561279, -0.2940816283226013, 0.14029885828495026, 0.026142742484807968, -0.017121415585279465, 0.02260681986808777, -0.14905418455600739, 0.11341916024684906, 0.14579297602176666, 0.1549358367919922, -0.054671548306941986, 0.21674567461013794, 0.31860074400901794, -0.2535940706729889, -0.20672030746936798, 0.0745464414358139, 0.041001006960868835, 0.02782200649380684, 0.3470098376274109, -0.21148277819156647, 0.17165954411029816, -0.12751315534114838, 0.19641220569610596, 0.07873846590518951, 0.5810100436210632, -0.1603117436170578, -0.30200648307800293, -0.2220238447189331, 0.0274130180478096, -0.15219220519065857, 0.27937230467796326, 0.30442389845848083, -0.3469521701335907, -0.037113748490810394, 0.12002578377723694, 0.004594877362251282, -0.25196170806884766, 0.148817777633667, -0.3268207907676697, 0.5327345132827759, -0.026789428666234016, 0.2572386562824249, 0.2517785131931305, -0.06401598453521729, 0.2552153170108795, 0.09958644211292267, 0.12674745917320251, -0.01648053713142872, -0.7961500883102417, 0.21634766459465027, 0.04584415256977081, -0.06959230452775955, -0.14543510973453522, 0.11359486728906631, 0.03891793265938759, 0.06938698142766953, 0.33497777581214905, 0.1872931718826294, 0.45576873421669006, -0.2532321810722351, 0.16367678344249725, 0.07857796549797058, 0.1665266752243042, 0.17893195152282715, -0.09016294032335281, 0.025779929012060165, -0.2468724250793457, -0.2822312116622925, 0.25917038321495056, -0.24799761176109314, 0.12251653522253036, -0.33996641635894775, 0.010661177337169647, 0.26698386669158936, -0.18802568316459656, -0.1468750238418579, 0.1288100928068161, 0.5210098624229431, -0.20069172978401184, 0.19335788488388062, -0.0670289695262909, 0.15080726146697998, -0.026528295129537582, 0.10268045961856842, 0.12323850393295288, -0.18068870902061462, -0.20034095644950867, -0.035435352474451065, 0.10611909627914429, -0.46931448578834534, -0.005622845143079758, 0.10118792951107025, 0.15750116109848022, -0.13803115487098694, 0.046947166323661804, -0.2193601429462433, 0.21303966641426086, 0.17891789972782135, -0.02886774018406868, 0.13167765736579895, 0.09637479484081268, -0.19808503985404968, -0.2556902766227722, 0.029446929693222046, -0.22230398654937744, -0.02468246966600418, -0.16628612577915192, -0.025666963309049606, 0.10877092182636261, -0.16157668828964233, -0.12424033880233765, -0.47798144817352295, 0.09249024838209152, 0.028431683778762817, 0.12245496362447739, -0.19410079717636108, -0.026277318596839905, 0.08718448877334595, 0.07624927908182144, 0.34110957384109497, -0.7038221955299377, 0.3094957768917084, 0.13865013420581818, 0.1867634356021881, 0.1823841631412506, 0.060167185962200165, -0.3273271918296814, 0.3425796329975128, -0.32745927572250366, -0.3932366967201233, 0.48951902985572815, -0.2894081175327301, -0.2037525177001953, 0.5882303714752197, 0.02508673071861267, 0.18949076533317566, 0.2672564685344696, -0.1754041314125061, 0.07188238203525543, -0.028892822563648224, 0.2333148568868637, 0.13146130740642548, 0.015964658930897713, -0.007054820656776428, -0.14282241463661194, 0.07480064034461975, 0.07622627168893814, 0.3296111226081848, 0.11400330066680908, 0.24624332785606384, -0.14594720304012299, -0.24463799595832825, 0.37292400002479553, -0.09916563332080841, -0.014750896021723747, 0.6046379208564758, 0.3249033987522125, 0.5105569362640381, 0.25378647446632385, 0.11326496303081512, -0.41511473059654236, 0.29191887378692627, 0.08819758147001266, -0.07793721556663513, -0.15910865366458893, 0.194406658411026, -0.10058878362178802, 0.3639097511768341, -0.36475834250450134, -0.021234598010778427, -0.14159764349460602, 0.3315974473953247, 0.08023302257061005, -0.1596723347902298, -0.2715167999267578, 0.5364522933959961, -0.028171073645353317, 0.029752235859632492, -0.3465368449687958, 0.26504284143447876, 0.15059906244277954, -0.10070688277482986, -0.022791214287281036, -0.14709362387657166, 0.17115893959999084, -0.26397034525871277, -0.11418744921684265, -0.0180500540882349, 0.08016014099121094, 0.02951534278690815, -0.0674455314874649, -0.12275463342666626, 0.035265661776065826, 0.19899089634418488, 0.12239868193864822, -0.16765670478343964, 0.07251890748739243, -0.16229398548603058, 0.16817070543766022, 0.11343362927436829, -0.03963489457964897, 0.8775913119316101, -0.13117296993732452, -0.05091933161020279, 0.17380684614181519, 0.04818519949913025, -0.07827363908290863, 0.2813858389854431, 0.3458264172077179, -0.12519726157188416, 0.7747631072998047, 0.025200853124260902, -0.3099311888217926, 0.13262681663036346, 0.12630394101142883, 0.09747808426618576, -0.292171448469162, 0.32185059785842896, 0.058613263070583344, 0.17652441561222076, 0.13214755058288574, 0.1307768076658249, 0.08865265548229218, -0.0063894372433424, 0.0627678781747818, -0.07038355618715286, -0.03447334095835686, -0.02129906415939331, -0.14709189534187317, 0.3116849660873413, 0.46995869278907776, 0.24915152788162231, 0.051177699118852615, -0.08373743295669556, -0.10910399258136749, -0.47389495372772217, -0.056465014815330505, 0.338805615901947, -0.04408521577715874, 0.6561024188995361, -0.3820865750312805, 0.20951054990291595, -0.18374018371105194, -0.032953012734651566, -0.2777332663536072, -0.2893812954425812, -0.4103124141693115, 0.5533872842788696, 0.0004053860902786255, 0.03965330868959427, -0.012281328439712524, 0.1912475824356079, 0.28197044134140015, -0.4306093454360962, -0.4352657198905945, -0.2973857522010803, -0.39064839482307434, -0.25663697719573975, 0.40720856189727783, -0.25733160972595215, 0.1288398653268814, -0.06359435617923737, -0.2558680474758148, -0.2816532552242279, -0.20922747254371643, 0.20640026032924652, -0.07203648239374161, 0.26712071895599365, 0.1242486760020256, 0.384333074092865, -0.07539352774620056, -0.21214035153388977, 0.0816400870680809, 0.026084549725055695, 0.08893542736768723, 0.31377822160720825, 0.016074679791927338, 0.172780841588974, 0.24930906295776367, -0.023241080343723297, -0.07274982333183289, -0.3044072985649109, 0.33756503462791443, -0.04795428737998009, 0.06917679309844971, -0.1822805404663086, 0.16151057183742523, 0.12678088247776031, -0.1072440817952156, 0.1393369734287262, 0.0471387654542923, -0.7890845537185669, 0.38083717226982117, -0.04578380286693573, -0.2189168632030487, -0.009365774691104889, 0.005403898656368256, 0.2474043220281601, 0.22401103377342224, -0.8357345461845398, 0.16739267110824585, -0.17681103944778442, -0.05858100205659866, -0.37322667241096497, -0.008712798357009888, 0.08586636185646057, -0.020336493849754333, 0.09104038029909134, -0.0064635202288627625, -0.1088060587644577, 0.31005948781967163, -0.03572016954421997, 0.13405534625053406, 0.1125105768442154, 0.5574473738670349, 0.01266549527645111, 0.38118934631347656, 0.18903006613254547, -0.08587190508842468, 0.5455589890480042, 0.18575355410575867, 0.13781282305717468, -0.023776356130838394, -0.3240283727645874, -0.09616189450025558, -0.09394724667072296, -0.3192823827266693, 0.07517148554325104, -0.23020894825458527, -0.3960193395614624, -0.24376103281974792, -0.10851353406906128, -0.016082875430583954, -0.36908572912216187, 0.3389439582824707, -0.25674593448638916, 0.1805402785539627, -0.05449299514293671, 0.17445755004882812, -0.2329321801662445, 0.0492873415350914, 0.05907322093844414, 0.039681173861026764, 0.10079047083854675, 0.03592170774936676, -0.01744326949119568, 0.027178090065717697, -0.29533934593200684, 0.10162591189146042, -0.027861177921295166, 0.6368467807769775, 0.02619171142578125, -0.22783952951431274, 0.1810615062713623, -0.42091548442840576, 1.0862935781478882, 0.004371950402855873, 0.1719057559967041, 0.10328123718500137, -0.3225915729999542, -0.32487916946411133, -0.24186578392982483, 0.04154545068740845, 0.10085992515087128, 0.14561480283737183, 0.6285645961761475, -0.26173752546310425, -0.4375111162662506, 0.09498433768749237, 0.04606737196445465, -0.23940840363502502, -0.383560448884964, -0.42488348484039307, 0.06966719031333923, -0.2741289734840393, 0.16032686829566956, -0.2538241147994995, 0.16143108904361725, 0.13703453540802002, -0.08189956843852997, -0.185103178024292, 0.036793604493141174, -0.067082479596138, 0.05820212885737419, 0.03567901626229286, -0.14290444552898407, 0.45670217275619507, 0.13966554403305054, 0.38643914461135864, 0.3842373192310333, 0.5061578750610352, 0.20189230144023895, -0.5282921195030212, 0.40660181641578674, -0.006385020911693573, 0.4171946942806244, 0.49241185188293457, 0.0313669852912426, -0.06020940840244293, -0.11693896353244781, 0.4121391177177429, -0.3650927245616913, 0.07557284832000732, 0.2685500979423523, 0.09452113509178162, -0.5400146842002869, -0.22966143488883972, 0.2794070541858673, -0.09213530272245407, 0.17321357131004333, 0.31317609548568726, 0.009723447263240814, 0.09898009896278381, 0.44218674302101135, -0.05007356032729149, 0.935173749923706, -0.18353690207004547, 0.1463697999715805, 0.08176329731941223, -0.2514200508594513, 0.08203347027301788, -0.8075329065322876, -0.06718039512634277, -0.3356967270374298, -0.12341111898422241, -0.050695233047008514, -0.4150264859199524, 0.2322779893875122, 0.11060144007205963, 0.25744104385375977, 0.302870512008667, -0.18523404002189636, -0.08551621437072754, 0.09146512299776077, 0.18418622016906738, -0.26441237330436707, -0.2280729115009308, -0.20178577303886414, -0.038865916430950165, -0.08612623065710068, 0.15736721456050873, -0.13432984054088593, -0.18398042023181915, 0.09216034412384033, 0.024095505475997925, -0.08240478485822678, 0.32219094038009644, 0.2362775057554245, -0.12929388880729675, 0.1903851479291916, -0.5672102570533752, 0.06911422312259674, 0.050745271146297455, 0.01628057286143303, 0.06156226992607117, -0.09395404160022736, 0.13844406604766846, -0.07612591981887817, -0.059646397829055786, 0.028627298772335052, -0.16809199750423431, 0.3660541772842407, 0.05356159806251526, -0.18488997220993042, -0.005199486389756203, -0.19425879418849945, -0.31605201959609985, 0.21468855440616608, 0.24857763946056366, 0.2423040270805359, -0.07175979018211365, 0.1527654379606247, 0.15029986202716827, -0.05277624353766441, -0.21824829280376434, -0.03131059929728508, -0.00405530072748661, -0.29269784688949585, 0.14289622008800507, -0.22503650188446045, -0.3655189871788025, -0.09177527576684952, 0.5890074968338013, -0.07822567224502563, 0.08570937067270279, 0.7374356389045715, 0.3529415726661682, -0.3006129264831543, -0.17746832966804504, -0.17881248891353607, 0.11029060184955597, -0.3835025131702423, 0.024294648319482803, -0.1968371719121933, 0.15801465511322021, 0.08171907067298889, -0.04965567588806152, -0.0468161441385746, -0.5141847729682922, -0.16947254538536072, -0.4469699561595917, -0.06129342317581177, -0.16433773934841156, -0.04567641392350197, 0.04061483219265938, 0.15350419282913208, 0.06286858022212982, -0.08693767338991165, 0.17622414231300354, -0.10023923218250275, -0.052232660353183746, -0.3210149109363556, 0.10178804397583008, -0.13651102781295776, -0.23009328544139862, 0.10774289816617966, -0.012172531336545944, -0.0246963519603014, 0.18973709642887115, 0.14669813215732574, -0.08286808431148529, -0.2902534306049347, 0.18606428802013397, 0.05519513785839081, 0.17549768090248108, 0.020624905824661255, -0.3635920286178589, -0.1096942275762558, -0.12017177045345306, 0.15694236755371094, -0.2246277630329132, 0.03613019362092018, -0.0385708212852478, 0.31473085284233093, 0.1896377056837082, -0.13768386840820312, -0.009014351293444633, 0.29884010553359985, -0.1603800356388092, 0.1787700355052948, 0.2681654989719391, -0.22116351127624512, 0.0986136943101883, -0.22397005558013916, 0.1204690933227539, 0.1649942845106125, 0.08603385090827942, 0.46223047375679016, -0.4950810968875885, 0.0941057801246643, -0.1475643515586853, 0.3739928901195526, 0.7864665985107422, 0.06588869541883469, -0.3358049988746643, 0.5836142301559448, -0.03529916703701019, -0.1688828468322754, -0.19515421986579895, -0.07339677214622498, 0.1300957351922989, -0.011951498687267303, 0.1767457127571106, -0.12386736273765564, -0.161464124917984, 0.19172890484333038, 0.08980917930603027, 0.13289037346839905, -0.0844569057226181, -0.057759542018175125, 0.17796024680137634, -0.06720008701086044, 0.01835094578564167, 0.389832079410553, 0.4206829369068146, 0.005094420164823532, 0.32186558842658997, 0.1181592345237732, 0.0928502082824707, -0.08312587440013885, 0.1517947018146515, -0.16327346861362457, -0.6148584485054016, 0.13215620815753937, 0.12634888291358948, 0.36038732528686523, -0.0004450269043445587, -0.019246242940425873, 0.30510377883911133, 0.1343078911304474, -0.31720906496047974, -0.4053647816181183, 0.17195579409599304, -0.0626777857542038, 0.07422681152820587, 0.10096640884876251, -0.19820575416088104, -0.04784960299730301, 0.21521982550621033, 0.10066275298595428, -0.19660170376300812, 0.14386481046676636, 0.22365035116672516, 0.21807806193828583, -0.45473888516426086, -0.27994686365127563, -0.04365656152367592, 0.16981133818626404, -0.09803774207830429, 0.20470741391181946, -0.015545181930065155, -0.17860198020935059, -0.30753692984580994, -0.1656147688627243, 0.23402702808380127, 0.39388227462768555, -0.026342540979385376, 0.07647620141506195, -0.09267565608024597, -0.015521015971899033, -0.07306738197803497, 0.09134456515312195, -0.2586296498775482, 0.19070667028427124, 0.44402480125427246, -0.08700110763311386, 0.024700913578271866, 0.04714459925889969, -0.012208187952637672, 0.3019934296607971, -0.22368766367435455, 0.11556029319763184, 0.3192693293094635, 0.07534247636795044, -0.05181219428777695, -0.09503543376922607, -0.5553688406944275, -0.023526305332779884, 0.314605712890625, -0.11451898515224457, 0.08592750132083893, -0.011792387813329697, -0.012143367901444435, -0.10128086805343628, 0.6486119031906128, 0.2916540801525116, 0.2418968379497528, -0.21200422942638397, -0.1555393785238266, -0.34214502573013306, 0.02503911778330803, -0.3704158067703247, -0.05790707468986511, 0.34151482582092285, 0.3790939152240753, 0.3623039424419403, 0.061518535017967224, 0.20589366555213928, -0.11149284243583679, -0.3410605788230896, 0.5995347499847412, -0.4080101251602173, -0.2176552563905716, 0.10039521753787994, 0.23404738306999207, -0.18516428768634796, -0.3669576644897461, 0.2158067375421524, -0.03218627721071243, -0.07665666192770004, 0.05324292927980423, -0.3467547595500946, 0.1349940001964569, -0.5269975066184998, 0.43979015946388245, -0.210679829120636, 0.07918364554643631, 0.1573905497789383, -0.14923152327537537, -0.28724902868270874, -0.10471171885728836, 0.08500143885612488, -0.05581682175397873, -0.11860346794128418, 0.09633418917655945, -0.24310803413391113, 0.025701258331537247, -0.45509207248687744, -0.026887595653533936, -0.09626853466033936, -0.0793653279542923, -0.028004270046949387, 0.114043228328228, 0.12630826234817505, 0.36312335729599, 0.060346439480781555, 0.18304938077926636, 0.296196311712265, 0.15447184443473816, -0.4213523864746094, 0.007076583802700043, 0.4268113970756531, -0.35018646717071533, -0.5633066296577454, 0.2273561954498291, 0.08539311587810516, 0.20049303770065308, -0.00033663585782051086, -0.343382865190506, 0.2204204499721527, 0.09320063889026642, -0.049670230597257614, 0.015464834868907928, 0.16075918078422546, 0.10356384515762329, 0.16035617887973785, -0.34982937574386597, 0.1480545997619629, 0.026098206639289856, -0.12798060476779938, -0.07283194363117218, -0.12167908251285553 ]
https://github.com/huggingface/datasets/issues/6078
Currently, it's not possible to efficiently resume streaming after an error. Eventually, we plan to support this for Parquet (see https://github.com/huggingface/datasets/issues/5380).
resume_download with streaming=True
### Describe the bug I used: ``` dataset = load_dataset( "oscar-corpus/OSCAR-2201", token=True, language="fr", streaming=True, split="train" ) ``` Unfortunately, the server had a problem during the training process. I saved the step my training stopped at. But how can I resume download from step 1_000_´000 without re-streaming all the first 1 million docs of the dataset? `download_config=DownloadConfig(resume_download=True)` seems to not work with streaming=True. ### Steps to reproduce the bug ``` from datasets import load_dataset, DownloadConfig dataset = load_dataset( "oscar-corpus/OSCAR-2201", token=True, language="fr", streaming=True, # optional split="train", download_config=DownloadConfig(resume_download=True) ) # interupt the run and try to relaunch it => this restart from scratch ``` ### Expected behavior I would expect a parameter to start streaming from a given index in the dataset. ### Environment info - `datasets` version: 2.14.0 - Platform: Linux-5.19.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.0
21
resume_download with streaming=True ### Describe the bug I used: ``` dataset = load_dataset( "oscar-corpus/OSCAR-2201", token=True, language="fr", streaming=True, split="train" ) ``` Unfortunately, the server had a problem during the training process. I saved the step my training stopped at. But how can I resume download from step 1_000_´000 without re-streaming all the first 1 million docs of the dataset? `download_config=DownloadConfig(resume_download=True)` seems to not work with streaming=True. ### Steps to reproduce the bug ``` from datasets import load_dataset, DownloadConfig dataset = load_dataset( "oscar-corpus/OSCAR-2201", token=True, language="fr", streaming=True, # optional split="train", download_config=DownloadConfig(resume_download=True) ) # interupt the run and try to relaunch it => this restart from scratch ``` ### Expected behavior I would expect a parameter to start streaming from a given index in the dataset. ### Environment info - `datasets` version: 2.14.0 - Platform: Linux-5.19.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.0 Currently, it's not possible to efficiently resume streaming after an error. Eventually, we plan to support this for Parquet (see https://github.com/huggingface/datasets/issues/5380).
[ -0.496049702167511, -0.22135448455810547, 0.094222292304039, 0.041804246604442596, 0.2625918984413147, -0.0770002156496048, -0.1220308393239975, -0.01835372857749462, 0.01003071665763855, 0.11760888993740082, 0.050583288073539734, 0.10911040008068085, 0.029635723680257797, 0.3978584408760071, 0.13156378269195557, -0.24123233556747437, -0.24040044844150543, 0.13702934980392456, 0.041532229632139206, -0.007516838610172272, 0.07286421954631805, -0.07075843214988708, -0.07919400930404663, -0.18932144343852997, 0.07768774032592773, -0.011764852330088615, 0.10519935190677643, 0.26650187373161316, -0.08747569471597672, -0.33894988894462585, 0.47374215722084045, 0.017693819478154182, 0.34804052114486694, 0.12353497743606567, -0.00012066405906807631, -0.04715906083583832, 0.46256184577941895, -0.21917565166950226, -0.4974648058414459, -0.38304176926612854, -0.010506786406040192, 0.06914500892162323, 0.25936150550842285, 0.022229254245758057, 0.05753510445356369, 0.14388759434223175, 0.11631138622760773, -0.038959428668022156, 0.5077916383743286, 0.2529856264591217, 0.10292242467403412, 0.07047010958194733, -0.03602097928524017, -0.03647411987185478, 0.05202289670705795, -0.026722226291894913, 0.22487279772758484, 0.2573970556259155, 0.1660224199295044, 0.12274294346570969, 0.025414757430553436, 0.12297971546649933, -0.2822917699813843, 0.1098949983716011, -0.03543340414762497, -0.14698214828968048, -0.11262299120426178, -0.3310839831829071, -0.003947283606976271, 0.21634474396705627, 0.458433598279953, -0.16932860016822815, -0.2736243009567261, -0.4461430311203003, 0.3890096843242645, -0.7690575122833252, -0.1457151174545288, 0.2189982831478119, -0.19107237458229065, 0.10966388881206512, -0.21039143204689026, -0.3429884910583496, -0.07098241150379181, 0.17176887392997742, -0.28152740001678467, 0.15584896504878998, -0.053307004272937775, 0.13118283450603485, -0.0055972617119550705, 0.437494158744812, -0.001690588891506195, 0.03344676271080971, 0.24048709869384766, 0.08765524625778198, -0.18875890970230103, 0.07692652940750122, 0.14653685688972473, 0.1699633151292801, 0.36399775743484497, 0.2783271372318268, 0.03386294096708298, -0.019675632938742638, 0.07410039007663727, 0.11044052243232727, 0.28141433000564575, -0.01946379989385605, -0.032676681876182556, -0.09713459014892578, 0.2745923399925232, 0.5747479200363159, -0.06498759984970093, -0.24651265144348145, 0.17943468689918518, 0.16709721088409424, -0.03317873924970627, 0.07235030829906464, 0.2647883892059326, -0.11124123632907867, -0.31329256296157837, 0.25422966480255127, -0.30034828186035156, 0.023781590163707733, 0.1022086888551712, 0.2574312686920166, -0.2194630652666092, 0.1721237599849701, 0.033689096570014954, -0.035026125609874725, -0.2099761962890625, -0.30755850672721863, -0.19666291773319244, -0.17514830827713013, -0.1440584659576416, 0.14648452401161194, 0.20375315845012665, -0.575951874256134, 0.3026045262813568, 0.2067302167415619, 0.07801143825054169, -0.038383547216653824, 0.18429528176784515, 0.04704802855849266, -0.028241973370313644, 0.32757872343063354, -0.05307632312178612, 0.28629276156425476, 0.2269977182149887, 0.043922483921051025, -0.09160272777080536, 0.1233583316206932, -0.3452517092227936, -0.3570653200149536, 0.15741565823554993, 0.08562855422496796, -0.0927659124135971, -0.049244463443756104, -0.4847492575645447, 0.11252440512180328, -0.19101913273334503, -0.058834634721279144, 0.2709330916404724, -0.05276382714509964, -0.27344268560409546, -0.09174550324678421, 0.5161373019218445, 0.42927825450897217, -0.10409344732761383, -0.44852179288864136, 0.029045719653367996, -0.07720891386270523, 0.38772422075271606, 0.2398766279220581, -0.2860030233860016, 0.12049663811922073, -0.21550552546977997, 0.18057072162628174, 0.510374128818512, -0.17987331748008728, -0.46150320768356323, 0.1548563838005066, -0.1824721395969391, 0.3241693079471588, -0.030083511024713516, -0.23251600563526154, 0.6310917139053345, -0.0045420341193675995, 0.08909890055656433, 0.35051214694976807, -0.12022370100021362, 0.07367017865180969, -0.16681982576847076, -0.3126962184906006, -0.06937797367572784, 0.12979719042778015, 0.058352548629045486, 0.10109414905309677, 0.15523351728916168, 0.15233013033866882, 0.4906778931617737, 0.1268654614686966, 0.12387794256210327, 0.18874028325080872, 0.040499910712242126, 0.2930474579334259, -0.2595272660255432, -0.28870081901550293, -0.2943045496940613, 0.22036691009998322, 0.3155354857444763, -0.32283681631088257, -0.07439093291759491, -0.1683625876903534, -0.3198935091495514, -0.24876779317855835, -0.043015751987695694, -0.38639360666275024, 0.045656390488147736, 0.17774908244609833, 0.01562611758708954, 0.2892366051673889, -0.30953431129455566, 0.4824357330799103, -0.32669755816459656, 0.2885855436325073, -0.3234611749649048, 0.38120096921920776, 0.3750759959220886, -0.24587738513946533, -0.02094276249408722, -0.21024593710899353, 0.3291260600090027, -0.07393283396959305, 0.01737946644425392, 0.5150038003921509, -0.24758140742778778, 0.5027757287025452, -0.10786089301109314, -0.25355270504951477, 0.12150689214468002, 0.046656325459480286, -0.2987900674343109, -0.06943497061729431, -0.01814994402229786, 0.08784012496471405, -0.06774985790252686, 0.15432590246200562, 0.056585561484098434, 0.1433294713497162, 0.270842969417572, 0.08015621453523636, 0.23842450976371765, -0.12183961272239685, -0.4467487335205078, 0.16696199774742126, 0.4732617139816284, -0.24994710087776184, -0.13334892690181732, -0.22474037110805511, -0.7261191010475159, 0.016103416681289673, 0.372111976146698, -0.18601788580417633, -0.12524010241031647, 0.25150808691978455, -0.1063959002494812, 0.11319835484027863, 0.1366528570652008, 0.11369192600250244, 0.3642547130584717, 0.22276671230793, 0.4113486111164093, 0.1282300502061844, -0.16703706979751587, -0.054889097809791565, 0.19418029487133026, 0.07993842661380768, -0.06650395691394806, 0.24242126941680908, 0.2200075089931488, -0.09599656611680984, -0.45850324630737305, 0.022399254143238068, 0.031115256249904633, 0.11921708285808563, -0.09784618765115738, 0.06392574310302734, -0.2855529189109802, -0.1823423206806183, -0.28303343057632446, -0.14036953449249268, -0.059856075793504715, -0.08643101900815964, -0.20787884294986725, 0.70548415184021, 0.08724169433116913, 0.2832266688346863, -0.33637043833732605, -0.02502545714378357, -0.1178348958492279, -0.2206253856420517, -0.15693262219429016, -0.11156729608774185, 0.01107855886220932, -0.04065660387277603, 0.004204023629426956, -0.010324064642190933, 0.3350895941257477, -0.023924216628074646, -0.3306794762611389, -0.34675031900405884, -0.09906721115112305, 0.23026078939437866, 0.06834915280342102, 0.04975280165672302, 0.1773175597190857, 0.39303064346313477, -0.10338884592056274, -0.14966577291488647, -0.00697597861289978, -0.16482996940612793, 0.032572150230407715, -0.04258833825588226, 0.05836416035890579, 0.5262755155563354, -0.07400395721197128, -0.26151952147483826, -0.07052218914031982, -0.3260258138179779, 0.33628371357917786, 0.09759028255939484, -0.18408304452896118, -0.07521304488182068, -0.22260552644729614, -0.04973022639751434, -0.16250094771385193, 0.1602431684732437, -0.3244282305240631, -0.5468454957008362, 0.11396025121212006, -0.09660014510154724, -0.11680789291858673, 0.0841590166091919, -0.11566880345344543, 0.07277137786149979, 0.3921825587749481, -0.6348934769630432, 0.04235949367284775, -0.1363219916820526, -0.05602523311972618, -0.5009466409683228, 0.17304278910160065, 0.4517565369606018, -0.314726322889328, 0.015109840780496597, 0.0015013515949249268, 0.09644173085689545, -0.13747917115688324, 0.3488178849220276, 0.2907482385635376, -0.24491026997566223, 0.6298728585243225, 0.11006065458059311, 0.7490259408950806, 0.176667720079422, 0.08042526245117188, 0.3741620182991028, 0.07000232487916946, 0.29339712858200073, -0.25738996267318726, -0.0848931223154068, -0.033186547458171844, -0.22461578249931335, -0.08831147849559784, 0.06307768076658249, -0.03862521052360535, -0.11149905622005463, -0.33706384897232056, -0.25898653268814087, -0.08923385292291641, -0.49243611097335815, -0.13228030502796173, -0.031147539615631104, 0.22949278354644775, 0.15140430629253387, 0.19722649455070496, 0.03899247199296951, 0.024602048099040985, -0.005602702498435974, 0.26885804533958435, 0.5406609177589417, 0.15088225901126862, 0.1599070280790329, 0.2073894590139389, -0.6008419990539551, -0.09730757772922516, 0.011050663888454437, 0.16624897718429565, 0.12496459484100342, 0.036927059292793274, 0.09715012460947037, 0.024072520434856415, 0.7052353024482727, -0.10116440057754517, 0.07364749908447266, -0.11432120203971863, -0.023812316358089447, -0.36143603920936584, -0.08210659772157669, -0.05679185688495636, 0.021859552711248398, 0.3505937159061432, 0.5292742252349854, -0.47354841232299805, 0.22554776072502136, 0.30805742740631104, 0.2028852105140686, 0.023967549204826355, -0.007913541048765182, -0.2953740060329437, -0.33033567667007446, -0.3908672332763672, 0.36101874709129333, 0.1980428546667099, -0.0839322879910469, -0.1311779022216797, -0.028219226747751236, -0.2031322717666626, -0.10761401057243347, -0.25720763206481934, -0.12798845767974854, 0.09872954338788986, 0.21780864894390106, 0.20227573812007904, 0.2422635555267334, 0.005047832615673542, 0.2539675831794739, 0.6088820099830627, 0.0634302869439125, -0.3228329122066498, -0.07595059275627136, 0.2449204921722412, 0.07367755472660065, 0.4285263419151306, -0.16382019221782684, 0.2823724150657654, 0.08865350484848022, 0.21729415655136108, -0.22239646315574646, 0.2898128926753998, 0.16712206602096558, -0.012464329600334167, -0.24053066968917847, -0.5118789076805115, 0.42746058106422424, -0.1153760552406311, -0.02285725623369217, 0.33785825967788696, 0.05679333209991455, -0.1646750271320343, -0.15412086248397827, -0.11489759385585785, 0.9310010671615601, 0.11383073031902313, 0.14978888630867004, 0.03693166375160217, -0.4117737412452698, 0.704987645149231, -0.1813504993915558, 0.21976007521152496, -0.025304347276687622, -0.5245158076286316, -0.14573852717876434, -0.1313055157661438, 0.07888512313365936, -0.22945819795131683, -0.2493768185377121, 0.4941037893295288, 0.03787505626678467, 0.20875327289104462, 0.06973747909069061, 0.05517119914293289, -0.32012972235679626, -0.2161342203617096, -0.4439336955547333, 0.006179895251989365, 0.015713173896074295, 0.14898476004600525, -0.16123071312904358, 0.0312395878136158, 0.33873552083969116, -0.03873848170042038, -0.2761147618293762, 0.050474539399147034, -0.5247801542282104, -0.19667766988277435, -0.3065584897994995, -0.38453012704849243, -0.10877843201160431, 0.1381540149450302, 0.10486358404159546, -0.04486812278628349, -0.2024514079093933, 0.2718440294265747, -0.07809284329414368, -0.030750669538974762, -0.13800014555454254, -0.07338028401136398, 0.3574019968509674, 0.05473354458808899, -0.18984660506248474, 0.19729852676391602, -0.1452285349369049, -0.031630389392375946, 0.09852558374404907, -0.04763255640864372, 0.3031575679779053, 0.009604722261428833, -0.12499945610761642, 0.0810268446803093, 0.1976957619190216, -0.3743039667606354, 0.014917667955160141, -0.03789824619889259, -0.04866042733192444, -0.0052115581929683685, -0.11719798296689987, -0.07614320516586304, -0.3564628064632416, 0.7775909304618835, -0.20320318639278412, 0.16840380430221558, 0.2900910973548889, 0.08895028382539749, -0.2962074875831604, -0.01522551104426384, -0.21313515305519104, -0.09395778924226761, -0.34120869636535645, 0.20435886085033417, -0.029205629602074623, 0.3600412607192993, -0.11491797864437103, 0.05299372225999832, -0.1930420696735382, -0.23706172406673431, -0.14636239409446716, -0.21819213032722473, -0.3055608868598938, 0.014521932229399681, 0.13683436810970306, 0.04549647867679596, 0.2934035658836365, 0.3051142990589142, 0.040502697229385376, -0.16017597913742065, -0.22168013453483582, 0.2562175989151001, -0.03940509632229805, 0.2456430196762085, 0.2580273747444153, 0.14670699834823608, 0.2010866403579712, -0.1326681673526764, 0.02992881089448929, 0.5029235482215881, 0.045568596571683884, -0.14200913906097412, -0.2659107446670532, 0.176591157913208, 0.09295646846294403, 0.18194818496704102, 0.1826310008764267, -0.07387499511241913, -0.0489615872502327, -0.1325000524520874, 0.323738157749176, 0.2062896490097046, 0.19079823791980743, -0.0723370909690857, 0.5120840072631836, 0.21248629689216614, -0.2801097631454468, 0.003216223791241646, -0.3717196583747864, 0.12806981801986694, -0.17180299758911133, 0.2528770864009857, -0.2131921947002411, -0.08794280886650085, -0.27687564492225647, -0.1866503208875656, 0.24924737215042114, 0.2083808034658432, 0.4294675886631012, -0.15197588503360748, -0.3692173659801483, -0.09534088522195816, 0.4700660705566406, 0.41814684867858887, -0.032502271234989166, -0.2387242317199707, 0.38860130310058594, 0.13115055859088898, -0.28403016924858093, -0.014354448765516281, 0.03274214640259743, 0.000774729996919632, 0.16540203988552094, 0.15395507216453552, -0.1409834623336792, -0.3093678951263428, -0.38050898909568787, 0.0871826708316803, 0.33276522159576416, 0.0634307712316513, 0.22358261048793793, 0.4717988967895508, 0.058900684118270874, -0.07276290655136108, -0.057024210691452026, 0.34899264574050903, 0.3038334846496582, 0.1435728520154953, 0.06737075746059418, 0.21276329457759857, 0.027113765478134155, 0.041226211935281754, -0.23623275756835938, -0.5356767177581787, -0.09862981736660004, 0.14520962536334991, -0.1553599089384079, 0.28006359934806824, -0.021472379565238953, 0.23495090007781982, 0.25977370142936707, -0.15076211094856262, -0.056149858981370926, 0.32884329557418823, 0.07892127335071564, -0.14304418861865997, 0.11424042284488678, -0.17430442571640015, 0.11278071999549866, 0.3002970814704895, 0.05692487582564354, 0.08016973733901978, 0.17720259726047516, 0.12258497625589371, 0.10536985099315643, -0.43303561210632324, -0.30302557349205017, -0.05811229348182678, 0.2611124515533447, -0.23821108043193817, 0.0313786044716835, 0.15520210564136505, -0.17257316410541534, -0.1426498293876648, 0.02361457608640194, 0.15719206631183624, -0.18294183909893036, 0.09521779417991638, 0.2580932676792145, 0.45321565866470337, 0.13830243051052094, -0.05781305581331253, -0.055862121284008026, 0.31957846879959106, 0.17677807807922363, 0.22428396344184875, 0.10936599224805832, -0.15626217424869537, 0.23095285892486572, -0.056959476321935654, -0.11663557589054108, -0.6016770601272583, 0.10457250475883484, 0.14760974049568176, 0.08305669575929642, -0.2604968845844269, 0.04201732203364372, -0.3207235634326935, 0.20274250209331512, 0.01116766408085823, -0.16925358772277832, 0.11445848643779755, 0.09186381846666336, 0.05905871465802193, -0.13148385286331177, 0.1203986406326294, 0.16377967596054077, -0.1158997043967247, -0.15346252918243408, -0.16198022663593292, -0.6316268444061279, -0.05440651625394821, -0.07809919863939285, -0.03421567752957344, 0.20367302000522614, 0.15596652030944824, -0.04478646442294121, 0.10213121771812439, -0.03915369510650635, 0.003621857613325119, 0.03251134231686592, 0.3136163353919983, 0.08451266586780548, -0.7207056879997253, -0.2565900683403015, -0.13878443837165833, -0.09252746403217316, -0.13402631878852844, 0.26790738105773926, -0.22129741311073303, 0.04042267054319382, 0.16801288723945618, -0.10355378687381744, -0.07620622217655182, -0.16688823699951172, 0.3284415900707245, 0.0856579914689064, 0.036195963621139526, -0.3109701871871948, -0.12327399104833603, -0.017081310972571373, 0.030219316482543945, -0.33186089992523193, -0.03022323176264763, -0.2692420780658722, 0.3080976903438568, -0.14727875590324402, -0.188258096575737, -0.5347961187362671, 0.25582653284072876, 0.45324471592903137, -0.02448011003434658, -0.34368911385536194, -0.019975289702415466, 0.07491620630025864, 0.08001302182674408, -0.049632783979177475, 0.4840205907821655, -0.2388988733291626, 0.20383918285369873, -0.13653835654258728, -0.4332265257835388, 0.7176174521446228, -0.4286111295223236, -0.11945666372776031, -0.2345181405544281, 0.31300321221351624, 0.4424707293510437, 0.022520000115036964, -0.5316163897514343, 0.3694484829902649, 0.3237767517566681, -0.1548597365617752, -0.4491170346736908, 0.2968636155128479, -0.03529411926865578, 0.09723667800426483, -0.06139668449759483, 0.1792227327823639, 0.4066920578479767, -0.20712000131607056, 0.31088823080062866, -0.23482032120227814 ]
https://github.com/huggingface/datasets/issues/6077
The `MAX_MAP_BATCH_SIZE = 1_000_000_000` hack is bad as it loads the entire dataset into RAM when performing `.map`. Instead, it's best to use `.iter(batch_size)` to iterate over the data batches and compute `mean` for each column. (`stddev` can be computed in another pass). Also, these arrays are big, so it makes sense to reduce `batch_size`/`writer_batch_size` to avoid RAM issues and slow IO.
Mapping gets stuck at 99%
### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2
62
Mapping gets stuck at 99% ### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 The `MAX_MAP_BATCH_SIZE = 1_000_000_000` hack is bad as it loads the entire dataset into RAM when performing `.map`. Instead, it's best to use `.iter(batch_size)` to iterate over the data batches and compute `mean` for each column. (`stddev` can be computed in another pass). Also, these arrays are big, so it makes sense to reduce `batch_size`/`writer_batch_size` to avoid RAM issues and slow IO.
[ -0.23888099193572998, -0.4203942120075226, 0.11454978585243225, 0.01367790624499321, 0.38200873136520386, -0.02695149928331375, -0.09978479146957397, 0.28061017394065857, 0.28092217445373535, 0.42724764347076416, -0.14177890121936798, 0.3004530966281891, 0.17234152555465698, -0.09254380315542221, -0.20135711133480072, 0.16480666399002075, 0.012814104557037354, 0.027215860784053802, -0.46503356099128723, -0.02325960248708725, -0.30321356654167175, -0.019846059381961823, -0.08741772174835205, -0.2261495590209961, 0.02980491891503334, 0.05566738545894623, 0.23480741679668427, 0.04804215580224991, -0.13257595896720886, -0.038998790085315704, 0.02572695165872574, 0.33187782764434814, -0.2694392204284668, 0.7168410420417786, -0.00012576166773214936, -0.24600815773010254, 0.38565802574157715, 0.12560486793518066, 0.07028398662805557, -0.14490455389022827, 0.4119063913822174, -0.2381652593612671, 0.07440550625324249, -0.25357335805892944, 0.21299567818641663, 0.09703768789768219, 0.1731753647327423, -0.2661339044570923, 0.2694084942340851, -0.2111963927745819, 0.06430794298648834, 0.16194218397140503, -0.1921634078025818, -0.02156234346330166, 0.04628835618495941, 0.304109662771225, 0.005572371184825897, 0.5163283348083496, 0.18567119538784027, -0.27363821864128113, -0.22961296141147614, 0.35308322310447693, -0.23241183161735535, -0.24688445031642914, 0.4489942193031311, -0.023223470896482468, 0.22934670746326447, -0.1401239037513733, 0.45047977566719055, 0.24075044691562653, -0.05068735405802727, -0.05831998586654663, -0.20002371072769165, -0.23911887407302856, -0.08658799529075623, -0.20893926918506622, 0.15879833698272705, 0.0763239711523056, -0.2498108595609665, -0.1351650357246399, -0.5892239212989807, -0.2015974223613739, 0.19031384587287903, 0.011416981928050518, -0.41549140214920044, -0.11164214462041855, -0.11775705218315125, 0.27343928813934326, 0.4124731719493866, -0.20074543356895447, -0.43840664625167847, -0.04841908812522888, 0.2957547903060913, 0.1649416983127594, -0.22380661964416504, 0.1342388391494751, 0.24506248533725739, -0.2066878378391266, 0.19872993230819702, 0.02951992303133011, -0.32746148109436035, 0.20284657180309296, -0.1723247766494751, 0.11157134175300598, 0.28773513436317444, 0.2299206256866455, -0.07176719605922699, 0.16607189178466797, 0.47925078868865967, 0.24024483561515808, -0.1251082718372345, 0.07817921787500381, 0.34749478101730347, -0.26293981075286865, 0.2062152624130249, -0.19157515466213226, 0.08132031559944153, -0.32711222767829895, -0.08810855448246002, 0.23380692303180695, -0.023116983473300934, 0.16657449305057526, 0.0541435144841671, 0.2664797008037567, 0.2880164384841919, 0.03394807502627373, 0.05194924771785736, 0.1139814630150795, -0.30280807614326477, 0.26088881492614746, 0.023673702031373978, -0.14034008979797363, -0.3892468214035034, 0.21316216886043549, 0.007915310561656952, -0.11985030770301819, 0.044383108615875244, 0.1521984338760376, 0.07513763755559921, -0.17251801490783691, -0.0070291198790073395, -0.15144768357276917, 0.2898397445678711, 0.311759889125824, -0.2254585176706314, 0.40087464451789856, -0.022290967404842377, -0.03102976828813553, -0.2700271010398865, 0.08179179579019547, 0.022208446636795998, -0.024028241634368896, 0.2052392065525055, 0.015945464372634888, -0.13217268884181976, 0.29703256487846375, -0.0594707727432251, 0.1867315024137497, 0.38606566190719604, -0.24491488933563232, 0.030569281429052353, -0.15452426671981812, -0.3442267179489136, -0.12373925745487213, 0.22804531455039978, 0.5708961486816406, -0.0792028084397316, 0.061522260308265686, 0.03908839449286461, 0.10825639963150024, 0.27754688262939453, 0.3245382606983185, 0.09113742411136627, 0.18433406949043274, -0.295149028301239, 0.029286503791809082, -0.3030865788459778, -0.1607225388288498, -0.4697612524032593, 0.4938766658306122, -0.55758136510849, 0.20389291644096375, 0.021610574796795845, 0.06717267632484436, -0.02055281773209572, -0.06775470077991486, 0.4217858910560608, 0.11313409358263016, -0.04053349792957306, 0.0642205998301506, -0.11549801379442215, -0.1540374457836151, 0.1377406120300293, 0.2166878581047058, 0.24219617247581482, -0.03080795705318451, 0.23239043354988098, -0.31481045484542847, 0.07439734041690826, -0.09870057553052902, 0.11744300276041031, 0.22700977325439453, 0.01741168275475502, 0.15186385810375214, 0.013074025511741638, -0.5110950469970703, -0.424011766910553, 0.12462998926639557, 0.058508679270744324, 0.020974023267626762, -0.3666141629219055, -0.23338085412979126, -0.3189186751842499, -0.06761809438467026, -0.03722742944955826, 0.2750457227230072, -0.12419383227825165, 0.02847856469452381, -0.15731194615364075, 0.12788617610931396, -0.037723951041698456, -0.18904894590377808, -0.06251073628664017, 0.23099103569984436, -0.6582081317901611, 0.15217989683151245, 0.2364165335893631, -0.2917599678039551, -0.031077079474925995, 0.23493507504463196, 0.17351001501083374, -0.3071972131729126, -0.08042377978563309, 0.3030446767807007, -0.16496020555496216, 0.2505459189414978, -0.0531485341489315, 0.4123338758945465, 0.09876082092523575, 0.192022904753685, -0.04778444021940231, 0.2165067344903946, 0.10364969074726105, -0.371297687292099, -0.1601835936307907, 0.31123116612434387, -0.23095887899398804, 0.4938892126083374, -0.17955541610717773, -0.01819901168346405, 0.05718153715133667, -0.03867214173078537, -0.3365512788295746, -0.17156073451042175, 0.4729599952697754, 0.2662584185600281, -0.02222122624516487, 0.05215839296579361, 0.12361421436071396, -0.04062875732779503, 0.453993558883667, -0.35915565490722656, -0.05735054239630699, 0.15214672684669495, -0.03703976050019264, 0.13274547457695007, 0.07663071155548096, -0.22056737542152405, 0.3286638855934143, 0.049584999680519104, 0.08901415765285492, 0.2569698095321655, 0.06748683005571365, -0.041223153471946716, 0.03859072923660278, 0.1568833887577057, 0.05245525389909744, 0.152063250541687, 0.06971380114555359, 0.07846188545227051, -0.28904837369918823, -0.2303764671087265, -0.09772730618715286, 0.26063981652259827, -0.24037621915340424, -0.1001814752817154, -0.2927585244178772, 0.3055819272994995, -0.10294544696807861, 0.22796159982681274, -0.3610994219779968, -0.4794292151927948, -0.338148832321167, 0.3350686728954315, -0.27422136068344116, 0.20275020599365234, 0.20204827189445496, 0.008992224931716919, -0.01044466346502304, -0.11006810516119003, -0.1464834362268448, -0.08160838484764099, -0.019761087372899055, -0.31321653723716736, 0.46844446659088135, -0.32853853702545166, 0.30248504877090454, -0.006484329700469971, -0.14062374830245972, -0.045863401144742966, -0.3811408579349518, -0.01819523051381111, 0.007683472707867622, 0.15184985101222992, 0.13487586379051208, 0.19577734172344208, -0.1746925413608551, 0.029227133840322495, 0.22800779342651367, -0.18603827059268951, -0.0746045783162117, 0.08755359053611755, 0.05278678238391876, 0.0610174760222435, -0.244971364736557, -0.028351765125989914, 0.16690650582313538, -0.30096790194511414, 0.6349741816520691, -0.5413112044334412, 0.19146491587162018, 0.10177934914827347, -0.1899566352367401, -0.06051914021372795, -0.3568724989891052, -0.08746054768562317, -0.1191839948296547, -0.09153535962104797, 0.24307197332382202, 0.018022917211055756, -0.09907539188861847, -0.07739753276109695, 0.11826848238706589, -0.33912333846092224, 0.42038455605506897, -0.3586280941963196, 0.003646053373813629, -0.6129183173179626, 0.41457775235176086, -0.3623543977737427, 0.5213750600814819, 0.24066737294197083, 0.052109912037849426, -0.06067913770675659, 0.11904853582382202, -0.22991332411766052, 0.11621721088886261, 0.01899860054254532, -0.31647324562072754, 0.07239903509616852, 0.38155293464660645, 0.2155790776014328, 0.39129796624183655, 0.23783697187900543, 0.01770208775997162, 0.0695260614156723, 0.03549239784479141, 0.25255534052848816, -0.4628986716270447, -0.47727876901626587, -0.02210593782365322, -0.0734882801771164, -0.16659069061279297, 0.11811310052871704, 0.07371115684509277, 0.03598174452781677, 0.06487427651882172, -0.16818220913410187, -0.21392810344696045, -0.45905959606170654, 0.15326930582523346, -0.020726650953292847, 0.010972069576382637, 0.11573585867881775, 0.32454198598861694, -0.20322832465171814, -0.17255716025829315, 0.22188594937324524, 0.23054184019565582, 0.09045741707086563, -0.14501164853572845, -0.6466357111930847, -0.1134195476770401, -0.5839855074882507, 0.312025785446167, -0.09698416292667389, 0.038543738424777985, -0.1606905311346054, 0.11498793214559555, 0.17899467051029205, -0.1679503172636032, 0.7110087275505066, -0.05402543395757675, 0.2511276304721832, -0.08594151586294174, -0.32301491498947144, -0.4334962069988251, 0.16963255405426025, 0.04335489869117737, 0.6516959071159363, 0.33520564436912537, 0.9209727644920349, -0.5595273971557617, 0.0984170138835907, 0.23311322927474976, 0.10756106674671173, -0.05370820313692093, -0.482727974653244, -0.16164933145046234, -0.3407106399536133, 0.0175735205411911, 0.03870432451367378, 0.07834150642156601, 0.17578011751174927, 0.035294197499752045, -0.26659631729125977, 0.08844099193811417, -0.0042086318135261536, 0.3237605094909668, -0.1250263750553131, 0.03229362145066261, 0.35413670539855957, 0.2597750723361969, 0.1955142319202423, 0.1271650642156601, 0.02885914407670498, 0.33507710695266724, 0.32583028078079224, 0.06455202400684357, 0.02420177310705185, -0.008665759116411209, 0.4252775013446808, 0.5220960378646851, 0.2626708447933197, 0.09232421219348907, 0.00224217027425766, 0.3612261414527893, -0.4305434226989746, -0.019320614635944366, 0.08422957360744476, 0.25744426250457764, 0.005420852452516556, -0.1232181191444397, 0.4518371820449829, 0.11618490517139435, -0.1984424591064453, 0.5560111403465271, 0.05901646614074707, -0.24077928066253662, 0.1654709428548813, -0.022777076810598373, 1.0856151580810547, -0.3258266746997833, 0.016873911023139954, 0.14731673896312714, -0.2032989263534546, 0.29720520973205566, -0.154873788356781, -0.11433054506778717, -0.24449531733989716, -0.22063344717025757, 0.2324163317680359, -0.004680842161178589, 0.23912140727043152, -0.14343780279159546, 0.058082520961761475, 0.26439881324768066, -0.07180655002593994, 0.16438747942447662, 0.059666067361831665, 0.1282811015844345, -0.185276061296463, -0.5459384918212891, -0.16539357602596283, -0.10275986790657043, -0.046446364372968674, 0.1588393747806549, 0.02618120238184929, 0.06112813204526901, -0.07266825437545776, 0.08410345017910004, 0.013736799359321594, -0.03083043545484543, -0.054277267307043076, -0.0644831508398056, -0.21674542129039764, 0.08868424594402313, -0.010880611836910248, 0.003827777225524187, -0.13319244980812073, 0.49164924025535583, -0.07399120926856995, 0.03424706682562828, 0.026431944221258163, 0.15796878933906555, 0.15945857763290405, -0.11559485644102097, -0.024185534566640854, 0.0624251514673233, -0.20603680610656738, -0.3283410668373108, 0.02239171415567398, 0.13847693800926208, -0.15436257421970367, -0.13176029920578003, -0.04287213459610939, -0.2277067005634308, -0.12716728448867798, -0.024350717663764954, 0.18371278047561646, -0.11008131504058838, -0.05849958956241608, 0.18449324369430542, -0.24122527241706848, 0.3736000061035156, -0.08822830766439438, -0.3953046500682831, -0.10393135994672775, 0.634495735168457, 0.010421285405755043, -0.23700863122940063, 0.7087687253952026, -0.07702712714672089, -0.05710796266794205, -0.16444748640060425, 0.33858850598335266, 0.5586377382278442, -0.24462783336639404, 0.21478335559368134, -0.2508840560913086, 0.01168060302734375, -0.10829368233680725, 0.08876387774944305, 0.1030031219124794, -0.5223097801208496, -0.10934809595346451, -0.5039828419685364, -0.4371582567691803, 0.050811268389225006, 0.31664660573005676, 0.1529403179883957, -0.21891142427921295, -0.08608618378639221, -0.23076024651527405, 0.1843235343694687, -0.13626912236213684, 0.005439497530460358, -0.03928055986762047, 0.22095070779323578, 0.1950281411409378, -0.1933629810810089, -0.03922664374113083, -0.20526930689811707, 0.03739861771464348, 0.27980539202690125, -0.25010910630226135, -0.03600414842367172, -0.03938615322113037, 0.2195020169019699, -0.2527807950973511, -0.17280623316764832, 0.3825644254684448, -0.28395652770996094, -0.14871761202812195, -0.4645368456840515, 0.21011124551296234, 0.2932005822658539, -0.0707581639289856, -0.11504864692687988, -0.014532241970300674, 0.3208968937397003, 0.16738751530647278, 0.24592085182666779, -0.06628403067588806, 0.040545351803302765, -0.14622974395751953, 0.10256902873516083, -0.05880538374185562, -0.11613209545612335, -0.32862749695777893, 0.019978441298007965, 0.31452351808547974, 0.0639902651309967, 0.30353280901908875, -0.18932077288627625, -0.22173196077346802, 0.3751179575920105, 0.5794050693511963, 0.3862799406051636, -0.2766030430793762, -0.2456652820110321, 0.1615334302186966, 0.03528717905282974, -0.06660784035921097, 0.23094028234481812, 0.5689198970794678, 0.07470636814832687, 0.03504416346549988, 0.17986057698726654, 0.0219527930021286, -0.14437080919742584, -0.2576483488082886, -0.19037556648254395, 0.1481853723526001, 0.07130447030067444, 0.047217052429914474, 0.21345385909080505, 0.16395673155784607, 0.061141327023506165, 0.3388981819152832, 0.28907161951065063, 0.08657218515872955, 0.4667104482650757, 0.368335098028183, 0.3922780752182007, -0.17793436348438263, 0.45053374767303467, -0.16573300957679749, -0.6048742532730103, 0.05006135255098343, 0.5202893018722534, 0.002904728055000305, 0.21429771184921265, 0.13388647139072418, 0.38824009895324707, -0.3346572518348694, -0.44256049394607544, -0.2183568775653839, 0.24097588658332825, -0.34840911626815796, -0.24051988124847412, -0.1277104914188385, -0.16644835472106934, -0.19621475040912628, 0.20828934013843536, 0.02846672013401985, -0.013913866132497787, 0.583319902420044, -0.05597822740674019, 0.07471881806850433, -0.16509905457496643, -0.13108569383621216, -0.15083187818527222, 0.5593531727790833, -0.4249300956726074, -0.058273643255233765, 0.08508919924497604, 0.20149405300617218, 0.005659561604261398, 0.09891647845506668, 0.22191698849201202, 0.5954395532608032, -0.3441551625728607, 0.17371316254138947, 0.007832694798707962, 0.0002804398536682129, -0.0733645111322403, 0.3781745433807373, -0.023917317390441895, 0.43066132068634033, 0.35236304998397827, -0.07691127061843872, -0.19672952592372894, -0.13659851253032684, 0.16856640577316284, 0.1623258739709854, -0.1707630306482315, 0.0013055577874183655, -0.10554943978786469, -0.2826889455318451, 0.04362761974334717, -0.23438489437103271, -0.15561634302139282, -0.2667936086654663, 0.015271030366420746, -0.2012171596288681, 0.04535336047410965, -0.3328709006309509, 0.04075251519680023, -0.1899547129869461, 0.3805100619792938, 0.3659440577030182, -0.0041065337136387825, -0.44092532992362976, -0.18570677936077118, -0.6614761352539062, 0.21573391556739807, -0.13150663673877716, -0.1283673644065857, 0.21142730116844177, 0.2039782553911209, 0.0662599727511406, -0.03784913942217827, -0.030719347298145294, -0.18035286664962769, 0.2537330985069275, 0.3709222972393036, 0.0629953145980835, -0.04947522655129433, -0.24363355338573456, -0.31671440601348877, 0.06748946011066437, -0.4301900565624237, 0.3383392095565796, -0.3967214524745941, -0.06871291249990463, 0.0988791435956955, 0.2348305732011795, -0.3199450373649597, 0.2399914711713791, 0.6963927149772644, 0.38060489296913147, 0.17886653542518616, -0.0882883295416832, -0.21704953908920288, -0.27396151423454285, 0.1600954234600067, -0.18827414512634277, 0.22882716357707977, -0.11228379607200623, 0.4331352114677429, -0.1477871537208557, 0.11189840734004974, -0.22905504703521729, 0.18503662943840027, -0.04645007103681564, -0.05673547834157944, -0.06749781221151352, -0.04833723604679108, -0.004544124007225037, 0.07446648180484772, 0.07342499494552612, 0.44285205006599426, 0.11574986577033997, 0.4185824394226074, -0.19462671875953674, -0.3257077932357788, 0.4559101462364197, -0.25945666432380676, -0.6162010431289673, 0.15928494930267334, 0.29199814796447754, 0.23965638875961304, -0.2519022524356842, -0.29562661051750183, -0.012355700135231018, 0.15429812669754028, -0.04089231789112091, -0.10765590518712997, 0.22024521231651306, -0.45446211099624634, -0.4066636264324188, -0.08461333066225052, 0.3272373676300049, 0.1267106533050537, -0.3212856352329254, 0.18627029657363892, -0.1217784658074379 ]
https://github.com/huggingface/datasets/issues/6077
Hi @mariosasko ! I agree, it's an ugly hack, but it was convenient since the resulting `mean_std` could be cached by the library. For my large dataset (which doesn't fit in RAM), I'm actually using something similar to what you suggested. I got rid of the first mapping in the above scripts and replaced it with an iterator, but the issue with the second mapping still persists.
Mapping gets stuck at 99%
### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2
67
Mapping gets stuck at 99% ### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 Hi @mariosasko ! I agree, it's an ugly hack, but it was convenient since the resulting `mean_std` could be cached by the library. For my large dataset (which doesn't fit in RAM), I'm actually using something similar to what you suggested. I got rid of the first mapping in the above scripts and replaced it with an iterator, but the issue with the second mapping still persists.
[ -0.23888099193572998, -0.4203942120075226, 0.11454978585243225, 0.01367790624499321, 0.38200873136520386, -0.02695149928331375, -0.09978479146957397, 0.28061017394065857, 0.28092217445373535, 0.42724764347076416, -0.14177890121936798, 0.3004530966281891, 0.17234152555465698, -0.09254380315542221, -0.20135711133480072, 0.16480666399002075, 0.012814104557037354, 0.027215860784053802, -0.46503356099128723, -0.02325960248708725, -0.30321356654167175, -0.019846059381961823, -0.08741772174835205, -0.2261495590209961, 0.02980491891503334, 0.05566738545894623, 0.23480741679668427, 0.04804215580224991, -0.13257595896720886, -0.038998790085315704, 0.02572695165872574, 0.33187782764434814, -0.2694392204284668, 0.7168410420417786, -0.00012576166773214936, -0.24600815773010254, 0.38565802574157715, 0.12560486793518066, 0.07028398662805557, -0.14490455389022827, 0.4119063913822174, -0.2381652593612671, 0.07440550625324249, -0.25357335805892944, 0.21299567818641663, 0.09703768789768219, 0.1731753647327423, -0.2661339044570923, 0.2694084942340851, -0.2111963927745819, 0.06430794298648834, 0.16194218397140503, -0.1921634078025818, -0.02156234346330166, 0.04628835618495941, 0.304109662771225, 0.005572371184825897, 0.5163283348083496, 0.18567119538784027, -0.27363821864128113, -0.22961296141147614, 0.35308322310447693, -0.23241183161735535, -0.24688445031642914, 0.4489942193031311, -0.023223470896482468, 0.22934670746326447, -0.1401239037513733, 0.45047977566719055, 0.24075044691562653, -0.05068735405802727, -0.05831998586654663, -0.20002371072769165, -0.23911887407302856, -0.08658799529075623, -0.20893926918506622, 0.15879833698272705, 0.0763239711523056, -0.2498108595609665, -0.1351650357246399, -0.5892239212989807, -0.2015974223613739, 0.19031384587287903, 0.011416981928050518, -0.41549140214920044, -0.11164214462041855, -0.11775705218315125, 0.27343928813934326, 0.4124731719493866, -0.20074543356895447, -0.43840664625167847, -0.04841908812522888, 0.2957547903060913, 0.1649416983127594, -0.22380661964416504, 0.1342388391494751, 0.24506248533725739, -0.2066878378391266, 0.19872993230819702, 0.02951992303133011, -0.32746148109436035, 0.20284657180309296, -0.1723247766494751, 0.11157134175300598, 0.28773513436317444, 0.2299206256866455, -0.07176719605922699, 0.16607189178466797, 0.47925078868865967, 0.24024483561515808, -0.1251082718372345, 0.07817921787500381, 0.34749478101730347, -0.26293981075286865, 0.2062152624130249, -0.19157515466213226, 0.08132031559944153, -0.32711222767829895, -0.08810855448246002, 0.23380692303180695, -0.023116983473300934, 0.16657449305057526, 0.0541435144841671, 0.2664797008037567, 0.2880164384841919, 0.03394807502627373, 0.05194924771785736, 0.1139814630150795, -0.30280807614326477, 0.26088881492614746, 0.023673702031373978, -0.14034008979797363, -0.3892468214035034, 0.21316216886043549, 0.007915310561656952, -0.11985030770301819, 0.044383108615875244, 0.1521984338760376, 0.07513763755559921, -0.17251801490783691, -0.0070291198790073395, -0.15144768357276917, 0.2898397445678711, 0.311759889125824, -0.2254585176706314, 0.40087464451789856, -0.022290967404842377, -0.03102976828813553, -0.2700271010398865, 0.08179179579019547, 0.022208446636795998, -0.024028241634368896, 0.2052392065525055, 0.015945464372634888, -0.13217268884181976, 0.29703256487846375, -0.0594707727432251, 0.1867315024137497, 0.38606566190719604, -0.24491488933563232, 0.030569281429052353, -0.15452426671981812, -0.3442267179489136, -0.12373925745487213, 0.22804531455039978, 0.5708961486816406, -0.0792028084397316, 0.061522260308265686, 0.03908839449286461, 0.10825639963150024, 0.27754688262939453, 0.3245382606983185, 0.09113742411136627, 0.18433406949043274, -0.295149028301239, 0.029286503791809082, -0.3030865788459778, -0.1607225388288498, -0.4697612524032593, 0.4938766658306122, -0.55758136510849, 0.20389291644096375, 0.021610574796795845, 0.06717267632484436, -0.02055281773209572, -0.06775470077991486, 0.4217858910560608, 0.11313409358263016, -0.04053349792957306, 0.0642205998301506, -0.11549801379442215, -0.1540374457836151, 0.1377406120300293, 0.2166878581047058, 0.24219617247581482, -0.03080795705318451, 0.23239043354988098, -0.31481045484542847, 0.07439734041690826, -0.09870057553052902, 0.11744300276041031, 0.22700977325439453, 0.01741168275475502, 0.15186385810375214, 0.013074025511741638, -0.5110950469970703, -0.424011766910553, 0.12462998926639557, 0.058508679270744324, 0.020974023267626762, -0.3666141629219055, -0.23338085412979126, -0.3189186751842499, -0.06761809438467026, -0.03722742944955826, 0.2750457227230072, -0.12419383227825165, 0.02847856469452381, -0.15731194615364075, 0.12788617610931396, -0.037723951041698456, -0.18904894590377808, -0.06251073628664017, 0.23099103569984436, -0.6582081317901611, 0.15217989683151245, 0.2364165335893631, -0.2917599678039551, -0.031077079474925995, 0.23493507504463196, 0.17351001501083374, -0.3071972131729126, -0.08042377978563309, 0.3030446767807007, -0.16496020555496216, 0.2505459189414978, -0.0531485341489315, 0.4123338758945465, 0.09876082092523575, 0.192022904753685, -0.04778444021940231, 0.2165067344903946, 0.10364969074726105, -0.371297687292099, -0.1601835936307907, 0.31123116612434387, -0.23095887899398804, 0.4938892126083374, -0.17955541610717773, -0.01819901168346405, 0.05718153715133667, -0.03867214173078537, -0.3365512788295746, -0.17156073451042175, 0.4729599952697754, 0.2662584185600281, -0.02222122624516487, 0.05215839296579361, 0.12361421436071396, -0.04062875732779503, 0.453993558883667, -0.35915565490722656, -0.05735054239630699, 0.15214672684669495, -0.03703976050019264, 0.13274547457695007, 0.07663071155548096, -0.22056737542152405, 0.3286638855934143, 0.049584999680519104, 0.08901415765285492, 0.2569698095321655, 0.06748683005571365, -0.041223153471946716, 0.03859072923660278, 0.1568833887577057, 0.05245525389909744, 0.152063250541687, 0.06971380114555359, 0.07846188545227051, -0.28904837369918823, -0.2303764671087265, -0.09772730618715286, 0.26063981652259827, -0.24037621915340424, -0.1001814752817154, -0.2927585244178772, 0.3055819272994995, -0.10294544696807861, 0.22796159982681274, -0.3610994219779968, -0.4794292151927948, -0.338148832321167, 0.3350686728954315, -0.27422136068344116, 0.20275020599365234, 0.20204827189445496, 0.008992224931716919, -0.01044466346502304, -0.11006810516119003, -0.1464834362268448, -0.08160838484764099, -0.019761087372899055, -0.31321653723716736, 0.46844446659088135, -0.32853853702545166, 0.30248504877090454, -0.006484329700469971, -0.14062374830245972, -0.045863401144742966, -0.3811408579349518, -0.01819523051381111, 0.007683472707867622, 0.15184985101222992, 0.13487586379051208, 0.19577734172344208, -0.1746925413608551, 0.029227133840322495, 0.22800779342651367, -0.18603827059268951, -0.0746045783162117, 0.08755359053611755, 0.05278678238391876, 0.0610174760222435, -0.244971364736557, -0.028351765125989914, 0.16690650582313538, -0.30096790194511414, 0.6349741816520691, -0.5413112044334412, 0.19146491587162018, 0.10177934914827347, -0.1899566352367401, -0.06051914021372795, -0.3568724989891052, -0.08746054768562317, -0.1191839948296547, -0.09153535962104797, 0.24307197332382202, 0.018022917211055756, -0.09907539188861847, -0.07739753276109695, 0.11826848238706589, -0.33912333846092224, 0.42038455605506897, -0.3586280941963196, 0.003646053373813629, -0.6129183173179626, 0.41457775235176086, -0.3623543977737427, 0.5213750600814819, 0.24066737294197083, 0.052109912037849426, -0.06067913770675659, 0.11904853582382202, -0.22991332411766052, 0.11621721088886261, 0.01899860054254532, -0.31647324562072754, 0.07239903509616852, 0.38155293464660645, 0.2155790776014328, 0.39129796624183655, 0.23783697187900543, 0.01770208775997162, 0.0695260614156723, 0.03549239784479141, 0.25255534052848816, -0.4628986716270447, -0.47727876901626587, -0.02210593782365322, -0.0734882801771164, -0.16659069061279297, 0.11811310052871704, 0.07371115684509277, 0.03598174452781677, 0.06487427651882172, -0.16818220913410187, -0.21392810344696045, -0.45905959606170654, 0.15326930582523346, -0.020726650953292847, 0.010972069576382637, 0.11573585867881775, 0.32454198598861694, -0.20322832465171814, -0.17255716025829315, 0.22188594937324524, 0.23054184019565582, 0.09045741707086563, -0.14501164853572845, -0.6466357111930847, -0.1134195476770401, -0.5839855074882507, 0.312025785446167, -0.09698416292667389, 0.038543738424777985, -0.1606905311346054, 0.11498793214559555, 0.17899467051029205, -0.1679503172636032, 0.7110087275505066, -0.05402543395757675, 0.2511276304721832, -0.08594151586294174, -0.32301491498947144, -0.4334962069988251, 0.16963255405426025, 0.04335489869117737, 0.6516959071159363, 0.33520564436912537, 0.9209727644920349, -0.5595273971557617, 0.0984170138835907, 0.23311322927474976, 0.10756106674671173, -0.05370820313692093, -0.482727974653244, -0.16164933145046234, -0.3407106399536133, 0.0175735205411911, 0.03870432451367378, 0.07834150642156601, 0.17578011751174927, 0.035294197499752045, -0.26659631729125977, 0.08844099193811417, -0.0042086318135261536, 0.3237605094909668, -0.1250263750553131, 0.03229362145066261, 0.35413670539855957, 0.2597750723361969, 0.1955142319202423, 0.1271650642156601, 0.02885914407670498, 0.33507710695266724, 0.32583028078079224, 0.06455202400684357, 0.02420177310705185, -0.008665759116411209, 0.4252775013446808, 0.5220960378646851, 0.2626708447933197, 0.09232421219348907, 0.00224217027425766, 0.3612261414527893, -0.4305434226989746, -0.019320614635944366, 0.08422957360744476, 0.25744426250457764, 0.005420852452516556, -0.1232181191444397, 0.4518371820449829, 0.11618490517139435, -0.1984424591064453, 0.5560111403465271, 0.05901646614074707, -0.24077928066253662, 0.1654709428548813, -0.022777076810598373, 1.0856151580810547, -0.3258266746997833, 0.016873911023139954, 0.14731673896312714, -0.2032989263534546, 0.29720520973205566, -0.154873788356781, -0.11433054506778717, -0.24449531733989716, -0.22063344717025757, 0.2324163317680359, -0.004680842161178589, 0.23912140727043152, -0.14343780279159546, 0.058082520961761475, 0.26439881324768066, -0.07180655002593994, 0.16438747942447662, 0.059666067361831665, 0.1282811015844345, -0.185276061296463, -0.5459384918212891, -0.16539357602596283, -0.10275986790657043, -0.046446364372968674, 0.1588393747806549, 0.02618120238184929, 0.06112813204526901, -0.07266825437545776, 0.08410345017910004, 0.013736799359321594, -0.03083043545484543, -0.054277267307043076, -0.0644831508398056, -0.21674542129039764, 0.08868424594402313, -0.010880611836910248, 0.003827777225524187, -0.13319244980812073, 0.49164924025535583, -0.07399120926856995, 0.03424706682562828, 0.026431944221258163, 0.15796878933906555, 0.15945857763290405, -0.11559485644102097, -0.024185534566640854, 0.0624251514673233, -0.20603680610656738, -0.3283410668373108, 0.02239171415567398, 0.13847693800926208, -0.15436257421970367, -0.13176029920578003, -0.04287213459610939, -0.2277067005634308, -0.12716728448867798, -0.024350717663764954, 0.18371278047561646, -0.11008131504058838, -0.05849958956241608, 0.18449324369430542, -0.24122527241706848, 0.3736000061035156, -0.08822830766439438, -0.3953046500682831, -0.10393135994672775, 0.634495735168457, 0.010421285405755043, -0.23700863122940063, 0.7087687253952026, -0.07702712714672089, -0.05710796266794205, -0.16444748640060425, 0.33858850598335266, 0.5586377382278442, -0.24462783336639404, 0.21478335559368134, -0.2508840560913086, 0.01168060302734375, -0.10829368233680725, 0.08876387774944305, 0.1030031219124794, -0.5223097801208496, -0.10934809595346451, -0.5039828419685364, -0.4371582567691803, 0.050811268389225006, 0.31664660573005676, 0.1529403179883957, -0.21891142427921295, -0.08608618378639221, -0.23076024651527405, 0.1843235343694687, -0.13626912236213684, 0.005439497530460358, -0.03928055986762047, 0.22095070779323578, 0.1950281411409378, -0.1933629810810089, -0.03922664374113083, -0.20526930689811707, 0.03739861771464348, 0.27980539202690125, -0.25010910630226135, -0.03600414842367172, -0.03938615322113037, 0.2195020169019699, -0.2527807950973511, -0.17280623316764832, 0.3825644254684448, -0.28395652770996094, -0.14871761202812195, -0.4645368456840515, 0.21011124551296234, 0.2932005822658539, -0.0707581639289856, -0.11504864692687988, -0.014532241970300674, 0.3208968937397003, 0.16738751530647278, 0.24592085182666779, -0.06628403067588806, 0.040545351803302765, -0.14622974395751953, 0.10256902873516083, -0.05880538374185562, -0.11613209545612335, -0.32862749695777893, 0.019978441298007965, 0.31452351808547974, 0.0639902651309967, 0.30353280901908875, -0.18932077288627625, -0.22173196077346802, 0.3751179575920105, 0.5794050693511963, 0.3862799406051636, -0.2766030430793762, -0.2456652820110321, 0.1615334302186966, 0.03528717905282974, -0.06660784035921097, 0.23094028234481812, 0.5689198970794678, 0.07470636814832687, 0.03504416346549988, 0.17986057698726654, 0.0219527930021286, -0.14437080919742584, -0.2576483488082886, -0.19037556648254395, 0.1481853723526001, 0.07130447030067444, 0.047217052429914474, 0.21345385909080505, 0.16395673155784607, 0.061141327023506165, 0.3388981819152832, 0.28907161951065063, 0.08657218515872955, 0.4667104482650757, 0.368335098028183, 0.3922780752182007, -0.17793436348438263, 0.45053374767303467, -0.16573300957679749, -0.6048742532730103, 0.05006135255098343, 0.5202893018722534, 0.002904728055000305, 0.21429771184921265, 0.13388647139072418, 0.38824009895324707, -0.3346572518348694, -0.44256049394607544, -0.2183568775653839, 0.24097588658332825, -0.34840911626815796, -0.24051988124847412, -0.1277104914188385, -0.16644835472106934, -0.19621475040912628, 0.20828934013843536, 0.02846672013401985, -0.013913866132497787, 0.583319902420044, -0.05597822740674019, 0.07471881806850433, -0.16509905457496643, -0.13108569383621216, -0.15083187818527222, 0.5593531727790833, -0.4249300956726074, -0.058273643255233765, 0.08508919924497604, 0.20149405300617218, 0.005659561604261398, 0.09891647845506668, 0.22191698849201202, 0.5954395532608032, -0.3441551625728607, 0.17371316254138947, 0.007832694798707962, 0.0002804398536682129, -0.0733645111322403, 0.3781745433807373, -0.023917317390441895, 0.43066132068634033, 0.35236304998397827, -0.07691127061843872, -0.19672952592372894, -0.13659851253032684, 0.16856640577316284, 0.1623258739709854, -0.1707630306482315, 0.0013055577874183655, -0.10554943978786469, -0.2826889455318451, 0.04362761974334717, -0.23438489437103271, -0.15561634302139282, -0.2667936086654663, 0.015271030366420746, -0.2012171596288681, 0.04535336047410965, -0.3328709006309509, 0.04075251519680023, -0.1899547129869461, 0.3805100619792938, 0.3659440577030182, -0.0041065337136387825, -0.44092532992362976, -0.18570677936077118, -0.6614761352539062, 0.21573391556739807, -0.13150663673877716, -0.1283673644065857, 0.21142730116844177, 0.2039782553911209, 0.0662599727511406, -0.03784913942217827, -0.030719347298145294, -0.18035286664962769, 0.2537330985069275, 0.3709222972393036, 0.0629953145980835, -0.04947522655129433, -0.24363355338573456, -0.31671440601348877, 0.06748946011066437, -0.4301900565624237, 0.3383392095565796, -0.3967214524745941, -0.06871291249990463, 0.0988791435956955, 0.2348305732011795, -0.3199450373649597, 0.2399914711713791, 0.6963927149772644, 0.38060489296913147, 0.17886653542518616, -0.0882883295416832, -0.21704953908920288, -0.27396151423454285, 0.1600954234600067, -0.18827414512634277, 0.22882716357707977, -0.11228379607200623, 0.4331352114677429, -0.1477871537208557, 0.11189840734004974, -0.22905504703521729, 0.18503662943840027, -0.04645007103681564, -0.05673547834157944, -0.06749781221151352, -0.04833723604679108, -0.004544124007225037, 0.07446648180484772, 0.07342499494552612, 0.44285205006599426, 0.11574986577033997, 0.4185824394226074, -0.19462671875953674, -0.3257077932357788, 0.4559101462364197, -0.25945666432380676, -0.6162010431289673, 0.15928494930267334, 0.29199814796447754, 0.23965638875961304, -0.2519022524356842, -0.29562661051750183, -0.012355700135231018, 0.15429812669754028, -0.04089231789112091, -0.10765590518712997, 0.22024521231651306, -0.45446211099624634, -0.4066636264324188, -0.08461333066225052, 0.3272373676300049, 0.1267106533050537, -0.3212856352329254, 0.18627029657363892, -0.1217784658074379 ]
https://github.com/huggingface/datasets/issues/6077
Have you tried to reduce `batch_size`/`writer_batch_size` in the 2nd `.map`? Also, can you interrupt the process when it gets stuck and share the error stack trace?
Mapping gets stuck at 99%
### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2
26
Mapping gets stuck at 99% ### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 Have you tried to reduce `batch_size`/`writer_batch_size` in the 2nd `.map`? Also, can you interrupt the process when it gets stuck and share the error stack trace?
[ -0.23888099193572998, -0.4203942120075226, 0.11454978585243225, 0.01367790624499321, 0.38200873136520386, -0.02695149928331375, -0.09978479146957397, 0.28061017394065857, 0.28092217445373535, 0.42724764347076416, -0.14177890121936798, 0.3004530966281891, 0.17234152555465698, -0.09254380315542221, -0.20135711133480072, 0.16480666399002075, 0.012814104557037354, 0.027215860784053802, -0.46503356099128723, -0.02325960248708725, -0.30321356654167175, -0.019846059381961823, -0.08741772174835205, -0.2261495590209961, 0.02980491891503334, 0.05566738545894623, 0.23480741679668427, 0.04804215580224991, -0.13257595896720886, -0.038998790085315704, 0.02572695165872574, 0.33187782764434814, -0.2694392204284668, 0.7168410420417786, -0.00012576166773214936, -0.24600815773010254, 0.38565802574157715, 0.12560486793518066, 0.07028398662805557, -0.14490455389022827, 0.4119063913822174, -0.2381652593612671, 0.07440550625324249, -0.25357335805892944, 0.21299567818641663, 0.09703768789768219, 0.1731753647327423, -0.2661339044570923, 0.2694084942340851, -0.2111963927745819, 0.06430794298648834, 0.16194218397140503, -0.1921634078025818, -0.02156234346330166, 0.04628835618495941, 0.304109662771225, 0.005572371184825897, 0.5163283348083496, 0.18567119538784027, -0.27363821864128113, -0.22961296141147614, 0.35308322310447693, -0.23241183161735535, -0.24688445031642914, 0.4489942193031311, -0.023223470896482468, 0.22934670746326447, -0.1401239037513733, 0.45047977566719055, 0.24075044691562653, -0.05068735405802727, -0.05831998586654663, -0.20002371072769165, -0.23911887407302856, -0.08658799529075623, -0.20893926918506622, 0.15879833698272705, 0.0763239711523056, -0.2498108595609665, -0.1351650357246399, -0.5892239212989807, -0.2015974223613739, 0.19031384587287903, 0.011416981928050518, -0.41549140214920044, -0.11164214462041855, -0.11775705218315125, 0.27343928813934326, 0.4124731719493866, -0.20074543356895447, -0.43840664625167847, -0.04841908812522888, 0.2957547903060913, 0.1649416983127594, -0.22380661964416504, 0.1342388391494751, 0.24506248533725739, -0.2066878378391266, 0.19872993230819702, 0.02951992303133011, -0.32746148109436035, 0.20284657180309296, -0.1723247766494751, 0.11157134175300598, 0.28773513436317444, 0.2299206256866455, -0.07176719605922699, 0.16607189178466797, 0.47925078868865967, 0.24024483561515808, -0.1251082718372345, 0.07817921787500381, 0.34749478101730347, -0.26293981075286865, 0.2062152624130249, -0.19157515466213226, 0.08132031559944153, -0.32711222767829895, -0.08810855448246002, 0.23380692303180695, -0.023116983473300934, 0.16657449305057526, 0.0541435144841671, 0.2664797008037567, 0.2880164384841919, 0.03394807502627373, 0.05194924771785736, 0.1139814630150795, -0.30280807614326477, 0.26088881492614746, 0.023673702031373978, -0.14034008979797363, -0.3892468214035034, 0.21316216886043549, 0.007915310561656952, -0.11985030770301819, 0.044383108615875244, 0.1521984338760376, 0.07513763755559921, -0.17251801490783691, -0.0070291198790073395, -0.15144768357276917, 0.2898397445678711, 0.311759889125824, -0.2254585176706314, 0.40087464451789856, -0.022290967404842377, -0.03102976828813553, -0.2700271010398865, 0.08179179579019547, 0.022208446636795998, -0.024028241634368896, 0.2052392065525055, 0.015945464372634888, -0.13217268884181976, 0.29703256487846375, -0.0594707727432251, 0.1867315024137497, 0.38606566190719604, -0.24491488933563232, 0.030569281429052353, -0.15452426671981812, -0.3442267179489136, -0.12373925745487213, 0.22804531455039978, 0.5708961486816406, -0.0792028084397316, 0.061522260308265686, 0.03908839449286461, 0.10825639963150024, 0.27754688262939453, 0.3245382606983185, 0.09113742411136627, 0.18433406949043274, -0.295149028301239, 0.029286503791809082, -0.3030865788459778, -0.1607225388288498, -0.4697612524032593, 0.4938766658306122, -0.55758136510849, 0.20389291644096375, 0.021610574796795845, 0.06717267632484436, -0.02055281773209572, -0.06775470077991486, 0.4217858910560608, 0.11313409358263016, -0.04053349792957306, 0.0642205998301506, -0.11549801379442215, -0.1540374457836151, 0.1377406120300293, 0.2166878581047058, 0.24219617247581482, -0.03080795705318451, 0.23239043354988098, -0.31481045484542847, 0.07439734041690826, -0.09870057553052902, 0.11744300276041031, 0.22700977325439453, 0.01741168275475502, 0.15186385810375214, 0.013074025511741638, -0.5110950469970703, -0.424011766910553, 0.12462998926639557, 0.058508679270744324, 0.020974023267626762, -0.3666141629219055, -0.23338085412979126, -0.3189186751842499, -0.06761809438467026, -0.03722742944955826, 0.2750457227230072, -0.12419383227825165, 0.02847856469452381, -0.15731194615364075, 0.12788617610931396, -0.037723951041698456, -0.18904894590377808, -0.06251073628664017, 0.23099103569984436, -0.6582081317901611, 0.15217989683151245, 0.2364165335893631, -0.2917599678039551, -0.031077079474925995, 0.23493507504463196, 0.17351001501083374, -0.3071972131729126, -0.08042377978563309, 0.3030446767807007, -0.16496020555496216, 0.2505459189414978, -0.0531485341489315, 0.4123338758945465, 0.09876082092523575, 0.192022904753685, -0.04778444021940231, 0.2165067344903946, 0.10364969074726105, -0.371297687292099, -0.1601835936307907, 0.31123116612434387, -0.23095887899398804, 0.4938892126083374, -0.17955541610717773, -0.01819901168346405, 0.05718153715133667, -0.03867214173078537, -0.3365512788295746, -0.17156073451042175, 0.4729599952697754, 0.2662584185600281, -0.02222122624516487, 0.05215839296579361, 0.12361421436071396, -0.04062875732779503, 0.453993558883667, -0.35915565490722656, -0.05735054239630699, 0.15214672684669495, -0.03703976050019264, 0.13274547457695007, 0.07663071155548096, -0.22056737542152405, 0.3286638855934143, 0.049584999680519104, 0.08901415765285492, 0.2569698095321655, 0.06748683005571365, -0.041223153471946716, 0.03859072923660278, 0.1568833887577057, 0.05245525389909744, 0.152063250541687, 0.06971380114555359, 0.07846188545227051, -0.28904837369918823, -0.2303764671087265, -0.09772730618715286, 0.26063981652259827, -0.24037621915340424, -0.1001814752817154, -0.2927585244178772, 0.3055819272994995, -0.10294544696807861, 0.22796159982681274, -0.3610994219779968, -0.4794292151927948, -0.338148832321167, 0.3350686728954315, -0.27422136068344116, 0.20275020599365234, 0.20204827189445496, 0.008992224931716919, -0.01044466346502304, -0.11006810516119003, -0.1464834362268448, -0.08160838484764099, -0.019761087372899055, -0.31321653723716736, 0.46844446659088135, -0.32853853702545166, 0.30248504877090454, -0.006484329700469971, -0.14062374830245972, -0.045863401144742966, -0.3811408579349518, -0.01819523051381111, 0.007683472707867622, 0.15184985101222992, 0.13487586379051208, 0.19577734172344208, -0.1746925413608551, 0.029227133840322495, 0.22800779342651367, -0.18603827059268951, -0.0746045783162117, 0.08755359053611755, 0.05278678238391876, 0.0610174760222435, -0.244971364736557, -0.028351765125989914, 0.16690650582313538, -0.30096790194511414, 0.6349741816520691, -0.5413112044334412, 0.19146491587162018, 0.10177934914827347, -0.1899566352367401, -0.06051914021372795, -0.3568724989891052, -0.08746054768562317, -0.1191839948296547, -0.09153535962104797, 0.24307197332382202, 0.018022917211055756, -0.09907539188861847, -0.07739753276109695, 0.11826848238706589, -0.33912333846092224, 0.42038455605506897, -0.3586280941963196, 0.003646053373813629, -0.6129183173179626, 0.41457775235176086, -0.3623543977737427, 0.5213750600814819, 0.24066737294197083, 0.052109912037849426, -0.06067913770675659, 0.11904853582382202, -0.22991332411766052, 0.11621721088886261, 0.01899860054254532, -0.31647324562072754, 0.07239903509616852, 0.38155293464660645, 0.2155790776014328, 0.39129796624183655, 0.23783697187900543, 0.01770208775997162, 0.0695260614156723, 0.03549239784479141, 0.25255534052848816, -0.4628986716270447, -0.47727876901626587, -0.02210593782365322, -0.0734882801771164, -0.16659069061279297, 0.11811310052871704, 0.07371115684509277, 0.03598174452781677, 0.06487427651882172, -0.16818220913410187, -0.21392810344696045, -0.45905959606170654, 0.15326930582523346, -0.020726650953292847, 0.010972069576382637, 0.11573585867881775, 0.32454198598861694, -0.20322832465171814, -0.17255716025829315, 0.22188594937324524, 0.23054184019565582, 0.09045741707086563, -0.14501164853572845, -0.6466357111930847, -0.1134195476770401, -0.5839855074882507, 0.312025785446167, -0.09698416292667389, 0.038543738424777985, -0.1606905311346054, 0.11498793214559555, 0.17899467051029205, -0.1679503172636032, 0.7110087275505066, -0.05402543395757675, 0.2511276304721832, -0.08594151586294174, -0.32301491498947144, -0.4334962069988251, 0.16963255405426025, 0.04335489869117737, 0.6516959071159363, 0.33520564436912537, 0.9209727644920349, -0.5595273971557617, 0.0984170138835907, 0.23311322927474976, 0.10756106674671173, -0.05370820313692093, -0.482727974653244, -0.16164933145046234, -0.3407106399536133, 0.0175735205411911, 0.03870432451367378, 0.07834150642156601, 0.17578011751174927, 0.035294197499752045, -0.26659631729125977, 0.08844099193811417, -0.0042086318135261536, 0.3237605094909668, -0.1250263750553131, 0.03229362145066261, 0.35413670539855957, 0.2597750723361969, 0.1955142319202423, 0.1271650642156601, 0.02885914407670498, 0.33507710695266724, 0.32583028078079224, 0.06455202400684357, 0.02420177310705185, -0.008665759116411209, 0.4252775013446808, 0.5220960378646851, 0.2626708447933197, 0.09232421219348907, 0.00224217027425766, 0.3612261414527893, -0.4305434226989746, -0.019320614635944366, 0.08422957360744476, 0.25744426250457764, 0.005420852452516556, -0.1232181191444397, 0.4518371820449829, 0.11618490517139435, -0.1984424591064453, 0.5560111403465271, 0.05901646614074707, -0.24077928066253662, 0.1654709428548813, -0.022777076810598373, 1.0856151580810547, -0.3258266746997833, 0.016873911023139954, 0.14731673896312714, -0.2032989263534546, 0.29720520973205566, -0.154873788356781, -0.11433054506778717, -0.24449531733989716, -0.22063344717025757, 0.2324163317680359, -0.004680842161178589, 0.23912140727043152, -0.14343780279159546, 0.058082520961761475, 0.26439881324768066, -0.07180655002593994, 0.16438747942447662, 0.059666067361831665, 0.1282811015844345, -0.185276061296463, -0.5459384918212891, -0.16539357602596283, -0.10275986790657043, -0.046446364372968674, 0.1588393747806549, 0.02618120238184929, 0.06112813204526901, -0.07266825437545776, 0.08410345017910004, 0.013736799359321594, -0.03083043545484543, -0.054277267307043076, -0.0644831508398056, -0.21674542129039764, 0.08868424594402313, -0.010880611836910248, 0.003827777225524187, -0.13319244980812073, 0.49164924025535583, -0.07399120926856995, 0.03424706682562828, 0.026431944221258163, 0.15796878933906555, 0.15945857763290405, -0.11559485644102097, -0.024185534566640854, 0.0624251514673233, -0.20603680610656738, -0.3283410668373108, 0.02239171415567398, 0.13847693800926208, -0.15436257421970367, -0.13176029920578003, -0.04287213459610939, -0.2277067005634308, -0.12716728448867798, -0.024350717663764954, 0.18371278047561646, -0.11008131504058838, -0.05849958956241608, 0.18449324369430542, -0.24122527241706848, 0.3736000061035156, -0.08822830766439438, -0.3953046500682831, -0.10393135994672775, 0.634495735168457, 0.010421285405755043, -0.23700863122940063, 0.7087687253952026, -0.07702712714672089, -0.05710796266794205, -0.16444748640060425, 0.33858850598335266, 0.5586377382278442, -0.24462783336639404, 0.21478335559368134, -0.2508840560913086, 0.01168060302734375, -0.10829368233680725, 0.08876387774944305, 0.1030031219124794, -0.5223097801208496, -0.10934809595346451, -0.5039828419685364, -0.4371582567691803, 0.050811268389225006, 0.31664660573005676, 0.1529403179883957, -0.21891142427921295, -0.08608618378639221, -0.23076024651527405, 0.1843235343694687, -0.13626912236213684, 0.005439497530460358, -0.03928055986762047, 0.22095070779323578, 0.1950281411409378, -0.1933629810810089, -0.03922664374113083, -0.20526930689811707, 0.03739861771464348, 0.27980539202690125, -0.25010910630226135, -0.03600414842367172, -0.03938615322113037, 0.2195020169019699, -0.2527807950973511, -0.17280623316764832, 0.3825644254684448, -0.28395652770996094, -0.14871761202812195, -0.4645368456840515, 0.21011124551296234, 0.2932005822658539, -0.0707581639289856, -0.11504864692687988, -0.014532241970300674, 0.3208968937397003, 0.16738751530647278, 0.24592085182666779, -0.06628403067588806, 0.040545351803302765, -0.14622974395751953, 0.10256902873516083, -0.05880538374185562, -0.11613209545612335, -0.32862749695777893, 0.019978441298007965, 0.31452351808547974, 0.0639902651309967, 0.30353280901908875, -0.18932077288627625, -0.22173196077346802, 0.3751179575920105, 0.5794050693511963, 0.3862799406051636, -0.2766030430793762, -0.2456652820110321, 0.1615334302186966, 0.03528717905282974, -0.06660784035921097, 0.23094028234481812, 0.5689198970794678, 0.07470636814832687, 0.03504416346549988, 0.17986057698726654, 0.0219527930021286, -0.14437080919742584, -0.2576483488082886, -0.19037556648254395, 0.1481853723526001, 0.07130447030067444, 0.047217052429914474, 0.21345385909080505, 0.16395673155784607, 0.061141327023506165, 0.3388981819152832, 0.28907161951065063, 0.08657218515872955, 0.4667104482650757, 0.368335098028183, 0.3922780752182007, -0.17793436348438263, 0.45053374767303467, -0.16573300957679749, -0.6048742532730103, 0.05006135255098343, 0.5202893018722534, 0.002904728055000305, 0.21429771184921265, 0.13388647139072418, 0.38824009895324707, -0.3346572518348694, -0.44256049394607544, -0.2183568775653839, 0.24097588658332825, -0.34840911626815796, -0.24051988124847412, -0.1277104914188385, -0.16644835472106934, -0.19621475040912628, 0.20828934013843536, 0.02846672013401985, -0.013913866132497787, 0.583319902420044, -0.05597822740674019, 0.07471881806850433, -0.16509905457496643, -0.13108569383621216, -0.15083187818527222, 0.5593531727790833, -0.4249300956726074, -0.058273643255233765, 0.08508919924497604, 0.20149405300617218, 0.005659561604261398, 0.09891647845506668, 0.22191698849201202, 0.5954395532608032, -0.3441551625728607, 0.17371316254138947, 0.007832694798707962, 0.0002804398536682129, -0.0733645111322403, 0.3781745433807373, -0.023917317390441895, 0.43066132068634033, 0.35236304998397827, -0.07691127061843872, -0.19672952592372894, -0.13659851253032684, 0.16856640577316284, 0.1623258739709854, -0.1707630306482315, 0.0013055577874183655, -0.10554943978786469, -0.2826889455318451, 0.04362761974334717, -0.23438489437103271, -0.15561634302139282, -0.2667936086654663, 0.015271030366420746, -0.2012171596288681, 0.04535336047410965, -0.3328709006309509, 0.04075251519680023, -0.1899547129869461, 0.3805100619792938, 0.3659440577030182, -0.0041065337136387825, -0.44092532992362976, -0.18570677936077118, -0.6614761352539062, 0.21573391556739807, -0.13150663673877716, -0.1283673644065857, 0.21142730116844177, 0.2039782553911209, 0.0662599727511406, -0.03784913942217827, -0.030719347298145294, -0.18035286664962769, 0.2537330985069275, 0.3709222972393036, 0.0629953145980835, -0.04947522655129433, -0.24363355338573456, -0.31671440601348877, 0.06748946011066437, -0.4301900565624237, 0.3383392095565796, -0.3967214524745941, -0.06871291249990463, 0.0988791435956955, 0.2348305732011795, -0.3199450373649597, 0.2399914711713791, 0.6963927149772644, 0.38060489296913147, 0.17886653542518616, -0.0882883295416832, -0.21704953908920288, -0.27396151423454285, 0.1600954234600067, -0.18827414512634277, 0.22882716357707977, -0.11228379607200623, 0.4331352114677429, -0.1477871537208557, 0.11189840734004974, -0.22905504703521729, 0.18503662943840027, -0.04645007103681564, -0.05673547834157944, -0.06749781221151352, -0.04833723604679108, -0.004544124007225037, 0.07446648180484772, 0.07342499494552612, 0.44285205006599426, 0.11574986577033997, 0.4185824394226074, -0.19462671875953674, -0.3257077932357788, 0.4559101462364197, -0.25945666432380676, -0.6162010431289673, 0.15928494930267334, 0.29199814796447754, 0.23965638875961304, -0.2519022524356842, -0.29562661051750183, -0.012355700135231018, 0.15429812669754028, -0.04089231789112091, -0.10765590518712997, 0.22024521231651306, -0.45446211099624634, -0.4066636264324188, -0.08461333066225052, 0.3272373676300049, 0.1267106533050537, -0.3212856352329254, 0.18627029657363892, -0.1217784658074379 ]
https://github.com/huggingface/datasets/issues/6077
I think `batch_size/writer_batch_size` is already at its lowest in the 2nd `.map` since `batched=False` implies `batch_size=1` and `len(ds) = 1000 = writer_batch_size`. Here is also a bunch of stack traces when I interrupted the process: <details> <summary>stack trace 1</summary> ```python (pyg)[d623204@rosetta-bigviz01 stage-laurent-f]$ python src/random_scripts/uses_random_data.py Found cached dataset random_data (/local_scratch/lfainsin/.cache/huggingface/datasets/random_data/default/0.0.0/444e214e1d0e6298cfd3f2368323ec37073dc1439f618e19395b1f421c69b066) Applying mean/std: 97%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 967/1000 [00:01<00:00, 534.87 examples/s]Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3449, in _map_single writer.write(example) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 263, in _cast_to_python_objects def _cast_to_python_objects(obj: Any, only_1d_for_numpy: bool, optimize_list_casting: bool) -> Tuple[Any, bool]: KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs_new/data/users/lfainsin/stage-laurent-f/src/random_scripts/uses_random_data.py", line 62, in <module> ds_normalized = ds.map( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3492, in _map_single writer.finalize() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 584, in finalize self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in <listcomp> [ KeyboardInterrupt ``` </details> <details> <summary>stack trace 2</summary> ```python (pyg)[d623204@rosetta-bigviz01 stage-laurent-f]$ python src/random_scripts/uses_random_data.py Found cached dataset random_data (/local_scratch/lfainsin/.cache/huggingface/datasets/random_data/default/0.0.0/444e214e1d0e6298cfd3f2368323ec37073dc1439f618e19395b1f421c69b066) Applying mean/std: 99%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 988/1000 [00:20<00:00, 526.19 examples/s]Applying mean/std: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 999/1000 [00:21<00:00, 9.66 examples/s]Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3449, in _map_single writer.write(example) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 263, in _cast_to_python_objects def _cast_to_python_objects(obj: Any, only_1d_for_numpy: bool, optimize_list_casting: bool) -> Tuple[Any, bool]: KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs_new/data/users/lfainsin/stage-laurent-f/src/random_scripts/uses_random_data.py", line 62, in <module> ds_normalized = ds.map( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3492, in _map_single writer.finalize() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 584, in finalize self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 291, in _cast_to_python_objects if config.JAX_AVAILABLE and "jax" in sys.modules: KeyboardInterrupt ``` </details> <details> <summary>stack trace 3</summary> ```python (pyg)[d623204@rosetta-bigviz01 stage-laurent-f]$ python src/random_scripts/uses_random_data.py Found cached dataset random_data (/local_scratch/lfainsin/.cache/huggingface/datasets/random_data/default/0.0.0/444e214e1d0e6298cfd3f2368323ec37073dc1439f618e19395b1f421c69b066) Applying mean/std: 99%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 989/1000 [00:01<00:00, 504.80 examples/s]Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3449, in _map_single writer.write(example) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs_new/data/users/lfainsin/stage-laurent-f/src/random_scripts/uses_random_data.py", line 62, in <module> ds_normalized = ds.map( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3492, in _map_single writer.finalize() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 584, in finalize self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 298, in _cast_to_python_objects if obj.ndim == 0: KeyboardInterrupt ``` </details>
Mapping gets stuck at 99%
### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2
1,454
Mapping gets stuck at 99% ### Describe the bug Hi ! I'm currently working with a large (~150GB) unnormalized dataset at work. The dataset is available on a read-only filesystem internally, and I use a [loading script](https://huggingface.co/docs/datasets/dataset_script) to retreive it. I want to normalize the features of the dataset, meaning I need to compute the mean and standard deviation metric for each feature of the entire dataset. I cannot load the entire dataset to RAM as it is too big, so following [this discussion on the huggingface discourse](https://discuss.huggingface.co/t/copy-columns-in-a-dataset-and-compute-statistics-for-a-column/22157) I am using a [map operation](https://huggingface.co/docs/datasets/v2.14.0/en/package_reference/main_classes#datasets.Dataset.map) to first compute the metrics and a second map operation to apply them on the dataset. The problem lies in the second mapping, as it gets stuck at ~99%. By checking what the process does (using `htop` and `strace`) it seems to be doing a lot of I/O operations, and I'm not sure why. Obviously, I could always normalize the dataset externally and then load it using a loading script. However, since the internal dataset is updated fairly frequently, using the library to perform normalization automatically would make it much easier for me. ### Steps to reproduce the bug I'm able to reproduce the problem using the following scripts: ```python # random_data.py import datasets import torch _VERSION = "1.0.0" class RandomDataset(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( version=_VERSION, supervised_keys=None, features=datasets.Features( { "positions": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "normals": datasets.Array2D( shape=(30000, 3), dtype="float32", ), "features": datasets.Array2D( shape=(30000, 6), dtype="float32", ), "scalars": datasets.Sequence( feature=datasets.Value("float32"), length=20, ), }, ), ) def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # type: ignore gen_kwargs={"nb_samples": 1000}, ), datasets.SplitGenerator( name=datasets.Split.TEST, # type: ignore gen_kwargs={"nb_samples": 100}, ), ] def _generate_examples(self, nb_samples: int): for idx in range(nb_samples): yield idx, { "positions": torch.randn(30000, 3), "normals": torch.randn(30000, 3), "features": torch.randn(30000, 6), "scalars": torch.randn(20), } ``` ```python # main.py import datasets import torch def apply_mean_std( dataset: datasets.Dataset, means: dict[str, torch.Tensor], stds: dict[str, torch.Tensor], ) -> dict[str, torch.Tensor]: """Normalize the dataset using the mean and standard deviation of each feature. Args: dataset (`Dataset`): A huggingface dataset. mean (`dict[str, Tensor]`): A dictionary containing the mean of each feature. std (`dict[str, Tensor]`): A dictionary containing the standard deviation of each feature. Returns: dict: A dictionary containing the normalized dataset. """ result = {} for key in means.keys(): # extract data from dataset data: torch.Tensor = dataset[key] # type: ignore # extract mean and std from dict mean = means[key] # type: ignore std = stds[key] # type: ignore # normalize data normalized_data = (data - mean) / std result[key] = normalized_data return result # get dataset ds = datasets.load_dataset( path="random_data.py", split="train", ).with_format("torch") # compute mean (along last axis) means = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} means_sq = {key: torch.zeros(ds[key][0].shape[-1]) for key in ds.column_names} for batch in ds.iter(batch_size=8): for key in ds.column_names: data = batch[key] batch_size = data.shape[0] data = data.reshape(-1, data.shape[-1]) means[key] += data.mean(dim=0) / len(ds) * batch_size means_sq[key] += (data**2).mean(dim=0) / len(ds) * batch_size # compute std (along last axis) stds = {key: torch.sqrt(means_sq[key] - means[key] ** 2) for key in ds.column_names} # normalize each feature of the dataset ds_normalized = ds.map( desc="Applying mean/std", # type: ignore function=apply_mean_std, batched=False, fn_kwargs={ "means": means, "stds": stds, }, ) ``` ### Expected behavior Using the previous scripts, the `ds_normalized` mapping completes in ~5 minutes, but any subsequent use of `ds_normalized` is really really slow, for example reapplying `apply_mean_std` to `ds_normalized` takes forever. This is very strange, I'm sure I must be missing something, but I would still expect this to be faster. ### Environment info - `datasets` version: 2.13.1 - Platform: Linux-3.10.0-1160.66.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 I think `batch_size/writer_batch_size` is already at its lowest in the 2nd `.map` since `batched=False` implies `batch_size=1` and `len(ds) = 1000 = writer_batch_size`. Here is also a bunch of stack traces when I interrupted the process: <details> <summary>stack trace 1</summary> ```python (pyg)[d623204@rosetta-bigviz01 stage-laurent-f]$ python src/random_scripts/uses_random_data.py Found cached dataset random_data (/local_scratch/lfainsin/.cache/huggingface/datasets/random_data/default/0.0.0/444e214e1d0e6298cfd3f2368323ec37073dc1439f618e19395b1f421c69b066) Applying mean/std: 97%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 967/1000 [00:01<00:00, 534.87 examples/s]Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3449, in _map_single writer.write(example) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 263, in _cast_to_python_objects def _cast_to_python_objects(obj: Any, only_1d_for_numpy: bool, optimize_list_casting: bool) -> Tuple[Any, bool]: KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs_new/data/users/lfainsin/stage-laurent-f/src/random_scripts/uses_random_data.py", line 62, in <module> ds_normalized = ds.map( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3492, in _map_single writer.finalize() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 584, in finalize self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in <listcomp> [ KeyboardInterrupt ``` </details> <details> <summary>stack trace 2</summary> ```python (pyg)[d623204@rosetta-bigviz01 stage-laurent-f]$ python src/random_scripts/uses_random_data.py Found cached dataset random_data (/local_scratch/lfainsin/.cache/huggingface/datasets/random_data/default/0.0.0/444e214e1d0e6298cfd3f2368323ec37073dc1439f618e19395b1f421c69b066) Applying mean/std: 99%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 988/1000 [00:20<00:00, 526.19 examples/s]Applying mean/std: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊| 999/1000 [00:21<00:00, 9.66 examples/s]Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3449, in _map_single writer.write(example) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 263, in _cast_to_python_objects def _cast_to_python_objects(obj: Any, only_1d_for_numpy: bool, optimize_list_casting: bool) -> Tuple[Any, bool]: KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs_new/data/users/lfainsin/stage-laurent-f/src/random_scripts/uses_random_data.py", line 62, in <module> ds_normalized = ds.map( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3492, in _map_single writer.finalize() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 584, in finalize self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 291, in _cast_to_python_objects if config.JAX_AVAILABLE and "jax" in sys.modules: KeyboardInterrupt ``` </details> <details> <summary>stack trace 3</summary> ```python (pyg)[d623204@rosetta-bigviz01 stage-laurent-f]$ python src/random_scripts/uses_random_data.py Found cached dataset random_data (/local_scratch/lfainsin/.cache/huggingface/datasets/random_data/default/0.0.0/444e214e1d0e6298cfd3f2368323ec37073dc1439f618e19395b1f421c69b066) Applying mean/std: 99%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 989/1000 [00:01<00:00, 504.80 examples/s]Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3449, in _map_single writer.write(example) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 490, in write self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( KeyboardInterrupt During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 179, in __arrow_array__ storage = to_pyarrow_listarray(data, pa_type) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 1466, in to_pyarrow_listarray return pa.array(data, pa_type.storage_dtype) File "pyarrow/array.pxi", line 320, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 123, in pyarrow.lib.check_status pyarrow.lib.ArrowTypeError: Could not convert tensor([[-1.0273, -0.8037, -0.6860], [-0.5034, -1.2685, -0.0558], [-1.0908, -1.1820, -0.3178], ..., [-0.8171, 0.1781, -0.5903], [ 0.4370, 1.9305, 0.5899], [-0.1426, 0.9053, -1.7559]]) with type Tensor: was not a sequence or recognized null for conversion to list type During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/gpfs_new/data/users/lfainsin/stage-laurent-f/src/random_scripts/uses_random_data.py", line 62, in <module> ds_normalized = ds.map( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 580, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 545, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3087, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3492, in _map_single writer.finalize() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 584, in finalize self.write_examples_on_file() File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 448, in write_examples_on_file self.write_batch(batch_examples=batch_examples) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 553, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/arrow_writer.py", line 223, in __arrow_array__ return pa.array(cast_to_python_objects(data, only_1d_for_numpy=True)) File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 446, in cast_to_python_objects return _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 407, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 408, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 319, in _cast_to_python_objects [ File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 320, in <listcomp> _cast_to_python_objects( File "/local_scratch/lfainsin/.conda/envs/pyg/lib/python3.10/site-packages/datasets/features/features.py", line 298, in _cast_to_python_objects if obj.ndim == 0: KeyboardInterrupt ``` </details>
[ -0.23888099193572998, -0.4203942120075226, 0.11454978585243225, 0.01367790624499321, 0.38200873136520386, -0.02695149928331375, -0.09978479146957397, 0.28061017394065857, 0.28092217445373535, 0.42724764347076416, -0.14177890121936798, 0.3004530966281891, 0.17234152555465698, -0.09254380315542221, -0.20135711133480072, 0.16480666399002075, 0.012814104557037354, 0.027215860784053802, -0.46503356099128723, -0.02325960248708725, -0.30321356654167175, -0.019846059381961823, -0.08741772174835205, -0.2261495590209961, 0.02980491891503334, 0.05566738545894623, 0.23480741679668427, 0.04804215580224991, -0.13257595896720886, -0.038998790085315704, 0.02572695165872574, 0.33187782764434814, -0.2694392204284668, 0.7168410420417786, -0.00012576166773214936, -0.24600815773010254, 0.38565802574157715, 0.12560486793518066, 0.07028398662805557, -0.14490455389022827, 0.4119063913822174, -0.2381652593612671, 0.07440550625324249, -0.25357335805892944, 0.21299567818641663, 0.09703768789768219, 0.1731753647327423, -0.2661339044570923, 0.2694084942340851, -0.2111963927745819, 0.06430794298648834, 0.16194218397140503, -0.1921634078025818, -0.02156234346330166, 0.04628835618495941, 0.304109662771225, 0.005572371184825897, 0.5163283348083496, 0.18567119538784027, -0.27363821864128113, -0.22961296141147614, 0.35308322310447693, -0.23241183161735535, -0.24688445031642914, 0.4489942193031311, -0.023223470896482468, 0.22934670746326447, -0.1401239037513733, 0.45047977566719055, 0.24075044691562653, -0.05068735405802727, -0.05831998586654663, -0.20002371072769165, -0.23911887407302856, -0.08658799529075623, -0.20893926918506622, 0.15879833698272705, 0.0763239711523056, -0.2498108595609665, -0.1351650357246399, -0.5892239212989807, -0.2015974223613739, 0.19031384587287903, 0.011416981928050518, -0.41549140214920044, -0.11164214462041855, -0.11775705218315125, 0.27343928813934326, 0.4124731719493866, -0.20074543356895447, -0.43840664625167847, -0.04841908812522888, 0.2957547903060913, 0.1649416983127594, -0.22380661964416504, 0.1342388391494751, 0.24506248533725739, -0.2066878378391266, 0.19872993230819702, 0.02951992303133011, -0.32746148109436035, 0.20284657180309296, -0.1723247766494751, 0.11157134175300598, 0.28773513436317444, 0.2299206256866455, -0.07176719605922699, 0.16607189178466797, 0.47925078868865967, 0.24024483561515808, -0.1251082718372345, 0.07817921787500381, 0.34749478101730347, -0.26293981075286865, 0.2062152624130249, -0.19157515466213226, 0.08132031559944153, -0.32711222767829895, -0.08810855448246002, 0.23380692303180695, -0.023116983473300934, 0.16657449305057526, 0.0541435144841671, 0.2664797008037567, 0.2880164384841919, 0.03394807502627373, 0.05194924771785736, 0.1139814630150795, -0.30280807614326477, 0.26088881492614746, 0.023673702031373978, -0.14034008979797363, -0.3892468214035034, 0.21316216886043549, 0.007915310561656952, -0.11985030770301819, 0.044383108615875244, 0.1521984338760376, 0.07513763755559921, -0.17251801490783691, -0.0070291198790073395, -0.15144768357276917, 0.2898397445678711, 0.311759889125824, -0.2254585176706314, 0.40087464451789856, -0.022290967404842377, -0.03102976828813553, -0.2700271010398865, 0.08179179579019547, 0.022208446636795998, -0.024028241634368896, 0.2052392065525055, 0.015945464372634888, -0.13217268884181976, 0.29703256487846375, -0.0594707727432251, 0.1867315024137497, 0.38606566190719604, -0.24491488933563232, 0.030569281429052353, -0.15452426671981812, -0.3442267179489136, -0.12373925745487213, 0.22804531455039978, 0.5708961486816406, -0.0792028084397316, 0.061522260308265686, 0.03908839449286461, 0.10825639963150024, 0.27754688262939453, 0.3245382606983185, 0.09113742411136627, 0.18433406949043274, -0.295149028301239, 0.029286503791809082, -0.3030865788459778, -0.1607225388288498, -0.4697612524032593, 0.4938766658306122, -0.55758136510849, 0.20389291644096375, 0.021610574796795845, 0.06717267632484436, -0.02055281773209572, -0.06775470077991486, 0.4217858910560608, 0.11313409358263016, -0.04053349792957306, 0.0642205998301506, -0.11549801379442215, -0.1540374457836151, 0.1377406120300293, 0.2166878581047058, 0.24219617247581482, -0.03080795705318451, 0.23239043354988098, -0.31481045484542847, 0.07439734041690826, -0.09870057553052902, 0.11744300276041031, 0.22700977325439453, 0.01741168275475502, 0.15186385810375214, 0.013074025511741638, -0.5110950469970703, -0.424011766910553, 0.12462998926639557, 0.058508679270744324, 0.020974023267626762, -0.3666141629219055, -0.23338085412979126, -0.3189186751842499, -0.06761809438467026, -0.03722742944955826, 0.2750457227230072, -0.12419383227825165, 0.02847856469452381, -0.15731194615364075, 0.12788617610931396, -0.037723951041698456, -0.18904894590377808, -0.06251073628664017, 0.23099103569984436, -0.6582081317901611, 0.15217989683151245, 0.2364165335893631, -0.2917599678039551, -0.031077079474925995, 0.23493507504463196, 0.17351001501083374, -0.3071972131729126, -0.08042377978563309, 0.3030446767807007, -0.16496020555496216, 0.2505459189414978, -0.0531485341489315, 0.4123338758945465, 0.09876082092523575, 0.192022904753685, -0.04778444021940231, 0.2165067344903946, 0.10364969074726105, -0.371297687292099, -0.1601835936307907, 0.31123116612434387, -0.23095887899398804, 0.4938892126083374, -0.17955541610717773, -0.01819901168346405, 0.05718153715133667, -0.03867214173078537, -0.3365512788295746, -0.17156073451042175, 0.4729599952697754, 0.2662584185600281, -0.02222122624516487, 0.05215839296579361, 0.12361421436071396, -0.04062875732779503, 0.453993558883667, -0.35915565490722656, -0.05735054239630699, 0.15214672684669495, -0.03703976050019264, 0.13274547457695007, 0.07663071155548096, -0.22056737542152405, 0.3286638855934143, 0.049584999680519104, 0.08901415765285492, 0.2569698095321655, 0.06748683005571365, -0.041223153471946716, 0.03859072923660278, 0.1568833887577057, 0.05245525389909744, 0.152063250541687, 0.06971380114555359, 0.07846188545227051, -0.28904837369918823, -0.2303764671087265, -0.09772730618715286, 0.26063981652259827, -0.24037621915340424, -0.1001814752817154, -0.2927585244178772, 0.3055819272994995, -0.10294544696807861, 0.22796159982681274, -0.3610994219779968, -0.4794292151927948, -0.338148832321167, 0.3350686728954315, -0.27422136068344116, 0.20275020599365234, 0.20204827189445496, 0.008992224931716919, -0.01044466346502304, -0.11006810516119003, -0.1464834362268448, -0.08160838484764099, -0.019761087372899055, -0.31321653723716736, 0.46844446659088135, -0.32853853702545166, 0.30248504877090454, -0.006484329700469971, -0.14062374830245972, -0.045863401144742966, -0.3811408579349518, -0.01819523051381111, 0.007683472707867622, 0.15184985101222992, 0.13487586379051208, 0.19577734172344208, -0.1746925413608551, 0.029227133840322495, 0.22800779342651367, -0.18603827059268951, -0.0746045783162117, 0.08755359053611755, 0.05278678238391876, 0.0610174760222435, -0.244971364736557, -0.028351765125989914, 0.16690650582313538, -0.30096790194511414, 0.6349741816520691, -0.5413112044334412, 0.19146491587162018, 0.10177934914827347, -0.1899566352367401, -0.06051914021372795, -0.3568724989891052, -0.08746054768562317, -0.1191839948296547, -0.09153535962104797, 0.24307197332382202, 0.018022917211055756, -0.09907539188861847, -0.07739753276109695, 0.11826848238706589, -0.33912333846092224, 0.42038455605506897, -0.3586280941963196, 0.003646053373813629, -0.6129183173179626, 0.41457775235176086, -0.3623543977737427, 0.5213750600814819, 0.24066737294197083, 0.052109912037849426, -0.06067913770675659, 0.11904853582382202, -0.22991332411766052, 0.11621721088886261, 0.01899860054254532, -0.31647324562072754, 0.07239903509616852, 0.38155293464660645, 0.2155790776014328, 0.39129796624183655, 0.23783697187900543, 0.01770208775997162, 0.0695260614156723, 0.03549239784479141, 0.25255534052848816, -0.4628986716270447, -0.47727876901626587, -0.02210593782365322, -0.0734882801771164, -0.16659069061279297, 0.11811310052871704, 0.07371115684509277, 0.03598174452781677, 0.06487427651882172, -0.16818220913410187, -0.21392810344696045, -0.45905959606170654, 0.15326930582523346, -0.020726650953292847, 0.010972069576382637, 0.11573585867881775, 0.32454198598861694, -0.20322832465171814, -0.17255716025829315, 0.22188594937324524, 0.23054184019565582, 0.09045741707086563, -0.14501164853572845, -0.6466357111930847, -0.1134195476770401, -0.5839855074882507, 0.312025785446167, -0.09698416292667389, 0.038543738424777985, -0.1606905311346054, 0.11498793214559555, 0.17899467051029205, -0.1679503172636032, 0.7110087275505066, -0.05402543395757675, 0.2511276304721832, -0.08594151586294174, -0.32301491498947144, -0.4334962069988251, 0.16963255405426025, 0.04335489869117737, 0.6516959071159363, 0.33520564436912537, 0.9209727644920349, -0.5595273971557617, 0.0984170138835907, 0.23311322927474976, 0.10756106674671173, -0.05370820313692093, -0.482727974653244, -0.16164933145046234, -0.3407106399536133, 0.0175735205411911, 0.03870432451367378, 0.07834150642156601, 0.17578011751174927, 0.035294197499752045, -0.26659631729125977, 0.08844099193811417, -0.0042086318135261536, 0.3237605094909668, -0.1250263750553131, 0.03229362145066261, 0.35413670539855957, 0.2597750723361969, 0.1955142319202423, 0.1271650642156601, 0.02885914407670498, 0.33507710695266724, 0.32583028078079224, 0.06455202400684357, 0.02420177310705185, -0.008665759116411209, 0.4252775013446808, 0.5220960378646851, 0.2626708447933197, 0.09232421219348907, 0.00224217027425766, 0.3612261414527893, -0.4305434226989746, -0.019320614635944366, 0.08422957360744476, 0.25744426250457764, 0.005420852452516556, -0.1232181191444397, 0.4518371820449829, 0.11618490517139435, -0.1984424591064453, 0.5560111403465271, 0.05901646614074707, -0.24077928066253662, 0.1654709428548813, -0.022777076810598373, 1.0856151580810547, -0.3258266746997833, 0.016873911023139954, 0.14731673896312714, -0.2032989263534546, 0.29720520973205566, -0.154873788356781, -0.11433054506778717, -0.24449531733989716, -0.22063344717025757, 0.2324163317680359, -0.004680842161178589, 0.23912140727043152, -0.14343780279159546, 0.058082520961761475, 0.26439881324768066, -0.07180655002593994, 0.16438747942447662, 0.059666067361831665, 0.1282811015844345, -0.185276061296463, -0.5459384918212891, -0.16539357602596283, -0.10275986790657043, -0.046446364372968674, 0.1588393747806549, 0.02618120238184929, 0.06112813204526901, -0.07266825437545776, 0.08410345017910004, 0.013736799359321594, -0.03083043545484543, -0.054277267307043076, -0.0644831508398056, -0.21674542129039764, 0.08868424594402313, -0.010880611836910248, 0.003827777225524187, -0.13319244980812073, 0.49164924025535583, -0.07399120926856995, 0.03424706682562828, 0.026431944221258163, 0.15796878933906555, 0.15945857763290405, -0.11559485644102097, -0.024185534566640854, 0.0624251514673233, -0.20603680610656738, -0.3283410668373108, 0.02239171415567398, 0.13847693800926208, -0.15436257421970367, -0.13176029920578003, -0.04287213459610939, -0.2277067005634308, -0.12716728448867798, -0.024350717663764954, 0.18371278047561646, -0.11008131504058838, -0.05849958956241608, 0.18449324369430542, -0.24122527241706848, 0.3736000061035156, -0.08822830766439438, -0.3953046500682831, -0.10393135994672775, 0.634495735168457, 0.010421285405755043, -0.23700863122940063, 0.7087687253952026, -0.07702712714672089, -0.05710796266794205, -0.16444748640060425, 0.33858850598335266, 0.5586377382278442, -0.24462783336639404, 0.21478335559368134, -0.2508840560913086, 0.01168060302734375, -0.10829368233680725, 0.08876387774944305, 0.1030031219124794, -0.5223097801208496, -0.10934809595346451, -0.5039828419685364, -0.4371582567691803, 0.050811268389225006, 0.31664660573005676, 0.1529403179883957, -0.21891142427921295, -0.08608618378639221, -0.23076024651527405, 0.1843235343694687, -0.13626912236213684, 0.005439497530460358, -0.03928055986762047, 0.22095070779323578, 0.1950281411409378, -0.1933629810810089, -0.03922664374113083, -0.20526930689811707, 0.03739861771464348, 0.27980539202690125, -0.25010910630226135, -0.03600414842367172, -0.03938615322113037, 0.2195020169019699, -0.2527807950973511, -0.17280623316764832, 0.3825644254684448, -0.28395652770996094, -0.14871761202812195, -0.4645368456840515, 0.21011124551296234, 0.2932005822658539, -0.0707581639289856, -0.11504864692687988, -0.014532241970300674, 0.3208968937397003, 0.16738751530647278, 0.24592085182666779, -0.06628403067588806, 0.040545351803302765, -0.14622974395751953, 0.10256902873516083, -0.05880538374185562, -0.11613209545612335, -0.32862749695777893, 0.019978441298007965, 0.31452351808547974, 0.0639902651309967, 0.30353280901908875, -0.18932077288627625, -0.22173196077346802, 0.3751179575920105, 0.5794050693511963, 0.3862799406051636, -0.2766030430793762, -0.2456652820110321, 0.1615334302186966, 0.03528717905282974, -0.06660784035921097, 0.23094028234481812, 0.5689198970794678, 0.07470636814832687, 0.03504416346549988, 0.17986057698726654, 0.0219527930021286, -0.14437080919742584, -0.2576483488082886, -0.19037556648254395, 0.1481853723526001, 0.07130447030067444, 0.047217052429914474, 0.21345385909080505, 0.16395673155784607, 0.061141327023506165, 0.3388981819152832, 0.28907161951065063, 0.08657218515872955, 0.4667104482650757, 0.368335098028183, 0.3922780752182007, -0.17793436348438263, 0.45053374767303467, -0.16573300957679749, -0.6048742532730103, 0.05006135255098343, 0.5202893018722534, 0.002904728055000305, 0.21429771184921265, 0.13388647139072418, 0.38824009895324707, -0.3346572518348694, -0.44256049394607544, -0.2183568775653839, 0.24097588658332825, -0.34840911626815796, -0.24051988124847412, -0.1277104914188385, -0.16644835472106934, -0.19621475040912628, 0.20828934013843536, 0.02846672013401985, -0.013913866132497787, 0.583319902420044, -0.05597822740674019, 0.07471881806850433, -0.16509905457496643, -0.13108569383621216, -0.15083187818527222, 0.5593531727790833, -0.4249300956726074, -0.058273643255233765, 0.08508919924497604, 0.20149405300617218, 0.005659561604261398, 0.09891647845506668, 0.22191698849201202, 0.5954395532608032, -0.3441551625728607, 0.17371316254138947, 0.007832694798707962, 0.0002804398536682129, -0.0733645111322403, 0.3781745433807373, -0.023917317390441895, 0.43066132068634033, 0.35236304998397827, -0.07691127061843872, -0.19672952592372894, -0.13659851253032684, 0.16856640577316284, 0.1623258739709854, -0.1707630306482315, 0.0013055577874183655, -0.10554943978786469, -0.2826889455318451, 0.04362761974334717, -0.23438489437103271, -0.15561634302139282, -0.2667936086654663, 0.015271030366420746, -0.2012171596288681, 0.04535336047410965, -0.3328709006309509, 0.04075251519680023, -0.1899547129869461, 0.3805100619792938, 0.3659440577030182, -0.0041065337136387825, -0.44092532992362976, -0.18570677936077118, -0.6614761352539062, 0.21573391556739807, -0.13150663673877716, -0.1283673644065857, 0.21142730116844177, 0.2039782553911209, 0.0662599727511406, -0.03784913942217827, -0.030719347298145294, -0.18035286664962769, 0.2537330985069275, 0.3709222972393036, 0.0629953145980835, -0.04947522655129433, -0.24363355338573456, -0.31671440601348877, 0.06748946011066437, -0.4301900565624237, 0.3383392095565796, -0.3967214524745941, -0.06871291249990463, 0.0988791435956955, 0.2348305732011795, -0.3199450373649597, 0.2399914711713791, 0.6963927149772644, 0.38060489296913147, 0.17886653542518616, -0.0882883295416832, -0.21704953908920288, -0.27396151423454285, 0.1600954234600067, -0.18827414512634277, 0.22882716357707977, -0.11228379607200623, 0.4331352114677429, -0.1477871537208557, 0.11189840734004974, -0.22905504703521729, 0.18503662943840027, -0.04645007103681564, -0.05673547834157944, -0.06749781221151352, -0.04833723604679108, -0.004544124007225037, 0.07446648180484772, 0.07342499494552612, 0.44285205006599426, 0.11574986577033997, 0.4185824394226074, -0.19462671875953674, -0.3257077932357788, 0.4559101462364197, -0.25945666432380676, -0.6162010431289673, 0.15928494930267334, 0.29199814796447754, 0.23965638875961304, -0.2519022524356842, -0.29562661051750183, -0.012355700135231018, 0.15429812669754028, -0.04089231789112091, -0.10765590518712997, 0.22024521231651306, -0.45446211099624634, -0.4066636264324188, -0.08461333066225052, 0.3272373676300049, 0.1267106533050537, -0.3212856352329254, 0.18627029657363892, -0.1217784658074379 ]
https://github.com/huggingface/datasets/issues/6075
This code behaves as expected on my local machine or in Colab. Which version of `soundfile` do you have installed? MP3 requires `soundfile>=0.12.1`.
Error loading music files using `load_dataset`
### Describe the bug I tried to load a music file using `datasets.load_dataset()` from the repository - https://huggingface.co/datasets/susnato/pop2piano_real_music_test I got the following error - ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__ return self._getitem(key) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2788, in _getitem formatted_output = format_table( File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 629, in format_table return formatter(pa_table, query_type=query_type) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 398, in __call__ return self.format_column(pa_table) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 442, in format_column column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 218, in decode_column return self.features.decode_column(column, column_name) if self.features else column File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/features.py", line 1924, in decode_column [decode_nested_example(self[column_name], value) if value is not None else None for value in column] File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/features.py", line 1924, in <listcomp> [decode_nested_example(self[column_name], value) if value is not None else None for value in column] File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/features.py", line 1325, in decode_nested_example return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/audio.py", line 184, in decode_example array, sampling_rate = sf.read(f) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 372, in read with SoundFile(file, 'r', samplerate, channels, File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 740, in __init__ self._file = self._open(file, mode_int, closefd) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 1264, in _open _error_check(_snd.sf_error(file_ptr), File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 1455, in _error_check raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) RuntimeError: Error opening <_io.BufferedReader name='/home/susnato/.cache/huggingface/datasets/downloads/d2b09cb974b967b13f91553297c40c0f02f3c0d4c8356350743598ff48d6f29e'>: Format not recognised. ``` ### Steps to reproduce the bug Code to reproduce the error - ```python from datasets import load_dataset ds = load_dataset("susnato/pop2piano_real_music_test", split="test") print(ds[0]) ``` ### Expected behavior I should be able to read the music file without any error. ### Environment info - `datasets` version: 2.14.0 - Platform: Linux-5.19.0-50-generic-x86_64-with-glibc2.35 - Python version: 3.9.16 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
23
Error loading music files using `load_dataset` ### Describe the bug I tried to load a music file using `datasets.load_dataset()` from the repository - https://huggingface.co/datasets/susnato/pop2piano_real_music_test I got the following error - ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__ return self._getitem(key) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2788, in _getitem formatted_output = format_table( File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 629, in format_table return formatter(pa_table, query_type=query_type) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 398, in __call__ return self.format_column(pa_table) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 442, in format_column column = self.python_features_decoder.decode_column(column, pa_table.column_names[0]) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/formatting/formatting.py", line 218, in decode_column return self.features.decode_column(column, column_name) if self.features else column File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/features.py", line 1924, in decode_column [decode_nested_example(self[column_name], value) if value is not None else None for value in column] File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/features.py", line 1924, in <listcomp> [decode_nested_example(self[column_name], value) if value is not None else None for value in column] File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/features.py", line 1325, in decode_nested_example return schema.decode_example(obj, token_per_repo_id=token_per_repo_id) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/datasets/features/audio.py", line 184, in decode_example array, sampling_rate = sf.read(f) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 372, in read with SoundFile(file, 'r', samplerate, channels, File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 740, in __init__ self._file = self._open(file, mode_int, closefd) File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 1264, in _open _error_check(_snd.sf_error(file_ptr), File "/home/susnato/anaconda3/envs/p2p/lib/python3.9/site-packages/soundfile.py", line 1455, in _error_check raise RuntimeError(prefix + _ffi.string(err_str).decode('utf-8', 'replace')) RuntimeError: Error opening <_io.BufferedReader name='/home/susnato/.cache/huggingface/datasets/downloads/d2b09cb974b967b13f91553297c40c0f02f3c0d4c8356350743598ff48d6f29e'>: Format not recognised. ``` ### Steps to reproduce the bug Code to reproduce the error - ```python from datasets import load_dataset ds = load_dataset("susnato/pop2piano_real_music_test", split="test") print(ds[0]) ``` ### Expected behavior I should be able to read the music file without any error. ### Environment info - `datasets` version: 2.14.0 - Platform: Linux-5.19.0-50-generic-x86_64-with-glibc2.35 - Python version: 3.9.16 - Huggingface_hub version: 0.15.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 This code behaves as expected on my local machine or in Colab. Which version of `soundfile` do you have installed? MP3 requires `soundfile>=0.12.1`.
[ -0.23908644914627075, 0.018336132168769836, -0.09103650599718094, 0.4606196880340576, 0.40761128067970276, -0.08961315453052521, 0.20931857824325562, 0.24716609716415405, -0.10778579115867615, 0.07141637057065964, -0.30748721957206726, 0.44494470953941345, -0.031737320125103, -0.10553357005119324, 0.08245271444320679, -0.16889458894729614, 0.012421831488609314, 0.10818792879581451, 0.1071992889046669, 0.2047397643327713, -0.4108785390853882, 0.34053489565849304, -0.33753371238708496, 0.1430414915084839, -0.2738106846809387, -0.013408578932285309, 0.048401325941085815, 0.3472689390182495, -0.3948429226875305, -0.4305104613304138, 0.13972747325897217, 0.04713500663638115, 0.14381086826324463, 0.6482419967651367, -0.0001046714824042283, 0.1015234887599945, 0.30860114097595215, -0.11870791763067245, -0.3150548040866852, -0.337666392326355, -0.46829771995544434, -0.07509183138608932, 0.07213513553142548, 0.0217047780752182, -0.03742524981498718, -0.35644617676734924, -0.32888883352279663, -0.39606982469558716, 0.4451804459095001, 0.4218829274177551, 0.3180524706840515, 0.005982980132102966, 0.08716405928134918, -0.20945397019386292, 0.2799549996852875, 0.10818661004304886, 0.07896685600280762, 0.43559107184410095, 0.31619706749916077, -0.019603777676820755, 0.08895106613636017, 0.21994155645370483, -0.18228036165237427, 0.09964090585708618, 0.27051037549972534, -0.06575961410999298, -0.006434895098209381, -0.10531975328922272, 0.26442816853523254, 0.10778428614139557, 0.7009289860725403, -0.23771491646766663, -0.3620317578315735, -0.13650749623775482, 0.19188982248306274, -0.1553173065185547, 0.10021158307790756, 0.10296885669231415, -0.1614103764295578, 0.15935471653938293, -0.024992307648062706, -0.15759439766407013, -0.02263762801885605, 0.15278394520282745, 0.12488144636154175, -0.056040700525045395, -0.15850430727005005, -0.006355367600917816, 0.28608033061027527, -0.22656068205833435, -0.005088143050670624, 0.028080735355615616, -0.210901141166687, 0.28104960918426514, -0.39699554443359375, 0.2609572410583496, -0.11122149229049683, -0.05755108967423439, 0.1662202626466751, 0.13252906501293182, 0.29928651452064514, 0.11031229794025421, -0.005434632301330566, 0.19590947031974792, 0.3282509744167328, 0.029436815530061722, -0.03840168938040733, 0.05460474640130997, 0.2994060516357422, 0.1882697343826294, 0.03505004197359085, -0.11894109845161438, -0.3040357232093811, -0.31900984048843384, 0.023130066692829132, -0.022986959666013718, 0.45090168714523315, -0.29805946350097656, -0.35926952958106995, -0.011654989793896675, -0.0786370113492012, 0.00007272139191627502, 0.12120170146226883, 0.39650958776474, 0.12178745865821838, 0.28586551547050476, 0.15632674098014832, 0.3789723813533783, -0.047286465764045715, 0.04534594342112541, -0.19305282831192017, -0.06428366154432297, -0.14035719633102417, -0.041311975568532944, 0.3622884750366211, -0.47906672954559326, 0.3036397695541382, 0.22420501708984375, 0.08447828888893127, -0.37467604875564575, 0.04036819934844971, -0.12645602226257324, -0.15209993720054626, 0.2875877022743225, -0.06751897186040878, 0.07290294021368027, 0.09305298328399658, -0.16221345961093903, 0.020006731152534485, 0.19150041043758392, -0.42052072286605835, -0.32257920503616333, -0.18253813683986664, 0.354893296957016, -0.1470288336277008, 0.2527434825897217, -0.5352618098258972, -0.048227448016405106, 0.1043207198381424, -0.3685171902179718, -0.11072941869497299, -0.06903457641601562, -0.15861934423446655, -0.13462132215499878, 0.3581819236278534, 0.40560054779052734, -0.25592684745788574, -0.015860125422477722, -0.003922495990991592, -0.12621159851551056, 0.0316535085439682, 0.22537055611610413, -0.2639249861240387, 0.10733741521835327, -0.37277936935424805, -0.03664589673280716, 0.42440348863601685, -0.24477654695510864, -0.42568790912628174, 0.08922196179628372, -0.13839900493621826, 0.13270780444145203, -0.037528228014707565, -0.2159757763147354, 0.06078975275158882, -0.027656085789203644, 0.37718191742897034, 0.22439417243003845, 0.14638930559158325, 0.2683536410331726, -0.1662890613079071, -0.034462105482816696, 0.0004222588613629341, 0.3315257132053375, -0.17586985230445862, 0.058234360069036484, 0.1205528974533081, 0.11119738221168518, 0.15415039658546448, 0.03840702027082443, -0.10710661858320236, 0.1177087277173996, 0.0051516019739210606, 0.019170742481946945, 0.09897968918085098, -0.16250371932983398, -0.18615801632404327, 0.08177031576633453, -0.04016818106174469, 0.0427442342042923, -0.4282327890396118, -0.17601685225963593, -0.48320794105529785, 0.15497827529907227, -0.44244810938835144, -0.05318587273359299, 0.22108638286590576, 0.1799997091293335, -0.11801992356777191, 0.17649123072624207, -0.11709211021661758, 0.25277405977249146, 0.0995669960975647, -0.012792475521564484, -0.3096620738506317, 0.06558914482593536, -0.0929180383682251, 0.02652527391910553, 0.26722538471221924, 0.284548282623291, 0.3690633177757263, -0.07268940657377243, -0.26882612705230713, 0.5382435321807861, 0.24079665541648865, 0.07343631982803345, -0.14502036571502686, -0.1417890340089798, 0.0933917909860611, -0.26159852743148804, 0.00978914462029934, 0.12999160587787628, 0.3000153601169586, -0.09758598357439041, -0.0811118334531784, 0.2897465229034424, -0.2223450094461441, 0.061654794961214066, -0.012172721326351166, -0.14692147076129913, 0.37553220987319946, 0.23296374082565308, -0.039453648030757904, -0.006869673728942871, 0.16447752714157104, 0.16922250390052795, 0.21935835480690002, 0.1261439323425293, -0.028163276612758636, -0.24172155559062958, 0.14220620691776276, -0.11120116710662842, 0.0343310609459877, 0.05627593770623207, -0.1779240071773529, -0.21490031480789185, 0.019543452188372612, 0.19601261615753174, 0.46652451157569885, 0.15615719556808472, -0.1526409238576889, -0.025598812848329544, 0.1490902304649353, -0.2366379052400589, 0.29029977321624756, 0.09267251193523407, 0.17193971574306488, 0.49539053440093994, 0.13850076496601105, -0.0427667573094368, -0.2816161811351776, -0.20489808917045593, 0.1364055573940277, 0.3968730866909027, -0.4860048294067383, -0.09429813921451569, -0.3528728187084198, -0.21411679685115814, 0.043898098170757294, -0.20193301141262054, -0.11580345034599304, -0.18880482017993927, 0.023767776787281036, 0.17077402770519257, -0.02480241283774376, 0.10398249328136444, -0.09917065501213074, 0.29977917671203613, 0.11199831962585449, -0.05952773243188858, -0.10148448497056961, -0.045574676245450974, -0.030993102118372917, 0.15188944339752197, 0.4908102750778198, 0.19198155403137207, 0.28280287981033325, -0.24197587370872498, 0.0621008574962616, -0.016196781769394875, 0.22676225006580353, 0.030379077419638634, 0.15414442121982574, 0.12345131486654282, 0.0642910748720169, 0.1354442536830902, 0.1749359667301178, -0.173142671585083, 0.34912875294685364, -0.10245046019554138, -0.10335996747016907, 0.35262420773506165, 0.049488674849271774, 0.08198894560337067, -0.21814848482608795, -0.2474304735660553, -0.2785748839378357, -0.5099348425865173, 0.014945068396627903, -0.17626440525054932, -0.0561235137283802, 0.3953647315502167, 0.06910470128059387, 0.29629743099212646, 0.1640607714653015, 0.2270093560218811, -0.30080446600914, -0.2620137631893158, 0.22857873141765594, -0.15878531336784363, -0.29197338223457336, 0.08248259127140045, 0.15716540813446045, 0.025002706795930862, 0.10819247364997864, -0.22918084263801575, -0.15976767241954803, 0.17915351688861847, 0.09485261142253876, -0.35544633865356445, -0.07324101775884628, 0.06547597795724869, 0.04879051446914673, -0.09171361476182938, -0.20928046107292175, -0.17336472868919373, -0.11927461624145508, -0.253945529460907, -0.013907331973314285, -0.03872251883149147, 0.42526108026504517, -0.22075027227401733, 0.37190520763397217, 0.006241641938686371, 0.04873954877257347, 0.37384122610092163, -0.09966588765382767, 0.41760674118995667, -0.1773032546043396, -0.26475220918655396, -0.06743128597736359, 0.009750597178936005, -0.008440546691417694, 0.15795721113681793, 0.05890648439526558, 0.030433470383286476, -0.29107797145843506, 0.2002491056919098, -0.20126664638519287, -0.03423680365085602, 0.02620674856007099, -0.14101608097553253, 0.16331864893436432, -0.013137783855199814, 0.2360924333333969, 0.14433522522449493, -0.04498055577278137, -0.0284744743257761, 0.306829571723938, 0.12137901782989502, -0.038071710616350174, -0.26569247245788574, 0.04530298709869385, -0.22088488936424255, 0.3005824089050293, 0.12201972305774689, 0.535332202911377, -0.14008957147598267, 0.00839553028345108, 0.009704150259494781, -0.1218048557639122, 0.5289768576622009, -0.053393684327602386, 0.16079847514629364, 0.25683802366256714, 0.07392169535160065, -0.3398493528366089, -0.03938568755984306, -0.15823251008987427, 0.2956883907318115, -0.16600434482097626, 0.48952993750572205, -0.19891676306724548, -0.2532891035079956, 0.010928267613053322, 0.18394915759563446, 0.053100794553756714, -0.23365971446037292, -0.3385901153087616, -0.3754463493824005, -0.3663494884967804, -0.09998749196529388, 0.13425001502037048, 0.3706296980381012, -0.2422025203704834, 0.01770651340484619, 0.06470148265361786, 0.26799726486206055, 0.09320911020040512, 0.1276710033416748, 0.5023238658905029, 0.26196059584617615, 0.10281269997358322, 0.37771058082580566, -0.001011379063129425, 0.3845022916793823, 0.5984044671058655, -0.020222719758749008, -0.2223510444164276, 0.051233913749456406, -0.08030395954847336, -0.11985482275485992, 0.11966349184513092, -0.1594194769859314, -0.013089824467897415, -0.0989704430103302, -0.12039880454540253, -0.13235944509506226, 0.06874382495880127, 0.3295811712741852, -0.06342512369155884, -0.37029945850372314, -0.6057953834533691, 0.24080060422420502, -0.11831118166446686, -0.09192341566085815, 0.20165735483169556, -0.0751282125711441, -0.17650091648101807, 0.2478816956281662, -0.28445765376091003, 0.6320363283157349, -0.049480073153972626, 0.14042317867279053, 0.3282921314239502, -0.214329332113266, 0.1869024932384491, -0.058918099850416183, -0.06177540495991707, -0.14846602082252502, -0.2799531817436218, 0.06482283771038055, -0.11580111086368561, -0.04016650840640068, 0.03263632208108902, -0.11802395433187485, -0.004670541733503342, 0.015182077884674072, 0.06603120267391205, 0.026646733283996582, 0.25962698459625244, -0.0826139748096466, -0.2043207585811615, -0.4769589304924011, 0.2725488841533661, -0.36430850625038147, -0.00009966827929019928, -0.12684482336044312, 0.02318771928548813, -0.06362905353307724, -0.20162203907966614, -0.19786792993545532, 0.1951514184474945, -0.3176821172237396, 0.3065721094608307, -0.18934524059295654, -0.4162079095840454, 0.20844170451164246, 0.22940464317798615, -0.2542090117931366, 0.17383603751659393, -0.23187972605228424, 0.12189359962940216, -0.10893658548593521, 0.1368831843137741, -0.13249361515045166, 0.16281655430793762, 0.06024126708507538, -0.012419149279594421, -0.1386708915233612, -0.005428217351436615, -0.10084335505962372, -0.21249344944953918, 0.03516402840614319, 0.08254078030586243, 0.15025481581687927, -0.19416490197181702, -0.4365387260913849, -0.3921509385108948, 0.1409311294555664, -0.21102918684482574, 0.2089645266532898, 0.2674507796764374, -0.1858348399400711, -0.13751579821109772, 0.14175528287887573, -0.2519843876361847, 0.08373768627643585, 0.5094395875930786, -0.26682746410369873, -0.13352999091148376, 0.4956059157848358, 0.0948796421289444, -0.10318764299154282, -0.27992966771125793, 0.32558512687683105, 0.007085088640451431, -0.6049143075942993, 0.15522883832454681, 0.17593201994895935, 0.02598799765110016, -0.024225832894444466, 0.21813717484474182, 0.07657645642757416, -0.15012715756893158, 0.18730668723583221, -0.715355396270752, -0.292196661233902, 0.13167132437229156, 0.06122906133532524, 0.1762274205684662, 0.12547963857650757, -0.18917988240718842, 0.008175313472747803, -0.2446868121623993, -0.3715771436691284, 0.26643481850624084, -0.0707586258649826, 0.023067276924848557, 0.058707766234874725, -0.07099893689155579, 0.061038222163915634, -0.18042458593845367, 0.22668758034706116, 0.0649370402097702, -0.20764577388763428, -0.2914346158504486, -0.06474169343709946, 0.08980774879455566, -0.007870224304497242, -0.2539294958114624, -0.12932872772216797, -0.15745945274829865, -0.13143214583396912, -0.08680257201194763, 0.13414612412452698, 0.21616534888744354, -0.003463711589574814, -0.0949687510728836, 0.02594539150595665, 0.06404180824756622, -0.05781850963830948, 0.2776145040988922, -0.009889539331197739, -0.05079362168908119, 0.06899137794971466, 0.06460478156805038, -0.17418698966503143, -0.020398087799549103, -0.2133985012769699, 0.17950989305973053, 0.09185303747653961, 0.0906767025589943, 0.33929941058158875, -0.4668278694152832, 0.20115742087364197, 0.2075108140707016, 0.3983936011791229, 0.41403627395629883, -0.37900441884994507, 0.09429141879081726, 0.10266587138175964, 0.2724880278110504, -0.2637813687324524, -0.12296853959560394, 0.1299503743648529, -0.13501816987991333, -0.11309673637151718, -0.02865327149629593, 0.010874830186367035, -0.17767634987831116, -0.1945590227842331, 0.024468980729579926, 0.5174505114555359, 0.19534820318222046, 0.08508361876010895, 0.37498190999031067, -0.06895860284566879, 0.16606435179710388, 0.018234113231301308, -0.025887615978717804, 0.0370616652071476, 0.2744229733943939, -0.33492472767829895, 0.2950940728187561, 0.0964265987277031, 0.06657692790031433, -0.037826985120773315, -0.5749416351318359, -0.013625682331621647, 0.32368898391723633, -0.09370016306638718, 0.15383508801460266, 0.05042627826333046, 0.3930080533027649, -0.355471134185791, -0.06081315129995346, 0.008264780044555664, -0.1139640286564827, -0.20409107208251953, 0.04960241913795471, -0.17466619610786438, -0.3110206127166748, -0.16502755880355835, 0.10266482084989548, -0.20189183950424194, 0.13705116510391235, -0.08340036123991013, 0.022708149626851082, -0.00988340750336647, -0.29465511441230774, 0.03146839514374733, 0.3783249258995056, -0.007583234459161758, -0.354983925819397, 0.20140650868415833, 0.23824618756771088, 0.11429654061794281, 0.4330645203590393, 0.20924261212348938, 0.5430935621261597, 0.33562231063842773, -0.037091389298439026, 0.029750429093837738, 0.016856111586093903, 0.009519703686237335, 0.006819471716880798, 0.18457134068012238, 0.30152297019958496, 0.12401150166988373, 0.3453789949417114, 0.26516103744506836, -0.14842888712882996, -0.005533487536013126, 0.3527411222457886, 0.07580186426639557, -0.12437520921230316, -0.017965562641620636, -0.3596237897872925, -0.1987484097480774, -0.1279391199350357, 0.07554413378238678, -0.17933881282806396, -0.03347234055399895, 0.17785203456878662, 0.28837791085243225, 0.06463241577148438, -0.12414053082466125, 0.13439352810382843, -0.03988253325223923, 0.4534018635749817, 0.3058528006076813, 0.19527924060821533, -0.115678571164608, -0.32341268658638, -0.9951176643371582, 0.17122521996498108, 0.1615038514137268, -0.0430646650493145, 0.17642422020435333, -0.15976418554782867, 0.21938377618789673, 0.19114899635314941, 0.06667350232601166, 0.13581699132919312, 0.14357827603816986, 0.06919561326503754, -0.3428238034248352, -0.3311593532562256, 0.04845111817121506, 0.09558092057704926, -0.09728297591209412, -0.4530346691608429, 0.08220861107110977, -0.11230422556400299, 0.14447081089019775, -0.1507830023765564, -0.05288355052471161, -0.40827667713165283, 0.03617114946246147, 0.33162763714790344, -0.0009889081120491028, 0.3948368728160858, -0.22355347871780396, -0.022797398269176483, -0.1647665649652481, -0.33200085163116455, 0.09061600267887115, 0.3392816185951233, 0.13070425391197205, 0.4094839096069336, 0.11114316433668137, -0.07165996730327606, -0.2454480230808258, 0.2756156027317047, -0.14888644218444824, 0.042025402188301086, -0.610696017742157, 0.09095694124698639, 0.07950576394796371, -0.0604432076215744, -0.0787353515625, -0.10501573979854584, -0.1970432698726654, 0.05279534310102463, -0.0869801789522171, -0.23399263620376587, 0.6291701197624207, -0.268974632024765, -0.2798370122909546, 0.16368037462234497, 0.33734408020973206, -0.0741720125079155, -0.12060913443565369, -0.48834624886512756, 0.32769572734832764, 0.3594090938568115, -0.03601451218128204, -0.3108646869659424, 0.16098062694072723, -0.33890682458877563, 0.017653055489063263, -0.11123208701610565, 0.2396777868270874, 0.06408777087926865, -0.2867424786090851, 0.2112250030040741, -0.3331231474876404 ]
https://github.com/huggingface/datasets/issues/6073
Version 2.3.2 is over one year old, so please use the latest release (2.14.0) to get the expected behavior. Version 2.3.2 does not contain some fixes we made to fix resolving hidden files/directories (starting with a dot).
version2.3.2 load_dataset()data_files can't include .xxxx in path
### Describe the bug First, I cd workdir. Then, I just use load_dataset("json", data_file={"train":"/a/b/c/.d/train/train.json", "test":"/a/b/c/.d/train/test.json"}) that couldn't work and <FileNotFoundError: Unable to find '/a/b/c/.d/train/train.jsonl' at /a/b/c/.d/> And I debug, it is fine in version2.1.2 So there maybe a bug in path join. Here is the whole bug report: /x/datasets/loa │ │ d.py:1656 in load_dataset │ │ │ │ 1653 │ ignore_verifications = ignore_verifications or save_infos │ │ 1654 │ │ │ 1655 │ # Create a dataset builder │ │ ❱ 1656 │ builder_instance = load_dataset_builder( │ │ 1657 │ │ path=path, │ │ 1658 │ │ name=name, │ │ 1659 │ │ data_dir=data_dir, │ │ │ │ x/datasets/loa │ │ d.py:1439 in load_dataset_builder │ │ │ │ 1436 │ if use_auth_token is not None: │ │ 1437 │ │ download_config = download_config.copy() if download_config e │ │ 1438 │ │ download_config.use_auth_token = use_auth_token │ │ ❱ 1439 │ dataset_module = dataset_module_factory( │ │ 1440 │ │ path, │ │ 1441 │ │ revision=revision, │ │ 1442 │ │ download_config=download_config, │ │ │ │ x/datasets/loa │ │ d.py:1097 in dataset_module_factory │ │ │ │ 1094 │ │ │ 1095 │ # Try packaged │ │ 1096 │ if path in _PACKAGED_DATASETS_MODULES: │ │ ❱ 1097 │ │ return PackagedDatasetModuleFactory( │ │ 1098 │ │ │ path, │ │ 1099 │ │ │ data_dir=data_dir, │ │ 1100 │ │ │ data_files=data_files, │ │ │ │x/datasets/loa │ │ d.py:743 in get_module │ │ │ │ 740 │ │ │ if self.data_dir is not None │ │ 741 │ │ │ else get_patterns_locally(str(Path().resolve())) │ │ 742 │ │ ) │ │ ❱ 743 │ │ data_files = DataFilesDict.from_local_or_remote( │ │ 744 │ │ │ patterns, │ │ 745 │ │ │ use_auth_token=self.download_config.use_auth_token, │ │ 746 │ │ │ base_path=str(Path(self.data_dir).resolve()) if self.data │ │ │ │ x/datasets/dat │ │ a_files.py:590 in from_local_or_remote │ │ │ │ 587 │ │ out = cls() │ │ 588 │ │ for key, patterns_for_key in patterns.items(): │ │ 589 │ │ │ out[key] = ( │ │ ❱ 590 │ │ │ │ DataFilesList.from_local_or_remote( │ │ 591 │ │ │ │ │ patterns_for_key, │ │ 592 │ │ │ │ │ base_path=base_path, │ │ 593 │ │ │ │ │ allowed_extensions=allowed_extensions, │ │ │ │ /x/datasets/dat │ │ a_files.py:558 in from_local_or_remote │ │ │ │ 555 │ │ use_auth_token: Optional[Union[bool, str]] = None, │ │ 556 │ ) -> "DataFilesList": │ │ 557 │ │ base_path = base_path if base_path is not None else str(Path() │ │ ❱ 558 │ │ data_files = resolve_patterns_locally_or_by_urls(base_path, pa │ │ 559 │ │ origin_metadata = _get_origin_metadata_locally_or_by_urls(data │ │ 560 │ │ return cls(data_files, origin_metadata) │ │ 561 │ │ │ │ /x/datasets/dat │ │ a_files.py:195 in resolve_patterns_locally_or_by_urls │ │ │ │ 192 │ │ if is_remote_url(pattern): │ │ 193 │ │ │ data_files.append(Url(pattern)) │ │ 194 │ │ else: │ │ ❱ 195 │ │ │ for path in _resolve_single_pattern_locally(base_path, pat │ │ 196 │ │ │ │ data_files.append(path) │ │ 197 │ │ │ 198 │ if not data_files: │ │ │ │ /x/datasets/dat │ │ a_files.py:145 in _resolve_single_pattern_locally │ │ │ │ 142 │ │ error_msg = f"Unable to find '{pattern}' at {Path(base_path).r │ │ 143 │ │ if allowed_extensions is not None: │ │ 144 │ │ │ error_msg += f" with any supported extension {list(allowed │ │ ❱ 145 │ │ raise FileNotFoundError(error_msg) │ │ 146 │ return sorted(out) │ │ 147 ### Steps to reproduce the bug 1. Version=2.3.2 2. In shell, cd workdir.(cd /a/b/c/.d/) 3. load_dataset("json", data_file={"train":"/a/b/c/.d/train/train.json", "test":"/a/b/c/.d/train/test.json"}) ### Expected behavior fix it please~ ### Environment info 2.3.2
37
version2.3.2 load_dataset()data_files can't include .xxxx in path ### Describe the bug First, I cd workdir. Then, I just use load_dataset("json", data_file={"train":"/a/b/c/.d/train/train.json", "test":"/a/b/c/.d/train/test.json"}) that couldn't work and <FileNotFoundError: Unable to find '/a/b/c/.d/train/train.jsonl' at /a/b/c/.d/> And I debug, it is fine in version2.1.2 So there maybe a bug in path join. Here is the whole bug report: /x/datasets/loa │ │ d.py:1656 in load_dataset │ │ │ │ 1653 │ ignore_verifications = ignore_verifications or save_infos │ │ 1654 │ │ │ 1655 │ # Create a dataset builder │ │ ❱ 1656 │ builder_instance = load_dataset_builder( │ │ 1657 │ │ path=path, │ │ 1658 │ │ name=name, │ │ 1659 │ │ data_dir=data_dir, │ │ │ │ x/datasets/loa │ │ d.py:1439 in load_dataset_builder │ │ │ │ 1436 │ if use_auth_token is not None: │ │ 1437 │ │ download_config = download_config.copy() if download_config e │ │ 1438 │ │ download_config.use_auth_token = use_auth_token │ │ ❱ 1439 │ dataset_module = dataset_module_factory( │ │ 1440 │ │ path, │ │ 1441 │ │ revision=revision, │ │ 1442 │ │ download_config=download_config, │ │ │ │ x/datasets/loa │ │ d.py:1097 in dataset_module_factory │ │ │ │ 1094 │ │ │ 1095 │ # Try packaged │ │ 1096 │ if path in _PACKAGED_DATASETS_MODULES: │ │ ❱ 1097 │ │ return PackagedDatasetModuleFactory( │ │ 1098 │ │ │ path, │ │ 1099 │ │ │ data_dir=data_dir, │ │ 1100 │ │ │ data_files=data_files, │ │ │ │x/datasets/loa │ │ d.py:743 in get_module │ │ │ │ 740 │ │ │ if self.data_dir is not None │ │ 741 │ │ │ else get_patterns_locally(str(Path().resolve())) │ │ 742 │ │ ) │ │ ❱ 743 │ │ data_files = DataFilesDict.from_local_or_remote( │ │ 744 │ │ │ patterns, │ │ 745 │ │ │ use_auth_token=self.download_config.use_auth_token, │ │ 746 │ │ │ base_path=str(Path(self.data_dir).resolve()) if self.data │ │ │ │ x/datasets/dat │ │ a_files.py:590 in from_local_or_remote │ │ │ │ 587 │ │ out = cls() │ │ 588 │ │ for key, patterns_for_key in patterns.items(): │ │ 589 │ │ │ out[key] = ( │ │ ❱ 590 │ │ │ │ DataFilesList.from_local_or_remote( │ │ 591 │ │ │ │ │ patterns_for_key, │ │ 592 │ │ │ │ │ base_path=base_path, │ │ 593 │ │ │ │ │ allowed_extensions=allowed_extensions, │ │ │ │ /x/datasets/dat │ │ a_files.py:558 in from_local_or_remote │ │ │ │ 555 │ │ use_auth_token: Optional[Union[bool, str]] = None, │ │ 556 │ ) -> "DataFilesList": │ │ 557 │ │ base_path = base_path if base_path is not None else str(Path() │ │ ❱ 558 │ │ data_files = resolve_patterns_locally_or_by_urls(base_path, pa │ │ 559 │ │ origin_metadata = _get_origin_metadata_locally_or_by_urls(data │ │ 560 │ │ return cls(data_files, origin_metadata) │ │ 561 │ │ │ │ /x/datasets/dat │ │ a_files.py:195 in resolve_patterns_locally_or_by_urls │ │ │ │ 192 │ │ if is_remote_url(pattern): │ │ 193 │ │ │ data_files.append(Url(pattern)) │ │ 194 │ │ else: │ │ ❱ 195 │ │ │ for path in _resolve_single_pattern_locally(base_path, pat │ │ 196 │ │ │ │ data_files.append(path) │ │ 197 │ │ │ 198 │ if not data_files: │ │ │ │ /x/datasets/dat │ │ a_files.py:145 in _resolve_single_pattern_locally │ │ │ │ 142 │ │ error_msg = f"Unable to find '{pattern}' at {Path(base_path).r │ │ 143 │ │ if allowed_extensions is not None: │ │ 144 │ │ │ error_msg += f" with any supported extension {list(allowed │ │ ❱ 145 │ │ raise FileNotFoundError(error_msg) │ │ 146 │ return sorted(out) │ │ 147 ### Steps to reproduce the bug 1. Version=2.3.2 2. In shell, cd workdir.(cd /a/b/c/.d/) 3. load_dataset("json", data_file={"train":"/a/b/c/.d/train/train.json", "test":"/a/b/c/.d/train/test.json"}) ### Expected behavior fix it please~ ### Environment info 2.3.2 Version 2.3.2 is over one year old, so please use the latest release (2.14.0) to get the expected behavior. Version 2.3.2 does not contain some fixes we made to fix resolving hidden files/directories (starting with a dot).
[ -0.0716601088643074, 0.4233098328113556, -0.057822637259960175, 0.46117934584617615, 0.17863152921199799, 0.13693568110466003, 0.22761712968349457, 0.3537435233592987, 0.06425778567790985, -0.1593811959028244, 0.18695884943008423, 0.5130402445793152, -0.099225252866745, 0.10764174908399582, -0.18250375986099243, -0.051775578409433365, 0.17263251543045044, 0.1970537155866623, -0.3572789430618286, 0.13083045184612274, -0.2849864363670349, 0.5683479309082031, -0.16157987713813782, 0.008546127006411552, -0.2708243131637573, 0.32366234064102173, -0.15645115077495575, 0.579368531703949, 0.09783622622489929, -0.23640327155590057, 0.38871079683303833, -0.16279226541519165, 0.40842413902282715, 0.6299089193344116, -0.00011586613982217386, 0.18434584140777588, 0.39381399750709534, -0.004632655531167984, -0.5326491594314575, -0.7496438026428223, -0.49041783809661865, -0.0817829892039299, 0.10338452458381653, -0.07899056375026703, 0.11047188937664032, 0.07026194781064987, -0.055515579879283905, -0.11248703300952911, 0.3147284984588623, 0.20087136328220367, 0.18514655530452728, 0.2963865399360657, 0.320637047290802, -0.17133454978466034, 0.36511608958244324, 0.305916965007782, -0.010106727480888367, 0.24268241226673126, 0.01990986242890358, 0.061060428619384766, 0.2363227903842926, 0.14020460844039917, 0.07367943227291107, -0.10122770816087723, 0.4102001488208771, 0.005014047026634216, 0.14917227625846863, -0.14177273213863373, -0.06254784017801285, 0.22235386073589325, 0.6393230557441711, -0.08248965442180634, -0.43175914883613586, -0.35920417308807373, -0.16818585991859436, 0.07697242498397827, 0.40959489345550537, -0.13980594277381897, 0.017384208738803864, 0.1525314301252365, 0.09962089359760284, -0.020225023850798607, -0.039856649935245514, 0.12981361150741577, 0.20992746949195862, 0.25906819105148315, 0.029875725507736206, 0.14878597855567932, 0.1279965043067932, -0.03027685172855854, 0.19002670049667358, -0.14893123507499695, -0.23689702153205872, -0.015420764684677124, -0.12110612541437149, -0.002992674708366394, 0.04561180621385574, -0.09426388144493103, 0.16608431935310364, 0.13092848658561707, -0.08755150437355042, -0.2797415554523468, -0.18444953858852386, 0.22040250897407532, 0.35290244221687317, -0.09011168777942657, 0.008225742727518082, 0.1444186121225357, 0.3006359934806824, 0.24906407296657562, -0.020213745534420013, 0.0012412704527378082, -0.3214772045612335, -0.46832340955734253, -0.2543788552284241, 0.044443484395742416, 0.22569866478443146, -0.054721537977457047, -0.38505715131759644, -0.3332751989364624, 0.00886690616607666, -0.2540441155433655, 0.1062532365322113, 0.3617952764034271, 0.11721937358379364, 0.16452398896217346, 0.03919500112533569, 0.2148684412240982, 0.21590815484523773, 0.03941016271710396, -0.2133486568927765, 0.07562153041362762, 0.06046895682811737, -0.08744096755981445, -0.01995648443698883, 0.05056440085172653, 0.5139116048812866, -0.21723416447639465, 0.13556186854839325, 0.0417599231004715, -0.05310417339205742, -0.12069857120513916, -0.006327170878648758, 0.3141530454158783, -0.01781749725341797, 0.12623900175094604, -0.1479368507862091, -0.1266225427389145, -0.22302141785621643, 0.15455541014671326, -0.6133893728256226, -0.41892209649086, -0.2679063379764557, 0.12928996980190277, -0.41615572571754456, -0.13249284029006958, -0.23996317386627197, -0.14327570796012878, 0.08270161598920822, -0.41185328364372253, -0.015123292803764343, -0.0718742161989212, -0.20654284954071045, -0.2820952534675598, 0.3870309889316559, 0.34316200017929077, -0.01311543583869934, -0.010952316224575043, -0.013624504208564758, -0.06717079877853394, 0.06728477030992508, 0.04566411301493645, -0.27603599429130554, 0.15766263008117676, -0.5451198220252991, 0.127101868391037, 0.5557776689529419, -0.5641899108886719, -0.11350435018539429, 0.4859558939933777, -0.1179562509059906, -0.07295244187116623, 0.36226174235343933, -0.17701470851898193, -0.2989143431186676, -0.3685341775417328, 0.19035567343235016, 0.4719110131263733, 0.23874065279960632, -0.1262286901473999, -0.16629615426063538, -0.34328019618988037, 0.18473443388938904, 0.04889039695262909, -0.1635442078113556, -0.08386948704719543, 0.10080185532569885, -0.1556459367275238, 0.43141910433769226, -0.19147412478923798, 0.05270100384950638, 0.5051995515823364, 0.32366710901260376, -0.09327586740255356, 0.2649616301059723, -0.036362554877996445, -0.4869992136955261, 0.1800476461648941, -0.06398360431194305, -0.5076830983161926, -0.03828967735171318, 0.013433963060379028, -0.21362584829330444, -0.12735965847969055, -0.4122997224330902, -0.2356177121400833, 0.05304073542356491, 0.1620292365550995, 0.13619208335876465, -0.08534867316484451, -0.2358996570110321, 0.026986805722117424, 0.038842156529426575, 0.005641095340251923, -0.21812546253204346, 0.4173923134803772, -0.024314146488904953, -0.15877950191497803, 0.04376653581857681, 0.4899638593196869, 0.13353703916072845, -0.17075538635253906, -0.06494355201721191, 0.34472334384918213, 0.056974343955516815, 0.43458032608032227, 0.17071092128753662, 0.08862590789794922, -0.1650395393371582, 0.021123498678207397, -0.21361836791038513, 0.1288616955280304, 0.12071558833122253, 0.020637884736061096, -0.13798902928829193, 0.06585829704999924, -0.29412269592285156, 0.37590888142585754, 0.2175278663635254, -0.15010890364646912, 0.335974782705307, -0.1569654792547226, -0.09666737914085388, -0.02067486196756363, 0.031189482659101486, 0.13773754239082336, 0.3410263955593109, 0.26297831535339355, -0.20048388838768005, -0.007896307855844498, 0.4563123285770416, 0.042708128690719604, -0.02907130867242813, 0.09255978465080261, -0.2926853895187378, -0.0991913303732872, -0.18736489117145538, 0.5712787508964539, 0.610680103302002, 0.1874045431613922, 0.2214118391275406, -0.0044759102165699005, 0.07902577519416809, -0.27626606822013855, 0.2761995792388916, -0.02765321359038353, 0.38792893290519714, 0.4224269390106201, 0.2899947762489319, 0.19424764811992645, -0.0746845230460167, -0.25798851251602173, -0.004274193197488785, 0.05890700966119766, -0.4232207238674164, 0.0652497187256813, -0.2765900194644928, -0.2917948067188263, -0.2089693695306778, -0.10842844843864441, -0.05500440672039986, -0.2133921980857849, -0.1858043223619461, 0.26103317737579346, -0.15350951254367828, 0.09515645354986191, -0.08697286248207092, -0.10973495244979858, -0.054955653846263885, -0.5429368019104004, -0.14255273342132568, 0.13944947719573975, -0.259871244430542, -0.0019459128379821777, 0.33589380979537964, -0.10906355082988739, -0.05411610007286072, -0.3750612437725067, -0.005029790103435516, -0.18959593772888184, -0.2553636431694031, -0.01647128164768219, 0.09225611388683319, 0.21243253350257874, 0.47888144850730896, -0.03054511547088623, 0.232239231467247, -0.25007015466690063, 0.16760705411434174, 0.12957650423049927, -0.12865673005580902, 0.12477078288793564, -0.18468615412712097, 0.07643941044807434, -0.22882622480392456, -0.4170071482658386, -0.056077852845191956, -0.4589705765247345, 0.25294172763824463, 0.06759019941091537, 0.04571720212697983, 0.2548462450504303, 0.18569079041481018, 0.3176504969596863, -0.15854808688163757, 0.09637749195098877, 0.03334168344736099, -0.5272014141082764, 0.5637416839599609, -0.09236455708742142, -0.23558956384658813, 0.23646312952041626, -0.24456065893173218, 0.32091596722602844, -0.2312006950378418, -0.3780798017978668, -0.22538283467292786, -0.09419267624616623, 0.29104921221733093, -0.07539667189121246, 0.06345652788877487, 0.17089171707630157, -0.05383925139904022, -0.03157907724380493, -0.2934640049934387, -0.1819794774055481, 0.21465268731117249, 0.30569884181022644, 0.39007699489593506, 0.06318123638629913, 0.2959423065185547, -0.03249981254339218, 0.44025495648384094, 0.2182561159133911, 0.08043387532234192, 0.36100441217422485, -0.18912506103515625, 0.44588804244995117, -0.18452638387680054, -0.031838446855545044, 0.00418352335691452, 0.09472694247961044, 0.03450851887464523, -0.07551427185535431, 0.22903573513031006, 0.0891147255897522, -0.2259557843208313, -0.24367746710777283, -0.17283311486244202, 0.022202178835868835, 0.07209157943725586, -0.27655524015426636, 0.14093226194381714, 0.004397734999656677, -0.1208677589893341, 0.1039356142282486, -0.06414490938186646, 0.13319231569766998, 0.39902329444885254, 0.35128891468048096, 0.11269249022006989, -0.21379411220550537, -0.2267773449420929, -0.09643931686878204, -0.003297947347164154, -0.06155265122652054, 0.4006941020488739, -0.12468446791172028, -0.15610271692276, -0.18496136367321014, -0.14963936805725098, 0.6990508437156677, -0.2030337005853653, 0.14097899198532104, 0.11583898961544037, 0.10975638031959534, -0.37589067220687866, -0.1470092386007309, 0.1839398890733719, 0.14995574951171875, 0.2182983011007309, 0.747199535369873, -0.13157393038272858, -0.2201429307460785, 0.2226841002702713, 0.36977413296699524, 0.043014317750930786, -0.28323766589164734, -0.42906826734542847, -0.1522546410560608, -0.2923091650009155, -0.3876054883003235, 0.06503575295209885, 0.2845792770385742, -0.028706714510917664, -0.2164633870124817, 0.1477932184934616, -0.29942700266838074, -0.13076654076576233, -0.08300036191940308, 0.4332220256328583, -0.03861325979232788, 0.21619409322738647, 0.30991241335868835, 0.15312960743904114, 0.2805512845516205, 0.5915563106536865, -0.1121700331568718, -0.40296804904937744, -0.013032594695687294, -0.33191215991973877, 0.39877381920814514, 0.09044033288955688, -0.4451468288898468, 0.10191532969474792, -0.19041487574577332, -0.16474764049053192, -0.08081944286823273, -0.12332846969366074, 0.45586642622947693, -0.10753359645605087, -0.11438359320163727, -0.42972221970558167, 0.17820075154304504, 0.192823588848114, 0.062343135476112366, 0.14153429865837097, -0.3788332939147949, -0.40473994612693787, 0.08386999368667603, -0.3653922975063324, 0.5086000561714172, 0.41988667845726013, 0.08733958750963211, 0.4594244062900543, -0.4138636589050293, 0.3546373248100281, 0.11200226843357086, 0.026519376784563065, -0.27779847383499146, 0.08643509447574615, 0.008045405149459839, -0.29943743348121643, 0.01948741264641285, 0.005362422205507755, -0.008533179759979248, 0.30561161041259766, -0.1416877657175064, 0.3304319977760315, -0.019105082377791405, 0.2252078652381897, 0.008565982803702354, 0.012722738087177277, -0.12168361246585846, -0.02271495945751667, 0.2072102427482605, -0.005758446641266346, 0.02512001246213913, -0.3891602158546448, -0.11340305209159851, -0.456744909286499, -0.07171466946601868, 0.15757369995117188, -0.21048957109451294, 0.08957573771476746, 0.43852293491363525, -0.4620351195335388, 0.1461227685213089, 0.5030969977378845, 0.09085351228713989, -0.2368214726448059, -0.3071429133415222, 0.1793374866247177, -0.27255669236183167, 0.3082571029663086, -0.0365259014070034, -0.10577186197042465, 0.05131230503320694, -0.1324278861284256, 0.010417208075523376, -0.03708358108997345, -0.46188420057296753, -0.3886701464653015, -0.0069585442543029785, 0.09044753015041351, -0.04420123249292374, 0.018307961523532867, -0.3505178391933441, 0.033223144710063934, 0.1129896342754364, -0.3535868525505066, 0.11586000770330429, 0.14774060249328613, -0.2027476578950882, -0.05621250346302986, -0.08335733413696289, -0.3307759165763855, 0.01624404639005661, 0.28769487142562866, -0.32955604791641235, 0.22707690298557281, 0.6590527892112732, 0.038496389985084534, 0.019811175763607025, -0.11453025043010712, 0.4269590675830841, 0.25983133912086487, -0.23236864805221558, -0.03801119700074196, 0.12652310729026794, 0.10255980491638184, -0.02414799854159355, 0.10456390678882599, 0.04831857979297638, -0.03872079402208328, -0.016679704189300537, -0.6765836477279663, -0.14932537078857422, 0.20279206335544586, -0.052471812814474106, -0.08164049685001373, -0.10060153901576996, -0.0996055006980896, 0.09250975400209427, -0.2424621284008026, -0.2187255322933197, 0.21640488505363464, -0.03636372089385986, -0.04157612472772598, -0.11127983033657074, 0.277241051197052, 0.29113495349884033, -0.0006000027060508728, 0.06198016181588173, -0.25785332918167114, -0.046331342309713364, -0.09658506512641907, -0.22210842370986938, 0.1251760870218277, -0.01772705838084221, 0.20910689234733582, -0.05285323038697243, -0.34906333684921265, -0.21588894724845886, -0.06437809765338898, -0.0907818153500557, -0.128208726644516, -0.10170085728168488, 0.1532575935125351, -0.12882018089294434, -0.019704017788171768, -0.02392367273569107, 0.07173624634742737, -0.2935449481010437, 0.16599133610725403, 0.15790481865406036, 0.36705800890922546, -0.10373661667108536, 0.05059891939163208, 0.0655718743801117, -0.25397560000419617, -0.5065340995788574, 0.251342236995697, 0.22979635000228882, -0.3746281564235687, 0.1216319352388382, 0.01171083003282547, 0.2124226838350296, 0.3804816007614136, -0.376613974571228, 0.26858586072921753, 0.1056266576051712, 0.12607303261756897, -0.20976322889328003, -0.17286135256290436, 0.12144691497087479, 0.1591741293668747, 0.0035616084933280945, -0.015212982892990112, 0.21193444728851318, -0.24423420429229736, -0.1273425966501236, 0.24527552723884583, 0.3986257314682007, 0.1437215805053711, 0.3242718279361725, 0.5455831289291382, -0.00872504711151123, 0.27941790223121643, -0.09198621660470963, 0.16395507752895355, 0.16895443201065063, 0.5386075377464294, 0.04339376091957092, 0.26090526580810547, 0.23760411143302917, 0.07543829828500748, -0.016525551676750183, -0.40959107875823975, 0.17301931977272034, 0.06604968756437302, 0.2028094381093979, -0.2600766122341156, -0.04993898421525955, 0.31549206376075745, -0.25972017645835876, 0.2378438115119934, 0.10369092226028442, -0.1272069811820984, -0.10556603968143463, -0.2698215842247009, -0.029397528618574142, -0.3579648733139038, 0.02096039056777954, 0.009597331285476685, -0.008923543617129326, -0.060065265744924545, -0.08960887044668198, -0.10676103830337524, -0.04432803764939308, -0.3732776939868927, 0.3618190288543701, 0.1728472113609314, -0.12152726948261261, -0.3939562439918518, 0.3556988835334778, 0.09304997324943542, -0.0475732646882534, 0.22351691126823425, 0.02814585529267788, 0.5923489332199097, 0.3908626437187195, 0.11283673346042633, -0.2635793685913086, -0.2291925847530365, -0.06812209635972977, -0.15856975317001343, 0.2554651200771332, -0.1060480996966362, 0.03143678233027458, 0.38554078340530396, 0.1383715271949768, -0.03940436989068985, 0.20080067217350006, 0.13796867430210114, 0.19632816314697266, -0.4275873601436615, 0.45355847477912903, -0.4129598140716553, -0.1379738748073578, 0.17667599022388458, 0.1671105921268463, -0.30342233180999756, -0.1414276361465454, 0.4055458605289459, 0.24491718411445618, 0.1746276170015335, 0.08111636340618134, 0.07202407717704773, 0.07321886718273163, 0.30455493927001953, 0.2822574973106384, 0.04966561496257782, -0.17177554965019226, -0.1999150812625885, -0.48491597175598145, 0.07569195330142975, -0.08552081882953644, 0.09903531521558762, -0.01965899020433426, 0.004764549434185028, -0.09030018001794815, -0.16038012504577637, 0.3992871642112732, 0.34724241495132446, 0.1683056652545929, -0.014426123350858688, -0.1931106150150299, -0.3753845989704132, -0.14851254224777222, 0.17656126618385315, 0.0025198012590408325, -0.2643372416496277, 0.04459809511899948, 0.19753657281398773, 0.009132824838161469, -0.12355808913707733, -0.21048575639724731, 0.0697907954454422, 0.09557346999645233, 0.22498832643032074, 0.05082053691148758, 0.214523047208786, -0.1953403353691101, -0.04316958039999008, -0.22888056933879852, -0.35759803652763367, 0.025695763528347015, 0.18264082074165344, -0.14123764634132385, 0.0532488152384758, -0.5081584453582764, 0.18504779040813446, -0.4717719852924347, -0.11449030786752701, -0.26545053720474243, -0.0832325667142868, -0.16249346733093262, 0.1895086169242859, -0.06494060158729553, 0.19632993638515472, 0.0311129130423069, -0.06849811226129532, -0.24465636909008026, -0.23691272735595703, -0.10828918218612671, -0.20690447092056274, 0.40023428201675415, -0.29647037386894226, -0.29702121019363403, 0.038174256682395935, 0.183700293302536, 0.045249588787555695, 0.16478867828845978, -0.15095362067222595, 0.11655804514884949, 0.5190091729164124, 0.2603139877319336, -0.18547144532203674, -0.00308099202811718, 0.05098786950111389, 0.30851906538009644, 0.14464780688285828, 0.06676430255174637, 0.13186177611351013, -0.2689743638038635, 0.11019887030124664, -0.17912809550762177 ]
https://github.com/huggingface/datasets/issues/6071
Hi ! Thanks for reporting, I opened a PR to fix this What filesystem are you using ?
storage_options provided to load_dataset not fully piping through since datasets 2.14.0
### Describe the bug Since the latest release of `datasets` (`2.14.0`), custom filesystem `storage_options` passed to `load_dataset()` do not seem to propagate through all the way - leading to problems if loading data files that need those options to be set. I think this is because of the new `_prepare_path_and_storage_options()` (https://github.com/huggingface/datasets/pull/6028), which returns the right `storage_options` to use given a path and a `DownloadConfig` - but which might not be taking into account the extra `storage_options` explicitly provided e.g. through `load_dataset()` ### Steps to reproduce the bug ```python import fsspec import pandas as pd import datasets # Generate mock parquet file data_files = "demo.parquet" pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]}).to_parquet(data_files) _storage_options = {"x": 1, "y": 2} fs = fsspec.filesystem("file", **_storage_options) dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options ) ``` Looking at the `storage_options` resolved here: https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L331 they end up being `{}`, instead of propagating through the `storage_options` that were provided to `load_dataset` (`fs.storage_options`). As these then get used for the filesystem operation a few lines below https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L339 the call will fail if the user-provided `storage_options` were needed. --- A temporary workaround that seemed to work locally to bypass the problem was to bundle a duplicate of the `storage_options` into the `download_config`, so that they make their way all the way to `_prepare_path_and_storage_options()` and get extracted correctly: ```python dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options, download_config=datasets.DownloadConfig(storage_options={fs.protocol: fs.storage_options}), ) ``` ### Expected behavior `storage_options` provided to `load_dataset` take effect in all backend filesystem operations. ### Environment info datasets==2.14.0
18
storage_options provided to load_dataset not fully piping through since datasets 2.14.0 ### Describe the bug Since the latest release of `datasets` (`2.14.0`), custom filesystem `storage_options` passed to `load_dataset()` do not seem to propagate through all the way - leading to problems if loading data files that need those options to be set. I think this is because of the new `_prepare_path_and_storage_options()` (https://github.com/huggingface/datasets/pull/6028), which returns the right `storage_options` to use given a path and a `DownloadConfig` - but which might not be taking into account the extra `storage_options` explicitly provided e.g. through `load_dataset()` ### Steps to reproduce the bug ```python import fsspec import pandas as pd import datasets # Generate mock parquet file data_files = "demo.parquet" pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]}).to_parquet(data_files) _storage_options = {"x": 1, "y": 2} fs = fsspec.filesystem("file", **_storage_options) dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options ) ``` Looking at the `storage_options` resolved here: https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L331 they end up being `{}`, instead of propagating through the `storage_options` that were provided to `load_dataset` (`fs.storage_options`). As these then get used for the filesystem operation a few lines below https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L339 the call will fail if the user-provided `storage_options` were needed. --- A temporary workaround that seemed to work locally to bypass the problem was to bundle a duplicate of the `storage_options` into the `download_config`, so that they make their way all the way to `_prepare_path_and_storage_options()` and get extracted correctly: ```python dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options, download_config=datasets.DownloadConfig(storage_options={fs.protocol: fs.storage_options}), ) ``` ### Expected behavior `storage_options` provided to `load_dataset` take effect in all backend filesystem operations. ### Environment info datasets==2.14.0 Hi ! Thanks for reporting, I opened a PR to fix this What filesystem are you using ?
[ -0.1529044508934021, -0.011342138051986694, -0.003598034381866455, 0.16890102624893188, 0.15709836781024933, -0.12320005893707275, 0.09978201240301132, 0.070525623857975, -0.21031856536865234, -0.010081648826599121, -0.05347316339612007, 0.3284134566783905, -0.016893036663532257, 0.2652384638786316, -0.01693091355264187, 0.16082412004470825, 0.19298574328422546, -0.16062197089195251, -0.014885764569044113, 0.0638226792216301, -0.4994562566280365, 0.29750344157218933, -0.2505772113800049, -0.24892766773700714, 0.011382129043340683, 0.1712588518857956, -0.4431491494178772, 0.2632840573787689, -0.1389782577753067, -0.48324230313301086, 0.45684880018234253, 0.2343108206987381, 0.09546422958374023, 0.08152297139167786, -0.00011923631245736033, 0.04260048270225525, 0.29415497183799744, -0.2264108508825302, -0.5904027819633484, -0.1628440022468567, 0.04189330339431763, -0.47021782398223877, 0.18840372562408447, 0.023276567459106445, -0.05431089550256729, -0.4134984016418457, 0.09615391492843628, -0.49545884132385254, 0.05777605250477791, 0.227621927857399, 0.17907677590847015, 0.02263636887073517, -0.04818800464272499, -0.2285676896572113, 0.34154653549194336, 0.3735133409500122, -0.1374729573726654, -0.00551263801753521, 0.27292925119400024, -0.054316446185112, -0.11526507139205933, -0.07878165692090988, -0.0131039097905159, 0.11376097798347473, 0.1877591609954834, 0.2261110246181488, 0.16567251086235046, 0.03768613934516907, -0.03665674850344658, 0.1427624225616455, 0.45085954666137695, -0.15998807549476624, -0.5891250967979431, -0.6514387726783752, -0.21155278384685516, -0.20485642552375793, 0.39381706714630127, 0.16065078973770142, 0.035622164607048035, 0.08709312975406647, -0.05306681618094444, -0.03636153042316437, -0.07393525540828705, 0.20547029376029968, -0.1676120162010193, 0.0291704460978508, -0.2509301006793976, -0.10110095143318176, 0.12311491370201111, -0.2830423414707184, -0.055891480296850204, -0.2714816927909851, -0.15696348249912262, 0.13555781543254852, -0.16906841099262238, 0.13198071718215942, 0.2142411470413208, 0.2572228014469147, 0.19660945236682892, 0.29817524552345276, -0.33012130856513977, 0.036151111125946045, 0.07645812630653381, -0.026515983045101166, 0.21963341534137726, -0.06262277066707611, -0.16235056519508362, 0.13285574316978455, -0.00017312727868556976, 0.26622623205184937, 0.21109749376773834, -0.2464478462934494, 0.23450469970703125, -0.1916486918926239, -0.5081838369369507, -0.409211665391922, 0.20068450272083282, -0.13596002757549286, -0.21971336007118225, 0.1767282485961914, -0.05386733636260033, 0.19782549142837524, 0.16621434688568115, 0.15914256870746613, 0.02144020050764084, 0.358197957277298, 0.1608537882566452, 0.14679504930973053, -0.2380598783493042, 0.09610654413700104, -0.22771957516670227, -0.2566017508506775, -0.14446786046028137, 0.04493770748376846, 0.2296503186225891, 0.18334771692752838, 0.2922353744506836, 0.20271095633506775, 0.183174729347229, 0.18125762045383453, -0.21307778358459473, -0.18323884904384613, 0.11654449999332428, 0.30839967727661133, -0.3350984752178192, 0.19474923610687256, 0.0007120170630514622, -0.14418910443782806, -0.07946261763572693, 0.022009188309311867, -0.2135763168334961, -0.3519361615180969, -0.04961836338043213, 0.12116825580596924, -0.24995502829551697, 0.02577899768948555, -0.7889909744262695, 0.16945864260196686, -0.006590895354747772, -0.1682536005973816, -0.11781971156597137, -0.1170005276799202, -0.3736807703971863, -0.16855773329734802, 0.3320229649543762, 0.5698568224906921, -0.39045456051826477, -0.06351491808891296, -0.22893460094928741, 0.05014786869287491, 0.3479349613189697, 0.13085897266864777, -0.19349123537540436, 0.05038730800151825, -0.46105247735977173, 0.23006094992160797, 0.15123163163661957, -0.1959133744239807, -0.25347262620925903, 0.3108753263950348, 0.048545822501182556, 0.4584910571575165, 0.2725849151611328, -0.3200862407684326, 0.38438358902931213, 0.013518918305635452, 0.03062581643462181, 0.15380965173244476, -0.022850073873996735, 0.0672120526432991, -0.35851067304611206, -0.25355392694473267, 0.13803614675998688, 0.06980416178703308, 0.011510113254189491, 0.10124529898166656, 0.06061430275440216, 0.18187707662582397, 0.491265207529068, 0.001003769226372242, 0.09354276955127716, 0.13175927102565765, 0.5366712212562561, 0.31965014338493347, -0.06025848910212517, -0.04064016789197922, -0.7242838144302368, 0.31308844685554504, 0.10148501396179199, -0.22565555572509766, -0.23923960328102112, 0.017458245158195496, -0.07169234752655029, -0.09543365985155106, -0.08140727877616882, -0.35325223207473755, 0.06297645717859268, 0.42058902978897095, -0.14905589818954468, 0.00017479807138442993, -0.08268050849437714, 0.5375640392303467, -0.3302561640739441, 0.046153724193573, -0.13080056011676788, 0.5203419327735901, 0.2100464403629303, -0.3021393418312073, -0.12886810302734375, 0.006178509443998337, 0.2287743240594864, -0.15721836686134338, -0.07246769964694977, 0.6432702541351318, 0.37767618894577026, 0.40617260336875916, -0.15891501307487488, 0.25979751348495483, 0.29748857021331787, 0.1923624575138092, 0.13827873766422272, -0.09338223934173584, 0.009467363357543945, 0.07103542983531952, -0.27554261684417725, 0.24551986157894135, -0.03242044150829315, 0.1961904764175415, 0.13141930103302002, -0.064715676009655, 0.25588440895080566, 0.2192060947418213, -0.030453413724899292, -0.2349282205104828, 0.08746816217899323, 0.17578938603401184, 0.4955281913280487, 0.07128541171550751, -0.2696816921234131, 0.20622217655181885, 0.3187848627567291, 0.05773750692605972, -0.3194294273853302, 0.09319858998060226, 0.1505412757396698, -0.27686625719070435, 0.40588727593421936, 0.2344791144132614, 0.5855885744094849, 0.2741243839263916, 0.07759135961532593, 0.0019690636545419693, -0.11168147623538971, -0.20621734857559204, 0.28509074449539185, 0.010217206552624702, -0.2254096418619156, 0.1691565364599228, 0.1585569679737091, 0.02587643265724182, -0.22696316242218018, 0.14274199306964874, 0.10646840184926987, 0.06672943383455276, -0.4064977765083313, -0.05336802452802658, -0.5170154571533203, 0.09911748766899109, -0.1635637879371643, 0.12758773565292358, -0.04996006563305855, -0.4888419508934021, 0.009089423343539238, 0.412933886051178, -0.2442966252565384, -0.012097630649805069, -0.27051541209220886, 0.3457806706428528, -0.14322036504745483, -0.2948174774646759, -0.17185786366462708, 0.2781960964202881, -0.2819984555244446, -0.005464188754558563, 0.1531396061182022, 0.09305252134799957, 0.1277538537979126, 0.11910869181156158, -0.08848588168621063, -0.48815372586250305, -0.20791824162006378, 0.036307480186223984, 0.0016322126612067223, 0.49122217297554016, 0.11655836552381516, 0.013308297842741013, 0.12897177040576935, 0.05875500664114952, 0.24476492404937744, 0.056944429874420166, -0.11708016693592072, 0.06708742678165436, 0.25455722212791443, 0.04504435509443283, -0.24820876121520996, -0.3474728465080261, -0.2745065689086914, -0.29499194025993347, 0.33749642968177795, 0.12403889000415802, -0.05476779490709305, 0.09293469786643982, 0.05072516202926636, 0.06367644667625427, -0.09462094306945801, 0.004473481327295303, -0.18537500500679016, -0.5136884450912476, 0.2958360016345978, -0.29191505908966064, -0.053235214203596115, -0.17694491147994995, 0.14653876423835754, -0.2228003740310669, 0.2402634620666504, -0.47417354583740234, -0.23481467366218567, -0.37178030610084534, 0.23204931616783142, -0.11996401101350784, -0.1242356076836586, 0.5179236531257629, 0.01617157831788063, 0.06244685500860214, -0.3381514847278595, -0.2415560781955719, 0.23680678009986877, 0.268536776304245, 0.14805051684379578, 0.036517683416604996, 0.2757120430469513, 0.1453666239976883, 0.40571194887161255, 0.28447195887565613, 0.13855229318141937, 0.5614778995513916, -0.19775497913360596, 0.48477619886398315, -0.3017764389514923, -0.27162736654281616, 0.032753750681877136, -0.01376834511756897, -0.08310255408287048, 0.31957295536994934, 0.23150478303432465, 0.16663619875907898, 0.1219366192817688, 0.12925295531749725, 0.04392465949058533, -0.2695170044898987, -0.0800718143582344, 0.05266232043504715, 0.264982134103775, -0.08634472638368607, 0.0702248364686966, -0.12028025835752487, -0.21644076704978943, -0.20239779353141785, 0.28641167283058167, 0.34584686160087585, 0.043873947113752365, 0.02525453269481659, 0.3351564407348633, -0.2060125470161438, 0.1664728820323944, -0.053641580045223236, 0.2929384112358093, -0.08354311436414719, -0.12660634517669678, 0.031132714822888374, 0.03948775678873062, 0.5939803123474121, 0.01470821164548397, -0.004010121803730726, 0.06334619224071503, -0.15936601161956787, -0.3437528908252716, -0.3490232229232788, -0.06845748424530029, 0.011130549013614655, 0.09455612301826477, 0.7519523501396179, -0.22000393271446228, -0.4369889795780182, -0.12328426539897919, 0.09896773099899292, -0.0873618870973587, 0.06713542342185974, -0.058444272726774216, 0.06510786712169647, -0.05940760672092438, -0.016716208308935165, 0.15318015217781067, 0.32995590567588806, -0.25756606459617615, -0.11358227580785751, -0.10946410894393921, -0.03070312738418579, 0.03047981485724449, -0.11693717539310455, 0.4279223680496216, -0.16924822330474854, 0.31139078736305237, 0.17268015444278717, 0.12448394298553467, 0.7365002036094666, 0.5298046469688416, -0.13362279534339905, 0.037912990897893906, 0.23305489122867584, -0.11072588711977005, 0.15690898895263672, 0.4179438352584839, -0.3743850886821747, 0.004163719713687897, -0.3720201551914215, 0.16513191163539886, -0.6378697156906128, 0.07944965362548828, 0.3956419825553894, -0.2623627483844757, 0.32684674859046936, -0.2986212372779846, 0.44278883934020996, 0.03963439166545868, -0.14986631274223328, -0.05277891829609871, 0.7544149160385132, -0.5522873997688293, 0.12094172835350037, 0.053844720125198364, 0.4973245859146118, 0.18918636441230774, 0.12890370190143585, 0.2719491422176361, -0.1932409554719925, 0.09770911931991577, -0.28750619292259216, -0.12471036612987518, -0.013589717447757721, -0.10173434019088745, 0.025476165115833282, -0.11347092688083649, 0.5026902556419373, 0.24782738089561462, 0.001516193151473999, 0.3146789073944092, 0.11939278244972229, 0.262554407119751, -0.022163545712828636, 0.12049618363380432, -0.18243494629859924, -0.32473224401474, -0.4567285478115082, 0.17926855385303497, 0.1526021957397461, -0.15040376782417297, 0.07162244617938995, 0.037279292941093445, -0.012757912278175354, 0.0483393520116806, -0.24441207945346832, -0.0359349325299263, -0.24547536671161652, 0.08235988020896912, 0.19629231095314026, -0.03182361274957657, 0.14594876766204834, 0.3657947778701782, 0.013159599155187607, 0.19133706390857697, -0.23237845301628113, -0.07654029130935669, -0.17003610730171204, 0.24022012948989868, -0.04281824827194214, 0.02087203785777092, 0.18233171105384827, 0.12357306480407715, -0.06126418709754944, -0.3627120554447174, -0.3034406900405884, -0.3035357892513275, -0.07885949313640594, -0.16233302652835846, 0.1149301528930664, -0.3291264474391937, -0.11804235726594925, -0.25748923420906067, 0.23642702400684357, -0.26744210720062256, 0.10332970321178436, 0.15140093863010406, -0.12074083834886551, 0.35196325182914734, -0.29440581798553467, -0.1382533460855484, -0.1874639093875885, 0.5069010853767395, -0.5611604452133179, 0.15931826829910278, 0.5466102957725525, -0.2013910412788391, -0.21512749791145325, -0.0771327018737793, 0.31759288907051086, -0.05515601485967636, -0.11492179334163666, 0.22679294645786285, -0.129827618598938, -0.04232260584831238, -0.10268983989953995, 0.3317652940750122, 0.2852449417114258, -0.08448264002799988, 0.04242667555809021, -0.24066898226737976, -0.16650283336639404, 0.23965293169021606, -0.09847597777843475, 0.23830319941043854, -0.031408149749040604, -0.14988763630390167, 0.03660036623477936, -0.31563621759414673, -0.28087854385375977, 0.2577804625034332, 0.00048510730266571045, 0.09125940501689911, 0.1340792030096054, 0.07682086527347565, 0.2611933946609497, -0.163411945104599, 0.09144139289855957, 0.040097471326589584, -0.1513117551803589, -0.09077305346727371, -0.24058587849140167, 0.124588742852211, 0.1574038565158844, -0.07511293888092041, -0.01931411772966385, -0.23914717137813568, -0.2117213010787964, -0.30256494879722595, 0.21973668038845062, 0.23495164513587952, 0.04271943122148514, 0.022290553897619247, 0.4115625023841858, 0.15869076550006866, 0.014029324054718018, 0.17317581176757812, 0.004862800240516663, -0.06714826077222824, -0.09979163110256195, 0.14213211834430695, -0.2958022654056549, -0.05952134355902672, 0.11275434494018555, 0.17669261991977692, 0.006020583212375641, 0.29075726866722107, 0.21639730036258698, -0.05988136678934097, -0.07287939637899399, 0.27708739042282104, 0.36540135741233826, 0.42822834849357605, 0.06663548201322556, -0.19082129001617432, 0.40411123633384705, 0.13159747421741486, -0.0875195860862732, -0.09171432256698608, 0.4313608705997467, 0.2522594928741455, 0.10794225335121155, 0.20839717984199524, 0.4449900984764099, -0.18336701393127441, -0.004106372594833374, 0.11702452600002289, 0.08271905779838562, -0.02563849836587906, 0.3114820718765259, 0.2292630821466446, -0.14188744127750397, 0.18926386535167694, 0.13632243871688843, -0.09574981033802032, 0.13738882541656494, 0.45636603236198425, -0.08465072512626648, 0.07290773838758469, 0.09640231728553772, -0.06941929459571838, 0.13577289879322052, -0.5972064137458801, -0.025477105751633644, 0.07513751089572906, -0.037592850625514984, 0.13427698612213135, -0.19390712678432465, 0.24338829517364502, -0.2016269564628601, -0.0906197726726532, -0.24652114510536194, 0.02967238798737526, -0.2424807846546173, -0.589363694190979, 0.3145052492618561, -0.31231212615966797, -0.36964666843414307, -0.011610336601734161, -0.1576976180076599, -0.31509125232696533, 0.23409605026245117, -0.15722909569740295, 0.03623802959918976, -0.34807875752449036, 0.06305908411741257, -0.040207214653491974, 0.2554674446582794, -0.25541675090789795, 0.329539030790329, -0.03982849046587944, -0.1565714180469513, 0.17835332453250885, 0.17572450637817383, 0.12603330612182617, 0.3068959712982178, 0.08420157432556152, -0.2576948404312134, 0.2731994092464447, 0.03073367476463318, -0.011701129376888275, 0.22580035030841827, -0.3136536478996277, 0.01909053325653076, 0.2549525201320648, 0.16048239171504974, -0.11654014885425568, 0.008762819692492485, 0.16191366314888, 0.1987234503030777, -0.5982886552810669, 0.5676096677780151, 0.09436602890491486, 0.00906691700220108, 0.20330695807933807, -0.04338126257061958, -0.2311059534549713, -0.2694467008113861, 0.25069570541381836, 0.06818967312574387, 0.3225814700126648, 0.29288387298583984, 0.07244783639907837, 0.19605694711208344, 0.10754558444023132, 0.1699853539466858, -0.4621151089668274, -0.17690150439739227, -0.200147807598114, -0.5422201156616211, -0.30183228850364685, -0.006984024308621883, -0.06662868708372116, 0.008102841675281525, 0.41325727105140686, 0.018916593864560127, -0.27490052580833435, -0.13044415414333344, -0.4263916611671448, 0.1417843997478485, 0.2348368912935257, -0.26504212617874146, -0.14033107459545135, -0.015246212482452393, -0.013888681307435036, 0.045037128031253815, -0.2781568169593811, -0.06045105680823326, 0.08501119911670685, 0.005498602986335754, 0.16368837654590607, 0.223372682929039, -0.07996299117803574, -0.24384967982769012, 0.1390407532453537, -0.010519771836698055, -0.13960754871368408, 0.03317222744226456, -0.13869744539260864, -0.5629132986068726, -0.13902302086353302, -0.008023194968700409, 0.11374348402023315, -0.4419747292995453, 0.7124947905540466, -0.3809422552585602, -0.0518496036529541, -0.29649004340171814, -0.16994497179985046, 0.14813414216041565, -0.22123634815216064, -0.3064981997013092, 0.30505600571632385, -0.08421045541763306, -0.035102393478155136, -0.12977802753448486, 0.21901117265224457, -0.2613045871257782, 0.3197374939918518, -0.054884783923625946, -0.3310236930847168, 0.3758852183818817, -0.32556071877479553, -0.05243142694234848, -0.04782329127192497, 0.25678330659866333, 0.23418432474136353, 0.04209217429161072, -0.5339726209640503, -0.005652382969856262, 0.4839295744895935, -0.12284266948699951, 0.06812499463558197, 0.15094296634197235, 0.06802305579185486, -0.11244285851716995, -0.10292080044746399, 0.2895389199256897, 0.13933327794075012, 0.02619197964668274, 0.25964099168777466, -0.29263749718666077 ]
https://github.com/huggingface/datasets/issues/6071
Hi @lhoestq ! Thank you so much 🙌 It's a bit of a custom setup, but in practice I am using a [pyarrow.fs.S3FileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.S3FileSystem.html) (wrapped in a `fsspec.implementations.arrow.ArrowFSWrapper` [to make it](https://arrow.apache.org/docs/python/filesystems.html#using-arrow-filesystems-with-fsspec) `fsspec` compatible). I also register it as an entrypoint with `fsspec` so that it's the one that gets automatically resolved when looking for filesystems for the `s3` protocol In my case the `storage_option` that seemed not getting piped through was the filesystem's `endpoint_override` that I use in some tests to point at a mock S3 bucket
storage_options provided to load_dataset not fully piping through since datasets 2.14.0
### Describe the bug Since the latest release of `datasets` (`2.14.0`), custom filesystem `storage_options` passed to `load_dataset()` do not seem to propagate through all the way - leading to problems if loading data files that need those options to be set. I think this is because of the new `_prepare_path_and_storage_options()` (https://github.com/huggingface/datasets/pull/6028), which returns the right `storage_options` to use given a path and a `DownloadConfig` - but which might not be taking into account the extra `storage_options` explicitly provided e.g. through `load_dataset()` ### Steps to reproduce the bug ```python import fsspec import pandas as pd import datasets # Generate mock parquet file data_files = "demo.parquet" pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]}).to_parquet(data_files) _storage_options = {"x": 1, "y": 2} fs = fsspec.filesystem("file", **_storage_options) dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options ) ``` Looking at the `storage_options` resolved here: https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L331 they end up being `{}`, instead of propagating through the `storage_options` that were provided to `load_dataset` (`fs.storage_options`). As these then get used for the filesystem operation a few lines below https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L339 the call will fail if the user-provided `storage_options` were needed. --- A temporary workaround that seemed to work locally to bypass the problem was to bundle a duplicate of the `storage_options` into the `download_config`, so that they make their way all the way to `_prepare_path_and_storage_options()` and get extracted correctly: ```python dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options, download_config=datasets.DownloadConfig(storage_options={fs.protocol: fs.storage_options}), ) ``` ### Expected behavior `storage_options` provided to `load_dataset` take effect in all backend filesystem operations. ### Environment info datasets==2.14.0
86
storage_options provided to load_dataset not fully piping through since datasets 2.14.0 ### Describe the bug Since the latest release of `datasets` (`2.14.0`), custom filesystem `storage_options` passed to `load_dataset()` do not seem to propagate through all the way - leading to problems if loading data files that need those options to be set. I think this is because of the new `_prepare_path_and_storage_options()` (https://github.com/huggingface/datasets/pull/6028), which returns the right `storage_options` to use given a path and a `DownloadConfig` - but which might not be taking into account the extra `storage_options` explicitly provided e.g. through `load_dataset()` ### Steps to reproduce the bug ```python import fsspec import pandas as pd import datasets # Generate mock parquet file data_files = "demo.parquet" pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]}).to_parquet(data_files) _storage_options = {"x": 1, "y": 2} fs = fsspec.filesystem("file", **_storage_options) dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options ) ``` Looking at the `storage_options` resolved here: https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L331 they end up being `{}`, instead of propagating through the `storage_options` that were provided to `load_dataset` (`fs.storage_options`). As these then get used for the filesystem operation a few lines below https://github.com/huggingface/datasets/blob/b0177910b32712f28d147879395e511207e39958/src/datasets/data_files.py#L339 the call will fail if the user-provided `storage_options` were needed. --- A temporary workaround that seemed to work locally to bypass the problem was to bundle a duplicate of the `storage_options` into the `download_config`, so that they make their way all the way to `_prepare_path_and_storage_options()` and get extracted correctly: ```python dataset = datasets.load_dataset( "parquet", data_files=data_files, storage_options=fs.storage_options, download_config=datasets.DownloadConfig(storage_options={fs.protocol: fs.storage_options}), ) ``` ### Expected behavior `storage_options` provided to `load_dataset` take effect in all backend filesystem operations. ### Environment info datasets==2.14.0 Hi @lhoestq ! Thank you so much 🙌 It's a bit of a custom setup, but in practice I am using a [pyarrow.fs.S3FileSystem](https://arrow.apache.org/docs/python/generated/pyarrow.fs.S3FileSystem.html) (wrapped in a `fsspec.implementations.arrow.ArrowFSWrapper` [to make it](https://arrow.apache.org/docs/python/filesystems.html#using-arrow-filesystems-with-fsspec) `fsspec` compatible). I also register it as an entrypoint with `fsspec` so that it's the one that gets automatically resolved when looking for filesystems for the `s3` protocol In my case the `storage_option` that seemed not getting piped through was the filesystem's `endpoint_override` that I use in some tests to point at a mock S3 bucket
[ -0.1529044508934021, -0.011342138051986694, -0.003598034381866455, 0.16890102624893188, 0.15709836781024933, -0.12320005893707275, 0.09978201240301132, 0.070525623857975, -0.21031856536865234, -0.010081648826599121, -0.05347316339612007, 0.3284134566783905, -0.016893036663532257, 0.2652384638786316, -0.01693091355264187, 0.16082412004470825, 0.19298574328422546, -0.16062197089195251, -0.014885764569044113, 0.0638226792216301, -0.4994562566280365, 0.29750344157218933, -0.2505772113800049, -0.24892766773700714, 0.011382129043340683, 0.1712588518857956, -0.4431491494178772, 0.2632840573787689, -0.1389782577753067, -0.48324230313301086, 0.45684880018234253, 0.2343108206987381, 0.09546422958374023, 0.08152297139167786, -0.00011923631245736033, 0.04260048270225525, 0.29415497183799744, -0.2264108508825302, -0.5904027819633484, -0.1628440022468567, 0.04189330339431763, -0.47021782398223877, 0.18840372562408447, 0.023276567459106445, -0.05431089550256729, -0.4134984016418457, 0.09615391492843628, -0.49545884132385254, 0.05777605250477791, 0.227621927857399, 0.17907677590847015, 0.02263636887073517, -0.04818800464272499, -0.2285676896572113, 0.34154653549194336, 0.3735133409500122, -0.1374729573726654, -0.00551263801753521, 0.27292925119400024, -0.054316446185112, -0.11526507139205933, -0.07878165692090988, -0.0131039097905159, 0.11376097798347473, 0.1877591609954834, 0.2261110246181488, 0.16567251086235046, 0.03768613934516907, -0.03665674850344658, 0.1427624225616455, 0.45085954666137695, -0.15998807549476624, -0.5891250967979431, -0.6514387726783752, -0.21155278384685516, -0.20485642552375793, 0.39381706714630127, 0.16065078973770142, 0.035622164607048035, 0.08709312975406647, -0.05306681618094444, -0.03636153042316437, -0.07393525540828705, 0.20547029376029968, -0.1676120162010193, 0.0291704460978508, -0.2509301006793976, -0.10110095143318176, 0.12311491370201111, -0.2830423414707184, -0.055891480296850204, -0.2714816927909851, -0.15696348249912262, 0.13555781543254852, -0.16906841099262238, 0.13198071718215942, 0.2142411470413208, 0.2572228014469147, 0.19660945236682892, 0.29817524552345276, -0.33012130856513977, 0.036151111125946045, 0.07645812630653381, -0.026515983045101166, 0.21963341534137726, -0.06262277066707611, -0.16235056519508362, 0.13285574316978455, -0.00017312727868556976, 0.26622623205184937, 0.21109749376773834, -0.2464478462934494, 0.23450469970703125, -0.1916486918926239, -0.5081838369369507, -0.409211665391922, 0.20068450272083282, -0.13596002757549286, -0.21971336007118225, 0.1767282485961914, -0.05386733636260033, 0.19782549142837524, 0.16621434688568115, 0.15914256870746613, 0.02144020050764084, 0.358197957277298, 0.1608537882566452, 0.14679504930973053, -0.2380598783493042, 0.09610654413700104, -0.22771957516670227, -0.2566017508506775, -0.14446786046028137, 0.04493770748376846, 0.2296503186225891, 0.18334771692752838, 0.2922353744506836, 0.20271095633506775, 0.183174729347229, 0.18125762045383453, -0.21307778358459473, -0.18323884904384613, 0.11654449999332428, 0.30839967727661133, -0.3350984752178192, 0.19474923610687256, 0.0007120170630514622, -0.14418910443782806, -0.07946261763572693, 0.022009188309311867, -0.2135763168334961, -0.3519361615180969, -0.04961836338043213, 0.12116825580596924, -0.24995502829551697, 0.02577899768948555, -0.7889909744262695, 0.16945864260196686, -0.006590895354747772, -0.1682536005973816, -0.11781971156597137, -0.1170005276799202, -0.3736807703971863, -0.16855773329734802, 0.3320229649543762, 0.5698568224906921, -0.39045456051826477, -0.06351491808891296, -0.22893460094928741, 0.05014786869287491, 0.3479349613189697, 0.13085897266864777, -0.19349123537540436, 0.05038730800151825, -0.46105247735977173, 0.23006094992160797, 0.15123163163661957, -0.1959133744239807, -0.25347262620925903, 0.3108753263950348, 0.048545822501182556, 0.4584910571575165, 0.2725849151611328, -0.3200862407684326, 0.38438358902931213, 0.013518918305635452, 0.03062581643462181, 0.15380965173244476, -0.022850073873996735, 0.0672120526432991, -0.35851067304611206, -0.25355392694473267, 0.13803614675998688, 0.06980416178703308, 0.011510113254189491, 0.10124529898166656, 0.06061430275440216, 0.18187707662582397, 0.491265207529068, 0.001003769226372242, 0.09354276955127716, 0.13175927102565765, 0.5366712212562561, 0.31965014338493347, -0.06025848910212517, -0.04064016789197922, -0.7242838144302368, 0.31308844685554504, 0.10148501396179199, -0.22565555572509766, -0.23923960328102112, 0.017458245158195496, -0.07169234752655029, -0.09543365985155106, -0.08140727877616882, -0.35325223207473755, 0.06297645717859268, 0.42058902978897095, -0.14905589818954468, 0.00017479807138442993, -0.08268050849437714, 0.5375640392303467, -0.3302561640739441, 0.046153724193573, -0.13080056011676788, 0.5203419327735901, 0.2100464403629303, -0.3021393418312073, -0.12886810302734375, 0.006178509443998337, 0.2287743240594864, -0.15721836686134338, -0.07246769964694977, 0.6432702541351318, 0.37767618894577026, 0.40617260336875916, -0.15891501307487488, 0.25979751348495483, 0.29748857021331787, 0.1923624575138092, 0.13827873766422272, -0.09338223934173584, 0.009467363357543945, 0.07103542983531952, -0.27554261684417725, 0.24551986157894135, -0.03242044150829315, 0.1961904764175415, 0.13141930103302002, -0.064715676009655, 0.25588440895080566, 0.2192060947418213, -0.030453413724899292, -0.2349282205104828, 0.08746816217899323, 0.17578938603401184, 0.4955281913280487, 0.07128541171550751, -0.2696816921234131, 0.20622217655181885, 0.3187848627567291, 0.05773750692605972, -0.3194294273853302, 0.09319858998060226, 0.1505412757396698, -0.27686625719070435, 0.40588727593421936, 0.2344791144132614, 0.5855885744094849, 0.2741243839263916, 0.07759135961532593, 0.0019690636545419693, -0.11168147623538971, -0.20621734857559204, 0.28509074449539185, 0.010217206552624702, -0.2254096418619156, 0.1691565364599228, 0.1585569679737091, 0.02587643265724182, -0.22696316242218018, 0.14274199306964874, 0.10646840184926987, 0.06672943383455276, -0.4064977765083313, -0.05336802452802658, -0.5170154571533203, 0.09911748766899109, -0.1635637879371643, 0.12758773565292358, -0.04996006563305855, -0.4888419508934021, 0.009089423343539238, 0.412933886051178, -0.2442966252565384, -0.012097630649805069, -0.27051541209220886, 0.3457806706428528, -0.14322036504745483, -0.2948174774646759, -0.17185786366462708, 0.2781960964202881, -0.2819984555244446, -0.005464188754558563, 0.1531396061182022, 0.09305252134799957, 0.1277538537979126, 0.11910869181156158, -0.08848588168621063, -0.48815372586250305, -0.20791824162006378, 0.036307480186223984, 0.0016322126612067223, 0.49122217297554016, 0.11655836552381516, 0.013308297842741013, 0.12897177040576935, 0.05875500664114952, 0.24476492404937744, 0.056944429874420166, -0.11708016693592072, 0.06708742678165436, 0.25455722212791443, 0.04504435509443283, -0.24820876121520996, -0.3474728465080261, -0.2745065689086914, -0.29499194025993347, 0.33749642968177795, 0.12403889000415802, -0.05476779490709305, 0.09293469786643982, 0.05072516202926636, 0.06367644667625427, -0.09462094306945801, 0.004473481327295303, -0.18537500500679016, -0.5136884450912476, 0.2958360016345978, -0.29191505908966064, -0.053235214203596115, -0.17694491147994995, 0.14653876423835754, -0.2228003740310669, 0.2402634620666504, -0.47417354583740234, -0.23481467366218567, -0.37178030610084534, 0.23204931616783142, -0.11996401101350784, -0.1242356076836586, 0.5179236531257629, 0.01617157831788063, 0.06244685500860214, -0.3381514847278595, -0.2415560781955719, 0.23680678009986877, 0.268536776304245, 0.14805051684379578, 0.036517683416604996, 0.2757120430469513, 0.1453666239976883, 0.40571194887161255, 0.28447195887565613, 0.13855229318141937, 0.5614778995513916, -0.19775497913360596, 0.48477619886398315, -0.3017764389514923, -0.27162736654281616, 0.032753750681877136, -0.01376834511756897, -0.08310255408287048, 0.31957295536994934, 0.23150478303432465, 0.16663619875907898, 0.1219366192817688, 0.12925295531749725, 0.04392465949058533, -0.2695170044898987, -0.0800718143582344, 0.05266232043504715, 0.264982134103775, -0.08634472638368607, 0.0702248364686966, -0.12028025835752487, -0.21644076704978943, -0.20239779353141785, 0.28641167283058167, 0.34584686160087585, 0.043873947113752365, 0.02525453269481659, 0.3351564407348633, -0.2060125470161438, 0.1664728820323944, -0.053641580045223236, 0.2929384112358093, -0.08354311436414719, -0.12660634517669678, 0.031132714822888374, 0.03948775678873062, 0.5939803123474121, 0.01470821164548397, -0.004010121803730726, 0.06334619224071503, -0.15936601161956787, -0.3437528908252716, -0.3490232229232788, -0.06845748424530029, 0.011130549013614655, 0.09455612301826477, 0.7519523501396179, -0.22000393271446228, -0.4369889795780182, -0.12328426539897919, 0.09896773099899292, -0.0873618870973587, 0.06713542342185974, -0.058444272726774216, 0.06510786712169647, -0.05940760672092438, -0.016716208308935165, 0.15318015217781067, 0.32995590567588806, -0.25756606459617615, -0.11358227580785751, -0.10946410894393921, -0.03070312738418579, 0.03047981485724449, -0.11693717539310455, 0.4279223680496216, -0.16924822330474854, 0.31139078736305237, 0.17268015444278717, 0.12448394298553467, 0.7365002036094666, 0.5298046469688416, -0.13362279534339905, 0.037912990897893906, 0.23305489122867584, -0.11072588711977005, 0.15690898895263672, 0.4179438352584839, -0.3743850886821747, 0.004163719713687897, -0.3720201551914215, 0.16513191163539886, -0.6378697156906128, 0.07944965362548828, 0.3956419825553894, -0.2623627483844757, 0.32684674859046936, -0.2986212372779846, 0.44278883934020996, 0.03963439166545868, -0.14986631274223328, -0.05277891829609871, 0.7544149160385132, -0.5522873997688293, 0.12094172835350037, 0.053844720125198364, 0.4973245859146118, 0.18918636441230774, 0.12890370190143585, 0.2719491422176361, -0.1932409554719925, 0.09770911931991577, -0.28750619292259216, -0.12471036612987518, -0.013589717447757721, -0.10173434019088745, 0.025476165115833282, -0.11347092688083649, 0.5026902556419373, 0.24782738089561462, 0.001516193151473999, 0.3146789073944092, 0.11939278244972229, 0.262554407119751, -0.022163545712828636, 0.12049618363380432, -0.18243494629859924, -0.32473224401474, -0.4567285478115082, 0.17926855385303497, 0.1526021957397461, -0.15040376782417297, 0.07162244617938995, 0.037279292941093445, -0.012757912278175354, 0.0483393520116806, -0.24441207945346832, -0.0359349325299263, -0.24547536671161652, 0.08235988020896912, 0.19629231095314026, -0.03182361274957657, 0.14594876766204834, 0.3657947778701782, 0.013159599155187607, 0.19133706390857697, -0.23237845301628113, -0.07654029130935669, -0.17003610730171204, 0.24022012948989868, -0.04281824827194214, 0.02087203785777092, 0.18233171105384827, 0.12357306480407715, -0.06126418709754944, -0.3627120554447174, -0.3034406900405884, -0.3035357892513275, -0.07885949313640594, -0.16233302652835846, 0.1149301528930664, -0.3291264474391937, -0.11804235726594925, -0.25748923420906067, 0.23642702400684357, -0.26744210720062256, 0.10332970321178436, 0.15140093863010406, -0.12074083834886551, 0.35196325182914734, -0.29440581798553467, -0.1382533460855484, -0.1874639093875885, 0.5069010853767395, -0.5611604452133179, 0.15931826829910278, 0.5466102957725525, -0.2013910412788391, -0.21512749791145325, -0.0771327018737793, 0.31759288907051086, -0.05515601485967636, -0.11492179334163666, 0.22679294645786285, -0.129827618598938, -0.04232260584831238, -0.10268983989953995, 0.3317652940750122, 0.2852449417114258, -0.08448264002799988, 0.04242667555809021, -0.24066898226737976, -0.16650283336639404, 0.23965293169021606, -0.09847597777843475, 0.23830319941043854, -0.031408149749040604, -0.14988763630390167, 0.03660036623477936, -0.31563621759414673, -0.28087854385375977, 0.2577804625034332, 0.00048510730266571045, 0.09125940501689911, 0.1340792030096054, 0.07682086527347565, 0.2611933946609497, -0.163411945104599, 0.09144139289855957, 0.040097471326589584, -0.1513117551803589, -0.09077305346727371, -0.24058587849140167, 0.124588742852211, 0.1574038565158844, -0.07511293888092041, -0.01931411772966385, -0.23914717137813568, -0.2117213010787964, -0.30256494879722595, 0.21973668038845062, 0.23495164513587952, 0.04271943122148514, 0.022290553897619247, 0.4115625023841858, 0.15869076550006866, 0.014029324054718018, 0.17317581176757812, 0.004862800240516663, -0.06714826077222824, -0.09979163110256195, 0.14213211834430695, -0.2958022654056549, -0.05952134355902672, 0.11275434494018555, 0.17669261991977692, 0.006020583212375641, 0.29075726866722107, 0.21639730036258698, -0.05988136678934097, -0.07287939637899399, 0.27708739042282104, 0.36540135741233826, 0.42822834849357605, 0.06663548201322556, -0.19082129001617432, 0.40411123633384705, 0.13159747421741486, -0.0875195860862732, -0.09171432256698608, 0.4313608705997467, 0.2522594928741455, 0.10794225335121155, 0.20839717984199524, 0.4449900984764099, -0.18336701393127441, -0.004106372594833374, 0.11702452600002289, 0.08271905779838562, -0.02563849836587906, 0.3114820718765259, 0.2292630821466446, -0.14188744127750397, 0.18926386535167694, 0.13632243871688843, -0.09574981033802032, 0.13738882541656494, 0.45636603236198425, -0.08465072512626648, 0.07290773838758469, 0.09640231728553772, -0.06941929459571838, 0.13577289879322052, -0.5972064137458801, -0.025477105751633644, 0.07513751089572906, -0.037592850625514984, 0.13427698612213135, -0.19390712678432465, 0.24338829517364502, -0.2016269564628601, -0.0906197726726532, -0.24652114510536194, 0.02967238798737526, -0.2424807846546173, -0.589363694190979, 0.3145052492618561, -0.31231212615966797, -0.36964666843414307, -0.011610336601734161, -0.1576976180076599, -0.31509125232696533, 0.23409605026245117, -0.15722909569740295, 0.03623802959918976, -0.34807875752449036, 0.06305908411741257, -0.040207214653491974, 0.2554674446582794, -0.25541675090789795, 0.329539030790329, -0.03982849046587944, -0.1565714180469513, 0.17835332453250885, 0.17572450637817383, 0.12603330612182617, 0.3068959712982178, 0.08420157432556152, -0.2576948404312134, 0.2731994092464447, 0.03073367476463318, -0.011701129376888275, 0.22580035030841827, -0.3136536478996277, 0.01909053325653076, 0.2549525201320648, 0.16048239171504974, -0.11654014885425568, 0.008762819692492485, 0.16191366314888, 0.1987234503030777, -0.5982886552810669, 0.5676096677780151, 0.09436602890491486, 0.00906691700220108, 0.20330695807933807, -0.04338126257061958, -0.2311059534549713, -0.2694467008113861, 0.25069570541381836, 0.06818967312574387, 0.3225814700126648, 0.29288387298583984, 0.07244783639907837, 0.19605694711208344, 0.10754558444023132, 0.1699853539466858, -0.4621151089668274, -0.17690150439739227, -0.200147807598114, -0.5422201156616211, -0.30183228850364685, -0.006984024308621883, -0.06662868708372116, 0.008102841675281525, 0.41325727105140686, 0.018916593864560127, -0.27490052580833435, -0.13044415414333344, -0.4263916611671448, 0.1417843997478485, 0.2348368912935257, -0.26504212617874146, -0.14033107459545135, -0.015246212482452393, -0.013888681307435036, 0.045037128031253815, -0.2781568169593811, -0.06045105680823326, 0.08501119911670685, 0.005498602986335754, 0.16368837654590607, 0.223372682929039, -0.07996299117803574, -0.24384967982769012, 0.1390407532453537, -0.010519771836698055, -0.13960754871368408, 0.03317222744226456, -0.13869744539260864, -0.5629132986068726, -0.13902302086353302, -0.008023194968700409, 0.11374348402023315, -0.4419747292995453, 0.7124947905540466, -0.3809422552585602, -0.0518496036529541, -0.29649004340171814, -0.16994497179985046, 0.14813414216041565, -0.22123634815216064, -0.3064981997013092, 0.30505600571632385, -0.08421045541763306, -0.035102393478155136, -0.12977802753448486, 0.21901117265224457, -0.2613045871257782, 0.3197374939918518, -0.054884783923625946, -0.3310236930847168, 0.3758852183818817, -0.32556071877479553, -0.05243142694234848, -0.04782329127192497, 0.25678330659866333, 0.23418432474136353, 0.04209217429161072, -0.5339726209640503, -0.005652382969856262, 0.4839295744895935, -0.12284266948699951, 0.06812499463558197, 0.15094296634197235, 0.06802305579185486, -0.11244285851716995, -0.10292080044746399, 0.2895389199256897, 0.13933327794075012, 0.02619197964668274, 0.25964099168777466, -0.29263749718666077 ]
https://github.com/huggingface/datasets/issues/6069
You can list the dataset's columns with `ds.column_names` before `.map` to check whether the dataset has an `image` column. If it doesn't, then this is a bug. Otherwise, please paste the line with the `.map` call.
KeyError: dataset has no key "image"
### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets
36
KeyError: dataset has no key "image" ### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets You can list the dataset's columns with `ds.column_names` before `.map` to check whether the dataset has an `image` column. If it doesn't, then this is a bug. Otherwise, please paste the line with the `.map` call.
[ -0.3240119218826294, -0.15878307819366455, -0.011707816272974014, 0.1274954080581665, 0.21714580059051514, 0.11436038464307785, 0.432375967502594, 0.18996256589889526, 0.2058950513601303, 0.12764695286750793, 0.33117371797561646, 0.3584793508052826, -0.33052605390548706, 0.021677955985069275, 0.06060277298092842, -0.2712496221065521, 0.29587677121162415, 0.07100914418697357, -0.1497236043214798, -0.25852036476135254, -0.46800553798675537, 0.17331983149051666, -0.15049749612808228, 0.30070722103118896, -0.43998900055885315, 0.0084268469363451, -0.43334129452705383, 0.2824035882949829, -0.0313471220433712, -0.10404077172279358, 0.11095847189426422, -0.22206415235996246, 0.028530798852443695, 0.5023258924484253, -0.00012373820936772972, -0.0580916590988636, 0.3827841579914093, -0.0792393684387207, -0.3645922541618347, -0.22404369711875916, -0.5285874605178833, -0.21975214779376984, -0.07419142127037048, -0.440970242023468, 0.13613474369049072, -0.42527374625205994, 0.10126866400241852, -0.3523350954055786, 0.3348715305328369, 0.156468003988266, 0.12436580657958984, -0.10388672351837158, -0.14852149784564972, -0.11360523104667664, 0.04790365695953369, 0.45757198333740234, 0.05933929979801178, 0.18663139641284943, 0.14653027057647705, -0.36136573553085327, 0.19248484075069427, 0.38053378462791443, -0.0853157639503479, -0.010553435422480106, 0.3869060277938843, 0.13483935594558716, -0.008848533034324646, -0.482502818107605, 0.31377142667770386, 0.1028556376695633, 0.4693731963634491, -0.24288228154182434, -0.40621381998062134, -0.34920036792755127, 0.03956317529082298, 0.13905870914459229, 0.08533813804388046, 0.061132773756980896, -0.09777310490608215, -0.0479680597782135, -0.3275781273841858, -0.2230752855539322, 0.024990864098072052, 0.17770978808403015, -0.24376723170280457, 0.0065879225730896, 0.03231299668550491, 0.24059294164180756, 0.06298569589853287, -0.04873349145054817, -0.1166735291481018, -0.09215684235095978, 0.04457789659500122, 0.3803728520870209, 0.11531828343868256, 0.04602137207984924, 0.03834044188261032, 0.2612226605415344, 0.025414779782295227, -0.4493270814418793, -0.4180811643600464, -0.2146291732788086, -0.025621112436056137, 0.07508637756109238, 0.2680394947528839, 0.35880738496780396, 0.036117084324359894, 0.5942155122756958, 0.057891957461833954, -0.1600528359413147, -0.16611115634441376, -0.06227023899555206, -0.19517870247364044, -0.16532884538173676, 0.33994048833847046, 0.13137732446193695, 0.1982305645942688, 0.07658788561820984, 0.2765145003795624, 0.02996894344687462, 0.1281576156616211, 0.05764783173799515, -0.324815571308136, 0.28960978984832764, 0.08528387546539307, 0.02010779082775116, 0.2765268385410309, 0.18848583102226257, -0.11160637438297272, 0.012613605707883835, -0.21088042855262756, 0.31107932329177856, -0.4532882869243622, -0.04840265214443207, -0.07409501075744629, -0.0544574111700058, 0.2021813690662384, -0.12029200047254562, -0.0033469758927822113, 0.17847226560115814, -0.2817744314670563, -0.10385584831237793, 0.20491796731948853, 0.3524015247821808, -0.0417676605284214, 0.36061832308769226, 0.4333384335041046, -0.36919474601745605, -0.02503737062215805, 0.29474592208862305, -0.4625452756881714, -0.0012661740183830261, -0.019506910815835, 0.03607122227549553, -0.31350433826446533, 0.039871230721473694, -0.6820293664932251, 0.08182363957166672, 0.24868044257164001, -0.007346831262111664, 0.1503525972366333, -0.1805553436279297, -0.20842039585113525, -0.12903517484664917, 0.017841234803199768, 0.6849641799926758, -0.6063417792320251, -0.13462509214878082, -0.13392585515975952, -0.017206337302923203, -0.0464152954518795, -0.0622166246175766, -0.018353214487433434, 0.4591878056526184, -0.3708326816558838, 0.1429987996816635, 0.1637173742055893, -0.5161160826683044, -0.3551771938800812, 0.3549804091453552, -0.16500110924243927, -0.1734168827533722, -0.07296949625015259, 0.15654289722442627, 0.26725348830223083, 0.1512879580259323, -0.0022303853183984756, 0.16201016306877136, -0.19220207631587982, 0.22386318445205688, -0.023279212415218353, 0.04079604893922806, -0.021166041493415833, 0.16211563348770142, 0.47779375314712524, 0.489083856344223, 0.07584063708782196, 0.3215159773826599, -0.13202662765979767, -0.06875067949295044, 0.1512155830860138, 0.27500319480895996, 0.09308033436536789, -0.07254964113235474, 0.2641373574733734, 0.12560872733592987, -0.1721106469631195, 0.24972254037857056, 0.010014735162258148, 0.07337930798530579, -0.5407448410987854, 0.14427593350410461, -0.33388733863830566, 0.0711665228009224, -0.23025065660476685, -0.19821861386299133, 0.006515059620141983, 0.001864854246377945, 0.02994920313358307, 0.34229034185409546, -0.1370961219072342, 0.24112939834594727, 0.11756348609924316, 0.07246667146682739, -0.28770509362220764, 0.2173319011926651, -0.05964624136686325, -0.16445519030094147, -0.18803516030311584, -0.16393467783927917, 0.06809479743242264, -0.017851000651717186, -0.1618698239326477, 0.4425543546676636, 0.14130941033363342, 0.14383529126644135, 0.013786609284579754, 0.06075004115700722, 0.42763957381248474, -0.44742900133132935, 0.02700580097734928, -0.06386065483093262, 0.3040165305137634, -0.02193685621023178, -0.34083372354507446, 0.18017318844795227, -0.05169223994016647, 0.4120114743709564, -0.02526526153087616, 0.2785916328430176, -0.012045755982398987, -0.10850860923528671, -0.18999120593070984, -0.22658780217170715, -0.0954984575510025, -0.5873386859893799, 0.1399913728237152, -0.040577687323093414, 0.023081809282302856, -0.17057234048843384, 0.2951332628726959, 0.13264912366867065, 0.27033182978630066, 0.13610577583312988, -0.2669861316680908, 0.3613688349723816, 0.09730568528175354, 0.38269007205963135, 0.6096727848052979, 0.11081932485103607, -0.31547340750694275, 0.0418461412191391, 0.08771345764398575, 0.15955130755901337, -0.09121599048376083, -0.05936050042510033, 0.2153698205947876, -0.002513705752789974, 0.031415894627571106, 0.13251018524169922, 0.0013085156679153442, -0.18531399965286255, -0.12586452066898346, 0.41475507616996765, -0.184840589761734, 0.2028798758983612, -0.2863861322402954, -0.5297971367835999, 0.14577922224998474, 0.2989865839481354, 0.1079692617058754, -0.351952463388443, -0.006508953403681517, -0.16357414424419403, -0.002610132098197937, 0.11543948203325272, -0.21976909041404724, -0.1455877721309662, 0.06836559623479843, -0.3103463053703308, -0.3483127951622009, -0.22515951097011566, -0.21173013746738434, -0.047353606671094894, 0.11563631147146225, -0.14229674637317657, 0.1573409140110016, -0.35004299879074097, 0.04994355887174606, -0.3351054787635803, -0.20780891180038452, 0.22059881687164307, -0.1588221788406372, 0.32510024309158325, 0.28061696887016296, 0.44686299562454224, -0.4469299018383026, -0.15277348458766937, 0.5118889808654785, -0.24019962549209595, -0.3904946446418762, 0.17321258783340454, -0.014076873660087585, -0.17885959148406982, -0.23799994587898254, -0.044296994805336, -0.07535137981176376, -0.06383737176656723, -0.022321153432130814, -0.05878907069563866, -0.003520393744111061, 0.33211657404899597, 0.5127057433128357, -0.18885399401187897, 0.07337905466556549, -0.33740234375, 0.06907469034194946, 0.058897897601127625, 0.29078733921051025, -0.04460033401846886, -0.39186936616897583, -0.09840863943099976, -0.25158679485321045, 0.13452379405498505, 0.23257505893707275, -0.46489858627319336, -0.08477289974689484, -0.029147829860448837, 0.3001294732093811, 0.1089862659573555, -0.005119675770401955, 0.31420621275901794, 0.05111353099346161, -0.035095468163490295, -0.4094221591949463, 0.07340085506439209, -0.059298720210790634, 0.06812778115272522, 0.31141647696495056, 0.19413575530052185, 0.4733065366744995, 0.02919653058052063, 0.6183464527130127, -0.24337279796600342, -0.17420776188373566, 0.25216981768608093, -0.4487782120704651, 0.3601571321487427, -0.22721552848815918, -0.5549502968788147, 0.09396056830883026, 0.2786133885383606, -0.2225247025489807, 0.0618542842566967, -0.14955691993236542, -0.25049951672554016, -0.19365030527114868, 0.189267098903656, -0.6431412696838379, 0.09716625511646271, -0.021094176918268204, -0.1855359971523285, 0.11025361716747284, 0.03143978863954544, -0.10241349041461945, -0.09929648786783218, 0.1425846815109253, 0.09244833886623383, 0.25114428997039795, 0.4196721017360687, 0.15251314640045166, -0.08839008957147598, -0.28380823135375977, -0.17385920882225037, 0.026941046118736267, -0.042890630662441254, 0.3009849786758423, -0.4160428047180176, -0.0325387641787529, -0.037935126572847366, 0.1457798182964325, 0.7827248573303223, -0.35874760150909424, 0.012929094955325127, 0.08097415417432785, -0.1575625091791153, -0.6299310326576233, -0.0568930022418499, -0.004017837345600128, 0.36147186160087585, -0.3360755443572998, 0.9524468183517456, 0.02569672465324402, 0.10360397398471832, 0.12459787726402283, 0.10940219461917877, -0.25770872831344604, -0.22920987010002136, -0.37078773975372314, -0.3082925081253052, -0.4742870628833771, 0.1182262971997261, 0.10475034266710281, -0.08055558800697327, 0.2987232506275177, 0.17743538320064545, -0.09672505408525467, 0.031956881284713745, -0.24427688121795654, 0.057492926716804504, 0.28274744749069214, -0.016078338027000427, 0.1609988957643509, 0.11917703598737717, 0.16763852536678314, 0.09694278240203857, 0.25329092144966125, 0.024640485644340515, -0.35654765367507935, 0.10023659467697144, -0.1780736893415451, 0.09497702121734619, 0.04454202950000763, -0.19581440091133118, -0.45298171043395996, 0.0768107920885086, 0.04475459083914757, -0.23981858789920807, 0.11804763227701187, 0.1838107705116272, -0.2184196412563324, -0.18042553961277008, -0.3649163842201233, 0.35734128952026367, 0.22078540921211243, -0.07798177748918533, 0.24957552552223206, 0.12574011087417603, -0.2935132682323456, 0.4186384677886963, 0.1568010002374649, 0.6220698356628418, -0.258928120136261, 0.06728485971689224, 0.15036779642105103, 0.0784359872341156, 0.38303855061531067, 0.2517644166946411, -0.1626656949520111, -0.2451448291540146, -0.28508061170578003, -0.06536625325679779, -0.06863240897655487, 0.15769103169441223, 0.15333989262580872, -0.16027653217315674, 0.1989656686782837, -0.31847965717315674, -0.09682843089103699, 0.00269336998462677, -0.18776777386665344, 0.10060524940490723, -0.19492565095424652, 0.1044229120016098, 0.1317252814769745, 0.062474872916936874, 0.46083205938339233, -0.03164058178663254, 0.09709511697292328, -0.48637285828590393, -0.23908868432044983, -0.3068636655807495, -0.038282301276922226, -0.1318470984697342, 0.010328896343708038, -0.1261674463748932, -0.16915562748908997, -0.15554574131965637, 0.7565414905548096, 0.2684207558631897, 0.1277427077293396, -0.07403513789176941, 0.24205663800239563, -0.07645873725414276, 0.32915669679641724, -0.03509358689188957, -0.1371493637561798, 0.19154223799705505, 0.09451277554035187, -0.12067446112632751, -0.19048473238945007, -0.1855766624212265, -0.041790951043367386, -0.29439863562583923, 0.11236780881881714, -0.12290211021900177, 0.09818476438522339, -0.24890899658203125, -0.10857489705085754, 0.10901370644569397, -0.005610711872577667, 0.03359873965382576, 0.0036101657897233963, 0.24150393903255463, 0.2677087187767029, -0.14144863188266754, -0.3298425078392029, 0.05991455540060997, 0.5912409424781799, -0.04429394006729126, -0.04850028455257416, 0.3585474491119385, -0.09833935648202896, 0.035789526998996735, -0.17512628436088562, 0.14800651371479034, 0.4282272458076477, -0.5345397591590881, 0.17009179294109344, -0.04838739335536957, 0.20815271139144897, -0.12930232286453247, 0.08406100422143936, 0.009369923733174801, -0.28442108631134033, -0.020844101905822754, -0.25663280487060547, -0.3511795997619629, 0.30648374557495117, -0.28442999720573425, 0.0723615288734436, -0.0749097540974617, -0.18879979848861694, 0.34785744547843933, -0.08616793900728226, -0.19660083949565887, -0.07229766249656677, -0.20782822370529175, 0.18514007329940796, 0.4709723889827728, 0.640989363193512, -0.03562058135867119, -0.22314149141311646, 0.020210005342960358, 0.07040845602750778, 0.07408607006072998, -0.13598190248012543, 0.031642407178878784, 0.18728262186050415, 0.1758611798286438, 0.12941037118434906, 0.03597315773367882, -0.14346814155578613, 0.0035690348595380783, -0.15675535798072815, 0.006399184465408325, 0.2841333746910095, -0.26796209812164307, 0.39775413274765015, 0.12071537971496582, 0.24989449977874756, 0.3024807572364807, 0.18032878637313843, -0.02670241892337799, 0.10984811186790466, 0.0386195033788681, 0.11973458528518677, 0.47043898701667786, 0.03993541747331619, -0.053312718868255615, -0.131130650639534, -0.3766035735607147, 0.15298505127429962, 0.3627462387084961, -0.33520588278770447, 0.5221237540245056, 0.34508687257766724, 0.2210984081029892, -0.09277169406414032, -0.3312913775444031, 0.07907238602638245, 0.3827647566795349, 0.11458365619182587, -0.23656877875328064, -0.10157932341098785, 0.3075176775455475, 0.17295178771018982, -0.15393836796283722, 0.08449473232030869, 0.01952933520078659, -0.028578616678714752, -0.2193191647529602, 0.07914149761199951, 0.5082217454910278, -0.4141005873680115, 0.12817807495594025, 0.8141906261444092, -0.24807600677013397, 0.2803058326244354, 0.16004317998886108, 0.2969684600830078, -0.21869024634361267, 0.7152098417282104, -0.11234211921691895, 0.25387436151504517, 0.12629544734954834, 0.1359470784664154, 0.31029170751571655, -0.24378012120723724, 0.13873182237148285, -0.0626235380768776, -0.10557249188423157, 0.12147645652294159, -0.1432764083147049, 0.10020190477371216, 0.06333787739276886, -0.05050826445221901, 0.13827848434448242, 0.06069978326559067, -0.13207203149795532, 0.1087697446346283, -0.3438924551010132, -0.06569721549749374, -0.09207111597061157, -0.02998698130249977, 0.02157818153500557, -0.2979593873023987, 0.3541392683982849, 0.061043720692396164, -0.22675485908985138, 0.008562896400690079, -0.3282231092453003, 0.35716840624809265, 0.08839258551597595, -0.20451344549655914, -0.046873562037944794, 0.03554297983646393, 0.03489042446017265, 0.4130970537662506, 0.5499945282936096, 0.3027174472808838, 0.4013916850090027, -0.030809445306658745, 0.2612684369087219, -0.21001049876213074, -0.18028098344802856, -0.08802101761102676, 0.3721499443054199, -0.0654994398355484, 0.090345099568367, 0.12236721813678741, 0.09291327744722366, 0.00002890452742576599, 0.38386768102645874, 0.0839918702840805, 0.2573707103729248, 0.2499019205570221, -0.13741625845432281, -0.3429301083087921, -0.11343199014663696, -0.012656157836318016, 0.2379535436630249, -0.31533318758010864, -0.13154177367687225, 0.3312356173992157, 0.06406812369823456, 0.07636956870555878, -0.08350339531898499, -0.03144346922636032, -0.10177673399448395, 0.3243888020515442, 0.6529425382614136, 0.10993904620409012, -0.23263093829154968, -0.053410232067108154, -0.5609844326972961, -0.05619993805885315, -0.2425207793712616, -0.16940909624099731, 0.03134561702609062, 0.07088860869407654, 0.020000364631414413, 0.09086278080940247, 0.25342339277267456, -0.01128024235367775, -0.09292429685592651, 0.5938346982002258, -0.09362935274839401, -0.5162175893783569, -0.07628575712442398, 0.31152787804603577, -0.0905885398387909, -0.1367376744747162, 0.08107970654964447, 0.018163252621889114, 0.0013035908341407776, -0.07260426878929138, -0.22115638852119446, -0.07552222907543182, -0.2014954537153244, 0.42511826753616333, 0.225094735622406, 0.3298240303993225, -0.05057141184806824, 0.2163849025964737, -0.19030557572841644, -0.15077927708625793, -0.25748589634895325, -0.021600831300020218, 0.07049205899238586, 0.39453744888305664, -0.17865514755249023, -0.11223515123128891, -0.25059306621551514, -0.14625558257102966, 0.20755136013031006, 0.05510178953409195, -0.2879942059516907, 0.16210408508777618, 0.041864603757858276, -0.13428916037082672, -0.04241399094462395, 0.12772426009178162, -0.01638413593173027, 0.08219821751117706, -0.2044335901737213, -0.46662038564682007, 0.3972909450531006, -0.5594139695167542, -0.27965617179870605, 0.0620059110224247, -0.03322435915470123, -0.09282174706459045, 0.02978629432618618, 0.03725288808345795, -0.09574335813522339, 0.2885720133781433, 0.03171955794095993, 0.007330060005187988, 0.01601465418934822, 0.0593714565038681, 0.2000545859336853, -0.03827480971813202, 0.07318392395973206, -0.14725540578365326, 0.059324637055397034, 0.20657186210155487, -0.15162616968154907 ]
https://github.com/huggingface/datasets/issues/6069
This is the piece of code I am running: ``` data_transforms = utils.get_data_augmentation(args) image_dataset = utils.load_image_dataset(args.dataset) def resize(examples): examples["pixel_values"] = [image.convert("RGB").resize((300, 300)) for image in examples["image"]] return examples def preprocess_train(example_batch): print(f"Example batch: \n{example_batch}") example_batch["pixel_values"] = [ data_transforms["train"](image.convert("RGB")) for image in example_batch["pixel_values"] ] return example_batch def preprocess_val(example_batch): example_batch["pixel_values"] = [ data_transforms["val"](image.convert("RGB")) for image in example_batch["pixel_values"] ] return example_batch image_dataset = image_dataset.map(resize, remove_columns=["image"], batched=True) image_dataset["train"].set_transform(preprocess_train) image_dataset["validation"].set_transform(preprocess_val) ``` When I print ds.column_names I get the following `{'train': ['image', 'label'], 'validation': ['image', 'label'], 'test': ['image', 'label']}` The `print(f"Example batch: \n{example_batch}")` in the `preprocess_train` function outputs only labels without images: ``` Example batch: {'label': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]} ``` The weird part of it all is that a sample code runs in a jupyter lab notebook without any bugs, but when I run my scripts from the terminal I get the bug. The same code.
KeyError: dataset has no key "image"
### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets
1,035
KeyError: dataset has no key "image" ### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets This is the piece of code I am running: ``` data_transforms = utils.get_data_augmentation(args) image_dataset = utils.load_image_dataset(args.dataset) def resize(examples): examples["pixel_values"] = [image.convert("RGB").resize((300, 300)) for image in examples["image"]] return examples def preprocess_train(example_batch): print(f"Example batch: \n{example_batch}") example_batch["pixel_values"] = [ data_transforms["train"](image.convert("RGB")) for image in example_batch["pixel_values"] ] return example_batch def preprocess_val(example_batch): example_batch["pixel_values"] = [ data_transforms["val"](image.convert("RGB")) for image in example_batch["pixel_values"] ] return example_batch image_dataset = image_dataset.map(resize, remove_columns=["image"], batched=True) image_dataset["train"].set_transform(preprocess_train) image_dataset["validation"].set_transform(preprocess_val) ``` When I print ds.column_names I get the following `{'train': ['image', 'label'], 'validation': ['image', 'label'], 'test': ['image', 'label']}` The `print(f"Example batch: \n{example_batch}")` in the `preprocess_train` function outputs only labels without images: ``` Example batch: {'label': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3]} ``` The weird part of it all is that a sample code runs in a jupyter lab notebook without any bugs, but when I run my scripts from the terminal I get the bug. The same code.
[ -0.22105160355567932, -0.056508734822273254, -0.06058565527200699, 0.10834148526191711, 0.2632569968700409, 0.15307189524173737, 0.472417950630188, 0.21166539192199707, 0.12338018417358398, 0.16673409938812256, 0.29630032181739807, 0.3156073987483978, -0.3349745273590088, 0.09006109088659286, 0.07807688415050507, -0.2683170735836029, 0.2543318271636963, 0.05102713033556938, -0.16069099307060242, -0.23428907990455627, -0.4243948459625244, 0.1922672986984253, -0.18417540192604065, 0.19716975092887878, -0.4763960540294647, -0.010748889297246933, -0.3853929042816162, 0.21124376356601715, 0.029560476541519165, -0.18921887874603271, 0.16238060593605042, -0.20089638233184814, 0.0675855427980423, 0.47937822341918945, -0.0001221692218678072, 0.005355842411518097, 0.3364503085613251, -0.11743707209825516, -0.40369123220443726, -0.17737643420696259, -0.42535263299942017, -0.22403264045715332, -0.09701293706893921, -0.4342421293258667, 0.11097460240125656, -0.4430277943611145, 0.04261533170938492, -0.37468501925468445, 0.3017173409461975, 0.19298408925533295, 0.1345195323228836, -0.017295539379119873, -0.11297836154699326, -0.04066617786884308, -0.009664196521043777, 0.432124525308609, 0.050964780151844025, 0.1553656905889511, 0.2007409632205963, -0.31698477268218994, 0.23068910837173462, 0.427872896194458, -0.021000254899263382, -0.05068294703960419, 0.32451722025871277, 0.1940402239561081, 0.09117677807807922, -0.5345329642295837, 0.2856532037258148, 0.030749928206205368, 0.35803842544555664, -0.165379136800766, -0.49795424938201904, -0.4647923409938812, -0.012067209929227829, 0.0634840801358223, -0.003738630563020706, 0.06180112063884735, -0.1053880900144577, -0.006770433858036995, -0.3934880495071411, -0.10643869638442993, 0.045600324869155884, 0.23138223588466644, -0.12659409642219543, 0.057548392564058304, 0.015198327600955963, 0.22397050261497498, 0.07937921583652496, 0.027201388031244278, -0.13542066514492035, -0.11181442439556122, 0.0842985063791275, 0.3511124551296234, 0.07077360153198242, 0.10744954645633698, 0.07472006976604462, 0.10093996673822403, 0.01982186734676361, -0.4107201099395752, -0.35039228200912476, -0.1980111002922058, 0.02380472794175148, 0.03503790497779846, 0.23480315506458282, 0.374106228351593, 0.0622900128364563, 0.6092028021812439, -0.01181117445230484, -0.1127866581082344, -0.16915346682071686, -0.06275565922260284, -0.18750062584877014, -0.2086438238620758, 0.3822365999221802, 0.22150251269340515, 0.20130755007266998, 0.1438072919845581, 0.1668301224708557, 0.14027950167655945, 0.06328094005584717, 0.02664346620440483, -0.26510292291641235, 0.271287739276886, 0.09209957718849182, 0.10904553532600403, 0.2572596073150635, 0.2306404560804367, -0.169651061296463, 0.05713777616620064, -0.2430163025856018, 0.2453278750181198, -0.41425567865371704, -0.062387146055698395, -0.013142548501491547, -0.0462709479033947, 0.2901511490345001, -0.12489847838878632, 0.025948433205485344, 0.08767378330230713, -0.20547494292259216, -0.1293615996837616, 0.30762067437171936, 0.3766118884086609, -0.107526034116745, 0.39974671602249146, 0.46931514143943787, -0.3198596239089966, -0.03462749719619751, 0.26960113644599915, -0.4482100307941437, -0.003231354057788849, -0.038776203989982605, 0.04563172161579132, -0.24302980303764343, 0.06048361212015152, -0.7241244316101074, 0.12034532427787781, 0.31662583351135254, 0.14522160589694977, 0.14083899557590485, -0.2530575096607208, -0.17233866453170776, -0.14494869112968445, 0.16069570183753967, 0.5728597640991211, -0.6417495608329773, -0.15107956528663635, -0.017345521599054337, 0.03785966336727142, 0.0421123206615448, -0.15782096982002258, -0.08770573139190674, 0.527733564376831, -0.38218456506729126, 0.11282914876937866, 0.13972383737564087, -0.5896504521369934, -0.36464715003967285, 0.321403443813324, -0.12616728246212006, -0.09245029091835022, -0.08163206279277802, 0.12394203990697861, 0.26909735798835754, 0.17768578231334686, 0.06673087179660797, 0.17025038599967957, -0.1959500014781952, 0.19215098023414612, 0.010538585484027863, 0.034580349922180176, -0.027120735496282578, 0.142207533121109, 0.47660601139068604, 0.3656329810619354, 0.00823940709233284, 0.20762597024440765, -0.021360278129577637, -0.09025830030441284, 0.19197027385234833, 0.29550060629844666, 0.03719311207532883, -0.03176085278391838, 0.2793596386909485, 0.13390909135341644, -0.19981077313423157, 0.3102896511554718, -0.019537702202796936, 0.032462142407894135, -0.486436128616333, 0.0859883725643158, -0.36197948455810547, 0.10518702864646912, -0.3008061945438385, -0.3822154998779297, 0.015133768320083618, 0.08635003119707108, 0.05616103857755661, 0.2974725365638733, -0.11173614859580994, 0.17427022755146027, 0.07342849671840668, 0.08386535942554474, -0.2645668089389801, 0.23371893167495728, -0.014582504518330097, -0.22658468782901764, -0.1879826784133911, -0.11542094498872757, 0.03906560689210892, -0.04304777830839157, -0.18786610662937164, 0.4597579538822174, 0.2447468787431717, 0.09729757159948349, -0.08802299946546555, 0.07237422466278076, 0.36317580938339233, -0.32811832427978516, -0.06458913534879684, -0.03708479180932045, 0.23862724006175995, -0.056507423520088196, -0.2702585458755493, 0.2620984613895416, 0.02046080492436886, 0.46277546882629395, -0.020028255879878998, 0.2492438554763794, -0.012202806770801544, -0.08804017305374146, -0.2451043725013733, -0.25009918212890625, -0.1678895652294159, -0.6099148988723755, 0.21116232872009277, -0.06813791394233704, 0.017470479011535645, -0.07199777662754059, 0.3113039433956146, 0.15175828337669373, 0.18452635407447815, 0.018816934898495674, -0.27243149280548096, 0.36881762742996216, 0.13553522527217865, 0.3566598892211914, 0.49716585874557495, 0.1460738182067871, -0.2567968964576721, -0.02508947253227234, 0.06537267565727234, 0.15850214660167694, -0.11323860287666321, 0.05533113330602646, 0.27358630299568176, 0.009308318607509136, 0.00020822137594223022, 0.12729154527187347, -0.01882735639810562, -0.1159130409359932, -0.12358614802360535, 0.34513431787490845, -0.19523760676383972, 0.23261409997940063, -0.2683989703655243, -0.4454793334007263, 0.11249968409538269, 0.19284993410110474, 0.1553220897912979, -0.42912453413009644, -0.09092578291893005, -0.16989760100841522, -0.050158653408288956, 0.1407257616519928, -0.28042763471603394, -0.19571848213672638, 0.0892249047756195, -0.3475284278392792, -0.24250465631484985, -0.20228904485702515, -0.28953078389167786, -0.04338483512401581, 0.06791700422763824, -0.1639607697725296, 0.23654206097126007, -0.23985375463962555, 0.008726492524147034, -0.21746498346328735, -0.2945020794868469, 0.2022847682237625, -0.20894524455070496, 0.3684842884540558, 0.20645666122436523, 0.3945041596889496, -0.4795875549316406, -0.1939806491136551, 0.4977301359176636, -0.17756322026252747, -0.3670773506164551, 0.0650104433298111, 0.1051405668258667, -0.20633359253406525, -0.233656644821167, -0.13470637798309326, -0.1468864530324936, -0.09044808149337769, -0.06801643967628479, -0.08393457531929016, -0.018361710011959076, 0.3617327809333801, 0.49652087688446045, -0.08191761374473572, 0.1412857472896576, -0.2713218927383423, 0.018090933561325073, 0.007795505225658417, 0.2732961177825928, -0.05884888023138046, -0.37237536907196045, -0.11101076006889343, -0.35240495204925537, 0.17485563457012177, 0.2389761507511139, -0.5152302980422974, -0.1237049400806427, -0.08654776215553284, 0.2520768642425537, 0.170070618391037, 0.07787161320447922, 0.34131157398223877, -0.016303490847349167, -0.04455899819731712, -0.4205484390258789, -0.035212643444538116, 0.0354023203253746, 0.08002050220966339, 0.2901116907596588, 0.11345667392015457, 0.4407598376274109, 0.05208033323287964, 0.7281197309494019, -0.15020662546157837, -0.2564125657081604, 0.22855672240257263, -0.43077266216278076, 0.3369482457637787, -0.21586623787879944, -0.5711135864257812, 0.1509043276309967, 0.2166880965232849, -0.22012200951576233, 0.06291858106851578, -0.1439920961856842, -0.18222415447235107, -0.1330292671918869, 0.2585165500640869, -0.709938108921051, 0.010663926601409912, 0.03360370546579361, -0.2781735360622406, 0.1921958029270172, -0.030937496572732925, 0.061339013278484344, -0.12069584429264069, 0.17537638545036316, 0.006085950881242752, 0.14355263113975525, 0.4494056701660156, 0.15139052271842957, -0.12208108603954315, -0.30430659651756287, -0.24990391731262207, 0.05610804259777069, 0.058372415602207184, 0.3843735456466675, -0.31902649998664856, -0.08251214027404785, -0.02197062224149704, 0.10945837199687958, 0.8251110315322876, -0.3944642245769501, -0.08316068351268768, 0.10791882127523422, -0.22323034703731537, -0.5548210144042969, -0.1789698302745819, -0.029715172946453094, 0.3361853361129761, -0.24368318915367126, 0.8831853270530701, -0.005536526441574097, 0.05024919658899307, 0.09802044928073883, 0.09264630079269409, -0.28015807271003723, -0.14241543412208557, -0.3721628189086914, -0.31455087661743164, -0.48777952790260315, 0.1227923184633255, 0.12665437161922455, -0.015409350395202637, 0.21446068584918976, 0.14557091891765594, -0.09952587634325027, 0.06962210685014725, -0.08697427809238434, 0.06788450479507446, 0.318460613489151, 0.1226758062839508, 0.1687842458486557, 0.1074216440320015, 0.18029482662677765, 0.23405851423740387, 0.30877333879470825, -0.03904575854539871, -0.38007041811943054, 0.12307572364807129, -0.19272825121879578, 0.18510852754116058, 0.08457839488983154, -0.19508783519268036, -0.46400725841522217, 0.12675796449184418, 0.016522474586963654, -0.3567667603492737, 0.25414717197418213, 0.3099832534790039, -0.18380191922187805, -0.2393755167722702, -0.4479488432407379, 0.3313864469528198, 0.1987086832523346, -0.11701908707618713, 0.22449836134910583, 0.11838501691818237, -0.32081010937690735, 0.4012708365917206, 0.22285901010036469, 0.5119650363922119, -0.21828190982341766, 0.13073262572288513, 0.17167669534683228, 0.14780254662036896, 0.3145953416824341, 0.36774352192878723, -0.0747523307800293, -0.22305816411972046, -0.26533395051956177, -0.050446249544620514, -0.10717004537582397, 0.1043623834848404, 0.2631499767303467, -0.1345604956150055, 0.17708110809326172, -0.306742399930954, -0.06864103674888611, -0.049711231142282486, -0.16274961829185486, 0.17582546174526215, -0.2232988327741623, 0.12988542020320892, 0.1456446796655655, 0.08311551809310913, 0.4265226721763611, -0.011644020676612854, 0.050020236521959305, -0.5480877161026001, -0.1982761174440384, -0.27858585119247437, 0.02594636380672455, -0.2507953345775604, 0.0548735149204731, -0.08764344453811646, -0.19641461968421936, -0.2217017263174057, 0.6881704330444336, 0.38642629981040955, 0.11399716883897781, -0.01120872050523758, 0.21639643609523773, -0.047315292060375214, 0.28829312324523926, 0.01702767238020897, -0.21826918423175812, 0.29086777567863464, 0.14348144829273224, -0.11523523926734924, -0.11020702123641968, -0.13250035047531128, -0.07551593333482742, -0.3119603395462036, 0.1089264303445816, -0.14315851032733917, 0.01260022446513176, -0.2528308033943176, -0.025461900979280472, 0.07712138444185257, -0.003513611853122711, 0.03145921602845192, 0.026665840297937393, 0.19558753073215485, 0.3389742076396942, -0.1626158505678177, -0.3396163582801819, 0.04978000000119209, 0.5517612099647522, 0.012874865904450417, -0.15304052829742432, 0.47991296648979187, -0.14411072432994843, 0.056870684027671814, -0.17277872562408447, 0.12660425901412964, 0.42805755138397217, -0.4457979202270508, 0.21538951992988586, 0.019289880990982056, 0.21808677911758423, -0.04897521436214447, 0.060778096318244934, -0.01514458004385233, -0.29890644550323486, -0.046306394040584564, -0.22044560313224792, -0.4115258455276489, 0.29722410440444946, -0.2821071147918701, 0.19009114801883698, -0.13347980380058289, -0.09092153608798981, 0.24928955733776093, -0.04403570294380188, -0.21037209033966064, -0.12038546055555344, -0.19863377511501312, 0.1839972734451294, 0.33338043093681335, 0.5500332117080688, 0.04155606031417847, -0.1864335536956787, 0.026825375854969025, 0.03470320627093315, 0.007054515182971954, -0.14806795120239258, -0.031130988150835037, 0.16407719254493713, 0.16758118569850922, 0.10713725537061691, 0.02713591232895851, -0.1582517921924591, -0.02079860307276249, -0.22569945454597473, 0.10568700730800629, 0.25948286056518555, -0.24154286086559296, 0.4514654278755188, 0.08308253437280655, 0.31119272112846375, 0.40228599309921265, 0.06264795362949371, -0.08951015770435333, 0.19385001063346863, 0.16533048450946808, 0.14323139190673828, 0.4722774922847748, 0.06570477783679962, -0.10838115960359573, -0.1070600301027298, -0.32952335476875305, 0.10482333600521088, 0.32820698618888855, -0.39284011721611023, 0.44079989194869995, 0.27844101190567017, 0.23402974009513855, -0.08143925666809082, -0.3069179058074951, 0.0885685458779335, 0.3555697202682495, 0.14409533143043518, -0.2011251449584961, -0.0563080795109272, 0.2821260690689087, 0.1418699324131012, -0.04635210707783699, 0.14039795100688934, 0.09677424281835556, 0.015373989939689636, -0.23648706078529358, 0.053852394223213196, 0.43005815148353577, -0.3480721414089203, 0.20986878871917725, 0.8231465220451355, -0.17960450053215027, 0.23729917407035828, 0.1530139148235321, 0.2944391667842865, -0.1586039662361145, 0.5478965044021606, -0.04938763007521629, 0.32720309495925903, 0.17201386392116547, 0.09655961394309998, 0.22086532413959503, -0.3062969446182251, 0.049972012639045715, -0.0641247034072876, -0.16715195775032043, 0.2458578199148178, -0.16281776130199432, 0.18245498836040497, 0.02375899627804756, -0.14909127354621887, 0.09630381315946579, 0.06291195750236511, -0.17073971033096313, 0.10268120467662811, -0.3835704028606415, -0.026686467230319977, -0.1630363017320633, -0.07195742428302765, 0.048222362995147705, -0.3867591321468353, 0.2849852442741394, 0.007103279232978821, -0.29304495453834534, -0.04515939950942993, -0.41850385069847107, 0.31832075119018555, 0.11237059533596039, -0.17611142992973328, -0.004950646311044693, 0.04731716588139534, 0.008540180511772633, 0.3743983507156372, 0.5605371594429016, 0.33751344680786133, 0.4255885183811188, -0.07064134627580643, 0.1829783022403717, -0.07705540955066681, -0.1286596655845642, -0.16700804233551025, 0.31727683544158936, -0.10721880942583084, 0.005708988755941391, 0.17625491321086884, 0.09241822361946106, 0.000780932605266571, 0.31552907824516296, 0.0594010204076767, 0.24147555232048035, 0.19566580653190613, -0.12441789358854294, -0.28308331966400146, -0.0008908361196517944, -0.005782075226306915, 0.20288999378681183, -0.3349461555480957, -0.2421729862689972, 0.37387681007385254, 0.01822681725025177, 0.16100077331066132, -0.05033893883228302, -0.014977643266320229, -0.2200442999601364, 0.3493783473968506, 0.6706641316413879, 0.15817146003246307, -0.2768561542034149, -0.04154936969280243, -0.5652069449424744, -0.12935692071914673, -0.2993898093700409, -0.21212609112262726, 0.02897430583834648, 0.09327097982168198, 0.06504683941602707, 0.06987877190113068, 0.2850152552127838, -0.10257840156555176, -0.10785737633705139, 0.5780853033065796, -0.12864938378334045, -0.445624440908432, -0.14436474442481995, 0.32068172097206116, -0.03423237055540085, -0.17971381545066833, 0.05292261391878128, -0.007740084081888199, 0.01625411957502365, -0.06533414125442505, -0.15764257311820984, -0.05853167921304703, -0.11714853346347809, 0.42483681440353394, 0.24639835953712463, 0.315346360206604, -0.07341498136520386, 0.18329355120658875, -0.249421164393425, -0.1552969515323639, -0.2503986954689026, -0.05284114181995392, 0.025524359196424484, 0.5383056402206421, -0.17439305782318115, -0.15827754139900208, -0.22442962229251862, -0.1231590062379837, 0.29335862398147583, -0.10095763951539993, -0.20964621007442474, 0.18865777552127838, -0.059700313955545425, -0.13309600949287415, 0.019499190151691437, 0.20815740525722504, -0.036430541425943375, 0.1198006123304367, -0.17173995077610016, -0.5024545192718506, 0.4158945679664612, -0.509803831577301, -0.3066895604133606, -0.018287915736436844, -0.05259200930595398, -0.1195254921913147, 0.13047367334365845, -0.020783916115760803, -0.10660085082054138, 0.3091920018196106, -0.003588411957025528, -0.09652823954820633, 0.07803496718406677, 0.05338013172149658, 0.18997740745544434, -0.009870722889900208, -0.034680359065532684, -0.12432870268821716, 0.08060872554779053, 0.18326202034950256, -0.14966276288032532 ]
https://github.com/huggingface/datasets/issues/6069
The `remove_columns=["image"]` argument in the `.map` call removes the `image` column from the output, so drop this argument to preserve it.
KeyError: dataset has no key "image"
### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets
21
KeyError: dataset has no key "image" ### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets The `remove_columns=["image"]` argument in the `.map` call removes the `image` column from the output, so drop this argument to preserve it.
[ -0.31539613008499146, -0.10617195814847946, -0.01786615699529648, 0.12197798490524292, 0.21011821925640106, 0.11844329535961151, 0.4634912610054016, 0.20816512405872345, 0.21189382672309875, 0.12302294373512268, 0.30953657627105713, 0.37598663568496704, -0.3384241461753845, 0.01839606463909149, 0.0421210378408432, -0.25269338488578796, 0.29134202003479004, 0.0760250985622406, -0.17509013414382935, -0.25539451837539673, -0.45710062980651855, 0.16980592906475067, -0.1632777452468872, 0.2816019356250763, -0.42522984743118286, -0.006026819348335266, -0.41362735629081726, 0.27423691749572754, -0.030584895983338356, -0.09416037052869797, 0.10970967262983322, -0.23174750804901123, 0.007237046957015991, 0.4983862638473511, -0.0001238898403244093, -0.06064692884683609, 0.36749038100242615, -0.08516206592321396, -0.3637675642967224, -0.21195214986801147, -0.5288520455360413, -0.1956067979335785, -0.07779654115438461, -0.43109193444252014, 0.13721373677253723, -0.4558437764644623, 0.07378576695919037, -0.37951236963272095, 0.3425050973892212, 0.1779770404100418, 0.12380655109882355, -0.09620305895805359, -0.18653342127799988, -0.10196714103221893, 0.047868311405181885, 0.44807082414627075, 0.05179747939109802, 0.16560615599155426, 0.15626183152198792, -0.3621879816055298, 0.1775682419538498, 0.37296897172927856, -0.10033557564020157, -0.028191206976771355, 0.38901254534721375, 0.13580463826656342, -0.008213600143790245, -0.46573421359062195, 0.3463032841682434, 0.11599854379892349, 0.44153979420661926, -0.2548368275165558, -0.40791746973991394, -0.37322819232940674, 0.04193730279803276, 0.1359006017446518, 0.07295697927474976, 0.061487503349781036, -0.10793262720108032, -0.017240174114704132, -0.3679233193397522, -0.23162239789962769, 0.03554613143205643, 0.16282819211483002, -0.2607899308204651, 0.010832980275154114, 0.029063142836093903, 0.2331295907497406, 0.06085037440061569, -0.032974958419799805, -0.07684613019227982, -0.11130361258983612, 0.05387016385793686, 0.3940868377685547, 0.11419083178043365, 0.06653407216072083, 0.07934806495904922, 0.2577861547470093, 0.034885890781879425, -0.45784345269203186, -0.40949055552482605, -0.20678108930587769, -0.03650493174791336, 0.05973033234477043, 0.2889642119407654, 0.37125903367996216, 0.04050734266638756, 0.6056992411613464, 0.05348624661564827, -0.16109690070152283, -0.12349070608615875, -0.047687649726867676, -0.16886137425899506, -0.13177229464054108, 0.3436477482318878, 0.14895829558372498, 0.21103154122829437, 0.07237254083156586, 0.2454422414302826, 0.06236644089221954, 0.1134142279624939, 0.05699384957551956, -0.3238286077976227, 0.2682405412197113, 0.11131487041711807, 0.02567632868885994, 0.2534024715423584, 0.17465105652809143, -0.1296471506357193, 0.015249446034431458, -0.2245878130197525, 0.3076413869857788, -0.44226858019828796, -0.059900663793087006, -0.045774903148412704, -0.05225410312414169, 0.21491049230098724, -0.10516369342803955, -0.007035067304968834, 0.194523885846138, -0.2897392213344574, -0.10312706232070923, 0.22342436015605927, 0.3483177721500397, -0.043570376932621, 0.36576467752456665, 0.43877071142196655, -0.3857583999633789, -0.03324294835329056, 0.30963605642318726, -0.44525396823883057, 0.004459299147129059, -0.03325618803501129, 0.033291518688201904, -0.3252396583557129, 0.0538410022854805, -0.6722304821014404, 0.09407059848308563, 0.24139034748077393, 0.017643287777900696, 0.14437443017959595, -0.2001045197248459, -0.2083805501461029, -0.1267976015806198, 0.02521222084760666, 0.6915944814682007, -0.645862877368927, -0.15132948756217957, -0.10410967469215393, -0.01374687161296606, -0.06529636681079865, -0.06342534720897675, -0.027051134034991264, 0.45782482624053955, -0.3732563555240631, 0.14673246443271637, 0.13157792389392853, -0.52019864320755, -0.35323724150657654, 0.37360453605651855, -0.1541411280632019, -0.1723860204219818, -0.09607355296611786, 0.1351010948419571, 0.2845538556575775, 0.14894026517868042, 0.012962590903043747, 0.15160417556762695, -0.19810079038143158, 0.21006613969802856, -0.01149110496044159, 0.030414864420890808, -0.01071467250585556, 0.15119662880897522, 0.49087056517601013, 0.4862924814224243, 0.07792401313781738, 0.2905188500881195, -0.10962694883346558, -0.06866566836833954, 0.18516191840171814, 0.29252153635025024, 0.09891799092292786, -0.09249864518642426, 0.26397696137428284, 0.12148912250995636, -0.19701194763183594, 0.24606361985206604, 0.01860453188419342, 0.07260730862617493, -0.5650854706764221, 0.12454813718795776, -0.3258368968963623, 0.0782475620508194, -0.24092793464660645, -0.19393093883991241, 0.0074353404343128204, -0.022942401468753815, 0.020653411746025085, 0.32739806175231934, -0.14122602343559265, 0.24691742658615112, 0.13051427900791168, 0.07226085662841797, -0.30200886726379395, 0.22050604224205017, -0.05604004114866257, -0.17715243995189667, -0.16106189787387848, -0.15513291954994202, 0.04301057010889053, -0.01600825972855091, -0.13644981384277344, 0.428968220949173, 0.13101530075073242, 0.13222865760326385, 0.007402539718896151, 0.07047785818576813, 0.4338299334049225, -0.4203728139400482, 0.04252567142248154, -0.07175292074680328, 0.2911023199558258, -0.021481290459632874, -0.37132248282432556, 0.17630651593208313, -0.06821539998054504, 0.42072397470474243, -0.028477385640144348, 0.2705139219760895, -0.020887549966573715, -0.1203308254480362, -0.19171088933944702, -0.24444398283958435, -0.11926195025444031, -0.5536996126174927, 0.15589162707328796, -0.025548743084073067, 0.035284727811813354, -0.14048711955547333, 0.2895563840866089, 0.12234867364168167, 0.24049988389015198, 0.11260746419429779, -0.2686571180820465, 0.34669429063796997, 0.12682008743286133, 0.4006008505821228, 0.6104682087898254, 0.11794988811016083, -0.28978800773620605, 0.055728182196617126, 0.09572114795446396, 0.16129183769226074, -0.08761291950941086, -0.027940768748521805, 0.22437414526939392, 0.01887594722211361, 0.03160286322236061, 0.12220922112464905, -0.02903667837381363, -0.18542461097240448, -0.11902770400047302, 0.42849546670913696, -0.17703120410442352, 0.19961000978946686, -0.3090231120586395, -0.5141733288764954, 0.15467685461044312, 0.30772125720977783, 0.09954917430877686, -0.37940338253974915, -0.009978939779102802, -0.16663524508476257, -0.01965697854757309, 0.12466124445199966, -0.2473084032535553, -0.14362281560897827, 0.07136471569538116, -0.29224056005477905, -0.3258475661277771, -0.24607452750205994, -0.21873508393764496, -0.04401100426912308, 0.10553216934204102, -0.14109061658382416, 0.1576990783214569, -0.331057608127594, 0.03911202400922775, -0.3379523754119873, -0.184519961476326, 0.24261526763439178, -0.1755368709564209, 0.32880711555480957, 0.294497549533844, 0.45356285572052, -0.4651479125022888, -0.13250242173671722, 0.4929733872413635, -0.25082314014434814, -0.390591561794281, 0.15653440356254578, -0.02245359867811203, -0.1849939227104187, -0.24077676236629486, -0.06104911491274834, -0.053991056978702545, -0.06728432327508926, -0.022165022790431976, -0.08065677434206009, 0.0017117345705628395, 0.32518815994262695, 0.5039725303649902, -0.1856163889169693, 0.08048878610134125, -0.355214923620224, 0.06282179057598114, 0.04327784478664398, 0.28549712896347046, -0.03461851924657822, -0.377236545085907, -0.09567064791917801, -0.23723429441452026, 0.14021211862564087, 0.246385857462883, -0.4555397927761078, -0.0813848003745079, -0.029105857014656067, 0.31122028827667236, 0.10670920461416245, 0.010136833414435387, 0.34189677238464355, 0.08317715674638748, -0.031822770833969116, -0.40370529890060425, 0.06178617477416992, -0.058283109217882156, 0.07031124085187912, 0.27802690863609314, 0.20375998318195343, 0.4557226896286011, 0.06993162631988525, 0.6251302361488342, -0.23282241821289062, -0.1584000438451767, 0.2343958467245102, -0.44056814908981323, 0.39363765716552734, -0.21828876435756683, -0.5436656475067139, 0.09445619583129883, 0.290256142616272, -0.22847983241081238, 0.09559579938650131, -0.13810662925243378, -0.24479129910469055, -0.17823849618434906, 0.201995849609375, -0.6604958176612854, 0.07826834172010422, -0.011346878483891487, -0.1803887039422989, 0.12468746304512024, 0.045059844851493835, -0.08062233775854111, -0.1129104346036911, 0.11879114806652069, 0.08708347380161285, 0.20985408127307892, 0.4322345554828644, 0.16417673230171204, -0.10204558074474335, -0.259824275970459, -0.22191056609153748, 0.027261249721050262, -0.049441710114479065, 0.2963925302028656, -0.40300828218460083, -0.055104196071624756, -0.044220730662345886, 0.1526588797569275, 0.7738450765609741, -0.35537514090538025, 0.010578667744994164, 0.08665074408054352, -0.13638974726200104, -0.6321834921836853, -0.06456902623176575, -0.026313304901123047, 0.36704951524734497, -0.34471696615219116, 0.9452192187309265, 0.026025891304016113, 0.07070887833833694, 0.1254885196685791, 0.11858770251274109, -0.2500409185886383, -0.22882746160030365, -0.34838399291038513, -0.31693950295448303, -0.466482549905777, 0.10284857451915741, 0.11550746113061905, -0.06449691951274872, 0.28958824276924133, 0.17207463085651398, -0.06710734963417053, 0.024734675884246826, -0.20626720786094666, 0.03999067842960358, 0.2854095995426178, -0.006115421652793884, 0.15287454426288605, 0.12360942363739014, 0.1924559473991394, 0.08359179645776749, 0.2544158101081848, 0.011322973296046257, -0.35541969537734985, 0.10379844158887863, -0.20676524937152863, 0.11871552467346191, 0.04943215847015381, -0.19169364869594574, -0.4626609683036804, 0.06788575649261475, 0.055288538336753845, -0.23614050447940826, 0.11593755334615707, 0.17358824610710144, -0.23414994776248932, -0.18344032764434814, -0.3547026216983795, 0.3275512456893921, 0.21377640962600708, -0.09493367373943329, 0.25446391105651855, 0.1429910510778427, -0.3092566132545471, 0.4371706545352936, 0.14683324098587036, 0.5944947600364685, -0.2736470401287079, 0.07237453758716583, 0.14311501383781433, 0.10257987678050995, 0.38071179389953613, 0.26523056626319885, -0.14207938313484192, -0.23996642231941223, -0.27444812655448914, -0.07170446217060089, -0.05420490726828575, 0.15880562365055084, 0.18849603831768036, -0.12200310081243515, 0.21876278519630432, -0.3128795027732849, -0.05922074243426323, 0.006525032222270966, -0.190901517868042, 0.12052278220653534, -0.20397399365901947, 0.10634002089500427, 0.12949731945991516, 0.046160973608493805, 0.4305177330970764, -0.027070654556155205, 0.11954309791326523, -0.4908601641654968, -0.22227907180786133, -0.2876821756362915, -0.04494452476501465, -0.12035195529460907, 0.03534594923257828, -0.11162939667701721, -0.18251655995845795, -0.17192214727401733, 0.754426896572113, 0.26833847165107727, 0.10657071322202682, -0.07103313505649567, 0.23788326978683472, -0.077921062707901, 0.33120957016944885, -0.02625701203942299, -0.13937340676784515, 0.18466325104236603, 0.11162043362855911, -0.1251549869775772, -0.18980000913143158, -0.1848505139350891, -0.0463518388569355, -0.29337751865386963, 0.09093669056892395, -0.12742729485034943, 0.07993432879447937, -0.25386524200439453, -0.10021192580461502, 0.1420651525259018, 0.003721095621585846, 0.0292433500289917, 0.01996082253754139, 0.25111499428749084, 0.28446096181869507, -0.14656327664852142, -0.32443246245384216, 0.0578012578189373, 0.5839856863021851, -0.03995282202959061, -0.04951033741235733, 0.3583930432796478, -0.08551326394081116, 0.03828096389770508, -0.17745359241962433, 0.13933880627155304, 0.4534786641597748, -0.5098831057548523, 0.17032195627689362, -0.06673559546470642, 0.20988456904888153, -0.12106314301490784, 0.07828402519226074, -0.02035260945558548, -0.28407835960388184, -0.01197042316198349, -0.23523253202438354, -0.34260305762290955, 0.3260418176651001, -0.2754345238208771, 0.06664460897445679, -0.08456786721944809, -0.18728375434875488, 0.3341316282749176, -0.09636285901069641, -0.1977560818195343, -0.05672943592071533, -0.20772702991962433, 0.19852842390537262, 0.4683372676372528, 0.640036940574646, -0.03802241012454033, -0.23991695046424866, 0.01747835800051689, 0.06067540869116783, 0.07365744560956955, -0.13714788854122162, 0.016086876392364502, 0.18306586146354675, 0.16650106012821198, 0.13609829545021057, 0.034690842032432556, -0.14892567694187164, -0.01111138891428709, -0.1739366203546524, 0.04414898157119751, 0.31594884395599365, -0.2606389820575714, 0.41789886355400085, 0.10487056523561478, 0.23708558082580566, 0.30005311965942383, 0.15403902530670166, -0.024272076785564423, 0.1026168018579483, 0.042835988104343414, 0.13827581703662872, 0.4976676106452942, 0.049838148057460785, -0.05712490901350975, -0.11242140829563141, -0.3884008228778839, 0.15212582051753998, 0.34931936860084534, -0.34433498978614807, 0.5113431811332703, 0.3564925193786621, 0.23433247208595276, -0.11130073666572571, -0.3336527347564697, 0.07105766236782074, 0.3627564609050751, 0.11582859605550766, -0.23738858103752136, -0.11019663512706757, 0.32310613989830017, 0.19491851329803467, -0.1313052475452423, 0.08110813051462173, 0.021060049533843994, -0.031309448182582855, -0.21933308243751526, 0.0837765485048294, 0.5148323774337769, -0.428741991519928, 0.1264771968126297, 0.8168135285377502, -0.24586324393749237, 0.2592743933200836, 0.16633400321006775, 0.2868519723415375, -0.2277839481830597, 0.7445975542068481, -0.09393887221813202, 0.25360122323036194, 0.11834150552749634, 0.15692521631717682, 0.293745219707489, -0.27723103761672974, 0.13443869352340698, -0.0647711530327797, -0.12644919753074646, 0.1104537844657898, -0.123493492603302, 0.12044112384319305, 0.07350870966911316, -0.07285396754741669, 0.13961976766586304, 0.06730112433433533, -0.15071243047714233, 0.09764602780342102, -0.33820194005966187, -0.07923300564289093, -0.06388716399669647, -0.010595723986625671, 0.02327420748770237, -0.3203902840614319, 0.35291528701782227, 0.05408039689064026, -0.23673225939273834, -0.00001766905188560486, -0.32914626598358154, 0.33746904134750366, 0.08196451514959335, -0.1831662654876709, -0.06512970477342606, 0.025635013356804848, 0.04602028429508209, 0.40259021520614624, 0.5419333577156067, 0.28483864665031433, 0.35724300146102905, -0.027589039877057076, 0.2682435214519501, -0.21399755775928497, -0.1941673457622528, -0.10303154587745667, 0.3700680732727051, -0.08151139318943024, 0.09560875594615936, 0.12103179097175598, 0.09517251700162888, 0.00729026272892952, 0.3688284158706665, 0.09231173992156982, 0.2546733617782593, 0.256511926651001, -0.12941798567771912, -0.32641837000846863, -0.13599231839179993, 0.004034347832202911, 0.23393487930297852, -0.29232192039489746, -0.14777372777462006, 0.3481930196285248, 0.06088981777429581, 0.08600647747516632, -0.08418862521648407, -0.032369356602430344, -0.10545352101325989, 0.2986292541027069, 0.6536589860916138, 0.08455169200897217, -0.24474233388900757, -0.0542873740196228, -0.5806489586830139, -0.06243003159761429, -0.25989067554473877, -0.16091784834861755, 0.029562000185251236, 0.07870544493198395, 0.03841381520032883, 0.09729531407356262, 0.21996772289276123, -0.01871398836374283, -0.10301049798727036, 0.5774096846580505, -0.08422242105007172, -0.5010042786598206, -0.0708003044128418, 0.3060348629951477, -0.07880288362503052, -0.15486323833465576, 0.08603999018669128, 0.03939145803451538, -0.001927487552165985, -0.08481157571077347, -0.18388159573078156, -0.07624955475330353, -0.2029157131910324, 0.4069518744945526, 0.23940972983837128, 0.29845327138900757, -0.03747405484318733, 0.1970885545015335, -0.1981472373008728, -0.13781216740608215, -0.2559772729873657, -0.013533573597669601, 0.06164559721946716, 0.3991781771183014, -0.18190240859985352, -0.12855662405490875, -0.23685646057128906, -0.1478220671415329, 0.20865201950073242, 0.07681868970394135, -0.3104313910007477, 0.18348917365074158, 0.02277107536792755, -0.11173374950885773, -0.039716217666864395, 0.13837772607803345, -0.020871326327323914, 0.08461995422840118, -0.19533602893352509, -0.4693582355976105, 0.38119247555732727, -0.5734119415283203, -0.30371561646461487, 0.050654664635658264, -0.03689201921224594, -0.10342462360858917, -0.005682030692696571, 0.021456748247146606, -0.09722213447093964, 0.28399965167045593, -0.011462707072496414, -0.017773106694221497, 0.02634812891483307, 0.02915903553366661, 0.19561238586902618, -0.03197360411286354, 0.06912557780742645, -0.12169141322374344, 0.047392845153808594, 0.20196013152599335, -0.13978107273578644 ]
https://github.com/huggingface/datasets/issues/6069
The problem is not with the removal of the image key. The bug is why only the labels are sent to be process, instead of all the featues or dictionary keys. P.S. I just dropped the removal argument as you've suggested, but that didn't solve the problem, because only the labels are being sent to be processed
KeyError: dataset has no key "image"
### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets
57
KeyError: dataset has no key "image" ### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets The problem is not with the removal of the image key. The bug is why only the labels are sent to be process, instead of all the featues or dictionary keys. P.S. I just dropped the removal argument as you've suggested, but that didn't solve the problem, because only the labels are being sent to be processed
[ -0.1723867654800415, -0.16476085782051086, -0.010105539113283157, 0.16590513288974762, 0.178179532289505, 0.11070188879966736, 0.40471309423446655, 0.22504006326198578, 0.1649189293384552, 0.19509558379650116, 0.314413845539093, 0.38263121247291565, -0.33293986320495605, 0.06640656292438507, -0.05160324275493622, -0.19769641757011414, 0.28553634881973267, 0.09437824040651321, -0.07178698480129242, -0.255048930644989, -0.5275389552116394, 0.11614257097244263, -0.14536847174167633, 0.27280670404434204, -0.43451976776123047, -0.05541408061981201, -0.37475264072418213, 0.2567179203033447, -0.04797952249646187, -0.12923385202884674, 0.02547512948513031, -0.1762768030166626, -0.07658335566520691, 0.44684645533561707, -0.00012780768156517297, -0.03784964978694916, 0.385895699262619, -0.10220786929130554, -0.4012535512447357, -0.16990825533866882, -0.5132812857627869, -0.1030353456735611, -0.014417566359043121, -0.42839714884757996, 0.19396813213825226, -0.49568599462509155, 0.0429111048579216, -0.35435277223587036, 0.3793807923793793, 0.1847541332244873, 0.10056902468204498, -0.19004680216312408, -0.18648557364940643, -0.01090739294886589, 0.07644902169704437, 0.3904533088207245, 0.1148257851600647, 0.16091211140155792, 0.1789909154176712, -0.32263049483299255, 0.1959373652935028, 0.38754886388778687, -0.15571355819702148, -0.030553173273801804, 0.43039774894714355, 0.024512462317943573, 0.08327984064817429, -0.61324542760849, 0.39397993683815, 0.09760870039463043, 0.45646005868911743, -0.20512071251869202, -0.433842271566391, -0.42759233713150024, 0.033389657735824585, 0.0664602741599083, 0.007174499332904816, 0.06030413508415222, -0.209181547164917, -0.04346340522170067, -0.34617018699645996, -0.2993563711643219, -0.008601836860179901, 0.14806000888347626, -0.24589985609054565, 0.10961483418941498, 0.07208871841430664, 0.22707299888134003, 0.07507853209972382, 0.09009280800819397, -0.03994588926434517, -0.10099989175796509, 0.0962740033864975, 0.3386824131011963, 0.09935007989406586, 0.08484996855258942, 0.06569616496562958, 0.24217534065246582, -0.005228281021118164, -0.44700437784194946, -0.5062910914421082, -0.10681654512882233, 0.020815491676330566, 0.060361336916685104, 0.3553221523761749, 0.35508885979652405, 0.1366996467113495, 0.5536136031150818, 0.10887283086776733, -0.18501566350460052, -0.11251247674226761, -0.030885864049196243, -0.11358959972858429, -0.07359938323497772, 0.29724955558776855, 0.17793282866477966, 0.2395441234111786, 0.07658588886260986, 0.18510019779205322, 0.008368000388145447, 0.11343137919902802, 0.07436320185661316, -0.3094339668750763, 0.28029030561447144, 0.08334603905677795, 0.1310386061668396, 0.24649903178215027, 0.17180374264717102, -0.16957728564739227, 0.07714872062206268, -0.20238158106803894, 0.28618139028549194, -0.37059924006462097, -0.13593527674674988, 0.01020415872335434, -0.04600757360458374, 0.2391388863325119, -0.06095686927437782, 0.016990449279546738, 0.14016902446746826, -0.2595585882663727, -0.16109907627105713, 0.2341555953025818, 0.3801703453063965, -0.08061137795448303, 0.384976863861084, 0.4293864965438843, -0.4190455675125122, -0.007389836013317108, 0.3405275046825409, -0.43189626932144165, -0.003529064357280731, 0.06204238533973694, 0.006969391368329525, -0.25226494669914246, 0.09532254934310913, -0.6512404084205627, 0.10429622232913971, 0.19219954311847687, 0.07886013388633728, 0.042176637798547745, -0.19122500717639923, -0.1861705183982849, -0.1405118703842163, -0.01400364562869072, 0.6709108948707581, -0.6312061548233032, -0.16796772181987762, -0.07977909594774246, -0.012565872631967068, 0.03429007530212402, -0.005700050853192806, -0.05241118371486664, 0.5209298729896545, -0.3237212002277374, 0.08366033434867859, 0.06711915135383606, -0.5798282027244568, -0.3782658576965332, 0.4013734757900238, -0.14086279273033142, -0.11389638483524323, -0.06742937862873077, 0.1449842005968094, 0.3234722316265106, 0.18384793400764465, -0.03124110773205757, 0.08334869146347046, -0.18533292412757874, 0.18263109028339386, 0.01709982007741928, 0.03653118014335632, 0.011950276792049408, 0.1060863584280014, 0.5382447242736816, 0.5622206926345825, 0.0298293549567461, 0.2889699339866638, -0.026274558156728745, -0.057391803711652756, 0.21069654822349548, 0.30936822295188904, 0.09224306046962738, -0.06117912009358406, 0.28214532136917114, 0.14496386051177979, -0.16741499304771423, 0.29909324645996094, -0.042243845760822296, 0.11278008669614792, -0.6442785263061523, 0.07770347595214844, -0.28335320949554443, 0.06416348367929459, -0.282585471868515, -0.21305334568023682, -0.02751203067600727, -0.05731120705604553, -0.01475939154624939, 0.28883683681488037, -0.18167394399642944, 0.23327180743217468, 0.09008524566888809, 0.1366458237171173, -0.22400721907615662, 0.13668981194496155, -0.060045354068279266, -0.15659098327159882, -0.16695472598075867, -0.14200130105018616, 0.07472385466098785, -0.024960016831755638, -0.13976146280765533, 0.403264582157135, 0.18911214172840118, 0.07146187871694565, -0.04768992215394974, 0.08728942275047302, 0.4486246705055237, -0.3561663329601288, -0.0052514998242259026, -0.08135846257209778, 0.3504151701927185, -0.02912437915802002, -0.3452538847923279, 0.14368945360183716, -0.09234891086816788, 0.5224118232727051, 0.023621834814548492, 0.25382000207901, -0.018180139362812042, -0.16192379593849182, -0.18168333172798157, -0.21873056888580322, -0.18877649307250977, -0.6474984884262085, 0.11959923058748245, -0.07374955713748932, 0.01627257466316223, -0.16013169288635254, 0.32567164301872253, 0.1687404066324234, 0.25589317083358765, 0.08498207479715347, -0.26491227746009827, 0.35131555795669556, 0.11454570293426514, 0.3567957580089569, 0.5610657930374146, 0.11153078079223633, -0.27462804317474365, 0.04297129064798355, 0.19427578151226044, 0.15428268909454346, -0.0000652894377708435, 0.08866965770721436, 0.2517947554588318, 0.06053958833217621, 0.04353456571698189, 0.1700458526611328, -0.0671638697385788, -0.15223559737205505, -0.12902256846427917, 0.39008378982543945, -0.16036835312843323, 0.17541086673736572, -0.35125890374183655, -0.6250008344650269, 0.20654822885990143, 0.38823142647743225, 0.03066481649875641, -0.3856756389141083, 0.049346230924129486, -0.1934700608253479, -0.057239413261413574, 0.06204463541507721, -0.18654848635196686, -0.17105190455913544, 0.023797959089279175, -0.32677873969078064, -0.35479703545570374, -0.27297765016555786, -0.18893471360206604, -0.06069016829133034, 0.06234234198927879, -0.16855351626873016, 0.2105245143175125, -0.3410426378250122, -0.07674331963062286, -0.2445656955242157, -0.20471253991127014, 0.2668527364730835, -0.1892363578081131, 0.3256411552429199, 0.2715986669063568, 0.5325111150741577, -0.4616181254386902, -0.1358475536108017, 0.46939659118652344, -0.2387002557516098, -0.43882983922958374, 0.13980577886104584, 0.05404331907629967, -0.10457669943571091, -0.28421175479888916, -0.04661932960152626, -0.04439328610897064, -0.09141816943883896, 0.053297966718673706, -0.040780264884233475, 0.07770353555679321, 0.3005847930908203, 0.42853033542633057, -0.24720235168933868, 0.09440271556377411, -0.25257864594459534, 0.09152853488922119, 0.09517379105091095, 0.19811120629310608, 0.03260856866836548, -0.3280063271522522, -0.06945748627185822, -0.1883847713470459, 0.1778550148010254, 0.26064789295196533, -0.5224291086196899, -0.13111594319343567, -0.05748344212770462, 0.32820063829421997, 0.0991949662566185, 0.05954995006322861, 0.3659003674983978, 0.12835758924484253, -0.018930930644273758, -0.40268149971961975, 0.0540204793214798, -0.042954541742801666, 0.005226494744420052, 0.22714844346046448, 0.21521702408790588, 0.45988407731056213, 0.09288524091243744, 0.71656334400177, -0.3211069107055664, -0.07761060446500778, 0.25192582607269287, -0.3550204038619995, 0.38520869612693787, -0.23567599058151245, -0.5562465786933899, 0.09069447219371796, 0.21142834424972534, -0.20915836095809937, 0.08717848360538483, -0.1810724139213562, -0.2635878622531891, -0.21404829621315002, 0.19561409950256348, -0.7114017605781555, 0.020873218774795532, -0.05030345171689987, -0.20966115593910217, 0.14206336438655853, 0.09183409810066223, -0.0758865475654602, -0.02428620308637619, 0.17123088240623474, 0.10001049190759659, 0.20127521455287933, 0.5163568258285522, 0.12524046003818512, -0.13407185673713684, -0.2942972779273987, -0.23421333730220795, 0.048612721264362335, -0.03110087290406227, 0.2817261219024658, -0.37251541018486023, -0.045871663838624954, 0.023445598781108856, 0.1538611203432083, 0.8323478102684021, -0.30927911400794983, 0.012493617832660675, 0.06447065621614456, -0.18700706958770752, -0.6176955699920654, -0.03111831471323967, -0.019525811076164246, 0.3756757378578186, -0.22779321670532227, 0.9286015629768372, -0.019809313118457794, 0.014982126653194427, 0.024380598217248917, 0.21105284988880157, -0.2932758331298828, -0.20498822629451752, -0.39414194226264954, -0.3734143376350403, -0.5144351124763489, 0.12728622555732727, 0.16845813393592834, -0.04577528312802315, 0.2315489798784256, 0.15486910939216614, -0.1543542742729187, -0.011824555695056915, -0.17279218137264252, -0.03557267785072327, 0.2763961851596832, -0.03110603615641594, 0.11058492213487625, 0.06930260360240936, 0.29634156823158264, 0.10836368054151535, 0.2616736888885498, 0.01872594654560089, -0.41347891092300415, 0.1221785843372345, -0.25265148282051086, 0.13793042302131653, 0.19950270652770996, -0.14846229553222656, -0.3929803669452667, 0.09156861156225204, 0.0727807879447937, -0.2565907835960388, 0.1465091109275818, 0.16418412327766418, -0.26491251587867737, -0.220218688249588, -0.3002622425556183, 0.21022267639636993, 0.24055294692516327, -0.1785849779844284, 0.24247629940509796, 0.16398528218269348, -0.3705769181251526, 0.43679240345954895, 0.16760645806789398, 0.7477710843086243, -0.2620195746421814, 0.10140988230705261, 0.02518784999847412, 0.09772384911775589, 0.3990289568901062, 0.25243839621543884, -0.017534978687763214, -0.23799127340316772, -0.32667604088783264, -0.0504889115691185, -0.05606967583298683, 0.16212520003318787, 0.24112370610237122, -0.0529816560447216, 0.2546001970767975, -0.3844655752182007, -0.14452090859413147, 0.06609136611223221, -0.08651954680681229, 0.12571729719638824, -0.16990593075752258, 0.14780251681804657, 0.07102114707231522, 0.0507587268948555, 0.41582611203193665, -0.06331956386566162, 0.11890148371458054, -0.4548831284046173, -0.2859112620353699, -0.17484334111213684, -0.06456710398197174, -0.2332264482975006, 0.06393919885158539, -0.2443273663520813, -0.10253943502902985, -0.15346217155456543, 0.705103874206543, 0.30656296014785767, 0.17319193482398987, -0.008291809819638729, 0.254081130027771, -0.010149337351322174, 0.3485758304595947, -0.02297809161245823, -0.06499982625246048, 0.17772682011127472, 0.08082985877990723, -0.11358752846717834, -0.20101267099380493, -0.2913610339164734, -0.10470804572105408, -0.36099982261657715, 0.12072445452213287, -0.1164008229970932, 0.1352592259645462, -0.19584286212921143, -0.08968411386013031, 0.14266708493232727, -0.042975008487701416, 0.004928857088088989, 0.06216062605381012, 0.21821121871471405, 0.3764694035053253, -0.21409812569618225, -0.3542618751525879, 0.04932565614581108, 0.5025840401649475, 0.0877191498875618, -0.06950955092906952, 0.41339191794395447, -0.1861724555492401, 0.029671095311641693, -0.1731906682252884, 0.05985061824321747, 0.33316540718078613, -0.5205097198486328, 0.2568167746067047, -0.035688187927007675, 0.15251706540584564, -0.1897096335887909, 0.0774497389793396, -0.09895355254411697, -0.24287906289100647, -0.05980261415243149, -0.19733977317810059, -0.33250755071640015, 0.3676427900791168, -0.2760932743549347, 0.07235553860664368, -0.10415876656770706, -0.16912078857421875, 0.29126712679862976, -0.0775400921702385, -0.17466846108436584, -0.09155373275279999, -0.19044440984725952, 0.2808797359466553, 0.4790225028991699, 0.6056616306304932, -0.11679719388484955, -0.2152782678604126, -0.016155201941728592, 0.06403285264968872, 0.16734258830547333, -0.1064852848649025, 0.02642122656106949, 0.21361799538135529, 0.14617900550365448, 0.15803489089012146, 0.03703617304563522, -0.12907753884792328, -0.0019142832607030869, -0.11559271812438965, 0.055471621453762054, 0.2762681841850281, -0.22329455614089966, 0.47165560722351074, 0.12869980931282043, 0.3426986634731293, 0.3061631917953491, 0.17837253212928772, -0.056435152888298035, 0.16823874413967133, 0.06919911503791809, 0.132903590798378, 0.47577521204948425, 0.050389811396598816, -0.09387710690498352, -0.19204315543174744, -0.4099353849887848, 0.12242130935192108, 0.3057541251182556, -0.3461534082889557, 0.49837997555732727, 0.3408578336238861, 0.2194051295518875, -0.010793633759021759, -0.3118436336517334, 0.01524847000837326, 0.4210485816001892, 0.10269729048013687, -0.24667835235595703, -0.15446621179580688, 0.3482765853404999, 0.0801127552986145, -0.14898481965065002, 0.12294772267341614, 0.04190964996814728, 0.03593777120113373, -0.2318228930234909, 0.03318093717098236, 0.43823257088661194, -0.44369322061538696, 0.1647682785987854, 0.7715485095977783, -0.2441800981760025, 0.2026938796043396, 0.15153823792934418, 0.27348360419273376, -0.2885819971561432, 0.6977822184562683, -0.11622827500104904, 0.2576329708099365, 0.11234787106513977, 0.11822148412466049, 0.3291006088256836, -0.216222882270813, 0.10918574035167694, -0.05504363030195236, -0.2118862420320511, 0.13811030983924866, -0.11086288839578629, 0.05363282561302185, 0.12669280171394348, -0.16337428987026215, 0.21627935767173767, 0.10728631913661957, -0.17016412317752838, 0.09031535685062408, -0.37944555282592773, -0.10704158246517181, -0.026794523000717163, -0.02509232610464096, 0.00767375435680151, -0.3106285333633423, 0.30798596143722534, 0.06218448281288147, -0.282448947429657, -0.053372688591480255, -0.35901933908462524, 0.27658337354660034, 0.18915899097919464, -0.17978426814079285, -0.18899239599704742, 0.03855539485812187, 0.06066266819834709, 0.31165727972984314, 0.5192857980728149, 0.22550025582313538, 0.32339155673980713, -0.08818141371011734, 0.2102673351764679, -0.21271923184394836, -0.17741014063358307, -0.16402897238731384, 0.41100040078163147, 0.021246638149023056, 0.16768227517604828, 0.1343325674533844, 0.052791424095630646, 0.01814081147313118, 0.3044518828392029, 0.09588785469532013, 0.2676004469394684, 0.2437361180782318, -0.054906997829675674, -0.23562443256378174, -0.13774368166923523, 0.08054803311824799, 0.2786083221435547, -0.27806252241134644, -0.1482142060995102, 0.31719452142715454, 0.0919400304555893, 0.099868044257164, -0.12444773316383362, -0.04343515262007713, -0.17211753129959106, 0.2623886466026306, 0.6321690082550049, 0.17307253181934357, -0.2536117434501648, 0.0028035640716552734, -0.5640813708305359, -0.04631423205137253, -0.1965886652469635, -0.20094087719917297, 0.11160324513912201, 0.08103421330451965, 0.07151849567890167, 0.08285640180110931, 0.15757328271865845, -0.09471511840820312, -0.04215565323829651, 0.5367688536643982, -0.08277022838592529, -0.35896480083465576, -0.093613401055336, 0.3619405925273895, -0.06894585490226746, -0.19731879234313965, 0.10195629298686981, 0.05241285264492035, -0.024872422218322754, -0.08696568012237549, -0.15653644502162933, -0.05984984338283539, -0.16044774651527405, 0.3363994061946869, 0.2990800440311432, 0.28338637948036194, -0.07616568356752396, 0.07865852862596512, -0.13067440688610077, -0.10893571376800537, -0.3627724051475525, -0.02789369598031044, 0.13487550616264343, 0.39113274216651917, -0.13420376181602478, -0.10413147509098053, -0.2512757182121277, -0.12291127443313599, 0.1601063311100006, 0.03737054020166397, -0.2775339186191559, 0.15186527371406555, 0.05826116353273392, -0.05906161665916443, -0.022040899842977524, 0.16377414762973785, 0.021365618333220482, -0.025574881583452225, -0.3404080271720886, -0.464516282081604, 0.43882107734680176, -0.5533766150474548, -0.3727949559688568, 0.03527013957500458, 0.020272206515073776, -0.06371907889842987, -0.0011313855648040771, 0.08452391624450684, -0.1498311311006546, 0.29974454641342163, -0.009368986822664738, -0.07611964643001556, 0.05098344385623932, -0.04938528314232826, 0.15991592407226562, -0.028665494173765182, -0.04658564552664757, -0.06708358228206635, 0.020880848169326782, 0.13420549035072327, -0.17141760885715485 ]
https://github.com/huggingface/datasets/issues/6069
All the `image_dataset.column_names` after the `map` call should also be present in `preprocess_train `/`preprocess_val` unless (input) `columns` in `set_transform` are specified. If that's not the case, we need a full reproducer (not snippets) with the environment info.
KeyError: dataset has no key "image"
### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets
37
KeyError: dataset has no key "image" ### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets All the `image_dataset.column_names` after the `map` call should also be present in `preprocess_train `/`preprocess_val` unless (input) `columns` in `set_transform` are specified. If that's not the case, we need a full reproducer (not snippets) with the environment info.
[ -0.3361893892288208, -0.09481370449066162, -0.013615399599075317, 0.11722663044929504, 0.2425265610218048, 0.10842374712228775, 0.46977174282073975, 0.20008452236652374, 0.19682937860488892, 0.1282196193933487, 0.32837414741516113, 0.384207546710968, -0.3407841920852661, 0.03303363919258118, 0.0770011767745018, -0.2610790729522705, 0.29122665524482727, 0.08057264983654022, -0.21310944855213165, -0.23923583328723907, -0.4572465419769287, 0.1998981088399887, -0.1820434033870697, 0.29386794567108154, -0.45724666118621826, 0.0069100093096494675, -0.43153437972068787, 0.25980237126350403, -0.04024975746870041, -0.11691802740097046, 0.1197466254234314, -0.23332004249095917, 0.0405748188495636, 0.5234624147415161, -0.00012229276762809604, -0.037954941391944885, 0.358302503824234, -0.09638771414756775, -0.3299914002418518, -0.2293689101934433, -0.5258889198303223, -0.20787887275218964, -0.06339818239212036, -0.4594169557094574, 0.1164882704615593, -0.4443151354789734, 0.08734188973903656, -0.3693397641181946, 0.34819918870925903, 0.2003520429134369, 0.13521656394004822, -0.07793507725000381, -0.19431568682193756, -0.10448887944221497, 0.03914399445056915, 0.4301532208919525, 0.026481300592422485, 0.13572105765342712, 0.1568145453929901, -0.37908560037612915, 0.17313331365585327, 0.3501141667366028, -0.058565814048051834, -0.039728812873363495, 0.3621806800365448, 0.17488396167755127, -0.030147362500429153, -0.4472680389881134, 0.2808803617954254, 0.11380642652511597, 0.42104843258857727, -0.25425437092781067, -0.38789746165275574, -0.36299777030944824, 0.02346518263220787, 0.09265081584453583, 0.1074371486902237, 0.06169033795595169, -0.1250155121088028, -0.01226772740483284, -0.38002756237983704, -0.1955638825893402, 0.039707571268081665, 0.1722288727760315, -0.22373497486114502, 0.020095091313123703, 0.020805124193429947, 0.2343129813671112, 0.029028216376900673, -0.021189000457525253, -0.0734667256474495, -0.1220824122428894, 0.06712354719638824, 0.4027016758918762, 0.0874338373541832, 0.06485816091299057, 0.05442875251173973, 0.20388013124465942, 0.01267772912979126, -0.4352189600467682, -0.3916443884372711, -0.22639718651771545, -0.025483321398496628, 0.06528711318969727, 0.2660505473613739, 0.3541235327720642, 0.018768291920423508, 0.5952317118644714, 0.07595571875572205, -0.1348760724067688, -0.13120660185813904, -0.06164555251598358, -0.21226024627685547, -0.17137642204761505, 0.3505284786224365, 0.15440069139003754, 0.1925041675567627, 0.08630426228046417, 0.26401087641716003, 0.1013660803437233, 0.13013523817062378, 0.029721278697252274, -0.30987292528152466, 0.2792159616947174, 0.0746903270483017, 0.03557634726166725, 0.2548781931400299, 0.13568010926246643, -0.11928754299879074, 0.008431442081928253, -0.2327856421470642, 0.2992153465747833, -0.5039143562316895, -0.03258500620722771, -0.028980303555727005, -0.02705470472574234, 0.2215782105922699, -0.07804583013057709, -0.02470986917614937, 0.16354325413703918, -0.26910918951034546, -0.10972638428211212, 0.24869558215141296, 0.3586122989654541, -0.04413209855556488, 0.38629257678985596, 0.41700980067253113, -0.3391103148460388, -0.03879368305206299, 0.3146717846393585, -0.4822486937046051, -0.013561896979808807, -0.037321679294109344, 0.04781036823987961, -0.33155596256256104, 0.0708966925740242, -0.6356047987937927, 0.058396872133016586, 0.2683280110359192, 0.030405990779399872, 0.15969349443912506, -0.18768125772476196, -0.22383956611156464, -0.1258106827735901, 0.0946248397231102, 0.6475911140441895, -0.6407673358917236, -0.14380314946174622, -0.0606519915163517, -0.008169872686266899, -0.027164075523614883, -0.09269972890615463, -0.03547115623950958, 0.4841839075088501, -0.3788148760795593, 0.12464913725852966, 0.1641700267791748, -0.4915582537651062, -0.33146747946739197, 0.3640623688697815, -0.16353994607925415, -0.1781354397535324, -0.06682948768138885, 0.11364160478115082, 0.245047926902771, 0.15299458801746368, 0.017862048000097275, 0.18129819631576538, -0.21465140581130981, 0.20626281201839447, 0.010021626949310303, 0.013936072587966919, -0.07324366271495819, 0.1736583113670349, 0.4916377663612366, 0.44458287954330444, 0.039904285222291946, 0.28416499495506287, -0.09435756504535675, -0.05562621355056763, 0.15515783429145813, 0.29970964789390564, 0.11298167705535889, -0.07873513549566269, 0.2594798505306244, 0.12087420374155045, -0.1835166960954666, 0.27302899956703186, 0.051381632685661316, 0.0460393987596035, -0.5548986792564392, 0.1409112513065338, -0.34386372566223145, 0.08335862308740616, -0.2514120042324066, -0.24236203730106354, 0.013998597860336304, 0.00436011515557766, 0.003790624439716339, 0.307512104511261, -0.16862499713897705, 0.2509406805038452, 0.07020024955272675, 0.07512640953063965, -0.27909937500953674, 0.20953458547592163, -0.07736038416624069, -0.2137647271156311, -0.19617709517478943, -0.15549099445343018, 0.01709899865090847, -0.02214086428284645, -0.16083988547325134, 0.4482753872871399, 0.16433629393577576, 0.12639962136745453, -0.027695942670106888, 0.08323806524276733, 0.4086480140686035, -0.4075549840927124, -0.007484856061637402, -0.1088450700044632, 0.26938995718955994, -0.017010711133480072, -0.39045029878616333, 0.1843569427728653, -0.07454170286655426, 0.4301844835281372, -0.016744114458560944, 0.25524479150772095, -0.0404546856880188, -0.11180417984724045, -0.20167918503284454, -0.23524110019207, -0.10113665461540222, -0.5321694016456604, 0.1640482097864151, -0.002882879227399826, 0.03880082070827484, -0.20056506991386414, 0.32441750168800354, 0.12939606606960297, 0.24665884673595428, 0.10962250828742981, -0.23133404552936554, 0.3654141426086426, 0.15133441984653473, 0.3799086809158325, 0.5697734355926514, 0.12575767934322357, -0.3021657466888428, 0.057005204260349274, 0.04626776650547981, 0.14222191274166107, -0.10778990387916565, -0.02894219011068344, 0.24092312157154083, 0.009072094224393368, -0.012302296236157417, 0.15107882022857666, 0.0065034180879592896, -0.1849530041217804, -0.09571515023708344, 0.3911617398262024, -0.1875426322221756, 0.19853690266609192, -0.2972397208213806, -0.45501768589019775, 0.12573379278182983, 0.33097371459007263, 0.13607941567897797, -0.34098291397094727, -0.05664163455367088, -0.22068852186203003, -0.002224445343017578, 0.15072324872016907, -0.2975086569786072, -0.1232679933309555, 0.07822679728269577, -0.2880474627017975, -0.2929736375808716, -0.2196623831987381, -0.23117965459823608, -0.03583153709769249, 0.10612885653972626, -0.17101025581359863, 0.1555439978837967, -0.31433454155921936, 0.04578308016061783, -0.2614069879055023, -0.2081233561038971, 0.2638946771621704, -0.16555704176425934, 0.34444719552993774, 0.277523010969162, 0.43284058570861816, -0.4202677607536316, -0.15894514322280884, 0.5039774179458618, -0.20972207188606262, -0.3816976547241211, 0.12116222083568573, -0.008810348808765411, -0.19199438393115997, -0.23883450031280518, -0.08907507359981537, -0.04456370323896408, -0.05737818777561188, -0.03203282132744789, -0.09261992573738098, 0.019466858357191086, 0.3192809224128723, 0.5174513459205627, -0.1573723554611206, 0.0539398118853569, -0.28794538974761963, 0.06560014188289642, 0.03895089030265808, 0.2878052890300751, -0.044100068509578705, -0.3744606673717499, -0.10217990726232529, -0.2716105282306671, 0.14776599407196045, 0.23349229991436005, -0.48119449615478516, -0.0977616012096405, -0.05842778831720352, 0.3230386972427368, 0.11828508973121643, 0.013162156566977501, 0.34300994873046875, 0.0580260343849659, -0.025662057101726532, -0.4222084581851959, 0.05933821201324463, -0.007932841777801514, 0.04671861603856087, 0.26678207516670227, 0.20379692316055298, 0.49537432193756104, 0.06758247315883636, 0.6670224666595459, -0.20856991410255432, -0.1931271106004715, 0.25992563366889954, -0.442496120929718, 0.37106698751449585, -0.2217104732990265, -0.5274102091789246, 0.09448710083961487, 0.27104535698890686, -0.23227427899837494, 0.056553781032562256, -0.14028313755989075, -0.23901094496250153, -0.18784385919570923, 0.2539939880371094, -0.6283789873123169, 0.06260834634304047, 0.017941279336810112, -0.1742565631866455, 0.148115336894989, 0.0027052611112594604, -0.06301773339509964, -0.0908113345503807, 0.14431998133659363, 0.11847051233053207, 0.18108633160591125, 0.4108014404773712, 0.13255241513252258, -0.10791335999965668, -0.27677127718925476, -0.20591890811920166, -0.014828883111476898, -0.039016690105199814, 0.3342912793159485, -0.39731258153915405, -0.0756671130657196, -0.04448956623673439, 0.13096679747104645, 0.7565439939498901, -0.3849175274372101, -0.01971544325351715, 0.11039415001869202, -0.1438637226819992, -0.6080487966537476, -0.09738538414239883, -0.036623310297727585, 0.36915892362594604, -0.340038925409317, 0.9584867358207703, 0.03424881398677826, 0.06699420511722565, 0.162226140499115, 0.06748590618371964, -0.26332634687423706, -0.2612909972667694, -0.3399541974067688, -0.2704662084579468, -0.42586737871170044, 0.08591032028198242, 0.13262055814266205, -0.07667894661426544, 0.2645252048969269, 0.13748353719711304, -0.0738680437207222, 0.0577344074845314, -0.19607748091220856, 0.04535600543022156, 0.26624596118927, 0.0038737207651138306, 0.21415266394615173, 0.1311631202697754, 0.17355115711688995, 0.06874794512987137, 0.2948131859302521, -0.046649523079395294, -0.31892403960227966, 0.16521784663200378, -0.1919643133878708, 0.15478067100048065, 0.06497285515069962, -0.18156743049621582, -0.4734398126602173, 0.07483620941638947, 0.01234620250761509, -0.2978898584842682, 0.16559873521327972, 0.22189879417419434, -0.1903071105480194, -0.15031664073467255, -0.4059574604034424, 0.3592112958431244, 0.2660815715789795, -0.10710997879505157, 0.2631258964538574, 0.11952350288629532, -0.2813906967639923, 0.4178665280342102, 0.1848599761724472, 0.6091033220291138, -0.27113160490989685, 0.09717781841754913, 0.13314147293567657, 0.0956394374370575, 0.3527291417121887, 0.24867312610149384, -0.1717018187046051, -0.262575626373291, -0.30128127336502075, -0.05667051672935486, -0.09302794188261032, 0.16898290812969208, 0.18086916208267212, -0.10149285942316055, 0.20384946465492249, -0.2820587158203125, -0.07701198756694794, 0.02257518470287323, -0.18705877661705017, 0.13530105352401733, -0.24267728626728058, 0.1470029503107071, 0.13150420784950256, 0.061871238052845, 0.4289014935493469, -0.021363623440265656, 0.12869396805763245, -0.48716363310813904, -0.1965547353029251, -0.3073815107345581, -0.023101389408111572, -0.12721379101276398, 0.009147677570581436, -0.10763898491859436, -0.20329463481903076, -0.1489291787147522, 0.7575446367263794, 0.2707512080669403, 0.14080087840557098, -0.045831430703401566, 0.260772705078125, -0.06496207416057587, 0.32539209723472595, -0.03146357461810112, -0.14932739734649658, 0.23486241698265076, 0.12543581426143646, -0.12119698524475098, -0.16851267218589783, -0.18787464499473572, -0.017808444797992706, -0.2741137742996216, 0.09143461287021637, -0.09781601279973984, 0.04794284328818321, -0.28215911984443665, -0.09910807758569717, 0.17848694324493408, 0.007210545241832733, 0.0523141473531723, 0.012117976322770119, 0.262463241815567, 0.2942248582839966, -0.1452028602361679, -0.3341824412345886, 0.06624387204647064, 0.5920328497886658, -0.0221981443464756, -0.05321348085999489, 0.3955155909061432, -0.06977653503417969, 0.05580054223537445, -0.16461890935897827, 0.14572682976722717, 0.5030284523963928, -0.5171135663986206, 0.12972861528396606, -0.08034658432006836, 0.17950654029846191, -0.12083454430103302, 0.08339391648769379, 0.030358601361513138, -0.31943145394325256, -0.01385757327079773, -0.22739975154399872, -0.35646283626556396, 0.3211337625980377, -0.26583749055862427, 0.08479328453540802, -0.06125283241271973, -0.21981410682201385, 0.29470956325531006, -0.10270921885967255, -0.21122947335243225, -0.09435984492301941, -0.23689505457878113, 0.18119756877422333, 0.455150306224823, 0.6147546172142029, -0.021302731707692146, -0.25627589225769043, 0.0323963388800621, 0.08196595311164856, 0.07601389288902283, -0.15018565952777863, 0.013085156679153442, 0.17337003350257874, 0.16187560558319092, 0.11203113943338394, 0.02813538908958435, -0.14805473387241364, -0.03489428758621216, -0.1840793788433075, 0.016606494784355164, 0.27776196599006653, -0.2644059956073761, 0.3960878849029541, 0.07572424411773682, 0.23610731959342957, 0.26472240686416626, 0.14921821653842926, -0.05249249190092087, 0.14012674987316132, 0.07393606007099152, 0.1263752579689026, 0.4735610783100128, 0.06094855070114136, -0.06513501703739166, -0.10833004117012024, -0.37943899631500244, 0.13875482976436615, 0.36452335119247437, -0.3298256993293762, 0.5015833973884583, 0.3299786448478699, 0.26168960332870483, -0.10065779834985733, -0.3491433560848236, 0.07827238738536835, 0.4046998918056488, 0.13662581145763397, -0.20963355898857117, -0.08676715195178986, 0.28593429923057556, 0.18765398859977722, -0.11473166942596436, 0.09330020844936371, 0.045939162373542786, -0.002485111355781555, -0.22126831114292145, 0.07824449986219406, 0.4827413856983185, -0.3821079730987549, 0.12492342293262482, 0.8185738325119019, -0.2346879243850708, 0.27596718072891235, 0.20806434750556946, 0.2857639789581299, -0.2115497589111328, 0.7056763768196106, -0.0994095653295517, 0.21959012746810913, 0.1412191092967987, 0.1563883125782013, 0.3047977685928345, -0.32658523321151733, 0.14668788015842438, -0.12722566723823547, -0.1320694237947464, 0.12917566299438477, -0.17598196864128113, 0.14589038491249084, 0.05467543378472328, -0.05557931587100029, 0.10842570662498474, 0.046295881271362305, -0.15099674463272095, 0.09289699792861938, -0.3789445757865906, -0.0610361322760582, -0.0958048552274704, -0.018611431121826172, 0.018650712445378304, -0.308729350566864, 0.36675065755844116, 0.05418584868311882, -0.2357195019721985, -0.006923610344529152, -0.32473450899124146, 0.33501824736595154, 0.10300089418888092, -0.18639019131660461, 0.022866031154990196, 0.006650995463132858, 0.026124166324734688, 0.3700123727321625, 0.5338700413703918, 0.2953793406486511, 0.39638540148735046, -0.022594735026359558, 0.24175944924354553, -0.15988118946552277, -0.1731075942516327, -0.0989857017993927, 0.35945260524749756, -0.09194259345531464, 0.10630843043327332, 0.13405835628509521, 0.09325618296861649, -0.008753489702939987, 0.34188133478164673, 0.07543081045150757, 0.2787538766860962, 0.23904600739479065, -0.138496994972229, -0.3130854070186615, -0.12537914514541626, 0.02358304336667061, 0.239714115858078, -0.31925880908966064, -0.14701375365257263, 0.37604033946990967, 0.05325419083237648, 0.09683825075626373, -0.08483567833900452, -0.022189442068338394, -0.11290386319160461, 0.3096011281013489, 0.6482157707214355, 0.08422086387872696, -0.2413325309753418, -0.06387457996606827, -0.5804754495620728, -0.06853905320167542, -0.2667239308357239, -0.191745787858963, 0.02567719668149948, 0.06293164938688278, 0.02451719343662262, 0.07306523621082306, 0.2454584538936615, -0.02875431440770626, -0.09354892373085022, 0.620883047580719, -0.1418178677558899, -0.5207052826881409, -0.08280055224895477, 0.28777992725372314, -0.09149271994829178, -0.14168916642665863, 0.08538699895143509, 0.028198011219501495, -0.0025158971548080444, -0.0813668817281723, -0.22623899579048157, -0.060803160071372986, -0.17666783928871155, 0.44938716292381287, 0.19317607581615448, 0.3118831515312195, -0.0337122306227684, 0.2326359748840332, -0.19784244894981384, -0.1469307839870453, -0.229889377951622, -0.020276110619306564, 0.0170045904815197, 0.3706514239311218, -0.18048809468746185, -0.14496636390686035, -0.2498561441898346, -0.17106734216213226, 0.19467204809188843, -0.0021705590188503265, -0.2955162227153778, 0.15930931270122528, -0.0073277950286865234, -0.1316797435283661, -0.007004182785749435, 0.15220236778259277, -0.03328578174114227, 0.07691070437431335, -0.18797622621059418, -0.49121320247650146, 0.38475528359413147, -0.5550433993339539, -0.27138108015060425, 0.022840268909931183, -0.054844558238983154, -0.1205647736787796, 0.07974783331155777, 0.023210614919662476, -0.10291889309883118, 0.3050917387008667, -0.016832778230309486, -0.032599594444036484, 0.0369863398373127, 0.03924153745174408, 0.2248692512512207, -0.03977297246456146, 0.11517101526260376, -0.16842778027057648, 0.024348393082618713, 0.16163071990013123, -0.13193032145500183 ]
https://github.com/huggingface/datasets/issues/6069
I have resolved the error after including a collate function as indicated in the Quick Start session of the Datasets docs.: Here is what I did: ``` data_transforms = utils.get_data_augmentation(args) image_dataset = utils.load_image_dataset(args.dataset) def preprocess_train(example_batch): example_batch["pixel_values"] = [ data_transforms["train"](image.convert("RGB")) for image in example_batch["image"] ] return example_batch def preprocess_val(example_batch): example_batch["pixel_values"] = [ data_transforms["val"](image.convert("RGB")) for image in example_batch["image"] ] return example_batch def collate_fn(examples): images = [] labels = [] for example in examples: images.append((example["pixel_values"])) labels.append(example["label"]) pixel_values = torch.stack(images) labels = torch.tensor(labels) return {"pixel_values": pixel_values, "label": labels} train_dataset = image_dataset["train"].with_transform(preprocess_train) val_dataset = image_dataset["validation"].with_transform(preprocess_val) image_datasets = { "train": train_dataset, "val": val_dataset } samplers = { "train": data.RandomSampler(train_dataset), "val": data.SequentialSampler(val_dataset), } dataloaders = { x: data.DataLoader( image_datasets[x], collate_fn=collate_fn, batch_size=batch_size, sampler=samplers[x], num_workers=args.num_workers, worker_init_fn=utils.set_seed_for_worker, generator=g, pin_memory=True, ) for x in ["train", "val"] } train_loader, val_loader = dataloaders["train"], dataloaders["val"] ``` Everything runs fine without any bug now.
KeyError: dataset has no key "image"
### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets
139
KeyError: dataset has no key "image" ### Describe the bug I've loaded a local image dataset with: `ds = laod_dataset("imagefolder", data_dir=path-to-data)` And defined a transform to process the data, following the Datasets docs. However, I get a keyError error, indicating there's no "image" key in my dataset. When I printed out the example_batch sent to the transformation function, it shows only the labels are being sent to the function. For some reason, the images are not in the example batches. ### Steps to reproduce the bug I'm using the latest stable version of datasets ### Expected behavior I expect the example_batches to contain both images and labels ### Environment info I'm using the latest stable version of datasets I have resolved the error after including a collate function as indicated in the Quick Start session of the Datasets docs.: Here is what I did: ``` data_transforms = utils.get_data_augmentation(args) image_dataset = utils.load_image_dataset(args.dataset) def preprocess_train(example_batch): example_batch["pixel_values"] = [ data_transforms["train"](image.convert("RGB")) for image in example_batch["image"] ] return example_batch def preprocess_val(example_batch): example_batch["pixel_values"] = [ data_transforms["val"](image.convert("RGB")) for image in example_batch["image"] ] return example_batch def collate_fn(examples): images = [] labels = [] for example in examples: images.append((example["pixel_values"])) labels.append(example["label"]) pixel_values = torch.stack(images) labels = torch.tensor(labels) return {"pixel_values": pixel_values, "label": labels} train_dataset = image_dataset["train"].with_transform(preprocess_train) val_dataset = image_dataset["validation"].with_transform(preprocess_val) image_datasets = { "train": train_dataset, "val": val_dataset } samplers = { "train": data.RandomSampler(train_dataset), "val": data.SequentialSampler(val_dataset), } dataloaders = { x: data.DataLoader( image_datasets[x], collate_fn=collate_fn, batch_size=batch_size, sampler=samplers[x], num_workers=args.num_workers, worker_init_fn=utils.set_seed_for_worker, generator=g, pin_memory=True, ) for x in ["train", "val"] } train_loader, val_loader = dataloaders["train"], dataloaders["val"] ``` Everything runs fine without any bug now.
[ -0.1899322271347046, -0.05999256670475006, -0.016740359365940094, 0.15395542979240417, 0.3059038519859314, 0.22089700400829315, 0.5759841203689575, 0.20979957282543182, -0.0695992112159729, 0.17101135849952698, 0.22148257493972778, 0.31010574102401733, -0.31011998653411865, 0.01872730255126953, 0.07050471007823944, -0.33328720927238464, 0.24941858649253845, 0.03614841029047966, -0.07022406905889511, -0.23530098795890808, -0.42487478256225586, 0.20574727654457092, -0.1682719886302948, 0.17842693626880646, -0.5364773869514465, 0.012359080836176872, -0.4262952506542206, 0.2646234333515167, 0.07035959511995316, -0.09349371492862701, 0.2423856407403946, -0.2041129469871521, -0.006170917302370071, 0.48078933358192444, -0.00012270206934772432, 0.008795276284217834, 0.33759045600891113, -0.14855512976646423, -0.36826077103614807, -0.24806152284145355, -0.26637816429138184, -0.23107405006885529, -0.09856880456209183, -0.46305716037750244, -0.002330683171749115, -0.4633629024028778, 0.0019332431256771088, -0.389399915933609, 0.27407461404800415, 0.18810376524925232, 0.11256633698940277, 0.050639085471630096, -0.04629235714673996, -0.07517272979021072, 0.09422572702169418, 0.2674151659011841, 0.022238746285438538, 0.10139665007591248, 0.16824083030223846, -0.2524268627166748, 0.1604025512933731, 0.3802778720855713, -0.06348779797554016, -0.019805826246738434, 0.33814698457717896, 0.14548057317733765, -0.1189790591597557, -0.5373306274414062, 0.2290574610233307, 0.07901810109615326, 0.2907918691635132, -0.19637413322925568, -0.40582361817359924, -0.41852375864982605, 0.021091017872095108, -0.07062938809394836, 0.05241672694683075, 0.1540295034646988, -0.12705367803573608, -0.03395228460431099, -0.2744314968585968, -0.05563607066869736, 0.03028995543718338, 0.2803618013858795, -0.15621469914913177, 0.0209045372903347, -0.014512494206428528, 0.29342445731163025, 0.1876637190580368, 0.0313580185174942, -0.04434729367494583, -0.0866534560918808, 0.16498275101184845, 0.38461583852767944, -0.08209683001041412, 0.08820712566375732, 0.0955352783203125, 0.1056833267211914, 0.06538208574056625, -0.42470934987068176, -0.38994961977005005, -0.20286345481872559, 0.07445558905601501, 0.1113966554403305, 0.21675091981887817, 0.34731850028038025, 0.029152626171708107, 0.4804038405418396, 0.0642961710691452, -0.20027068257331848, -0.1247120201587677, -0.061556752771139145, -0.2634441554546356, -0.2898698151111603, 0.2655625343322754, 0.3154102861881256, 0.16386152803897858, 0.13408713042736053, 0.13176926970481873, 0.15807870030403137, 0.023027367889881134, 0.04659195616841316, -0.28129148483276367, 0.3013898730278015, 0.11426742374897003, 0.10892830789089203, 0.30578672885894775, 0.22842682898044586, -0.12720683217048645, 0.004053756594657898, -0.20927788317203522, 0.3057790994644165, -0.36098712682724, -0.09462334960699081, 0.016649305820465088, -0.2813989520072937, 0.2246270775794983, -0.13843850791454315, 0.09493052214384079, 0.0755130872130394, -0.17957058548927307, -0.1550264060497284, 0.3437469005584717, 0.3563773036003113, -0.05663811415433884, 0.3565463423728943, 0.4974823594093323, -0.3217334747314453, -0.07169671356678009, 0.27192264795303345, -0.5373655557632446, -0.12560312449932098, -0.13961391150951385, -0.002183868084102869, -0.20810692012310028, 0.112537682056427, -0.5917957425117493, 0.0953470915555954, 0.29564011096954346, 0.15290389955043793, 0.0382002517580986, -0.1943437159061432, -0.18740153312683105, -0.1942339390516281, 0.22915126383304596, 0.5316872596740723, -0.628563404083252, -0.17890426516532898, -0.09288299083709717, 0.03595627099275589, -0.052763596177101135, 0.0046650730073452, -0.15522922575473785, 0.5048214197158813, -0.35732537508010864, 0.05586487054824829, 0.20162856578826904, -0.52471923828125, -0.37137266993522644, 0.30330437421798706, -0.06707721948623657, -0.09183329343795776, -0.1091281920671463, 0.23444080352783203, 0.2962179183959961, 0.1790197789669037, 0.22680391371250153, 0.25504255294799805, -0.19336295127868652, 0.14871355891227722, -0.0038667991757392883, 0.03666422516107559, 0.1253034770488739, 0.17483650147914886, 0.43266889452934265, 0.3517506420612335, -0.04466717317700386, 0.07815771549940109, -0.12927982211112976, -0.13490700721740723, 0.1706933081150055, 0.36393705010414124, 0.09385159611701965, -0.16713333129882812, 0.3048016428947449, 0.22493839263916016, -0.2788340449333191, 0.2861536741256714, 0.10734982043504715, 0.11237277090549469, -0.568047821521759, 0.09769277274608612, -0.22841855883598328, 0.03402004390954971, -0.30933845043182373, -0.42584770917892456, -0.006732303649187088, -0.0038834847509860992, 0.012194529175758362, 0.2676512598991394, -0.10017062723636627, 0.21362780034542084, 0.08298095315694809, 0.0649971067905426, -0.3293336033821106, 0.24313071370124817, -0.11288673430681229, -0.2288953959941864, -0.18419046700000763, -0.05337764695286751, 0.05862955003976822, -0.08353196084499359, -0.16708263754844666, 0.49469536542892456, 0.14585959911346436, 0.07641555368900299, -0.16195940971374512, 0.07904475182294846, 0.41309797763824463, -0.30717891454696655, -0.13330426812171936, -0.10590168833732605, 0.2095927894115448, -0.018224500119686127, -0.20985552668571472, 0.3891017735004425, 0.11680815368890762, 0.42221391201019287, -0.036920830607414246, 0.21312832832336426, 0.006479442119598389, -0.06491376459598541, -0.22142183780670166, -0.13643334805965424, -0.058907054364681244, -0.5367249846458435, 0.20810598134994507, -0.0316140353679657, -0.07151317596435547, -0.1598312258720398, 0.3188415765762329, 0.18425820767879486, 0.17321227490901947, 0.06148144602775574, -0.3406996726989746, 0.3557111620903015, 0.16318507492542267, 0.2990644574165344, 0.504594624042511, 0.15080362558364868, -0.2852318584918976, 0.032105155289173126, 0.018931623548269272, 0.20043478906154633, -0.10272173583507538, 0.030963363125920296, 0.283913791179657, 0.06979569792747498, 0.04394660145044327, 0.21056747436523438, -0.014302864670753479, -0.1012377142906189, -0.10198536515235901, 0.3601281940937042, -0.2184353768825531, 0.2438831776380539, -0.2961885333061218, -0.43394362926483154, 0.15433745086193085, 0.2370242476463318, 0.12064123153686523, -0.3701903820037842, -0.05119745805859566, -0.19988404214382172, -0.06049755960702896, 0.1879466325044632, -0.1283901482820511, -0.09429073333740234, 0.19546927511692047, -0.35850396752357483, -0.2534565329551697, -0.32035577297210693, -0.17932790517807007, -0.058300018310546875, 0.07838466763496399, -0.2377476692199707, 0.23473720252513885, -0.22264176607131958, 0.025097057223320007, -0.22515307366847992, -0.34170007705688477, 0.2516440153121948, -0.21269482374191284, 0.32294636964797974, 0.19198259711265564, 0.4012264013290405, -0.4345087707042694, -0.3081994652748108, 0.5172311663627625, -0.18402421474456787, -0.36898550391197205, 0.09799689799547195, 0.06999097764492035, -0.22159138321876526, -0.2496490627527237, -0.1706046462059021, -0.11457847058773041, -0.12459412962198257, -0.04682506248354912, -0.162358820438385, -0.013368763029575348, 0.2253786325454712, 0.5101364850997925, -0.04964365065097809, 0.19107788801193237, -0.21419072151184082, -0.02957259491086006, -0.09792681783437729, 0.36051493883132935, -0.10928480327129364, -0.4649750888347626, -0.0934821218252182, -0.38654205203056335, 0.1361231505870819, 0.3152381181716919, -0.48119333386421204, -0.1306210458278656, -0.027159210294485092, 0.28504687547683716, 0.12449102103710175, 0.0985618606209755, 0.28588661551475525, -0.017096934840083122, 0.011529121547937393, -0.3736814856529236, -0.07602519541978836, -0.011409714818000793, 0.12696298956871033, 0.34054088592529297, 0.14057861268520355, 0.5638031363487244, 0.10022680461406708, 0.7871633768081665, -0.25717923045158386, -0.40548694133758545, 0.22710807621479034, -0.4031779170036316, 0.4135963022708893, -0.1933172643184662, -0.585004985332489, 0.20162634551525116, 0.15932630002498627, -0.15012437105178833, 0.022122036665678024, -0.17690284550189972, -0.23437505960464478, -0.23276643455028534, 0.27688002586364746, -0.6673378944396973, -0.011320427060127258, 0.0858389288187027, -0.17189469933509827, 0.2081363946199417, -0.05528511106967926, 0.0035524368286132812, -0.10829876363277435, 0.1550748348236084, 0.07125000655651093, 0.1820845603942871, 0.41575175523757935, 0.12413382530212402, 0.06612372398376465, -0.28920429944992065, -0.31543678045272827, 0.05353642255067825, 0.07917198538780212, 0.3480997085571289, -0.2873793840408325, -0.0736268013715744, -0.01725933700799942, 0.1259991079568863, 0.9026609659194946, -0.3390020430088043, -0.19735682010650635, 0.10167769342660904, -0.13045987486839294, -0.5646671652793884, -0.15808835625648499, -0.022970333695411682, 0.3535597026348114, -0.18013998866081238, 0.9966745376586914, -0.014644160866737366, 0.014598805457353592, 0.07086946070194244, 0.16280150413513184, -0.254921555519104, -0.15208640694618225, -0.38120633363723755, -0.3065894842147827, -0.5549915432929993, 0.13978144526481628, 0.16702625155448914, 0.022459186613559723, 0.1654375195503235, 0.1467154324054718, -0.141449972987175, 0.0861784964799881, -0.11071735620498657, -0.0011140145361423492, 0.3720778524875641, 0.08596023917198181, 0.19244490563869476, 0.07663185894489288, 0.2834688425064087, 0.1960618793964386, 0.3782210052013397, 0.008813891559839249, -0.340859591960907, 0.18240973353385925, -0.16935154795646667, 0.1581113040447235, 0.05547267198562622, -0.20285949110984802, -0.3891235589981079, 0.006622873246669769, 0.025980571284890175, -0.3146516680717468, 0.28050562739372253, 0.3593765199184418, -0.1453723907470703, -0.34554043412208557, -0.3190688490867615, 0.32190316915512085, 0.12882086634635925, -0.025436192750930786, 0.29522621631622314, 0.05591230094432831, -0.2649281919002533, 0.38082319498062134, 0.20863422751426697, 0.5872730016708374, -0.2610563039779663, 0.20595616102218628, 0.13620366156101227, 0.14835095405578613, 0.37295064330101013, 0.18544253706932068, 0.00763591006398201, -0.23808449506759644, -0.35038572549819946, -0.08141115307807922, -0.13667228817939758, 0.0884307473897934, 0.22565962374210358, -0.1429549902677536, 0.18217086791992188, -0.2815793752670288, -0.10227349400520325, -0.06932149082422256, -0.17594268918037415, 0.2143610268831253, -0.28317326307296753, 0.12745678424835205, 0.11760541796684265, 0.05466345325112343, 0.44408172369003296, -0.007964614778757095, 0.062437720596790314, -0.4583582878112793, -0.2068062722682953, -0.2277013659477234, 0.01701260358095169, -0.2763598561286926, 0.15767906606197357, -0.010714318603277206, -0.3377879858016968, -0.1726391613483429, 0.655206024646759, 0.3559136390686035, 0.07517391443252563, 0.022616924718022346, 0.2102627009153366, -0.01915917918086052, 0.26380348205566406, 0.02953023836016655, -0.2040623277425766, 0.3012316823005676, 0.13062632083892822, -0.05514748394489288, -0.12357475608587265, -0.14165779948234558, -0.15129870176315308, -0.17627479135990143, 0.16520734131336212, -0.19100898504257202, 0.06747265160083771, -0.32676196098327637, 0.022048406302928925, 0.06117842346429825, 0.0023854300379753113, 0.0407836027443409, 0.0449327751994133, 0.06932610273361206, 0.24466031789779663, -0.22900249063968658, -0.31452155113220215, 0.09104573726654053, 0.597521185874939, 0.018049176782369614, -0.10895799845457077, 0.4332502782344818, -0.05974121391773224, 0.030703313648700714, -0.1092832088470459, 0.1264854520559311, 0.4893684983253479, -0.47704771161079407, 0.20613941550254822, -0.03869658336043358, 0.21778056025505066, -0.1923641413450241, -0.0006349626928567886, -0.04331030324101448, -0.24724221229553223, -0.06562930345535278, -0.20370221138000488, -0.41553354263305664, 0.27524685859680176, -0.2541984021663666, 0.1815781593322754, -0.054657381027936935, 0.008762262761592865, 0.25002625584602356, -0.05879370868206024, -0.2100960612297058, -0.030329976230859756, -0.2245739996433258, 0.1982540786266327, 0.366936057806015, 0.5762490630149841, 0.06666527688503265, -0.1679694801568985, -0.0010988861322402954, 0.09170684218406677, 0.040353935211896896, -0.1382385790348053, -0.08148998022079468, 0.16308026015758514, 0.17142587900161743, 0.07822511345148087, 0.09433437883853912, -0.1802217960357666, -0.037128057330846786, -0.209914892911911, 0.159265398979187, 0.24781090021133423, -0.2450985610485077, 0.45634526014328003, -0.001186855137348175, 0.30298274755477905, 0.34827151894569397, 0.018345262855291367, -0.056061286479234695, 0.1572219878435135, 0.19942975044250488, 0.12169323116540909, 0.3938046991825104, 0.11211393028497696, -0.11564922332763672, -0.12471359968185425, -0.3576336205005646, -0.016159342601895332, 0.28521493077278137, -0.3727135956287384, 0.34842389822006226, 0.14646142721176147, 0.24932657182216644, -0.11376816034317017, -0.4158466160297394, 0.18454307317733765, 0.4139660596847534, 0.1136518269777298, -0.21739721298217773, -0.08212558925151825, 0.20320789515972137, 0.10711151361465454, -0.06793380528688431, 0.025383494794368744, 0.07253900170326233, 0.09335404634475708, -0.22560709714889526, 0.0219385027885437, 0.3735608458518982, -0.3973355293273926, 0.25288066267967224, 0.6943511962890625, -0.154091477394104, 0.22119984030723572, 0.14082175493240356, 0.23699204623699188, -0.1341034173965454, 0.4227617084980011, -0.058893244713544846, 0.22799639403820038, 0.259304404258728, 0.09945105016231537, 0.2924920618534088, -0.3087690770626068, 0.17516876757144928, -0.08378904312849045, -0.14128971099853516, 0.15344130992889404, -0.19631245732307434, 0.31987470388412476, 0.04271416738629341, -0.14697593450546265, 0.091773122549057, 0.17224392294883728, -0.16589823365211487, 0.09082646667957306, -0.22761182487010956, 0.016985490918159485, -0.2053007185459137, -0.027982566505670547, 0.04962396249175072, -0.3885928988456726, 0.1790468394756317, 0.08653798699378967, -0.25495773553848267, 0.018511924892663956, -0.34665441513061523, 0.3796118497848511, 0.1340624839067459, -0.13447445631027222, 0.009487994015216827, 0.06794249266386032, -0.027137931436300278, 0.3475915789604187, 0.42660075426101685, 0.3703880310058594, 0.45275717973709106, -0.11467631161212921, 0.21271634101867676, -0.000029277056455612183, -0.13985200226306915, -0.10162857174873352, 0.2674996852874756, -0.08183786273002625, -0.042422570288181305, 0.2148853838443756, 0.0788486897945404, -0.009939784184098244, 0.2599834203720093, 0.08807775378227234, 0.272892028093338, 0.20077845454216003, -0.1809627115726471, -0.35668134689331055, -0.07173299789428711, -0.0035382909700274467, 0.1637830287218094, -0.36165955662727356, -0.18438157439231873, 0.43957221508026123, 0.05232951417565346, 0.14427942037582397, 0.0012005828320980072, -0.014999769628047943, -0.19217444956302643, 0.37594980001449585, 0.6408963799476624, 0.14864176511764526, -0.2707992196083069, -0.10163123905658722, -0.6065291166305542, -0.06047145649790764, -0.2125801295042038, -0.24425503611564636, 0.05737572908401489, 0.16796991229057312, 0.07185713946819305, 0.10202904045581818, 0.18407577276229858, -0.2624291777610779, 0.01877366006374359, 0.4543737471103668, -0.19971758127212524, -0.4804832637310028, -0.1737615168094635, 0.2672554850578308, -0.010748613625764847, -0.13545359671115875, -0.06700505316257477, 0.08320378512144089, 0.01209055632352829, -0.10956846177577972, -0.1643315553665161, -0.11674530804157257, -0.20105306804180145, 0.38090458512306213, 0.15732046961784363, 0.3760699927806854, -0.024974193423986435, 0.22867625951766968, -0.1744799017906189, -0.21265624463558197, -0.2646598517894745, -0.10386279970407486, 0.0819755345582962, 0.4303570091724396, -0.09370908886194229, -0.24776504933834076, -0.29137831926345825, -0.00414150208234787, 0.308057963848114, -0.07874365150928497, -0.22328877449035645, 0.28306007385253906, -0.022265374660491943, -0.1039564311504364, 0.03049558401107788, 0.2064879983663559, -0.054920852184295654, 0.13069117069244385, -0.1797797530889511, -0.4800490140914917, 0.4707169532775879, -0.5182598829269409, -0.2184678018093109, 0.0072809383273124695, -0.11423975229263306, -0.05882193148136139, 0.22257742285728455, -0.09046319127082825, -0.09797560423612595, 0.26199084520339966, -0.046046920120716095, -0.14674502611160278, 0.14068011939525604, 0.05060854181647301, 0.24426215887069702, -0.0012653246521949768, -0.21647527813911438, -0.026259567588567734, 0.09817381203174591, 0.11775730550289154, -0.2041216641664505 ]
https://github.com/huggingface/datasets/issues/6066
Hi ! I opened https://github.com/huggingface/datasets/pull/6067 to add the missing `_lock` We'll do a patch release soon, but feel free to install `datasets` from source in the meantime
AttributeError: '_tqdm_cls' object has no attribute '_lock'
### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master
27
AttributeError: '_tqdm_cls' object has no attribute '_lock' ### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master Hi ! I opened https://github.com/huggingface/datasets/pull/6067 to add the missing `_lock` We'll do a patch release soon, but feel free to install `datasets` from source in the meantime
[ -0.17624372243881226, -0.28966182470321655, -0.08112587034702301, 0.21007463335990906, 0.2333376258611679, -0.10606662184000015, 0.34196195006370544, 0.3747367858886719, -0.07112034410238266, 0.04517202824354172, -0.0528116337954998, 0.36341848969459534, -0.1971302181482315, 0.045730821788311005, -0.18291465938091278, -0.00689138937741518, -0.13124388456344604, 0.020862717181444168, -0.20673298835754395, 0.0033792033791542053, -0.1716487854719162, 0.4683590829372406, -0.08010941743850708, 0.13005515933036804, -0.25565633177757263, -0.20349068939685822, 0.16306191682815552, 0.3502751588821411, -0.007030440494418144, -0.30351102352142334, -0.11140717566013336, -0.10186009854078293, -0.05263517051935196, 0.4311617314815521, -0.00010188113083131611, 0.01722419261932373, 0.20431292057037354, 0.028904132544994354, -0.029196154326200485, 0.2324400693178177, -0.0893627405166626, -0.32429632544517517, 0.06823205202817917, -0.415113627910614, 0.10848918557167053, 0.06326441466808319, -0.19405770301818848, -0.23127201199531555, 0.32062941789627075, 0.3468674421310425, 0.3375101685523987, 0.6315898299217224, 0.11758527904748917, -0.2974742352962494, 0.13813945651054382, -0.6866133213043213, -0.1452908217906952, 0.3828820586204529, 0.39306849241256714, -0.15615196526050568, -0.1257725954055786, 0.44635438919067383, -0.20600301027297974, 0.12796887755393982, 0.052920613437891006, 0.0023293383419513702, 0.3116326332092285, -0.24241529405117035, 0.07748255133628845, 0.1708017885684967, 0.289000004529953, -0.21589024364948273, -0.2434055209159851, 0.0930149108171463, 0.04800634831190109, -0.0048852041363716125, 0.1265002191066742, 0.05001086741685867, -0.06385327875614166, 0.26224178075790405, 0.15560640394687653, 0.040796760469675064, 0.025513745844364166, 0.013189439661800861, -0.11713609099388123, 0.0792979896068573, -0.04866957664489746, -0.07651211321353912, 0.07735542953014374, -0.10525166988372803, 0.14313006401062012, 0.18866600096225739, -0.046736110001802444, -0.05241589620709419, -0.24947065114974976, -0.21683403849601746, 0.25611624121665955, -0.005165014415979385, 0.05867046117782593, 0.3036542534828186, -0.15571123361587524, 0.005433986894786358, 0.2551167607307434, 0.2048766165971756, -0.06266528367996216, 0.06939762085676193, -0.178655743598938, 0.24922451376914978, 0.3359309434890747, 0.13168199360370636, -0.4111805558204651, 0.023218469694256783, 0.12441401183605194, -0.5652226209640503, 0.46770596504211426, 0.2188752144575119, 0.3554536700248718, 0.009391829371452332, -0.10201791673898697, 0.3170149326324463, 0.06359929591417313, 0.12306588888168335, 0.03071204572916031, 0.5289992094039917, 0.06685376167297363, 0.026434067636728287, 0.16250833868980408, 0.07873621582984924, -0.253558874130249, -0.19508427381515503, -0.38241246342658997, 0.27257484197616577, 0.09470878541469574, -0.17660225927829742, -0.2180849015712738, 0.021639809012413025, 0.3145618140697479, 0.09877444058656693, 0.28230881690979004, -0.10110379755496979, 0.21613946557044983, -0.11841076612472534, -0.1336711347103119, 0.294524610042572, -0.1807553470134735, 0.026631809771060944, 0.3852580189704895, -0.16503587365150452, -0.1075342446565628, 0.07099132239818573, -0.3095545470714569, -0.36073213815689087, -0.07286526262760162, 0.33589813113212585, 0.2892538905143738, -0.10082326829433441, 0.20751291513442993, -0.09548504650592804, 0.19716693460941315, -0.002150006592273712, 0.13766273856163025, -0.18475432693958282, 0.11319926381111145, -0.2605932950973511, 0.011992305517196655, 0.4320237636566162, -0.1237608939409256, 0.06401273608207703, 0.06927753239870071, -0.2472057044506073, 0.030836403369903564, 0.14972607791423798, -0.1095857322216034, 0.25240692496299744, -0.25785031914711, 0.12189163267612457, 0.4097575843334198, -0.4624580144882202, -0.4775365889072418, 0.2878197431564331, -0.3083667457103729, -0.2022576928138733, 0.17586390674114227, 0.15166530013084412, 0.10582467913627625, 0.04770877584815025, 0.13497409224510193, 0.07823212444782257, -0.012863731943070889, 0.14650937914848328, -0.3378346562385559, 0.009831428527832031, -0.06713211536407471, -0.038945965468883514, 0.22446207702159882, 0.10187189280986786, 0.23127718269824982, -0.01684235781431198, 0.05187024921178818, 0.06404443830251694, -0.10972344875335693, 0.23697291314601898, 0.21071767807006836, -0.12287292629480362, -0.06297795474529266, -0.2114746868610382, -0.37101465463638306, 0.19960764050483704, -0.1813734918832779, 0.11976946890354156, -0.1311619132757187, -0.06717035174369812, -0.4082634449005127, 0.053611092269420624, -0.13966041803359985, -0.23769207298755646, 0.33915603160858154, -0.03415241837501526, -0.18240882456302643, 0.021303385496139526, -0.21208462119102478, 0.23389999568462372, -0.08713017404079437, 0.03133399784564972, 0.0957871824502945, 0.19024914503097534, -0.35479459166526794, -0.21003781259059906, 0.01658514142036438, -0.0010826736688613892, 0.22280819714069366, -0.040578681975603104, -0.15474583208560944, 0.413745254278183, 0.21876215934753418, 0.20871387422084808, 0.12224452197551727, 0.027159593999385834, 0.04666351526975632, -0.058835819363594055, -0.1929829716682434, 0.10744354128837585, 0.17377960681915283, -0.053301144391298294, 0.44121140241622925, 0.3880492150783539, 0.08838482946157455, -0.018452104181051254, 0.09897086769342422, 0.1828119158744812, 0.20703931152820587, -0.17483030259609222, 0.05743835121393204, -0.11844375729560852, 0.181797057390213, 0.29003122448921204, 0.12432312220335007, -0.1987747699022293, -0.3176746964454651, 0.09158353507518768, 0.42360493540763855, 0.19340284168720245, 0.13275031745433807, -0.29050758481025696, -0.03624244034290314, 0.21948865056037903, -0.14339789748191833, 0.33189091086387634, 0.3839683532714844, 0.15319837629795074, -0.055251676589250565, 0.19961611926555634, 0.02830320969223976, -0.21175016462802887, 0.14888593554496765, 0.06971036642789841, 0.11572545766830444, 0.3716866374015808, 0.013980358839035034, -0.03581853583455086, -0.17296312749385834, -0.5833550095558167, 0.03084918111562729, 0.32766103744506836, -0.2748904824256897, -0.027151312679052353, -0.24907183647155762, 0.16089880466461182, -0.005646776407957077, -0.18654099106788635, -0.10606856644153595, -0.4009949564933777, 0.13035988807678223, 0.14989227056503296, -0.25143152475357056, 0.09320110827684402, -0.3306337893009186, 0.05896395444869995, 0.2605491280555725, 0.13764844834804535, -0.0858118087053299, -0.2859734892845154, -0.023156359791755676, 0.1251211166381836, 0.16462033987045288, -0.11435960978269577, 0.36511877179145813, -0.09647669643163681, -0.09289789199829102, -0.16814157366752625, -0.14692318439483643, -0.054308272898197174, -0.06969505548477173, 0.3964959383010864, 0.22913934290409088, 0.3598935902118683, -0.2095957100391388, 0.014201510697603226, 0.26924780011177063, -0.15935830771923065, -0.1855555772781372, 0.13302628695964813, 0.09044203907251358, -0.17475643754005432, -0.14481240510940552, -0.3975484371185303, -0.3130279779434204, -0.5213376879692078, -0.15240028500556946, 0.01825735718011856, 0.23235754668712616, 0.24619707465171814, -0.06183215603232384, 0.37329816818237305, 0.12861403822898865, 0.3635660707950592, -0.09317144751548767, -0.393348753452301, 0.30689647793769836, -0.29320669174194336, -0.5069096684455872, -0.0434742197394371, -0.13778123259544373, 0.2502913177013397, -0.25147688388824463, -0.29335251450538635, -0.46909335255622864, -0.11449437588453293, 0.24946027994155884, -0.2808770537376404, 0.08051083981990814, 0.2564235031604767, 0.03449222818017006, -0.2961099445819855, -0.08493977785110474, 0.14733272790908813, -0.04667253419756889, 0.012393197044730186, -0.24388350546360016, -0.10966402292251587, 0.07931351661682129, 0.12174667418003082, 0.5469098091125488, 0.08898253738880157, 0.28529635071754456, 0.2871619462966919, -0.19751648604869843, 0.054314594715833664, -0.075798898935318, -0.4440813660621643, -0.24680985510349274, 0.12811464071273804, -0.1824152171611786, 0.17094866931438446, -0.25820451974868774, 0.2667827010154724, -0.18969428539276123, 0.031036846339702606, -0.23754079639911652, -0.1722639799118042, -0.14695893228054047, 0.0562354177236557, 0.15923483669757843, -0.15053591132164001, 0.12115778028964996, 0.03438490256667137, 0.3415389358997345, 0.35949966311454773, 0.5301384329795837, -0.3401510715484619, -0.15933655202388763, -0.3693682849407196, -0.027826042845845222, -0.22526538372039795, 0.1913948357105255, -0.014697927981615067, 0.24152648448944092, 0.011217363178730011, -0.19436092674732208, 0.06760869920253754, -0.2165011167526245, 0.3101823329925537, 0.11110030114650726, 0.1339612901210785, 0.3004104197025299, -0.19804632663726807, 0.09785090386867523, -0.10747373104095459, -0.3215748369693756, -0.20235314965248108, 0.3507084250450134, 0.3277986943721771, -0.19233180582523346, -0.00356978178024292, -0.19763973355293274, -0.12292645871639252, -0.2336282879114151, -0.08256176114082336, -0.19146913290023804, -0.2060847282409668, -0.5143704414367676, 0.22853806614875793, 0.21522578597068787, 0.30451682209968567, 0.22863470017910004, -0.06604083627462387, -0.0453592911362648, -0.34206071496009827, -0.007541332393884659, 0.1319132149219513, 0.16354432702064514, -0.19367089867591858, 0.18786360323429108, -0.30443722009658813, -0.1363782435655594, -0.046469852328300476, 0.43247827887535095, 0.0541624054312706, -0.239146888256073, -0.12887313961982727, -0.08782403916120529, 0.1340724378824234, 0.11724856495857239, -0.22471517324447632, 0.020937209948897362, 0.05608879402279854, 0.2689249813556671, 0.22183829545974731, -0.08973720669746399, 0.19424280524253845, -0.11701369285583496, 0.06147213652729988, -0.045734550803899765, 0.10718347132205963, -0.060260746628046036, 0.056403279304504395, 0.15334245562553406, -0.008361879736185074, 0.0007910877466201782, 0.07465890049934387, 0.04577053338289261, 0.8141485452651978, 0.07185615599155426, 0.02881724014878273, 0.39878687262535095, -0.07649203389883041, 0.026566646993160248, -0.05377346649765968, -0.0472666472196579, -0.4759175479412079, -0.4287510812282562, -0.004331361502408981, -0.18773378431797028, 0.3959293067455292, -0.09594477713108063, -0.25641337037086487, 0.016841553151607513, -0.21192821860313416, 0.06972411274909973, -0.25535547733306885, 0.059220269322395325, -0.1666862815618515, -0.04262286797165871, -0.26659533381462097, 0.24246054887771606, 0.03852858766913414, 0.06736230850219727, -0.2238292098045349, -0.1628028154373169, -0.1083671897649765, -0.236205592751503, -0.14957377314567566, 0.044983334839344025, -0.4897359311580658, 0.3633761405944824, 0.1694135069847107, -0.17303530871868134, -0.24627527594566345, -0.04804372787475586, 0.04229341447353363, 0.161616250872612, 0.00907229632139206, 0.16051426529884338, 0.33873695135116577, 0.01719624549150467, 0.06971308588981628, 0.12951849400997162, 0.6255922317504883, -0.29617536067962646, -0.06997183710336685, 0.25819143652915955, -0.0703793466091156, -0.16811224818229675, 0.25123971700668335, 0.08516904711723328, 0.1144418865442276, -0.15498816967010498, -0.22314342856407166, 0.030415212735533714, -0.2460322380065918, -0.33370816707611084, 0.21201281249523163, 0.18348652124404907, -0.28036996722221375, 0.11846795678138733, -0.04893391579389572, -0.1853344887495041, -0.14668790996074677, 0.2795677185058594, -0.020329197868704796, 0.2111203372478485, 0.4180724024772644, 0.1485842764377594, -0.32087576389312744, -0.42044341564178467, 0.15206022560596466, -0.1358197033405304, -0.2077386975288391, 0.45738252997398376, 0.02835128828883171, -0.13380268216133118, 0.06009434536099434, 0.547139048576355, 0.04352793097496033, 0.07778821885585785, -0.01475013792514801, -0.5255994200706482, -0.5390862822532654, -0.027754124253988266, -0.15863123536109924, 0.13955891132354736, -0.08613083511590958, 0.3869228959083557, -0.17648983001708984, 0.1428253948688507, -0.4534685015678406, -0.010904166847467422, -0.3043157458305359, 0.012121370062232018, 0.3330516815185547, -0.12599346041679382, 0.1883438229560852, 0.35374924540519714, 0.25105541944503784, 0.2561659812927246, -0.1985631138086319, -0.37430548667907715, -0.22375282645225525, 0.10092442482709885, 0.10287781059741974, -0.03606480360031128, 0.014600593596696854, -0.16241884231567383, -0.07640856504440308, 0.04587592929601669, 0.012399978935718536, 0.19031263887882233, -0.03191279247403145, 0.4283803701400757, 0.0660799890756607, 0.017683833837509155, -0.08185769617557526, 0.11410658061504364, -0.05253162980079651, -0.09036090224981308, -0.07530773431062698, -0.08022797107696533, -0.0997772067785263, -0.07874128967523575, -0.34498995542526245, 0.04051893204450607, -0.14069199562072754, 0.09585254639387131, 0.37018609046936035, 0.005360269919037819, -0.1250995248556137, 0.34536251425743103, 0.19379019737243652, 0.1545015573501587, -0.20998048782348633, -0.11246266961097717, 0.20599766075611115, 0.3322298228740692, -0.3889960050582886, -0.06613888591527939, -0.07266151905059814, -0.013331390917301178, 0.1420871913433075, 0.21651719510555267, -0.09566058218479156, -0.1143789291381836, -0.21403898298740387, 0.2105545848608017, 0.004003200680017471, -0.2780230641365051, 0.06721314042806625, 0.09774412214756012, 0.0016040802001953125, 0.09462352097034454, 0.3893909752368927, 0.19859996438026428, 0.06525424867868423, 0.04238616302609444, -0.2482941597700119, 0.0427999347448349, 0.0227469764649868, -0.13915155827999115, 0.132770374417305, -0.1913740485906601, 0.35282331705093384, 0.026450231671333313, 0.07931150496006012, -0.15092724561691284, -0.01495746523141861, 0.13642758131027222, 0.10998786985874176, 0.19470353424549103, 0.011231303215026855, 0.2555442154407501, -0.3021965026855469, 0.02495168149471283, 0.4505772292613983, 0.0012910887598991394, 0.010607495903968811, -0.11430072784423828, 0.1265629678964615, 0.14691941440105438, 0.36392876505851746, 0.28376689553260803, 0.12361583113670349, -0.2854915261268616, -0.24918726086616516, 0.1783473789691925, -0.013511456549167633, -0.5115432739257812, -0.1405288726091385, 0.16904021799564362, 0.09186063706874847, -0.0014996044337749481, 0.19675329327583313, 0.3545476794242859, 0.30715978145599365, -0.14513379335403442, -0.04075150191783905, -0.061635784804821014, -0.10663457214832306, -0.05946514010429382, 0.16613620519638062, -0.1060972511768341, 0.16498300433158875, 0.33422940969467163, 0.2022123485803604, -0.3309974670410156, -0.08569306135177612, 0.10033359378576279, -0.18154487013816833, -0.14718835055828094, 0.4650391936302185, 0.07912446558475494, -0.29301631450653076, -0.18671196699142456, 0.14762961864471436, -0.314522922039032, -0.3138011693954468, 0.07677477598190308, -0.06084389239549637, 0.18347562849521637, -0.27726662158966064, 0.16979867219924927, 0.04477442800998688, 0.2366686761379242, 0.4011516571044922, -0.05484384298324585, -0.41469913721084595, 0.008219733834266663, -0.574737548828125, 0.44581231474876404, 0.11493833363056183, -0.40760013461112976, -0.07454361021518707, 0.27758991718292236, -0.1946355551481247, 0.16969656944274902, 0.3113996386528015, -0.25948959589004517, 0.028853487223386765, 0.27408072352409363, -0.2840310037136078, -0.058122795075178146, -0.14939488470554352, -0.21608400344848633, 0.07854130864143372, -0.1431656926870346, 0.08864661306142807, -0.12808987498283386, 0.25983545184135437, -0.06764142215251923, -0.35888344049453735, 0.17348890006542206, 0.21292081475257874, 0.33979901671409607, 0.054932087659835815, 0.3236159682273865, -0.2871127128601074, 0.03701212257146835, 0.022650988772511482, -0.1575068235397339, -0.026935718953609467, -0.04059045389294624, 0.15620659291744232, 0.2100025713443756, 0.040879786014556885, -0.10207216441631317, -0.319333016872406, 0.5023040771484375, -0.1591847836971283, -0.2146231234073639, -0.2082204520702362, 0.3630659580230713, 0.062128931283950806, 0.10627026110887527, 0.060560766607522964, 0.26186075806617737, 0.040609002113342285, 0.34129929542541504, -0.47204723954200745, -0.6365747451782227, 0.44734644889831543, -0.3823893666267395, -0.2945074737071991, 0.03226245567202568, 0.4139120280742645, -0.12446030974388123, 0.030820073559880257, -0.4388791620731354, 0.052297309041023254, 0.26447540521621704, -0.0637119710445404, -0.10672169923782349, 0.41927558183670044, -0.039980627596378326, 0.14795786142349243, 0.025188446044921875, 0.21676066517829895, 0.08250175416469574, 0.07250147312879562, -0.10108307003974915, -0.042484063655138016 ]
https://github.com/huggingface/datasets/issues/6066
I have tested the latest main, it does not work. I add more logs to reproduce this issue, it looks like a multi threading bug: ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" import os import threading print(os.getpid(), threading.get_ident(), "ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) print(os.getpid(), threading.get_ident(), "set_lock") yield lock if old_lock is None: print(os.getpid(), threading.get_ident(), "del tqdm_class") del tqdm_class._lock else: tqdm_class.set_lock(old_lock) ``` output ``` 64943 8424758784 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 8424758784 set_lock 64943 8424758784 del tqdm_class 64943 8424758784 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 8424758784 set_lock 64943 8424758784 del tqdm_class 64943 11638370304 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 11638370304 set_lock 64943 11568967680 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 11568967680 set_lock 64943 11638370304 del tqdm_class 64943 11638370304 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 11638370304 set_lock 64943 11638370304 del tqdm_class 64943 11568967680 del tqdm_class ``` Thread `11638370304` del the _lock from tqdm_class first, then thread `11568967680` del _lock failed.
AttributeError: '_tqdm_cls' object has no attribute '_lock'
### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master
184
AttributeError: '_tqdm_cls' object has no attribute '_lock' ### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master I have tested the latest main, it does not work. I add more logs to reproduce this issue, it looks like a multi threading bug: ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" import os import threading print(os.getpid(), threading.get_ident(), "ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) print(os.getpid(), threading.get_ident(), "set_lock") yield lock if old_lock is None: print(os.getpid(), threading.get_ident(), "del tqdm_class") del tqdm_class._lock else: tqdm_class.set_lock(old_lock) ``` output ``` 64943 8424758784 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 8424758784 set_lock 64943 8424758784 del tqdm_class 64943 8424758784 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 8424758784 set_lock 64943 8424758784 del tqdm_class 64943 11638370304 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 11638370304 set_lock 64943 11568967680 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 11568967680 set_lock 64943 11638370304 del tqdm_class 64943 11638370304 ensure_lock <datasets.utils.logging._tqdm_cls object at 0x2aa7fb250> 64943 11638370304 set_lock 64943 11638370304 del tqdm_class 64943 11568967680 del tqdm_class ``` Thread `11638370304` del the _lock from tqdm_class first, then thread `11568967680` del _lock failed.
[ -0.17624372243881226, -0.28966182470321655, -0.08112587034702301, 0.21007463335990906, 0.2333376258611679, -0.10606662184000015, 0.34196195006370544, 0.3747367858886719, -0.07112034410238266, 0.04517202824354172, -0.0528116337954998, 0.36341848969459534, -0.1971302181482315, 0.045730821788311005, -0.18291465938091278, -0.00689138937741518, -0.13124388456344604, 0.020862717181444168, -0.20673298835754395, 0.0033792033791542053, -0.1716487854719162, 0.4683590829372406, -0.08010941743850708, 0.13005515933036804, -0.25565633177757263, -0.20349068939685822, 0.16306191682815552, 0.3502751588821411, -0.007030440494418144, -0.30351102352142334, -0.11140717566013336, -0.10186009854078293, -0.05263517051935196, 0.4311617314815521, -0.00010188113083131611, 0.01722419261932373, 0.20431292057037354, 0.028904132544994354, -0.029196154326200485, 0.2324400693178177, -0.0893627405166626, -0.32429632544517517, 0.06823205202817917, -0.415113627910614, 0.10848918557167053, 0.06326441466808319, -0.19405770301818848, -0.23127201199531555, 0.32062941789627075, 0.3468674421310425, 0.3375101685523987, 0.6315898299217224, 0.11758527904748917, -0.2974742352962494, 0.13813945651054382, -0.6866133213043213, -0.1452908217906952, 0.3828820586204529, 0.39306849241256714, -0.15615196526050568, -0.1257725954055786, 0.44635438919067383, -0.20600301027297974, 0.12796887755393982, 0.052920613437891006, 0.0023293383419513702, 0.3116326332092285, -0.24241529405117035, 0.07748255133628845, 0.1708017885684967, 0.289000004529953, -0.21589024364948273, -0.2434055209159851, 0.0930149108171463, 0.04800634831190109, -0.0048852041363716125, 0.1265002191066742, 0.05001086741685867, -0.06385327875614166, 0.26224178075790405, 0.15560640394687653, 0.040796760469675064, 0.025513745844364166, 0.013189439661800861, -0.11713609099388123, 0.0792979896068573, -0.04866957664489746, -0.07651211321353912, 0.07735542953014374, -0.10525166988372803, 0.14313006401062012, 0.18866600096225739, -0.046736110001802444, -0.05241589620709419, -0.24947065114974976, -0.21683403849601746, 0.25611624121665955, -0.005165014415979385, 0.05867046117782593, 0.3036542534828186, -0.15571123361587524, 0.005433986894786358, 0.2551167607307434, 0.2048766165971756, -0.06266528367996216, 0.06939762085676193, -0.178655743598938, 0.24922451376914978, 0.3359309434890747, 0.13168199360370636, -0.4111805558204651, 0.023218469694256783, 0.12441401183605194, -0.5652226209640503, 0.46770596504211426, 0.2188752144575119, 0.3554536700248718, 0.009391829371452332, -0.10201791673898697, 0.3170149326324463, 0.06359929591417313, 0.12306588888168335, 0.03071204572916031, 0.5289992094039917, 0.06685376167297363, 0.026434067636728287, 0.16250833868980408, 0.07873621582984924, -0.253558874130249, -0.19508427381515503, -0.38241246342658997, 0.27257484197616577, 0.09470878541469574, -0.17660225927829742, -0.2180849015712738, 0.021639809012413025, 0.3145618140697479, 0.09877444058656693, 0.28230881690979004, -0.10110379755496979, 0.21613946557044983, -0.11841076612472534, -0.1336711347103119, 0.294524610042572, -0.1807553470134735, 0.026631809771060944, 0.3852580189704895, -0.16503587365150452, -0.1075342446565628, 0.07099132239818573, -0.3095545470714569, -0.36073213815689087, -0.07286526262760162, 0.33589813113212585, 0.2892538905143738, -0.10082326829433441, 0.20751291513442993, -0.09548504650592804, 0.19716693460941315, -0.002150006592273712, 0.13766273856163025, -0.18475432693958282, 0.11319926381111145, -0.2605932950973511, 0.011992305517196655, 0.4320237636566162, -0.1237608939409256, 0.06401273608207703, 0.06927753239870071, -0.2472057044506073, 0.030836403369903564, 0.14972607791423798, -0.1095857322216034, 0.25240692496299744, -0.25785031914711, 0.12189163267612457, 0.4097575843334198, -0.4624580144882202, -0.4775365889072418, 0.2878197431564331, -0.3083667457103729, -0.2022576928138733, 0.17586390674114227, 0.15166530013084412, 0.10582467913627625, 0.04770877584815025, 0.13497409224510193, 0.07823212444782257, -0.012863731943070889, 0.14650937914848328, -0.3378346562385559, 0.009831428527832031, -0.06713211536407471, -0.038945965468883514, 0.22446207702159882, 0.10187189280986786, 0.23127718269824982, -0.01684235781431198, 0.05187024921178818, 0.06404443830251694, -0.10972344875335693, 0.23697291314601898, 0.21071767807006836, -0.12287292629480362, -0.06297795474529266, -0.2114746868610382, -0.37101465463638306, 0.19960764050483704, -0.1813734918832779, 0.11976946890354156, -0.1311619132757187, -0.06717035174369812, -0.4082634449005127, 0.053611092269420624, -0.13966041803359985, -0.23769207298755646, 0.33915603160858154, -0.03415241837501526, -0.18240882456302643, 0.021303385496139526, -0.21208462119102478, 0.23389999568462372, -0.08713017404079437, 0.03133399784564972, 0.0957871824502945, 0.19024914503097534, -0.35479459166526794, -0.21003781259059906, 0.01658514142036438, -0.0010826736688613892, 0.22280819714069366, -0.040578681975603104, -0.15474583208560944, 0.413745254278183, 0.21876215934753418, 0.20871387422084808, 0.12224452197551727, 0.027159593999385834, 0.04666351526975632, -0.058835819363594055, -0.1929829716682434, 0.10744354128837585, 0.17377960681915283, -0.053301144391298294, 0.44121140241622925, 0.3880492150783539, 0.08838482946157455, -0.018452104181051254, 0.09897086769342422, 0.1828119158744812, 0.20703931152820587, -0.17483030259609222, 0.05743835121393204, -0.11844375729560852, 0.181797057390213, 0.29003122448921204, 0.12432312220335007, -0.1987747699022293, -0.3176746964454651, 0.09158353507518768, 0.42360493540763855, 0.19340284168720245, 0.13275031745433807, -0.29050758481025696, -0.03624244034290314, 0.21948865056037903, -0.14339789748191833, 0.33189091086387634, 0.3839683532714844, 0.15319837629795074, -0.055251676589250565, 0.19961611926555634, 0.02830320969223976, -0.21175016462802887, 0.14888593554496765, 0.06971036642789841, 0.11572545766830444, 0.3716866374015808, 0.013980358839035034, -0.03581853583455086, -0.17296312749385834, -0.5833550095558167, 0.03084918111562729, 0.32766103744506836, -0.2748904824256897, -0.027151312679052353, -0.24907183647155762, 0.16089880466461182, -0.005646776407957077, -0.18654099106788635, -0.10606856644153595, -0.4009949564933777, 0.13035988807678223, 0.14989227056503296, -0.25143152475357056, 0.09320110827684402, -0.3306337893009186, 0.05896395444869995, 0.2605491280555725, 0.13764844834804535, -0.0858118087053299, -0.2859734892845154, -0.023156359791755676, 0.1251211166381836, 0.16462033987045288, -0.11435960978269577, 0.36511877179145813, -0.09647669643163681, -0.09289789199829102, -0.16814157366752625, -0.14692318439483643, -0.054308272898197174, -0.06969505548477173, 0.3964959383010864, 0.22913934290409088, 0.3598935902118683, -0.2095957100391388, 0.014201510697603226, 0.26924780011177063, -0.15935830771923065, -0.1855555772781372, 0.13302628695964813, 0.09044203907251358, -0.17475643754005432, -0.14481240510940552, -0.3975484371185303, -0.3130279779434204, -0.5213376879692078, -0.15240028500556946, 0.01825735718011856, 0.23235754668712616, 0.24619707465171814, -0.06183215603232384, 0.37329816818237305, 0.12861403822898865, 0.3635660707950592, -0.09317144751548767, -0.393348753452301, 0.30689647793769836, -0.29320669174194336, -0.5069096684455872, -0.0434742197394371, -0.13778123259544373, 0.2502913177013397, -0.25147688388824463, -0.29335251450538635, -0.46909335255622864, -0.11449437588453293, 0.24946027994155884, -0.2808770537376404, 0.08051083981990814, 0.2564235031604767, 0.03449222818017006, -0.2961099445819855, -0.08493977785110474, 0.14733272790908813, -0.04667253419756889, 0.012393197044730186, -0.24388350546360016, -0.10966402292251587, 0.07931351661682129, 0.12174667418003082, 0.5469098091125488, 0.08898253738880157, 0.28529635071754456, 0.2871619462966919, -0.19751648604869843, 0.054314594715833664, -0.075798898935318, -0.4440813660621643, -0.24680985510349274, 0.12811464071273804, -0.1824152171611786, 0.17094866931438446, -0.25820451974868774, 0.2667827010154724, -0.18969428539276123, 0.031036846339702606, -0.23754079639911652, -0.1722639799118042, -0.14695893228054047, 0.0562354177236557, 0.15923483669757843, -0.15053591132164001, 0.12115778028964996, 0.03438490256667137, 0.3415389358997345, 0.35949966311454773, 0.5301384329795837, -0.3401510715484619, -0.15933655202388763, -0.3693682849407196, -0.027826042845845222, -0.22526538372039795, 0.1913948357105255, -0.014697927981615067, 0.24152648448944092, 0.011217363178730011, -0.19436092674732208, 0.06760869920253754, -0.2165011167526245, 0.3101823329925537, 0.11110030114650726, 0.1339612901210785, 0.3004104197025299, -0.19804632663726807, 0.09785090386867523, -0.10747373104095459, -0.3215748369693756, -0.20235314965248108, 0.3507084250450134, 0.3277986943721771, -0.19233180582523346, -0.00356978178024292, -0.19763973355293274, -0.12292645871639252, -0.2336282879114151, -0.08256176114082336, -0.19146913290023804, -0.2060847282409668, -0.5143704414367676, 0.22853806614875793, 0.21522578597068787, 0.30451682209968567, 0.22863470017910004, -0.06604083627462387, -0.0453592911362648, -0.34206071496009827, -0.007541332393884659, 0.1319132149219513, 0.16354432702064514, -0.19367089867591858, 0.18786360323429108, -0.30443722009658813, -0.1363782435655594, -0.046469852328300476, 0.43247827887535095, 0.0541624054312706, -0.239146888256073, -0.12887313961982727, -0.08782403916120529, 0.1340724378824234, 0.11724856495857239, -0.22471517324447632, 0.020937209948897362, 0.05608879402279854, 0.2689249813556671, 0.22183829545974731, -0.08973720669746399, 0.19424280524253845, -0.11701369285583496, 0.06147213652729988, -0.045734550803899765, 0.10718347132205963, -0.060260746628046036, 0.056403279304504395, 0.15334245562553406, -0.008361879736185074, 0.0007910877466201782, 0.07465890049934387, 0.04577053338289261, 0.8141485452651978, 0.07185615599155426, 0.02881724014878273, 0.39878687262535095, -0.07649203389883041, 0.026566646993160248, -0.05377346649765968, -0.0472666472196579, -0.4759175479412079, -0.4287510812282562, -0.004331361502408981, -0.18773378431797028, 0.3959293067455292, -0.09594477713108063, -0.25641337037086487, 0.016841553151607513, -0.21192821860313416, 0.06972411274909973, -0.25535547733306885, 0.059220269322395325, -0.1666862815618515, -0.04262286797165871, -0.26659533381462097, 0.24246054887771606, 0.03852858766913414, 0.06736230850219727, -0.2238292098045349, -0.1628028154373169, -0.1083671897649765, -0.236205592751503, -0.14957377314567566, 0.044983334839344025, -0.4897359311580658, 0.3633761405944824, 0.1694135069847107, -0.17303530871868134, -0.24627527594566345, -0.04804372787475586, 0.04229341447353363, 0.161616250872612, 0.00907229632139206, 0.16051426529884338, 0.33873695135116577, 0.01719624549150467, 0.06971308588981628, 0.12951849400997162, 0.6255922317504883, -0.29617536067962646, -0.06997183710336685, 0.25819143652915955, -0.0703793466091156, -0.16811224818229675, 0.25123971700668335, 0.08516904711723328, 0.1144418865442276, -0.15498816967010498, -0.22314342856407166, 0.030415212735533714, -0.2460322380065918, -0.33370816707611084, 0.21201281249523163, 0.18348652124404907, -0.28036996722221375, 0.11846795678138733, -0.04893391579389572, -0.1853344887495041, -0.14668790996074677, 0.2795677185058594, -0.020329197868704796, 0.2111203372478485, 0.4180724024772644, 0.1485842764377594, -0.32087576389312744, -0.42044341564178467, 0.15206022560596466, -0.1358197033405304, -0.2077386975288391, 0.45738252997398376, 0.02835128828883171, -0.13380268216133118, 0.06009434536099434, 0.547139048576355, 0.04352793097496033, 0.07778821885585785, -0.01475013792514801, -0.5255994200706482, -0.5390862822532654, -0.027754124253988266, -0.15863123536109924, 0.13955891132354736, -0.08613083511590958, 0.3869228959083557, -0.17648983001708984, 0.1428253948688507, -0.4534685015678406, -0.010904166847467422, -0.3043157458305359, 0.012121370062232018, 0.3330516815185547, -0.12599346041679382, 0.1883438229560852, 0.35374924540519714, 0.25105541944503784, 0.2561659812927246, -0.1985631138086319, -0.37430548667907715, -0.22375282645225525, 0.10092442482709885, 0.10287781059741974, -0.03606480360031128, 0.014600593596696854, -0.16241884231567383, -0.07640856504440308, 0.04587592929601669, 0.012399978935718536, 0.19031263887882233, -0.03191279247403145, 0.4283803701400757, 0.0660799890756607, 0.017683833837509155, -0.08185769617557526, 0.11410658061504364, -0.05253162980079651, -0.09036090224981308, -0.07530773431062698, -0.08022797107696533, -0.0997772067785263, -0.07874128967523575, -0.34498995542526245, 0.04051893204450607, -0.14069199562072754, 0.09585254639387131, 0.37018609046936035, 0.005360269919037819, -0.1250995248556137, 0.34536251425743103, 0.19379019737243652, 0.1545015573501587, -0.20998048782348633, -0.11246266961097717, 0.20599766075611115, 0.3322298228740692, -0.3889960050582886, -0.06613888591527939, -0.07266151905059814, -0.013331390917301178, 0.1420871913433075, 0.21651719510555267, -0.09566058218479156, -0.1143789291381836, -0.21403898298740387, 0.2105545848608017, 0.004003200680017471, -0.2780230641365051, 0.06721314042806625, 0.09774412214756012, 0.0016040802001953125, 0.09462352097034454, 0.3893909752368927, 0.19859996438026428, 0.06525424867868423, 0.04238616302609444, -0.2482941597700119, 0.0427999347448349, 0.0227469764649868, -0.13915155827999115, 0.132770374417305, -0.1913740485906601, 0.35282331705093384, 0.026450231671333313, 0.07931150496006012, -0.15092724561691284, -0.01495746523141861, 0.13642758131027222, 0.10998786985874176, 0.19470353424549103, 0.011231303215026855, 0.2555442154407501, -0.3021965026855469, 0.02495168149471283, 0.4505772292613983, 0.0012910887598991394, 0.010607495903968811, -0.11430072784423828, 0.1265629678964615, 0.14691941440105438, 0.36392876505851746, 0.28376689553260803, 0.12361583113670349, -0.2854915261268616, -0.24918726086616516, 0.1783473789691925, -0.013511456549167633, -0.5115432739257812, -0.1405288726091385, 0.16904021799564362, 0.09186063706874847, -0.0014996044337749481, 0.19675329327583313, 0.3545476794242859, 0.30715978145599365, -0.14513379335403442, -0.04075150191783905, -0.061635784804821014, -0.10663457214832306, -0.05946514010429382, 0.16613620519638062, -0.1060972511768341, 0.16498300433158875, 0.33422940969467163, 0.2022123485803604, -0.3309974670410156, -0.08569306135177612, 0.10033359378576279, -0.18154487013816833, -0.14718835055828094, 0.4650391936302185, 0.07912446558475494, -0.29301631450653076, -0.18671196699142456, 0.14762961864471436, -0.314522922039032, -0.3138011693954468, 0.07677477598190308, -0.06084389239549637, 0.18347562849521637, -0.27726662158966064, 0.16979867219924927, 0.04477442800998688, 0.2366686761379242, 0.4011516571044922, -0.05484384298324585, -0.41469913721084595, 0.008219733834266663, -0.574737548828125, 0.44581231474876404, 0.11493833363056183, -0.40760013461112976, -0.07454361021518707, 0.27758991718292236, -0.1946355551481247, 0.16969656944274902, 0.3113996386528015, -0.25948959589004517, 0.028853487223386765, 0.27408072352409363, -0.2840310037136078, -0.058122795075178146, -0.14939488470554352, -0.21608400344848633, 0.07854130864143372, -0.1431656926870346, 0.08864661306142807, -0.12808987498283386, 0.25983545184135437, -0.06764142215251923, -0.35888344049453735, 0.17348890006542206, 0.21292081475257874, 0.33979901671409607, 0.054932087659835815, 0.3236159682273865, -0.2871127128601074, 0.03701212257146835, 0.022650988772511482, -0.1575068235397339, -0.026935718953609467, -0.04059045389294624, 0.15620659291744232, 0.2100025713443756, 0.040879786014556885, -0.10207216441631317, -0.319333016872406, 0.5023040771484375, -0.1591847836971283, -0.2146231234073639, -0.2082204520702362, 0.3630659580230713, 0.062128931283950806, 0.10627026110887527, 0.060560766607522964, 0.26186075806617737, 0.040609002113342285, 0.34129929542541504, -0.47204723954200745, -0.6365747451782227, 0.44734644889831543, -0.3823893666267395, -0.2945074737071991, 0.03226245567202568, 0.4139120280742645, -0.12446030974388123, 0.030820073559880257, -0.4388791620731354, 0.052297309041023254, 0.26447540521621704, -0.0637119710445404, -0.10672169923782349, 0.41927558183670044, -0.039980627596378326, 0.14795786142349243, 0.025188446044921875, 0.21676066517829895, 0.08250175416469574, 0.07250147312879562, -0.10108307003974915, -0.042484063655138016 ]
https://github.com/huggingface/datasets/issues/6066
Maybe it is a bug of tqdm? I think simply use `try ... except AttributeError ...` wraps `del tqdm_class._lock` should work.
AttributeError: '_tqdm_cls' object has no attribute '_lock'
### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master
21
AttributeError: '_tqdm_cls' object has no attribute '_lock' ### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master Maybe it is a bug of tqdm? I think simply use `try ... except AttributeError ...` wraps `del tqdm_class._lock` should work.
[ -0.17624372243881226, -0.28966182470321655, -0.08112587034702301, 0.21007463335990906, 0.2333376258611679, -0.10606662184000015, 0.34196195006370544, 0.3747367858886719, -0.07112034410238266, 0.04517202824354172, -0.0528116337954998, 0.36341848969459534, -0.1971302181482315, 0.045730821788311005, -0.18291465938091278, -0.00689138937741518, -0.13124388456344604, 0.020862717181444168, -0.20673298835754395, 0.0033792033791542053, -0.1716487854719162, 0.4683590829372406, -0.08010941743850708, 0.13005515933036804, -0.25565633177757263, -0.20349068939685822, 0.16306191682815552, 0.3502751588821411, -0.007030440494418144, -0.30351102352142334, -0.11140717566013336, -0.10186009854078293, -0.05263517051935196, 0.4311617314815521, -0.00010188113083131611, 0.01722419261932373, 0.20431292057037354, 0.028904132544994354, -0.029196154326200485, 0.2324400693178177, -0.0893627405166626, -0.32429632544517517, 0.06823205202817917, -0.415113627910614, 0.10848918557167053, 0.06326441466808319, -0.19405770301818848, -0.23127201199531555, 0.32062941789627075, 0.3468674421310425, 0.3375101685523987, 0.6315898299217224, 0.11758527904748917, -0.2974742352962494, 0.13813945651054382, -0.6866133213043213, -0.1452908217906952, 0.3828820586204529, 0.39306849241256714, -0.15615196526050568, -0.1257725954055786, 0.44635438919067383, -0.20600301027297974, 0.12796887755393982, 0.052920613437891006, 0.0023293383419513702, 0.3116326332092285, -0.24241529405117035, 0.07748255133628845, 0.1708017885684967, 0.289000004529953, -0.21589024364948273, -0.2434055209159851, 0.0930149108171463, 0.04800634831190109, -0.0048852041363716125, 0.1265002191066742, 0.05001086741685867, -0.06385327875614166, 0.26224178075790405, 0.15560640394687653, 0.040796760469675064, 0.025513745844364166, 0.013189439661800861, -0.11713609099388123, 0.0792979896068573, -0.04866957664489746, -0.07651211321353912, 0.07735542953014374, -0.10525166988372803, 0.14313006401062012, 0.18866600096225739, -0.046736110001802444, -0.05241589620709419, -0.24947065114974976, -0.21683403849601746, 0.25611624121665955, -0.005165014415979385, 0.05867046117782593, 0.3036542534828186, -0.15571123361587524, 0.005433986894786358, 0.2551167607307434, 0.2048766165971756, -0.06266528367996216, 0.06939762085676193, -0.178655743598938, 0.24922451376914978, 0.3359309434890747, 0.13168199360370636, -0.4111805558204651, 0.023218469694256783, 0.12441401183605194, -0.5652226209640503, 0.46770596504211426, 0.2188752144575119, 0.3554536700248718, 0.009391829371452332, -0.10201791673898697, 0.3170149326324463, 0.06359929591417313, 0.12306588888168335, 0.03071204572916031, 0.5289992094039917, 0.06685376167297363, 0.026434067636728287, 0.16250833868980408, 0.07873621582984924, -0.253558874130249, -0.19508427381515503, -0.38241246342658997, 0.27257484197616577, 0.09470878541469574, -0.17660225927829742, -0.2180849015712738, 0.021639809012413025, 0.3145618140697479, 0.09877444058656693, 0.28230881690979004, -0.10110379755496979, 0.21613946557044983, -0.11841076612472534, -0.1336711347103119, 0.294524610042572, -0.1807553470134735, 0.026631809771060944, 0.3852580189704895, -0.16503587365150452, -0.1075342446565628, 0.07099132239818573, -0.3095545470714569, -0.36073213815689087, -0.07286526262760162, 0.33589813113212585, 0.2892538905143738, -0.10082326829433441, 0.20751291513442993, -0.09548504650592804, 0.19716693460941315, -0.002150006592273712, 0.13766273856163025, -0.18475432693958282, 0.11319926381111145, -0.2605932950973511, 0.011992305517196655, 0.4320237636566162, -0.1237608939409256, 0.06401273608207703, 0.06927753239870071, -0.2472057044506073, 0.030836403369903564, 0.14972607791423798, -0.1095857322216034, 0.25240692496299744, -0.25785031914711, 0.12189163267612457, 0.4097575843334198, -0.4624580144882202, -0.4775365889072418, 0.2878197431564331, -0.3083667457103729, -0.2022576928138733, 0.17586390674114227, 0.15166530013084412, 0.10582467913627625, 0.04770877584815025, 0.13497409224510193, 0.07823212444782257, -0.012863731943070889, 0.14650937914848328, -0.3378346562385559, 0.009831428527832031, -0.06713211536407471, -0.038945965468883514, 0.22446207702159882, 0.10187189280986786, 0.23127718269824982, -0.01684235781431198, 0.05187024921178818, 0.06404443830251694, -0.10972344875335693, 0.23697291314601898, 0.21071767807006836, -0.12287292629480362, -0.06297795474529266, -0.2114746868610382, -0.37101465463638306, 0.19960764050483704, -0.1813734918832779, 0.11976946890354156, -0.1311619132757187, -0.06717035174369812, -0.4082634449005127, 0.053611092269420624, -0.13966041803359985, -0.23769207298755646, 0.33915603160858154, -0.03415241837501526, -0.18240882456302643, 0.021303385496139526, -0.21208462119102478, 0.23389999568462372, -0.08713017404079437, 0.03133399784564972, 0.0957871824502945, 0.19024914503097534, -0.35479459166526794, -0.21003781259059906, 0.01658514142036438, -0.0010826736688613892, 0.22280819714069366, -0.040578681975603104, -0.15474583208560944, 0.413745254278183, 0.21876215934753418, 0.20871387422084808, 0.12224452197551727, 0.027159593999385834, 0.04666351526975632, -0.058835819363594055, -0.1929829716682434, 0.10744354128837585, 0.17377960681915283, -0.053301144391298294, 0.44121140241622925, 0.3880492150783539, 0.08838482946157455, -0.018452104181051254, 0.09897086769342422, 0.1828119158744812, 0.20703931152820587, -0.17483030259609222, 0.05743835121393204, -0.11844375729560852, 0.181797057390213, 0.29003122448921204, 0.12432312220335007, -0.1987747699022293, -0.3176746964454651, 0.09158353507518768, 0.42360493540763855, 0.19340284168720245, 0.13275031745433807, -0.29050758481025696, -0.03624244034290314, 0.21948865056037903, -0.14339789748191833, 0.33189091086387634, 0.3839683532714844, 0.15319837629795074, -0.055251676589250565, 0.19961611926555634, 0.02830320969223976, -0.21175016462802887, 0.14888593554496765, 0.06971036642789841, 0.11572545766830444, 0.3716866374015808, 0.013980358839035034, -0.03581853583455086, -0.17296312749385834, -0.5833550095558167, 0.03084918111562729, 0.32766103744506836, -0.2748904824256897, -0.027151312679052353, -0.24907183647155762, 0.16089880466461182, -0.005646776407957077, -0.18654099106788635, -0.10606856644153595, -0.4009949564933777, 0.13035988807678223, 0.14989227056503296, -0.25143152475357056, 0.09320110827684402, -0.3306337893009186, 0.05896395444869995, 0.2605491280555725, 0.13764844834804535, -0.0858118087053299, -0.2859734892845154, -0.023156359791755676, 0.1251211166381836, 0.16462033987045288, -0.11435960978269577, 0.36511877179145813, -0.09647669643163681, -0.09289789199829102, -0.16814157366752625, -0.14692318439483643, -0.054308272898197174, -0.06969505548477173, 0.3964959383010864, 0.22913934290409088, 0.3598935902118683, -0.2095957100391388, 0.014201510697603226, 0.26924780011177063, -0.15935830771923065, -0.1855555772781372, 0.13302628695964813, 0.09044203907251358, -0.17475643754005432, -0.14481240510940552, -0.3975484371185303, -0.3130279779434204, -0.5213376879692078, -0.15240028500556946, 0.01825735718011856, 0.23235754668712616, 0.24619707465171814, -0.06183215603232384, 0.37329816818237305, 0.12861403822898865, 0.3635660707950592, -0.09317144751548767, -0.393348753452301, 0.30689647793769836, -0.29320669174194336, -0.5069096684455872, -0.0434742197394371, -0.13778123259544373, 0.2502913177013397, -0.25147688388824463, -0.29335251450538635, -0.46909335255622864, -0.11449437588453293, 0.24946027994155884, -0.2808770537376404, 0.08051083981990814, 0.2564235031604767, 0.03449222818017006, -0.2961099445819855, -0.08493977785110474, 0.14733272790908813, -0.04667253419756889, 0.012393197044730186, -0.24388350546360016, -0.10966402292251587, 0.07931351661682129, 0.12174667418003082, 0.5469098091125488, 0.08898253738880157, 0.28529635071754456, 0.2871619462966919, -0.19751648604869843, 0.054314594715833664, -0.075798898935318, -0.4440813660621643, -0.24680985510349274, 0.12811464071273804, -0.1824152171611786, 0.17094866931438446, -0.25820451974868774, 0.2667827010154724, -0.18969428539276123, 0.031036846339702606, -0.23754079639911652, -0.1722639799118042, -0.14695893228054047, 0.0562354177236557, 0.15923483669757843, -0.15053591132164001, 0.12115778028964996, 0.03438490256667137, 0.3415389358997345, 0.35949966311454773, 0.5301384329795837, -0.3401510715484619, -0.15933655202388763, -0.3693682849407196, -0.027826042845845222, -0.22526538372039795, 0.1913948357105255, -0.014697927981615067, 0.24152648448944092, 0.011217363178730011, -0.19436092674732208, 0.06760869920253754, -0.2165011167526245, 0.3101823329925537, 0.11110030114650726, 0.1339612901210785, 0.3004104197025299, -0.19804632663726807, 0.09785090386867523, -0.10747373104095459, -0.3215748369693756, -0.20235314965248108, 0.3507084250450134, 0.3277986943721771, -0.19233180582523346, -0.00356978178024292, -0.19763973355293274, -0.12292645871639252, -0.2336282879114151, -0.08256176114082336, -0.19146913290023804, -0.2060847282409668, -0.5143704414367676, 0.22853806614875793, 0.21522578597068787, 0.30451682209968567, 0.22863470017910004, -0.06604083627462387, -0.0453592911362648, -0.34206071496009827, -0.007541332393884659, 0.1319132149219513, 0.16354432702064514, -0.19367089867591858, 0.18786360323429108, -0.30443722009658813, -0.1363782435655594, -0.046469852328300476, 0.43247827887535095, 0.0541624054312706, -0.239146888256073, -0.12887313961982727, -0.08782403916120529, 0.1340724378824234, 0.11724856495857239, -0.22471517324447632, 0.020937209948897362, 0.05608879402279854, 0.2689249813556671, 0.22183829545974731, -0.08973720669746399, 0.19424280524253845, -0.11701369285583496, 0.06147213652729988, -0.045734550803899765, 0.10718347132205963, -0.060260746628046036, 0.056403279304504395, 0.15334245562553406, -0.008361879736185074, 0.0007910877466201782, 0.07465890049934387, 0.04577053338289261, 0.8141485452651978, 0.07185615599155426, 0.02881724014878273, 0.39878687262535095, -0.07649203389883041, 0.026566646993160248, -0.05377346649765968, -0.0472666472196579, -0.4759175479412079, -0.4287510812282562, -0.004331361502408981, -0.18773378431797028, 0.3959293067455292, -0.09594477713108063, -0.25641337037086487, 0.016841553151607513, -0.21192821860313416, 0.06972411274909973, -0.25535547733306885, 0.059220269322395325, -0.1666862815618515, -0.04262286797165871, -0.26659533381462097, 0.24246054887771606, 0.03852858766913414, 0.06736230850219727, -0.2238292098045349, -0.1628028154373169, -0.1083671897649765, -0.236205592751503, -0.14957377314567566, 0.044983334839344025, -0.4897359311580658, 0.3633761405944824, 0.1694135069847107, -0.17303530871868134, -0.24627527594566345, -0.04804372787475586, 0.04229341447353363, 0.161616250872612, 0.00907229632139206, 0.16051426529884338, 0.33873695135116577, 0.01719624549150467, 0.06971308588981628, 0.12951849400997162, 0.6255922317504883, -0.29617536067962646, -0.06997183710336685, 0.25819143652915955, -0.0703793466091156, -0.16811224818229675, 0.25123971700668335, 0.08516904711723328, 0.1144418865442276, -0.15498816967010498, -0.22314342856407166, 0.030415212735533714, -0.2460322380065918, -0.33370816707611084, 0.21201281249523163, 0.18348652124404907, -0.28036996722221375, 0.11846795678138733, -0.04893391579389572, -0.1853344887495041, -0.14668790996074677, 0.2795677185058594, -0.020329197868704796, 0.2111203372478485, 0.4180724024772644, 0.1485842764377594, -0.32087576389312744, -0.42044341564178467, 0.15206022560596466, -0.1358197033405304, -0.2077386975288391, 0.45738252997398376, 0.02835128828883171, -0.13380268216133118, 0.06009434536099434, 0.547139048576355, 0.04352793097496033, 0.07778821885585785, -0.01475013792514801, -0.5255994200706482, -0.5390862822532654, -0.027754124253988266, -0.15863123536109924, 0.13955891132354736, -0.08613083511590958, 0.3869228959083557, -0.17648983001708984, 0.1428253948688507, -0.4534685015678406, -0.010904166847467422, -0.3043157458305359, 0.012121370062232018, 0.3330516815185547, -0.12599346041679382, 0.1883438229560852, 0.35374924540519714, 0.25105541944503784, 0.2561659812927246, -0.1985631138086319, -0.37430548667907715, -0.22375282645225525, 0.10092442482709885, 0.10287781059741974, -0.03606480360031128, 0.014600593596696854, -0.16241884231567383, -0.07640856504440308, 0.04587592929601669, 0.012399978935718536, 0.19031263887882233, -0.03191279247403145, 0.4283803701400757, 0.0660799890756607, 0.017683833837509155, -0.08185769617557526, 0.11410658061504364, -0.05253162980079651, -0.09036090224981308, -0.07530773431062698, -0.08022797107696533, -0.0997772067785263, -0.07874128967523575, -0.34498995542526245, 0.04051893204450607, -0.14069199562072754, 0.09585254639387131, 0.37018609046936035, 0.005360269919037819, -0.1250995248556137, 0.34536251425743103, 0.19379019737243652, 0.1545015573501587, -0.20998048782348633, -0.11246266961097717, 0.20599766075611115, 0.3322298228740692, -0.3889960050582886, -0.06613888591527939, -0.07266151905059814, -0.013331390917301178, 0.1420871913433075, 0.21651719510555267, -0.09566058218479156, -0.1143789291381836, -0.21403898298740387, 0.2105545848608017, 0.004003200680017471, -0.2780230641365051, 0.06721314042806625, 0.09774412214756012, 0.0016040802001953125, 0.09462352097034454, 0.3893909752368927, 0.19859996438026428, 0.06525424867868423, 0.04238616302609444, -0.2482941597700119, 0.0427999347448349, 0.0227469764649868, -0.13915155827999115, 0.132770374417305, -0.1913740485906601, 0.35282331705093384, 0.026450231671333313, 0.07931150496006012, -0.15092724561691284, -0.01495746523141861, 0.13642758131027222, 0.10998786985874176, 0.19470353424549103, 0.011231303215026855, 0.2555442154407501, -0.3021965026855469, 0.02495168149471283, 0.4505772292613983, 0.0012910887598991394, 0.010607495903968811, -0.11430072784423828, 0.1265629678964615, 0.14691941440105438, 0.36392876505851746, 0.28376689553260803, 0.12361583113670349, -0.2854915261268616, -0.24918726086616516, 0.1783473789691925, -0.013511456549167633, -0.5115432739257812, -0.1405288726091385, 0.16904021799564362, 0.09186063706874847, -0.0014996044337749481, 0.19675329327583313, 0.3545476794242859, 0.30715978145599365, -0.14513379335403442, -0.04075150191783905, -0.061635784804821014, -0.10663457214832306, -0.05946514010429382, 0.16613620519638062, -0.1060972511768341, 0.16498300433158875, 0.33422940969467163, 0.2022123485803604, -0.3309974670410156, -0.08569306135177612, 0.10033359378576279, -0.18154487013816833, -0.14718835055828094, 0.4650391936302185, 0.07912446558475494, -0.29301631450653076, -0.18671196699142456, 0.14762961864471436, -0.314522922039032, -0.3138011693954468, 0.07677477598190308, -0.06084389239549637, 0.18347562849521637, -0.27726662158966064, 0.16979867219924927, 0.04477442800998688, 0.2366686761379242, 0.4011516571044922, -0.05484384298324585, -0.41469913721084595, 0.008219733834266663, -0.574737548828125, 0.44581231474876404, 0.11493833363056183, -0.40760013461112976, -0.07454361021518707, 0.27758991718292236, -0.1946355551481247, 0.16969656944274902, 0.3113996386528015, -0.25948959589004517, 0.028853487223386765, 0.27408072352409363, -0.2840310037136078, -0.058122795075178146, -0.14939488470554352, -0.21608400344848633, 0.07854130864143372, -0.1431656926870346, 0.08864661306142807, -0.12808987498283386, 0.25983545184135437, -0.06764142215251923, -0.35888344049453735, 0.17348890006542206, 0.21292081475257874, 0.33979901671409607, 0.054932087659835815, 0.3236159682273865, -0.2871127128601074, 0.03701212257146835, 0.022650988772511482, -0.1575068235397339, -0.026935718953609467, -0.04059045389294624, 0.15620659291744232, 0.2100025713443756, 0.040879786014556885, -0.10207216441631317, -0.319333016872406, 0.5023040771484375, -0.1591847836971283, -0.2146231234073639, -0.2082204520702362, 0.3630659580230713, 0.062128931283950806, 0.10627026110887527, 0.060560766607522964, 0.26186075806617737, 0.040609002113342285, 0.34129929542541504, -0.47204723954200745, -0.6365747451782227, 0.44734644889831543, -0.3823893666267395, -0.2945074737071991, 0.03226245567202568, 0.4139120280742645, -0.12446030974388123, 0.030820073559880257, -0.4388791620731354, 0.052297309041023254, 0.26447540521621704, -0.0637119710445404, -0.10672169923782349, 0.41927558183670044, -0.039980627596378326, 0.14795786142349243, 0.025188446044921875, 0.21676066517829895, 0.08250175416469574, 0.07250147312879562, -0.10108307003974915, -0.042484063655138016 ]
https://github.com/huggingface/datasets/issues/6066
Yes it looks like a bug on their end indeed, do you want to open a PR on tqdm ? Let me see if I can find a workaround in the meantime
AttributeError: '_tqdm_cls' object has no attribute '_lock'
### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master
32
AttributeError: '_tqdm_cls' object has no attribute '_lock' ### Describe the bug ```python File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/load.py", line 1034, in get_module data_files = DataFilesDict.from_patterns( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 671, in from_patterns DataFilesList.from_patterns( File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 586, in from_patterns origin_metadata = _get_origin_metadata(data_files, download_config=download_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/datasets/data_files.py", line 502, in _get_origin_metadata return thread_map( ^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 70, in thread_map return _executor_map(ThreadPoolExecutor, fn, *iterables, **tqdm_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 48, in _executor_map with ensure_lock(tqdm_class, lock_name=lock_name) as lk: File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/Users/codingl2k1/.pyenv/versions/3.11.4/lib/python3.11/site-packages/tqdm/contrib/concurrent.py", line 25, in ensure_lock del tqdm_class._lock ^^^^^^^^^^^^^^^^ AttributeError: '_tqdm_cls' object has no attribute '_lock' ``` ### Steps to reproduce the bug Happens ocasionally. ### Expected behavior I added a print in tqdm `ensure_lock()`, got a `ensure_lock <datasets.utils.logging._tqdm_cls object at 0x16dddead0> ` print. According to the code in https://github.com/tqdm/tqdm/blob/master/tqdm/contrib/concurrent.py#L24 ```python @contextmanager def ensure_lock(tqdm_class, lock_name=""): """get (create if necessary) and then restore `tqdm_class`'s lock""" print("ensure_lock", tqdm_class, lock_name) old_lock = getattr(tqdm_class, '_lock', None) # don't create a new lock lock = old_lock or tqdm_class.get_lock() # maybe create a new lock lock = getattr(lock, lock_name, lock) # maybe subtype tqdm_class.set_lock(lock) yield lock if old_lock is None: del tqdm_class._lock # <-- It tries to del the `_lock` attribute from tqdm_class. else: tqdm_class.set_lock(old_lock) ``` But, huggingface datasets `datasets.utils.logging._tqdm_cls` does not have the field `_lock`: https://github.com/huggingface/datasets/blob/main/src/datasets/utils/logging.py#L205 ```python class _tqdm_cls: def __call__(self, *args, disable=False, **kwargs): if _tqdm_active and not disable: return tqdm_lib.tqdm(*args, **kwargs) else: return EmptyTqdm(*args, **kwargs) def set_lock(self, *args, **kwargs): self._lock = None if _tqdm_active: return tqdm_lib.tqdm.set_lock(*args, **kwargs) def get_lock(self): if _tqdm_active: return tqdm_lib.tqdm.get_lock() ``` ### Environment info Python 3.11.4 tqdm '4.65.0' datasets master Yes it looks like a bug on their end indeed, do you want to open a PR on tqdm ? Let me see if I can find a workaround in the meantime
[ -0.17624372243881226, -0.28966182470321655, -0.08112587034702301, 0.21007463335990906, 0.2333376258611679, -0.10606662184000015, 0.34196195006370544, 0.3747367858886719, -0.07112034410238266, 0.04517202824354172, -0.0528116337954998, 0.36341848969459534, -0.1971302181482315, 0.045730821788311005, -0.18291465938091278, -0.00689138937741518, -0.13124388456344604, 0.020862717181444168, -0.20673298835754395, 0.0033792033791542053, -0.1716487854719162, 0.4683590829372406, -0.08010941743850708, 0.13005515933036804, -0.25565633177757263, -0.20349068939685822, 0.16306191682815552, 0.3502751588821411, -0.007030440494418144, -0.30351102352142334, -0.11140717566013336, -0.10186009854078293, -0.05263517051935196, 0.4311617314815521, -0.00010188113083131611, 0.01722419261932373, 0.20431292057037354, 0.028904132544994354, -0.029196154326200485, 0.2324400693178177, -0.0893627405166626, -0.32429632544517517, 0.06823205202817917, -0.415113627910614, 0.10848918557167053, 0.06326441466808319, -0.19405770301818848, -0.23127201199531555, 0.32062941789627075, 0.3468674421310425, 0.3375101685523987, 0.6315898299217224, 0.11758527904748917, -0.2974742352962494, 0.13813945651054382, -0.6866133213043213, -0.1452908217906952, 0.3828820586204529, 0.39306849241256714, -0.15615196526050568, -0.1257725954055786, 0.44635438919067383, -0.20600301027297974, 0.12796887755393982, 0.052920613437891006, 0.0023293383419513702, 0.3116326332092285, -0.24241529405117035, 0.07748255133628845, 0.1708017885684967, 0.289000004529953, -0.21589024364948273, -0.2434055209159851, 0.0930149108171463, 0.04800634831190109, -0.0048852041363716125, 0.1265002191066742, 0.05001086741685867, -0.06385327875614166, 0.26224178075790405, 0.15560640394687653, 0.040796760469675064, 0.025513745844364166, 0.013189439661800861, -0.11713609099388123, 0.0792979896068573, -0.04866957664489746, -0.07651211321353912, 0.07735542953014374, -0.10525166988372803, 0.14313006401062012, 0.18866600096225739, -0.046736110001802444, -0.05241589620709419, -0.24947065114974976, -0.21683403849601746, 0.25611624121665955, -0.005165014415979385, 0.05867046117782593, 0.3036542534828186, -0.15571123361587524, 0.005433986894786358, 0.2551167607307434, 0.2048766165971756, -0.06266528367996216, 0.06939762085676193, -0.178655743598938, 0.24922451376914978, 0.3359309434890747, 0.13168199360370636, -0.4111805558204651, 0.023218469694256783, 0.12441401183605194, -0.5652226209640503, 0.46770596504211426, 0.2188752144575119, 0.3554536700248718, 0.009391829371452332, -0.10201791673898697, 0.3170149326324463, 0.06359929591417313, 0.12306588888168335, 0.03071204572916031, 0.5289992094039917, 0.06685376167297363, 0.026434067636728287, 0.16250833868980408, 0.07873621582984924, -0.253558874130249, -0.19508427381515503, -0.38241246342658997, 0.27257484197616577, 0.09470878541469574, -0.17660225927829742, -0.2180849015712738, 0.021639809012413025, 0.3145618140697479, 0.09877444058656693, 0.28230881690979004, -0.10110379755496979, 0.21613946557044983, -0.11841076612472534, -0.1336711347103119, 0.294524610042572, -0.1807553470134735, 0.026631809771060944, 0.3852580189704895, -0.16503587365150452, -0.1075342446565628, 0.07099132239818573, -0.3095545470714569, -0.36073213815689087, -0.07286526262760162, 0.33589813113212585, 0.2892538905143738, -0.10082326829433441, 0.20751291513442993, -0.09548504650592804, 0.19716693460941315, -0.002150006592273712, 0.13766273856163025, -0.18475432693958282, 0.11319926381111145, -0.2605932950973511, 0.011992305517196655, 0.4320237636566162, -0.1237608939409256, 0.06401273608207703, 0.06927753239870071, -0.2472057044506073, 0.030836403369903564, 0.14972607791423798, -0.1095857322216034, 0.25240692496299744, -0.25785031914711, 0.12189163267612457, 0.4097575843334198, -0.4624580144882202, -0.4775365889072418, 0.2878197431564331, -0.3083667457103729, -0.2022576928138733, 0.17586390674114227, 0.15166530013084412, 0.10582467913627625, 0.04770877584815025, 0.13497409224510193, 0.07823212444782257, -0.012863731943070889, 0.14650937914848328, -0.3378346562385559, 0.009831428527832031, -0.06713211536407471, -0.038945965468883514, 0.22446207702159882, 0.10187189280986786, 0.23127718269824982, -0.01684235781431198, 0.05187024921178818, 0.06404443830251694, -0.10972344875335693, 0.23697291314601898, 0.21071767807006836, -0.12287292629480362, -0.06297795474529266, -0.2114746868610382, -0.37101465463638306, 0.19960764050483704, -0.1813734918832779, 0.11976946890354156, -0.1311619132757187, -0.06717035174369812, -0.4082634449005127, 0.053611092269420624, -0.13966041803359985, -0.23769207298755646, 0.33915603160858154, -0.03415241837501526, -0.18240882456302643, 0.021303385496139526, -0.21208462119102478, 0.23389999568462372, -0.08713017404079437, 0.03133399784564972, 0.0957871824502945, 0.19024914503097534, -0.35479459166526794, -0.21003781259059906, 0.01658514142036438, -0.0010826736688613892, 0.22280819714069366, -0.040578681975603104, -0.15474583208560944, 0.413745254278183, 0.21876215934753418, 0.20871387422084808, 0.12224452197551727, 0.027159593999385834, 0.04666351526975632, -0.058835819363594055, -0.1929829716682434, 0.10744354128837585, 0.17377960681915283, -0.053301144391298294, 0.44121140241622925, 0.3880492150783539, 0.08838482946157455, -0.018452104181051254, 0.09897086769342422, 0.1828119158744812, 0.20703931152820587, -0.17483030259609222, 0.05743835121393204, -0.11844375729560852, 0.181797057390213, 0.29003122448921204, 0.12432312220335007, -0.1987747699022293, -0.3176746964454651, 0.09158353507518768, 0.42360493540763855, 0.19340284168720245, 0.13275031745433807, -0.29050758481025696, -0.03624244034290314, 0.21948865056037903, -0.14339789748191833, 0.33189091086387634, 0.3839683532714844, 0.15319837629795074, -0.055251676589250565, 0.19961611926555634, 0.02830320969223976, -0.21175016462802887, 0.14888593554496765, 0.06971036642789841, 0.11572545766830444, 0.3716866374015808, 0.013980358839035034, -0.03581853583455086, -0.17296312749385834, -0.5833550095558167, 0.03084918111562729, 0.32766103744506836, -0.2748904824256897, -0.027151312679052353, -0.24907183647155762, 0.16089880466461182, -0.005646776407957077, -0.18654099106788635, -0.10606856644153595, -0.4009949564933777, 0.13035988807678223, 0.14989227056503296, -0.25143152475357056, 0.09320110827684402, -0.3306337893009186, 0.05896395444869995, 0.2605491280555725, 0.13764844834804535, -0.0858118087053299, -0.2859734892845154, -0.023156359791755676, 0.1251211166381836, 0.16462033987045288, -0.11435960978269577, 0.36511877179145813, -0.09647669643163681, -0.09289789199829102, -0.16814157366752625, -0.14692318439483643, -0.054308272898197174, -0.06969505548477173, 0.3964959383010864, 0.22913934290409088, 0.3598935902118683, -0.2095957100391388, 0.014201510697603226, 0.26924780011177063, -0.15935830771923065, -0.1855555772781372, 0.13302628695964813, 0.09044203907251358, -0.17475643754005432, -0.14481240510940552, -0.3975484371185303, -0.3130279779434204, -0.5213376879692078, -0.15240028500556946, 0.01825735718011856, 0.23235754668712616, 0.24619707465171814, -0.06183215603232384, 0.37329816818237305, 0.12861403822898865, 0.3635660707950592, -0.09317144751548767, -0.393348753452301, 0.30689647793769836, -0.29320669174194336, -0.5069096684455872, -0.0434742197394371, -0.13778123259544373, 0.2502913177013397, -0.25147688388824463, -0.29335251450538635, -0.46909335255622864, -0.11449437588453293, 0.24946027994155884, -0.2808770537376404, 0.08051083981990814, 0.2564235031604767, 0.03449222818017006, -0.2961099445819855, -0.08493977785110474, 0.14733272790908813, -0.04667253419756889, 0.012393197044730186, -0.24388350546360016, -0.10966402292251587, 0.07931351661682129, 0.12174667418003082, 0.5469098091125488, 0.08898253738880157, 0.28529635071754456, 0.2871619462966919, -0.19751648604869843, 0.054314594715833664, -0.075798898935318, -0.4440813660621643, -0.24680985510349274, 0.12811464071273804, -0.1824152171611786, 0.17094866931438446, -0.25820451974868774, 0.2667827010154724, -0.18969428539276123, 0.031036846339702606, -0.23754079639911652, -0.1722639799118042, -0.14695893228054047, 0.0562354177236557, 0.15923483669757843, -0.15053591132164001, 0.12115778028964996, 0.03438490256667137, 0.3415389358997345, 0.35949966311454773, 0.5301384329795837, -0.3401510715484619, -0.15933655202388763, -0.3693682849407196, -0.027826042845845222, -0.22526538372039795, 0.1913948357105255, -0.014697927981615067, 0.24152648448944092, 0.011217363178730011, -0.19436092674732208, 0.06760869920253754, -0.2165011167526245, 0.3101823329925537, 0.11110030114650726, 0.1339612901210785, 0.3004104197025299, -0.19804632663726807, 0.09785090386867523, -0.10747373104095459, -0.3215748369693756, -0.20235314965248108, 0.3507084250450134, 0.3277986943721771, -0.19233180582523346, -0.00356978178024292, -0.19763973355293274, -0.12292645871639252, -0.2336282879114151, -0.08256176114082336, -0.19146913290023804, -0.2060847282409668, -0.5143704414367676, 0.22853806614875793, 0.21522578597068787, 0.30451682209968567, 0.22863470017910004, -0.06604083627462387, -0.0453592911362648, -0.34206071496009827, -0.007541332393884659, 0.1319132149219513, 0.16354432702064514, -0.19367089867591858, 0.18786360323429108, -0.30443722009658813, -0.1363782435655594, -0.046469852328300476, 0.43247827887535095, 0.0541624054312706, -0.239146888256073, -0.12887313961982727, -0.08782403916120529, 0.1340724378824234, 0.11724856495857239, -0.22471517324447632, 0.020937209948897362, 0.05608879402279854, 0.2689249813556671, 0.22183829545974731, -0.08973720669746399, 0.19424280524253845, -0.11701369285583496, 0.06147213652729988, -0.045734550803899765, 0.10718347132205963, -0.060260746628046036, 0.056403279304504395, 0.15334245562553406, -0.008361879736185074, 0.0007910877466201782, 0.07465890049934387, 0.04577053338289261, 0.8141485452651978, 0.07185615599155426, 0.02881724014878273, 0.39878687262535095, -0.07649203389883041, 0.026566646993160248, -0.05377346649765968, -0.0472666472196579, -0.4759175479412079, -0.4287510812282562, -0.004331361502408981, -0.18773378431797028, 0.3959293067455292, -0.09594477713108063, -0.25641337037086487, 0.016841553151607513, -0.21192821860313416, 0.06972411274909973, -0.25535547733306885, 0.059220269322395325, -0.1666862815618515, -0.04262286797165871, -0.26659533381462097, 0.24246054887771606, 0.03852858766913414, 0.06736230850219727, -0.2238292098045349, -0.1628028154373169, -0.1083671897649765, -0.236205592751503, -0.14957377314567566, 0.044983334839344025, -0.4897359311580658, 0.3633761405944824, 0.1694135069847107, -0.17303530871868134, -0.24627527594566345, -0.04804372787475586, 0.04229341447353363, 0.161616250872612, 0.00907229632139206, 0.16051426529884338, 0.33873695135116577, 0.01719624549150467, 0.06971308588981628, 0.12951849400997162, 0.6255922317504883, -0.29617536067962646, -0.06997183710336685, 0.25819143652915955, -0.0703793466091156, -0.16811224818229675, 0.25123971700668335, 0.08516904711723328, 0.1144418865442276, -0.15498816967010498, -0.22314342856407166, 0.030415212735533714, -0.2460322380065918, -0.33370816707611084, 0.21201281249523163, 0.18348652124404907, -0.28036996722221375, 0.11846795678138733, -0.04893391579389572, -0.1853344887495041, -0.14668790996074677, 0.2795677185058594, -0.020329197868704796, 0.2111203372478485, 0.4180724024772644, 0.1485842764377594, -0.32087576389312744, -0.42044341564178467, 0.15206022560596466, -0.1358197033405304, -0.2077386975288391, 0.45738252997398376, 0.02835128828883171, -0.13380268216133118, 0.06009434536099434, 0.547139048576355, 0.04352793097496033, 0.07778821885585785, -0.01475013792514801, -0.5255994200706482, -0.5390862822532654, -0.027754124253988266, -0.15863123536109924, 0.13955891132354736, -0.08613083511590958, 0.3869228959083557, -0.17648983001708984, 0.1428253948688507, -0.4534685015678406, -0.010904166847467422, -0.3043157458305359, 0.012121370062232018, 0.3330516815185547, -0.12599346041679382, 0.1883438229560852, 0.35374924540519714, 0.25105541944503784, 0.2561659812927246, -0.1985631138086319, -0.37430548667907715, -0.22375282645225525, 0.10092442482709885, 0.10287781059741974, -0.03606480360031128, 0.014600593596696854, -0.16241884231567383, -0.07640856504440308, 0.04587592929601669, 0.012399978935718536, 0.19031263887882233, -0.03191279247403145, 0.4283803701400757, 0.0660799890756607, 0.017683833837509155, -0.08185769617557526, 0.11410658061504364, -0.05253162980079651, -0.09036090224981308, -0.07530773431062698, -0.08022797107696533, -0.0997772067785263, -0.07874128967523575, -0.34498995542526245, 0.04051893204450607, -0.14069199562072754, 0.09585254639387131, 0.37018609046936035, 0.005360269919037819, -0.1250995248556137, 0.34536251425743103, 0.19379019737243652, 0.1545015573501587, -0.20998048782348633, -0.11246266961097717, 0.20599766075611115, 0.3322298228740692, -0.3889960050582886, -0.06613888591527939, -0.07266151905059814, -0.013331390917301178, 0.1420871913433075, 0.21651719510555267, -0.09566058218479156, -0.1143789291381836, -0.21403898298740387, 0.2105545848608017, 0.004003200680017471, -0.2780230641365051, 0.06721314042806625, 0.09774412214756012, 0.0016040802001953125, 0.09462352097034454, 0.3893909752368927, 0.19859996438026428, 0.06525424867868423, 0.04238616302609444, -0.2482941597700119, 0.0427999347448349, 0.0227469764649868, -0.13915155827999115, 0.132770374417305, -0.1913740485906601, 0.35282331705093384, 0.026450231671333313, 0.07931150496006012, -0.15092724561691284, -0.01495746523141861, 0.13642758131027222, 0.10998786985874176, 0.19470353424549103, 0.011231303215026855, 0.2555442154407501, -0.3021965026855469, 0.02495168149471283, 0.4505772292613983, 0.0012910887598991394, 0.010607495903968811, -0.11430072784423828, 0.1265629678964615, 0.14691941440105438, 0.36392876505851746, 0.28376689553260803, 0.12361583113670349, -0.2854915261268616, -0.24918726086616516, 0.1783473789691925, -0.013511456549167633, -0.5115432739257812, -0.1405288726091385, 0.16904021799564362, 0.09186063706874847, -0.0014996044337749481, 0.19675329327583313, 0.3545476794242859, 0.30715978145599365, -0.14513379335403442, -0.04075150191783905, -0.061635784804821014, -0.10663457214832306, -0.05946514010429382, 0.16613620519638062, -0.1060972511768341, 0.16498300433158875, 0.33422940969467163, 0.2022123485803604, -0.3309974670410156, -0.08569306135177612, 0.10033359378576279, -0.18154487013816833, -0.14718835055828094, 0.4650391936302185, 0.07912446558475494, -0.29301631450653076, -0.18671196699142456, 0.14762961864471436, -0.314522922039032, -0.3138011693954468, 0.07677477598190308, -0.06084389239549637, 0.18347562849521637, -0.27726662158966064, 0.16979867219924927, 0.04477442800998688, 0.2366686761379242, 0.4011516571044922, -0.05484384298324585, -0.41469913721084595, 0.008219733834266663, -0.574737548828125, 0.44581231474876404, 0.11493833363056183, -0.40760013461112976, -0.07454361021518707, 0.27758991718292236, -0.1946355551481247, 0.16969656944274902, 0.3113996386528015, -0.25948959589004517, 0.028853487223386765, 0.27408072352409363, -0.2840310037136078, -0.058122795075178146, -0.14939488470554352, -0.21608400344848633, 0.07854130864143372, -0.1431656926870346, 0.08864661306142807, -0.12808987498283386, 0.25983545184135437, -0.06764142215251923, -0.35888344049453735, 0.17348890006542206, 0.21292081475257874, 0.33979901671409607, 0.054932087659835815, 0.3236159682273865, -0.2871127128601074, 0.03701212257146835, 0.022650988772511482, -0.1575068235397339, -0.026935718953609467, -0.04059045389294624, 0.15620659291744232, 0.2100025713443756, 0.040879786014556885, -0.10207216441631317, -0.319333016872406, 0.5023040771484375, -0.1591847836971283, -0.2146231234073639, -0.2082204520702362, 0.3630659580230713, 0.062128931283950806, 0.10627026110887527, 0.060560766607522964, 0.26186075806617737, 0.040609002113342285, 0.34129929542541504, -0.47204723954200745, -0.6365747451782227, 0.44734644889831543, -0.3823893666267395, -0.2945074737071991, 0.03226245567202568, 0.4139120280742645, -0.12446030974388123, 0.030820073559880257, -0.4388791620731354, 0.052297309041023254, 0.26447540521621704, -0.0637119710445404, -0.10672169923782349, 0.41927558183670044, -0.039980627596378326, 0.14795786142349243, 0.025188446044921875, 0.21676066517829895, 0.08250175416469574, 0.07250147312879562, -0.10108307003974915, -0.042484063655138016 ]
https://github.com/huggingface/datasets/issues/6060
Sorry for asking a duplicate question about `num_proc`, I searched the forum and find the solution. But I still can't make the trick with `torch.distributed.barrier()` to only map at the main process work. The [post on forum]( https://discuss.huggingface.co/t/slow-processing-with-map-when-using-deepspeed-or-fairscale/7229/7) didn't help.
Dataset.map() execute twice when in PyTorch DDP mode
### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04`
40
Dataset.map() execute twice when in PyTorch DDP mode ### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04` Sorry for asking a duplicate question about `num_proc`, I searched the forum and find the solution. But I still can't make the trick with `torch.distributed.barrier()` to only map at the main process work. The [post on forum]( https://discuss.huggingface.co/t/slow-processing-with-map-when-using-deepspeed-or-fairscale/7229/7) didn't help.
[ -0.32103100419044495, -0.7901483178138733, 0.07416713982820511, 0.4760359823703766, 0.19198887050151825, -0.20305119454860687, 0.333636999130249, -0.06287026405334473, 0.28612929582595825, 0.10324004292488098, 0.0988529622554779, 0.42667683959007263, 0.10860054194927216, -0.27073511481285095, 0.26226451992988586, -0.11581375449895859, 0.04877207428216934, -0.11253102123737335, -0.25205907225608826, -0.16373468935489655, -0.04876964911818504, 0.04147990792989731, -0.28428107500076294, -0.14575734734535217, -0.2898797392845154, -0.2069510519504547, -0.12485435605049133, 0.048838552087545395, 0.12250620871782303, -0.4142807722091675, 0.07270678877830505, 0.025525208562612534, 0.2511764168739319, 0.7024824619293213, -0.00012532873370219022, 0.12123211473226547, 0.035358965396881104, 0.08784251660108566, -0.11136380583047867, -0.21161513030529022, 0.040127500891685486, 0.006766483187675476, 0.1880064457654953, -0.31016722321510315, -0.07990685105323792, -0.1228446289896965, -0.048925694078207016, -0.19009625911712646, 0.5397399663925171, 0.03262636810541153, 0.056453850120306015, 0.3101402819156647, -0.24512332677841187, -0.1108986958861351, -0.17450827360153198, 0.3002592921257019, -0.07534078508615494, 0.5350342392921448, 0.16150157153606415, -0.08843705803155899, -0.41928064823150635, 0.2667405605316162, -0.24642817676067352, 0.550044596195221, 0.13305068016052246, 0.12014256417751312, 0.03167671337723732, -0.2911275327205658, 0.05965176969766617, 0.06908471882343292, -0.09921068698167801, -0.30998143553733826, 0.15371185541152954, -0.25827112793922424, -0.11648387461900711, -0.2640652656555176, 0.16125977039337158, 0.15867719054222107, -0.1405617594718933, -0.10502299666404724, -0.5622197985649109, 0.14480705559253693, 0.09224528074264526, -0.048315636813640594, -0.07534369826316833, 0.4892403483390808, 0.02302117645740509, 0.37704727053642273, 0.2719419002532959, 0.3056618273258209, -0.009230680763721466, 0.017283812165260315, 0.0891876071691513, -0.06200944632291794, -0.3598806858062744, 0.21913066506385803, 0.2167998105287552, -0.1657853126525879, 0.09063758701086044, -0.07611612230539322, 0.04283556342124939, -0.03956732153892517, 0.32623162865638733, 0.08787097781896591, 0.10524041950702667, 0.34720176458358765, 0.038984719663858414, 0.5393652319908142, 0.2395360767841339, 0.011268243193626404, -0.28527966141700745, 0.14430789649486542, 0.17589369416236877, -0.13361188769340515, 0.11007119715213776, -0.12112648785114288, 0.31967249512672424, 0.06094662845134735, -0.1968836784362793, -0.27893662452697754, -0.21450653672218323, -0.2553021311759949, 0.1042732372879982, 0.3648208677768707, 0.12008309364318848, -0.087459996342659, 0.11024118959903717, 0.1192271038889885, -0.28099972009658813, -0.07104428112506866, -0.08085709810256958, -0.17239344120025635, -0.26921772956848145, 0.13414683938026428, 0.10696448385715485, -0.11755009740591049, 0.2842017412185669, 0.42022088170051575, 0.10877502709627151, -0.09469049423933029, 0.2539523243904114, -0.11998850107192993, 0.17431625723838806, 0.17003843188285828, -0.04282473027706146, 0.09917523711919785, 0.2043856978416443, 0.5848972201347351, -0.01503051072359085, 0.350251704454422, -0.18256273865699768, -0.1469983160495758, 0.3495730757713318, -0.011409945785999298, 0.23411236703395844, 0.29897525906562805, -0.19871576130390167, 0.18534430861473083, 0.3968254327774048, -0.43091845512390137, 0.2522372305393219, -0.21273793280124664, -0.7713404297828674, -0.14055733382701874, 0.3055552840232849, 0.5337104797363281, 0.28961941599845886, -0.1263495832681656, 0.42376217246055603, 0.14521749317646027, 0.3250264823436737, 0.2623722553253174, -0.4677085876464844, 0.32337361574172974, -0.40510082244873047, -0.3190339207649231, 0.15427953004837036, -0.40845954418182373, -0.39752787351608276, 0.35963359475135803, -0.5518220067024231, 0.059446968138217926, 0.08789782226085663, 0.07109933346509933, 0.25532397627830505, 0.26625514030456543, 0.22006580233573914, 0.04205203056335449, 0.025809304788708687, 0.3425559997558594, -0.24576586484909058, 0.2578607201576233, 0.545812726020813, 0.007495075464248657, -0.15884000062942505, 0.1128162294626236, 0.08242455124855042, 0.08996100723743439, 0.36403363943099976, 0.10886331647634506, -0.11402643471956253, 0.007277727127075195, -0.39600488543510437, -0.20402032136917114, 0.04767940193414688, -0.07438138872385025, -0.22941842675209045, 0.3985094130039215, -0.12211257219314575, -0.028364986181259155, -0.0037024393677711487, 0.014123335480690002, 0.18085558712482452, -0.0402129590511322, -0.34806162118911743, -0.3720846474170685, -0.13439540565013885, 0.18901856243610382, 0.07952683418989182, -0.0724213644862175, -0.10399400442838669, 0.28549525141716003, -0.09906434267759323, -0.04219251871109009, -0.30290836095809937, 0.05293065309524536, 0.02331896685063839, -0.05225265026092529, -0.19600875675678253, -0.08475957810878754, 0.300087034702301, -0.3161177337169647, -0.1975407600402832, 0.3197054862976074, 0.11068513989448547, 0.03098534792661667, -0.0342056080698967, -0.1643436849117279, 0.44110795855522156, -0.008304528892040253, 0.06155356764793396, 0.47325947880744934, 0.06943874061107635, -0.1465318202972412, -0.1924816370010376, 0.25467902421951294, 0.14265137910842896, 0.13472706079483032, -0.15512694418430328, -0.1455819308757782, -0.09947420656681061, 0.058443062007427216, -0.05991983041167259, 0.20915746688842773, 0.2657237648963928, 0.20881830155849457, 0.27354371547698975, 0.11554981023073196, -0.22683307528495789, -0.12739193439483643, 0.1331399530172348, 0.023160919547080994, 0.08099952340126038, -0.06695393472909927, -0.11647076904773712, 0.03238584101200104, 0.29902493953704834, -0.017120853066444397, 0.45884209871292114, 0.1188306212425232, 0.2843678295612335, 0.031166626140475273, -0.2166600227355957, -0.029790375381708145, 0.06018131226301193, -0.1503361463546753, 0.09821672737598419, -0.06067062169313431, 0.413851261138916, -0.04729703068733215, -0.35904112458229065, -0.06880336254835129, 0.33778756856918335, 0.07448829710483551, -0.24584439396858215, 0.1695542186498642, -0.241023451089859, 0.014985278248786926, -0.2882787883281708, 0.279346764087677, -0.16765975952148438, 0.1733199954032898, -0.11825311183929443, 0.4081527590751648, 0.1852991282939911, 0.39765307307243347, 0.35181379318237305, 0.041423261165618896, -0.1488129198551178, -0.14785906672477722, 0.2478780746459961, -0.09317834675312042, -0.08223912119865417, -0.06049042195081711, 0.050327785313129425, -0.0871376097202301, 0.5514771342277527, 0.11091134697198868, -0.48693427443504333, -0.1813448667526245, 0.08564940094947815, 0.08983299136161804, 0.10212331265211105, -0.29832786321640015, -0.0835379809141159, -0.013610988855361938, -0.27005794644355774, 0.1311352550983429, 0.34428781270980835, -0.46287423372268677, -0.18503767251968384, 0.11620007455348969, 0.00006802752614021301, -0.12305642664432526, -0.1995704621076584, -0.3244553208351135, 0.05849149823188782, -0.15177088975906372, 0.3342583179473877, -0.205897718667984, 0.285815566778183, -0.12700214982032776, 0.09779035300016403, -0.010174442082643509, -0.02102283388376236, -0.030537493526935577, -0.08207440376281738, -0.42676621675491333, -0.04151913523674011, -0.08720071613788605, -0.2174294888973236, -0.21946927905082703, 0.10197065770626068, -0.18046686053276062, 0.4664595127105713, -0.4788520336151123, -0.42627382278442383, -0.23839151859283447, 0.35457751154899597, -0.19474442303180695, 0.2055778205394745, 0.5381614565849304, -0.10454204678535461, 0.05447199195623398, 0.09598629176616669, -0.2025066316127777, 0.3153032064437866, 0.16995061933994293, 0.13322590291500092, 0.28371092677116394, 0.4944392740726471, -0.002390652894973755, 0.8055747747421265, 0.2815593183040619, -0.1330988109111786, 0.09402408450841904, -0.4099043607711792, 0.03872789442539215, -0.1161407083272934, -0.3991627097129822, 0.15716907382011414, -0.12431600689888, -0.13921178877353668, 0.11112987995147705, -0.1367260068655014, -0.08218682557344437, -0.0847591981291771, -0.26178473234176636, 0.04142649471759796, -0.13335683941841125, -0.0016670748591423035, -0.09317905455827713, 0.3270925283432007, -0.03908434510231018, 0.20677557587623596, -0.10299725085496902, 0.12215262651443481, 0.04603707790374756, -0.27475738525390625, 0.344443142414093, -0.009908322244882584, -0.22914323210716248, 0.1980471909046173, -0.38754382729530334, 0.23339878022670746, 0.13931617140769958, 0.09074768424034119, -0.1531815081834793, 0.24404765665531158, 0.3723222315311432, 0.016393158584833145, 0.8515889644622803, 0.20654863119125366, 0.3926394581794739, -0.06385268270969391, -0.5782086849212646, -0.4568251967430115, -0.015657231211662292, -0.17178767919540405, 0.38177841901779175, 0.28464388847351074, -0.04700204357504845, -0.1308157593011856, -0.058146294206380844, -0.0574004240334034, 0.1253233700990677, -0.19049739837646484, -0.2800319194793701, -0.49488329887390137, -0.05831324681639671, -0.4450277090072632, 0.36693570017814636, 0.2846795916557312, -0.11023788154125214, -0.020069720223546028, -0.21457433700561523, 0.09521342068910599, 0.07837872207164764, -0.04237345606088638, 0.2386717051267624, 0.2561565041542053, 0.10197336971759796, 0.18973290920257568, 0.4703606963157654, 0.31322288513183594, 0.01463579572737217, 0.49203065037727356, -0.28032979369163513, -0.12606805562973022, 0.05534517392516136, 0.09950810670852661, 0.1329486072063446, 0.40727347135543823, 0.13329824805259705, 0.05851009115576744, -0.10428708791732788, 0.18158608675003052, -0.3366781175136566, -0.11681513488292694, 0.37885838747024536, 0.12456897646188736, -0.06399190425872803, -0.4345674514770508, 0.19299502670764923, 0.04701348394155502, -0.2752251625061035, 0.6179056763648987, -0.44700753688812256, -0.2240835726261139, 0.07093451172113419, -0.17497432231903076, 0.7820196747779846, -0.1744816154241562, 0.041306205093860626, 0.0809965506196022, -0.05491071566939354, 0.2876678705215454, -0.13424453139305115, 0.38403382897377014, -0.37181469798088074, -0.23508723080158234, 0.05896364897489548, -0.19969579577445984, 0.07527974247932434, -0.019774075597524643, 0.041475579142570496, 0.1268935650587082, -0.03389665484428406, 0.19931696355342865, -0.12998676300048828, 0.17681698501110077, 0.3123518228530884, -0.18389935791492462, -0.03766634687781334, -0.04231409355998039, -0.023523200303316116, 0.28262221813201904, -0.010782252997159958, 0.03039909154176712, 0.19777238368988037, -0.32419753074645996, -0.049074381589889526, 0.1419382393360138, -0.5082389116287231, 0.43468329310417175, -0.15203727781772614, -0.264252245426178, -0.1014367938041687, 0.735869288444519, 0.08062509447336197, -0.22749841213226318, 0.09769903868436813, -0.0021504806354641914, 0.18710893392562866, 0.2432192713022232, -0.3142434060573578, -0.22403186559677124, -0.19225718080997467, -0.06264733523130417, -0.46019798517227173, -0.18495523929595947, -0.07633833587169647, -0.31969571113586426, -0.24082443118095398, 0.5648025870323181, 0.10051076114177704, 0.06293807923793793, 0.04463617876172066, 0.12916617095470428, 0.0443769246339798, -0.247446209192276, -0.06726662814617157, 0.05077717825770378, -0.2799234092235565, 0.11551687121391296, 0.009563341736793518, -0.3812546133995056, 0.05051935836672783, 0.5093289613723755, 0.16595147550106049, 0.40768754482269287, 0.19413147866725922, 0.1248687207698822, -0.04974427446722984, -0.12555640935897827, -0.062313057482242584, 0.15009596943855286, -0.2873275876045227, 0.22064396739006042, -0.06300689280033112, 0.07249099016189575, -0.09506359696388245, 0.13673239946365356, -0.06849803775548935, 0.013889847323298454, -0.08418700098991394, -0.09499192982912064, -0.31692948937416077, -0.1809070110321045, 0.03409748151898384, -0.0005236519500613213, 0.3702937066555023, 0.3343854248523712, 0.2498791217803955, 0.4636760950088501, -0.14911621809005737, 0.04224524646997452, 0.23245388269424438, 0.3340829312801361, -0.023512454703450203, -0.008763470686972141, 0.04821523278951645, -0.0160430409014225, -0.08510634303092957, 0.3576095700263977, -0.10078448057174683, -0.052683331072330475, -0.15263932943344116, 0.23410794138908386, -0.20396681129932404, -0.06581909954547882, -0.17026540637016296, -0.4797412157058716, 0.06136393919587135, -0.32725340127944946, 0.40052443742752075, 0.4074571430683136, -0.035150185227394104, -0.09914932399988174, 0.25876718759536743, 0.05589265748858452, -0.2011529803276062, -0.00876532681286335, -0.3253212571144104, -0.34483879804611206, 0.14392027258872986, -0.007134565152227879, 0.05552556738257408, -0.03736123442649841, -0.37686672806739807, -0.15646715462207794, 0.41800734400749207, -0.07706829905509949, 0.007746649906039238, -0.2281447798013687, -0.11427351087331772, -0.0873553454875946, 0.40227723121643066, 0.09043355286121368, -0.3119918406009674, -0.07325480133295059, -0.13250640034675598, 0.01673976704478264, -0.35503333806991577, -0.11912642419338226, 0.31738561391830444, 0.009169202297925949, 0.13769260048866272, 0.42766618728637695, 0.2895326316356659, -0.03956472873687744, -0.21204042434692383, 0.011784441769123077, 0.1576681286096573, -0.35620948672294617, 0.07280118763446808, -0.18851517140865326, -0.09778635203838348, 0.01162794604897499, 0.2780613601207733, 0.0850769430398941, 0.10676440596580505, 0.09130354225635529, 0.030378853902220726, 0.6768695116043091, 0.0920587033033371, 0.14612546563148499, 0.26083117723464966, -0.2278212606906891, 0.28829869627952576, 0.07550755143165588, -0.3025502562522888, -0.0710994154214859, -0.07912856340408325, 0.1973545104265213, -0.5555619597434998, -0.39933228492736816, -0.31075039505958557, 0.18628162145614624, -0.21436002850532532, -0.05778402090072632, 0.13677923381328583, -0.13642288744449615, 0.07552652060985565, 0.2659595012664795, 0.1297883689403534, 0.029939716681838036, 0.5465022921562195, 0.09842737019062042, -0.25007161498069763, -0.2736552357673645, -0.4249807596206665, 0.12966743111610413, 0.15650281310081482, -0.3208833932876587, 0.23554933071136475, 0.19289299845695496, -0.14153268933296204, -0.20708702504634857, 0.3230242133140564, 0.22245298326015472, 0.2408062070608139, -0.14938431978225708, 0.1486433744430542, 0.15672411024570465, 0.26859769225120544, -0.12406465411186218, 0.11281496286392212, -0.05504320561885834, 0.26080211997032166, 0.13793975114822388, -0.07691347599029541, -0.11137478053569794, -0.03642915561795235, 0.26485326886177063, 0.13187755644321442, -0.04035180062055588, 0.5132675170898438, -0.3210429549217224, -0.03484959155321121, -0.0998164713382721, 0.06669826805591583, -0.22419282793998718, 0.2018771469593048, 0.27154606580734253, -0.20290392637252808, -0.025898955762386322, -0.1484331488609314, -0.022203102707862854, -0.12431511282920837, 0.2903858721256256, -0.05832153186202049, 0.13950927555561066, -0.5078446865081787, -0.1249920204281807, -0.6539648771286011, 0.40354204177856445, -0.3416747450828552, 0.10131336748600006, -0.045467451214790344, 0.01246209442615509, -0.09291023015975952, 0.08096955716609955, 0.04091886430978775, -0.3370940685272217, 0.16748173534870148, 0.23781314492225647, -0.1938321888446808, 0.08604031056165695, -0.5267012715339661, 0.0938861295580864, 0.19810214638710022, -0.23821628093719482, 0.3681204617023468, -0.3649635910987854, -0.05377914011478424, -0.0013588778674602509, 0.13489887118339539, 0.0012995600700378418, -0.06714189052581787, 0.4232494533061981, 0.21226225793361664, 0.43789640069007874, 0.06804228574037552, 0.08424141258001328, 0.004541715607047081, 0.08080026507377625, -0.2294754832983017, 0.20281396806240082, 0.19673994183540344, 0.4024079740047455, -0.21268731355667114, -0.5200225114822388, -0.40589869022369385, 0.4765301048755646, 0.11305727809667587, -0.16179123520851135, -0.049647748470306396, -0.13779661059379578, -0.11923132836818695, 0.17818638682365417, 0.12312297523021698, 0.4212478697299957, 0.13837644457817078, -0.04294353723526001, -0.19605007767677307, -0.24784280359745026, 0.3423401117324829, -0.7567551136016846, -0.30113938450813293, -0.25887951254844666, 0.28308019042015076, 0.07499000430107117, -0.11602260917425156, -0.7164036631584167, -0.13075600564479828, 0.09190855920314789, -0.19980044662952423, -0.23095345497131348, 0.09965474903583527, -0.3373803496360779, -0.05446145310997963, -0.01040860265493393, 0.3596119284629822, -0.13169531524181366, -0.5107806921005249, 0.16256888210773468, -0.09332819283008575 ]
https://github.com/huggingface/datasets/issues/6060
If it does the `map` twice then it means the hash of your map function is not some same between your two processes. Can you make sure your map functions have the same hash in different processes ? ```python from datasets.fingerprint import Hasher print(Hasher.hash(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True))) print(Hasher.hash(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16))) ``` You can also set the fingerprint used to reload the resulting dataset by passing `new_finegrprint=` in `map`, see https://huggingface.co/docs/datasets/v2.13.1/en/about_cache#the-cache. This will force the different processes to use the same fingerprint used to locate the resulting dataset in the cache.
Dataset.map() execute twice when in PyTorch DDP mode
### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04`
95
Dataset.map() execute twice when in PyTorch DDP mode ### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04` If it does the `map` twice then it means the hash of your map function is not some same between your two processes. Can you make sure your map functions have the same hash in different processes ? ```python from datasets.fingerprint import Hasher print(Hasher.hash(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True))) print(Hasher.hash(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16))) ``` You can also set the fingerprint used to reload the resulting dataset by passing `new_finegrprint=` in `map`, see https://huggingface.co/docs/datasets/v2.13.1/en/about_cache#the-cache. This will force the different processes to use the same fingerprint used to locate the resulting dataset in the cache.
[ -0.32103100419044495, -0.7901483178138733, 0.07416713982820511, 0.4760359823703766, 0.19198887050151825, -0.20305119454860687, 0.333636999130249, -0.06287026405334473, 0.28612929582595825, 0.10324004292488098, 0.0988529622554779, 0.42667683959007263, 0.10860054194927216, -0.27073511481285095, 0.26226451992988586, -0.11581375449895859, 0.04877207428216934, -0.11253102123737335, -0.25205907225608826, -0.16373468935489655, -0.04876964911818504, 0.04147990792989731, -0.28428107500076294, -0.14575734734535217, -0.2898797392845154, -0.2069510519504547, -0.12485435605049133, 0.048838552087545395, 0.12250620871782303, -0.4142807722091675, 0.07270678877830505, 0.025525208562612534, 0.2511764168739319, 0.7024824619293213, -0.00012532873370219022, 0.12123211473226547, 0.035358965396881104, 0.08784251660108566, -0.11136380583047867, -0.21161513030529022, 0.040127500891685486, 0.006766483187675476, 0.1880064457654953, -0.31016722321510315, -0.07990685105323792, -0.1228446289896965, -0.048925694078207016, -0.19009625911712646, 0.5397399663925171, 0.03262636810541153, 0.056453850120306015, 0.3101402819156647, -0.24512332677841187, -0.1108986958861351, -0.17450827360153198, 0.3002592921257019, -0.07534078508615494, 0.5350342392921448, 0.16150157153606415, -0.08843705803155899, -0.41928064823150635, 0.2667405605316162, -0.24642817676067352, 0.550044596195221, 0.13305068016052246, 0.12014256417751312, 0.03167671337723732, -0.2911275327205658, 0.05965176969766617, 0.06908471882343292, -0.09921068698167801, -0.30998143553733826, 0.15371185541152954, -0.25827112793922424, -0.11648387461900711, -0.2640652656555176, 0.16125977039337158, 0.15867719054222107, -0.1405617594718933, -0.10502299666404724, -0.5622197985649109, 0.14480705559253693, 0.09224528074264526, -0.048315636813640594, -0.07534369826316833, 0.4892403483390808, 0.02302117645740509, 0.37704727053642273, 0.2719419002532959, 0.3056618273258209, -0.009230680763721466, 0.017283812165260315, 0.0891876071691513, -0.06200944632291794, -0.3598806858062744, 0.21913066506385803, 0.2167998105287552, -0.1657853126525879, 0.09063758701086044, -0.07611612230539322, 0.04283556342124939, -0.03956732153892517, 0.32623162865638733, 0.08787097781896591, 0.10524041950702667, 0.34720176458358765, 0.038984719663858414, 0.5393652319908142, 0.2395360767841339, 0.011268243193626404, -0.28527966141700745, 0.14430789649486542, 0.17589369416236877, -0.13361188769340515, 0.11007119715213776, -0.12112648785114288, 0.31967249512672424, 0.06094662845134735, -0.1968836784362793, -0.27893662452697754, -0.21450653672218323, -0.2553021311759949, 0.1042732372879982, 0.3648208677768707, 0.12008309364318848, -0.087459996342659, 0.11024118959903717, 0.1192271038889885, -0.28099972009658813, -0.07104428112506866, -0.08085709810256958, -0.17239344120025635, -0.26921772956848145, 0.13414683938026428, 0.10696448385715485, -0.11755009740591049, 0.2842017412185669, 0.42022088170051575, 0.10877502709627151, -0.09469049423933029, 0.2539523243904114, -0.11998850107192993, 0.17431625723838806, 0.17003843188285828, -0.04282473027706146, 0.09917523711919785, 0.2043856978416443, 0.5848972201347351, -0.01503051072359085, 0.350251704454422, -0.18256273865699768, -0.1469983160495758, 0.3495730757713318, -0.011409945785999298, 0.23411236703395844, 0.29897525906562805, -0.19871576130390167, 0.18534430861473083, 0.3968254327774048, -0.43091845512390137, 0.2522372305393219, -0.21273793280124664, -0.7713404297828674, -0.14055733382701874, 0.3055552840232849, 0.5337104797363281, 0.28961941599845886, -0.1263495832681656, 0.42376217246055603, 0.14521749317646027, 0.3250264823436737, 0.2623722553253174, -0.4677085876464844, 0.32337361574172974, -0.40510082244873047, -0.3190339207649231, 0.15427953004837036, -0.40845954418182373, -0.39752787351608276, 0.35963359475135803, -0.5518220067024231, 0.059446968138217926, 0.08789782226085663, 0.07109933346509933, 0.25532397627830505, 0.26625514030456543, 0.22006580233573914, 0.04205203056335449, 0.025809304788708687, 0.3425559997558594, -0.24576586484909058, 0.2578607201576233, 0.545812726020813, 0.007495075464248657, -0.15884000062942505, 0.1128162294626236, 0.08242455124855042, 0.08996100723743439, 0.36403363943099976, 0.10886331647634506, -0.11402643471956253, 0.007277727127075195, -0.39600488543510437, -0.20402032136917114, 0.04767940193414688, -0.07438138872385025, -0.22941842675209045, 0.3985094130039215, -0.12211257219314575, -0.028364986181259155, -0.0037024393677711487, 0.014123335480690002, 0.18085558712482452, -0.0402129590511322, -0.34806162118911743, -0.3720846474170685, -0.13439540565013885, 0.18901856243610382, 0.07952683418989182, -0.0724213644862175, -0.10399400442838669, 0.28549525141716003, -0.09906434267759323, -0.04219251871109009, -0.30290836095809937, 0.05293065309524536, 0.02331896685063839, -0.05225265026092529, -0.19600875675678253, -0.08475957810878754, 0.300087034702301, -0.3161177337169647, -0.1975407600402832, 0.3197054862976074, 0.11068513989448547, 0.03098534792661667, -0.0342056080698967, -0.1643436849117279, 0.44110795855522156, -0.008304528892040253, 0.06155356764793396, 0.47325947880744934, 0.06943874061107635, -0.1465318202972412, -0.1924816370010376, 0.25467902421951294, 0.14265137910842896, 0.13472706079483032, -0.15512694418430328, -0.1455819308757782, -0.09947420656681061, 0.058443062007427216, -0.05991983041167259, 0.20915746688842773, 0.2657237648963928, 0.20881830155849457, 0.27354371547698975, 0.11554981023073196, -0.22683307528495789, -0.12739193439483643, 0.1331399530172348, 0.023160919547080994, 0.08099952340126038, -0.06695393472909927, -0.11647076904773712, 0.03238584101200104, 0.29902493953704834, -0.017120853066444397, 0.45884209871292114, 0.1188306212425232, 0.2843678295612335, 0.031166626140475273, -0.2166600227355957, -0.029790375381708145, 0.06018131226301193, -0.1503361463546753, 0.09821672737598419, -0.06067062169313431, 0.413851261138916, -0.04729703068733215, -0.35904112458229065, -0.06880336254835129, 0.33778756856918335, 0.07448829710483551, -0.24584439396858215, 0.1695542186498642, -0.241023451089859, 0.014985278248786926, -0.2882787883281708, 0.279346764087677, -0.16765975952148438, 0.1733199954032898, -0.11825311183929443, 0.4081527590751648, 0.1852991282939911, 0.39765307307243347, 0.35181379318237305, 0.041423261165618896, -0.1488129198551178, -0.14785906672477722, 0.2478780746459961, -0.09317834675312042, -0.08223912119865417, -0.06049042195081711, 0.050327785313129425, -0.0871376097202301, 0.5514771342277527, 0.11091134697198868, -0.48693427443504333, -0.1813448667526245, 0.08564940094947815, 0.08983299136161804, 0.10212331265211105, -0.29832786321640015, -0.0835379809141159, -0.013610988855361938, -0.27005794644355774, 0.1311352550983429, 0.34428781270980835, -0.46287423372268677, -0.18503767251968384, 0.11620007455348969, 0.00006802752614021301, -0.12305642664432526, -0.1995704621076584, -0.3244553208351135, 0.05849149823188782, -0.15177088975906372, 0.3342583179473877, -0.205897718667984, 0.285815566778183, -0.12700214982032776, 0.09779035300016403, -0.010174442082643509, -0.02102283388376236, -0.030537493526935577, -0.08207440376281738, -0.42676621675491333, -0.04151913523674011, -0.08720071613788605, -0.2174294888973236, -0.21946927905082703, 0.10197065770626068, -0.18046686053276062, 0.4664595127105713, -0.4788520336151123, -0.42627382278442383, -0.23839151859283447, 0.35457751154899597, -0.19474442303180695, 0.2055778205394745, 0.5381614565849304, -0.10454204678535461, 0.05447199195623398, 0.09598629176616669, -0.2025066316127777, 0.3153032064437866, 0.16995061933994293, 0.13322590291500092, 0.28371092677116394, 0.4944392740726471, -0.002390652894973755, 0.8055747747421265, 0.2815593183040619, -0.1330988109111786, 0.09402408450841904, -0.4099043607711792, 0.03872789442539215, -0.1161407083272934, -0.3991627097129822, 0.15716907382011414, -0.12431600689888, -0.13921178877353668, 0.11112987995147705, -0.1367260068655014, -0.08218682557344437, -0.0847591981291771, -0.26178473234176636, 0.04142649471759796, -0.13335683941841125, -0.0016670748591423035, -0.09317905455827713, 0.3270925283432007, -0.03908434510231018, 0.20677557587623596, -0.10299725085496902, 0.12215262651443481, 0.04603707790374756, -0.27475738525390625, 0.344443142414093, -0.009908322244882584, -0.22914323210716248, 0.1980471909046173, -0.38754382729530334, 0.23339878022670746, 0.13931617140769958, 0.09074768424034119, -0.1531815081834793, 0.24404765665531158, 0.3723222315311432, 0.016393158584833145, 0.8515889644622803, 0.20654863119125366, 0.3926394581794739, -0.06385268270969391, -0.5782086849212646, -0.4568251967430115, -0.015657231211662292, -0.17178767919540405, 0.38177841901779175, 0.28464388847351074, -0.04700204357504845, -0.1308157593011856, -0.058146294206380844, -0.0574004240334034, 0.1253233700990677, -0.19049739837646484, -0.2800319194793701, -0.49488329887390137, -0.05831324681639671, -0.4450277090072632, 0.36693570017814636, 0.2846795916557312, -0.11023788154125214, -0.020069720223546028, -0.21457433700561523, 0.09521342068910599, 0.07837872207164764, -0.04237345606088638, 0.2386717051267624, 0.2561565041542053, 0.10197336971759796, 0.18973290920257568, 0.4703606963157654, 0.31322288513183594, 0.01463579572737217, 0.49203065037727356, -0.28032979369163513, -0.12606805562973022, 0.05534517392516136, 0.09950810670852661, 0.1329486072063446, 0.40727347135543823, 0.13329824805259705, 0.05851009115576744, -0.10428708791732788, 0.18158608675003052, -0.3366781175136566, -0.11681513488292694, 0.37885838747024536, 0.12456897646188736, -0.06399190425872803, -0.4345674514770508, 0.19299502670764923, 0.04701348394155502, -0.2752251625061035, 0.6179056763648987, -0.44700753688812256, -0.2240835726261139, 0.07093451172113419, -0.17497432231903076, 0.7820196747779846, -0.1744816154241562, 0.041306205093860626, 0.0809965506196022, -0.05491071566939354, 0.2876678705215454, -0.13424453139305115, 0.38403382897377014, -0.37181469798088074, -0.23508723080158234, 0.05896364897489548, -0.19969579577445984, 0.07527974247932434, -0.019774075597524643, 0.041475579142570496, 0.1268935650587082, -0.03389665484428406, 0.19931696355342865, -0.12998676300048828, 0.17681698501110077, 0.3123518228530884, -0.18389935791492462, -0.03766634687781334, -0.04231409355998039, -0.023523200303316116, 0.28262221813201904, -0.010782252997159958, 0.03039909154176712, 0.19777238368988037, -0.32419753074645996, -0.049074381589889526, 0.1419382393360138, -0.5082389116287231, 0.43468329310417175, -0.15203727781772614, -0.264252245426178, -0.1014367938041687, 0.735869288444519, 0.08062509447336197, -0.22749841213226318, 0.09769903868436813, -0.0021504806354641914, 0.18710893392562866, 0.2432192713022232, -0.3142434060573578, -0.22403186559677124, -0.19225718080997467, -0.06264733523130417, -0.46019798517227173, -0.18495523929595947, -0.07633833587169647, -0.31969571113586426, -0.24082443118095398, 0.5648025870323181, 0.10051076114177704, 0.06293807923793793, 0.04463617876172066, 0.12916617095470428, 0.0443769246339798, -0.247446209192276, -0.06726662814617157, 0.05077717825770378, -0.2799234092235565, 0.11551687121391296, 0.009563341736793518, -0.3812546133995056, 0.05051935836672783, 0.5093289613723755, 0.16595147550106049, 0.40768754482269287, 0.19413147866725922, 0.1248687207698822, -0.04974427446722984, -0.12555640935897827, -0.062313057482242584, 0.15009596943855286, -0.2873275876045227, 0.22064396739006042, -0.06300689280033112, 0.07249099016189575, -0.09506359696388245, 0.13673239946365356, -0.06849803775548935, 0.013889847323298454, -0.08418700098991394, -0.09499192982912064, -0.31692948937416077, -0.1809070110321045, 0.03409748151898384, -0.0005236519500613213, 0.3702937066555023, 0.3343854248523712, 0.2498791217803955, 0.4636760950088501, -0.14911621809005737, 0.04224524646997452, 0.23245388269424438, 0.3340829312801361, -0.023512454703450203, -0.008763470686972141, 0.04821523278951645, -0.0160430409014225, -0.08510634303092957, 0.3576095700263977, -0.10078448057174683, -0.052683331072330475, -0.15263932943344116, 0.23410794138908386, -0.20396681129932404, -0.06581909954547882, -0.17026540637016296, -0.4797412157058716, 0.06136393919587135, -0.32725340127944946, 0.40052443742752075, 0.4074571430683136, -0.035150185227394104, -0.09914932399988174, 0.25876718759536743, 0.05589265748858452, -0.2011529803276062, -0.00876532681286335, -0.3253212571144104, -0.34483879804611206, 0.14392027258872986, -0.007134565152227879, 0.05552556738257408, -0.03736123442649841, -0.37686672806739807, -0.15646715462207794, 0.41800734400749207, -0.07706829905509949, 0.007746649906039238, -0.2281447798013687, -0.11427351087331772, -0.0873553454875946, 0.40227723121643066, 0.09043355286121368, -0.3119918406009674, -0.07325480133295059, -0.13250640034675598, 0.01673976704478264, -0.35503333806991577, -0.11912642419338226, 0.31738561391830444, 0.009169202297925949, 0.13769260048866272, 0.42766618728637695, 0.2895326316356659, -0.03956472873687744, -0.21204042434692383, 0.011784441769123077, 0.1576681286096573, -0.35620948672294617, 0.07280118763446808, -0.18851517140865326, -0.09778635203838348, 0.01162794604897499, 0.2780613601207733, 0.0850769430398941, 0.10676440596580505, 0.09130354225635529, 0.030378853902220726, 0.6768695116043091, 0.0920587033033371, 0.14612546563148499, 0.26083117723464966, -0.2278212606906891, 0.28829869627952576, 0.07550755143165588, -0.3025502562522888, -0.0710994154214859, -0.07912856340408325, 0.1973545104265213, -0.5555619597434998, -0.39933228492736816, -0.31075039505958557, 0.18628162145614624, -0.21436002850532532, -0.05778402090072632, 0.13677923381328583, -0.13642288744449615, 0.07552652060985565, 0.2659595012664795, 0.1297883689403534, 0.029939716681838036, 0.5465022921562195, 0.09842737019062042, -0.25007161498069763, -0.2736552357673645, -0.4249807596206665, 0.12966743111610413, 0.15650281310081482, -0.3208833932876587, 0.23554933071136475, 0.19289299845695496, -0.14153268933296204, -0.20708702504634857, 0.3230242133140564, 0.22245298326015472, 0.2408062070608139, -0.14938431978225708, 0.1486433744430542, 0.15672411024570465, 0.26859769225120544, -0.12406465411186218, 0.11281496286392212, -0.05504320561885834, 0.26080211997032166, 0.13793975114822388, -0.07691347599029541, -0.11137478053569794, -0.03642915561795235, 0.26485326886177063, 0.13187755644321442, -0.04035180062055588, 0.5132675170898438, -0.3210429549217224, -0.03484959155321121, -0.0998164713382721, 0.06669826805591583, -0.22419282793998718, 0.2018771469593048, 0.27154606580734253, -0.20290392637252808, -0.025898955762386322, -0.1484331488609314, -0.022203102707862854, -0.12431511282920837, 0.2903858721256256, -0.05832153186202049, 0.13950927555561066, -0.5078446865081787, -0.1249920204281807, -0.6539648771286011, 0.40354204177856445, -0.3416747450828552, 0.10131336748600006, -0.045467451214790344, 0.01246209442615509, -0.09291023015975952, 0.08096955716609955, 0.04091886430978775, -0.3370940685272217, 0.16748173534870148, 0.23781314492225647, -0.1938321888446808, 0.08604031056165695, -0.5267012715339661, 0.0938861295580864, 0.19810214638710022, -0.23821628093719482, 0.3681204617023468, -0.3649635910987854, -0.05377914011478424, -0.0013588778674602509, 0.13489887118339539, 0.0012995600700378418, -0.06714189052581787, 0.4232494533061981, 0.21226225793361664, 0.43789640069007874, 0.06804228574037552, 0.08424141258001328, 0.004541715607047081, 0.08080026507377625, -0.2294754832983017, 0.20281396806240082, 0.19673994183540344, 0.4024079740047455, -0.21268731355667114, -0.5200225114822388, -0.40589869022369385, 0.4765301048755646, 0.11305727809667587, -0.16179123520851135, -0.049647748470306396, -0.13779661059379578, -0.11923132836818695, 0.17818638682365417, 0.12312297523021698, 0.4212478697299957, 0.13837644457817078, -0.04294353723526001, -0.19605007767677307, -0.24784280359745026, 0.3423401117324829, -0.7567551136016846, -0.30113938450813293, -0.25887951254844666, 0.28308019042015076, 0.07499000430107117, -0.11602260917425156, -0.7164036631584167, -0.13075600564479828, 0.09190855920314789, -0.19980044662952423, -0.23095345497131348, 0.09965474903583527, -0.3373803496360779, -0.05446145310997963, -0.01040860265493393, 0.3596119284629822, -0.13169531524181366, -0.5107806921005249, 0.16256888210773468, -0.09332819283008575 ]
https://github.com/huggingface/datasets/issues/6060
Thanks for help! I find the fingerprint between processes don't have same hash: ``` Rank 0: Gpu 0 cut_reorder_keys fingerprint c7f47f40e9a67657 Rank 0: Gpu 0 random_shift fingerprint 240a0ce79831e7d4 Rank 1: Gpu 1 cut_reorder_keys fingerprint 20edd3d9cf284001 Rank 1: Gpu 1 random_shift fingerprint 819f7c1c18e7733f ``` But my functions only process the example one by one and don't need rank or other arguments. After all it can work in the test for dataset and dataloader. I'll try to set `new_fingerprint` to see if it works and figure out the reason of different hash.
Dataset.map() execute twice when in PyTorch DDP mode
### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04`
90
Dataset.map() execute twice when in PyTorch DDP mode ### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04` Thanks for help! I find the fingerprint between processes don't have same hash: ``` Rank 0: Gpu 0 cut_reorder_keys fingerprint c7f47f40e9a67657 Rank 0: Gpu 0 random_shift fingerprint 240a0ce79831e7d4 Rank 1: Gpu 1 cut_reorder_keys fingerprint 20edd3d9cf284001 Rank 1: Gpu 1 random_shift fingerprint 819f7c1c18e7733f ``` But my functions only process the example one by one and don't need rank or other arguments. After all it can work in the test for dataset and dataloader. I'll try to set `new_fingerprint` to see if it works and figure out the reason of different hash.
[ -0.32103100419044495, -0.7901483178138733, 0.07416713982820511, 0.4760359823703766, 0.19198887050151825, -0.20305119454860687, 0.333636999130249, -0.06287026405334473, 0.28612929582595825, 0.10324004292488098, 0.0988529622554779, 0.42667683959007263, 0.10860054194927216, -0.27073511481285095, 0.26226451992988586, -0.11581375449895859, 0.04877207428216934, -0.11253102123737335, -0.25205907225608826, -0.16373468935489655, -0.04876964911818504, 0.04147990792989731, -0.28428107500076294, -0.14575734734535217, -0.2898797392845154, -0.2069510519504547, -0.12485435605049133, 0.048838552087545395, 0.12250620871782303, -0.4142807722091675, 0.07270678877830505, 0.025525208562612534, 0.2511764168739319, 0.7024824619293213, -0.00012532873370219022, 0.12123211473226547, 0.035358965396881104, 0.08784251660108566, -0.11136380583047867, -0.21161513030529022, 0.040127500891685486, 0.006766483187675476, 0.1880064457654953, -0.31016722321510315, -0.07990685105323792, -0.1228446289896965, -0.048925694078207016, -0.19009625911712646, 0.5397399663925171, 0.03262636810541153, 0.056453850120306015, 0.3101402819156647, -0.24512332677841187, -0.1108986958861351, -0.17450827360153198, 0.3002592921257019, -0.07534078508615494, 0.5350342392921448, 0.16150157153606415, -0.08843705803155899, -0.41928064823150635, 0.2667405605316162, -0.24642817676067352, 0.550044596195221, 0.13305068016052246, 0.12014256417751312, 0.03167671337723732, -0.2911275327205658, 0.05965176969766617, 0.06908471882343292, -0.09921068698167801, -0.30998143553733826, 0.15371185541152954, -0.25827112793922424, -0.11648387461900711, -0.2640652656555176, 0.16125977039337158, 0.15867719054222107, -0.1405617594718933, -0.10502299666404724, -0.5622197985649109, 0.14480705559253693, 0.09224528074264526, -0.048315636813640594, -0.07534369826316833, 0.4892403483390808, 0.02302117645740509, 0.37704727053642273, 0.2719419002532959, 0.3056618273258209, -0.009230680763721466, 0.017283812165260315, 0.0891876071691513, -0.06200944632291794, -0.3598806858062744, 0.21913066506385803, 0.2167998105287552, -0.1657853126525879, 0.09063758701086044, -0.07611612230539322, 0.04283556342124939, -0.03956732153892517, 0.32623162865638733, 0.08787097781896591, 0.10524041950702667, 0.34720176458358765, 0.038984719663858414, 0.5393652319908142, 0.2395360767841339, 0.011268243193626404, -0.28527966141700745, 0.14430789649486542, 0.17589369416236877, -0.13361188769340515, 0.11007119715213776, -0.12112648785114288, 0.31967249512672424, 0.06094662845134735, -0.1968836784362793, -0.27893662452697754, -0.21450653672218323, -0.2553021311759949, 0.1042732372879982, 0.3648208677768707, 0.12008309364318848, -0.087459996342659, 0.11024118959903717, 0.1192271038889885, -0.28099972009658813, -0.07104428112506866, -0.08085709810256958, -0.17239344120025635, -0.26921772956848145, 0.13414683938026428, 0.10696448385715485, -0.11755009740591049, 0.2842017412185669, 0.42022088170051575, 0.10877502709627151, -0.09469049423933029, 0.2539523243904114, -0.11998850107192993, 0.17431625723838806, 0.17003843188285828, -0.04282473027706146, 0.09917523711919785, 0.2043856978416443, 0.5848972201347351, -0.01503051072359085, 0.350251704454422, -0.18256273865699768, -0.1469983160495758, 0.3495730757713318, -0.011409945785999298, 0.23411236703395844, 0.29897525906562805, -0.19871576130390167, 0.18534430861473083, 0.3968254327774048, -0.43091845512390137, 0.2522372305393219, -0.21273793280124664, -0.7713404297828674, -0.14055733382701874, 0.3055552840232849, 0.5337104797363281, 0.28961941599845886, -0.1263495832681656, 0.42376217246055603, 0.14521749317646027, 0.3250264823436737, 0.2623722553253174, -0.4677085876464844, 0.32337361574172974, -0.40510082244873047, -0.3190339207649231, 0.15427953004837036, -0.40845954418182373, -0.39752787351608276, 0.35963359475135803, -0.5518220067024231, 0.059446968138217926, 0.08789782226085663, 0.07109933346509933, 0.25532397627830505, 0.26625514030456543, 0.22006580233573914, 0.04205203056335449, 0.025809304788708687, 0.3425559997558594, -0.24576586484909058, 0.2578607201576233, 0.545812726020813, 0.007495075464248657, -0.15884000062942505, 0.1128162294626236, 0.08242455124855042, 0.08996100723743439, 0.36403363943099976, 0.10886331647634506, -0.11402643471956253, 0.007277727127075195, -0.39600488543510437, -0.20402032136917114, 0.04767940193414688, -0.07438138872385025, -0.22941842675209045, 0.3985094130039215, -0.12211257219314575, -0.028364986181259155, -0.0037024393677711487, 0.014123335480690002, 0.18085558712482452, -0.0402129590511322, -0.34806162118911743, -0.3720846474170685, -0.13439540565013885, 0.18901856243610382, 0.07952683418989182, -0.0724213644862175, -0.10399400442838669, 0.28549525141716003, -0.09906434267759323, -0.04219251871109009, -0.30290836095809937, 0.05293065309524536, 0.02331896685063839, -0.05225265026092529, -0.19600875675678253, -0.08475957810878754, 0.300087034702301, -0.3161177337169647, -0.1975407600402832, 0.3197054862976074, 0.11068513989448547, 0.03098534792661667, -0.0342056080698967, -0.1643436849117279, 0.44110795855522156, -0.008304528892040253, 0.06155356764793396, 0.47325947880744934, 0.06943874061107635, -0.1465318202972412, -0.1924816370010376, 0.25467902421951294, 0.14265137910842896, 0.13472706079483032, -0.15512694418430328, -0.1455819308757782, -0.09947420656681061, 0.058443062007427216, -0.05991983041167259, 0.20915746688842773, 0.2657237648963928, 0.20881830155849457, 0.27354371547698975, 0.11554981023073196, -0.22683307528495789, -0.12739193439483643, 0.1331399530172348, 0.023160919547080994, 0.08099952340126038, -0.06695393472909927, -0.11647076904773712, 0.03238584101200104, 0.29902493953704834, -0.017120853066444397, 0.45884209871292114, 0.1188306212425232, 0.2843678295612335, 0.031166626140475273, -0.2166600227355957, -0.029790375381708145, 0.06018131226301193, -0.1503361463546753, 0.09821672737598419, -0.06067062169313431, 0.413851261138916, -0.04729703068733215, -0.35904112458229065, -0.06880336254835129, 0.33778756856918335, 0.07448829710483551, -0.24584439396858215, 0.1695542186498642, -0.241023451089859, 0.014985278248786926, -0.2882787883281708, 0.279346764087677, -0.16765975952148438, 0.1733199954032898, -0.11825311183929443, 0.4081527590751648, 0.1852991282939911, 0.39765307307243347, 0.35181379318237305, 0.041423261165618896, -0.1488129198551178, -0.14785906672477722, 0.2478780746459961, -0.09317834675312042, -0.08223912119865417, -0.06049042195081711, 0.050327785313129425, -0.0871376097202301, 0.5514771342277527, 0.11091134697198868, -0.48693427443504333, -0.1813448667526245, 0.08564940094947815, 0.08983299136161804, 0.10212331265211105, -0.29832786321640015, -0.0835379809141159, -0.013610988855361938, -0.27005794644355774, 0.1311352550983429, 0.34428781270980835, -0.46287423372268677, -0.18503767251968384, 0.11620007455348969, 0.00006802752614021301, -0.12305642664432526, -0.1995704621076584, -0.3244553208351135, 0.05849149823188782, -0.15177088975906372, 0.3342583179473877, -0.205897718667984, 0.285815566778183, -0.12700214982032776, 0.09779035300016403, -0.010174442082643509, -0.02102283388376236, -0.030537493526935577, -0.08207440376281738, -0.42676621675491333, -0.04151913523674011, -0.08720071613788605, -0.2174294888973236, -0.21946927905082703, 0.10197065770626068, -0.18046686053276062, 0.4664595127105713, -0.4788520336151123, -0.42627382278442383, -0.23839151859283447, 0.35457751154899597, -0.19474442303180695, 0.2055778205394745, 0.5381614565849304, -0.10454204678535461, 0.05447199195623398, 0.09598629176616669, -0.2025066316127777, 0.3153032064437866, 0.16995061933994293, 0.13322590291500092, 0.28371092677116394, 0.4944392740726471, -0.002390652894973755, 0.8055747747421265, 0.2815593183040619, -0.1330988109111786, 0.09402408450841904, -0.4099043607711792, 0.03872789442539215, -0.1161407083272934, -0.3991627097129822, 0.15716907382011414, -0.12431600689888, -0.13921178877353668, 0.11112987995147705, -0.1367260068655014, -0.08218682557344437, -0.0847591981291771, -0.26178473234176636, 0.04142649471759796, -0.13335683941841125, -0.0016670748591423035, -0.09317905455827713, 0.3270925283432007, -0.03908434510231018, 0.20677557587623596, -0.10299725085496902, 0.12215262651443481, 0.04603707790374756, -0.27475738525390625, 0.344443142414093, -0.009908322244882584, -0.22914323210716248, 0.1980471909046173, -0.38754382729530334, 0.23339878022670746, 0.13931617140769958, 0.09074768424034119, -0.1531815081834793, 0.24404765665531158, 0.3723222315311432, 0.016393158584833145, 0.8515889644622803, 0.20654863119125366, 0.3926394581794739, -0.06385268270969391, -0.5782086849212646, -0.4568251967430115, -0.015657231211662292, -0.17178767919540405, 0.38177841901779175, 0.28464388847351074, -0.04700204357504845, -0.1308157593011856, -0.058146294206380844, -0.0574004240334034, 0.1253233700990677, -0.19049739837646484, -0.2800319194793701, -0.49488329887390137, -0.05831324681639671, -0.4450277090072632, 0.36693570017814636, 0.2846795916557312, -0.11023788154125214, -0.020069720223546028, -0.21457433700561523, 0.09521342068910599, 0.07837872207164764, -0.04237345606088638, 0.2386717051267624, 0.2561565041542053, 0.10197336971759796, 0.18973290920257568, 0.4703606963157654, 0.31322288513183594, 0.01463579572737217, 0.49203065037727356, -0.28032979369163513, -0.12606805562973022, 0.05534517392516136, 0.09950810670852661, 0.1329486072063446, 0.40727347135543823, 0.13329824805259705, 0.05851009115576744, -0.10428708791732788, 0.18158608675003052, -0.3366781175136566, -0.11681513488292694, 0.37885838747024536, 0.12456897646188736, -0.06399190425872803, -0.4345674514770508, 0.19299502670764923, 0.04701348394155502, -0.2752251625061035, 0.6179056763648987, -0.44700753688812256, -0.2240835726261139, 0.07093451172113419, -0.17497432231903076, 0.7820196747779846, -0.1744816154241562, 0.041306205093860626, 0.0809965506196022, -0.05491071566939354, 0.2876678705215454, -0.13424453139305115, 0.38403382897377014, -0.37181469798088074, -0.23508723080158234, 0.05896364897489548, -0.19969579577445984, 0.07527974247932434, -0.019774075597524643, 0.041475579142570496, 0.1268935650587082, -0.03389665484428406, 0.19931696355342865, -0.12998676300048828, 0.17681698501110077, 0.3123518228530884, -0.18389935791492462, -0.03766634687781334, -0.04231409355998039, -0.023523200303316116, 0.28262221813201904, -0.010782252997159958, 0.03039909154176712, 0.19777238368988037, -0.32419753074645996, -0.049074381589889526, 0.1419382393360138, -0.5082389116287231, 0.43468329310417175, -0.15203727781772614, -0.264252245426178, -0.1014367938041687, 0.735869288444519, 0.08062509447336197, -0.22749841213226318, 0.09769903868436813, -0.0021504806354641914, 0.18710893392562866, 0.2432192713022232, -0.3142434060573578, -0.22403186559677124, -0.19225718080997467, -0.06264733523130417, -0.46019798517227173, -0.18495523929595947, -0.07633833587169647, -0.31969571113586426, -0.24082443118095398, 0.5648025870323181, 0.10051076114177704, 0.06293807923793793, 0.04463617876172066, 0.12916617095470428, 0.0443769246339798, -0.247446209192276, -0.06726662814617157, 0.05077717825770378, -0.2799234092235565, 0.11551687121391296, 0.009563341736793518, -0.3812546133995056, 0.05051935836672783, 0.5093289613723755, 0.16595147550106049, 0.40768754482269287, 0.19413147866725922, 0.1248687207698822, -0.04974427446722984, -0.12555640935897827, -0.062313057482242584, 0.15009596943855286, -0.2873275876045227, 0.22064396739006042, -0.06300689280033112, 0.07249099016189575, -0.09506359696388245, 0.13673239946365356, -0.06849803775548935, 0.013889847323298454, -0.08418700098991394, -0.09499192982912064, -0.31692948937416077, -0.1809070110321045, 0.03409748151898384, -0.0005236519500613213, 0.3702937066555023, 0.3343854248523712, 0.2498791217803955, 0.4636760950088501, -0.14911621809005737, 0.04224524646997452, 0.23245388269424438, 0.3340829312801361, -0.023512454703450203, -0.008763470686972141, 0.04821523278951645, -0.0160430409014225, -0.08510634303092957, 0.3576095700263977, -0.10078448057174683, -0.052683331072330475, -0.15263932943344116, 0.23410794138908386, -0.20396681129932404, -0.06581909954547882, -0.17026540637016296, -0.4797412157058716, 0.06136393919587135, -0.32725340127944946, 0.40052443742752075, 0.4074571430683136, -0.035150185227394104, -0.09914932399988174, 0.25876718759536743, 0.05589265748858452, -0.2011529803276062, -0.00876532681286335, -0.3253212571144104, -0.34483879804611206, 0.14392027258872986, -0.007134565152227879, 0.05552556738257408, -0.03736123442649841, -0.37686672806739807, -0.15646715462207794, 0.41800734400749207, -0.07706829905509949, 0.007746649906039238, -0.2281447798013687, -0.11427351087331772, -0.0873553454875946, 0.40227723121643066, 0.09043355286121368, -0.3119918406009674, -0.07325480133295059, -0.13250640034675598, 0.01673976704478264, -0.35503333806991577, -0.11912642419338226, 0.31738561391830444, 0.009169202297925949, 0.13769260048866272, 0.42766618728637695, 0.2895326316356659, -0.03956472873687744, -0.21204042434692383, 0.011784441769123077, 0.1576681286096573, -0.35620948672294617, 0.07280118763446808, -0.18851517140865326, -0.09778635203838348, 0.01162794604897499, 0.2780613601207733, 0.0850769430398941, 0.10676440596580505, 0.09130354225635529, 0.030378853902220726, 0.6768695116043091, 0.0920587033033371, 0.14612546563148499, 0.26083117723464966, -0.2278212606906891, 0.28829869627952576, 0.07550755143165588, -0.3025502562522888, -0.0710994154214859, -0.07912856340408325, 0.1973545104265213, -0.5555619597434998, -0.39933228492736816, -0.31075039505958557, 0.18628162145614624, -0.21436002850532532, -0.05778402090072632, 0.13677923381328583, -0.13642288744449615, 0.07552652060985565, 0.2659595012664795, 0.1297883689403534, 0.029939716681838036, 0.5465022921562195, 0.09842737019062042, -0.25007161498069763, -0.2736552357673645, -0.4249807596206665, 0.12966743111610413, 0.15650281310081482, -0.3208833932876587, 0.23554933071136475, 0.19289299845695496, -0.14153268933296204, -0.20708702504634857, 0.3230242133140564, 0.22245298326015472, 0.2408062070608139, -0.14938431978225708, 0.1486433744430542, 0.15672411024570465, 0.26859769225120544, -0.12406465411186218, 0.11281496286392212, -0.05504320561885834, 0.26080211997032166, 0.13793975114822388, -0.07691347599029541, -0.11137478053569794, -0.03642915561795235, 0.26485326886177063, 0.13187755644321442, -0.04035180062055588, 0.5132675170898438, -0.3210429549217224, -0.03484959155321121, -0.0998164713382721, 0.06669826805591583, -0.22419282793998718, 0.2018771469593048, 0.27154606580734253, -0.20290392637252808, -0.025898955762386322, -0.1484331488609314, -0.022203102707862854, -0.12431511282920837, 0.2903858721256256, -0.05832153186202049, 0.13950927555561066, -0.5078446865081787, -0.1249920204281807, -0.6539648771286011, 0.40354204177856445, -0.3416747450828552, 0.10131336748600006, -0.045467451214790344, 0.01246209442615509, -0.09291023015975952, 0.08096955716609955, 0.04091886430978775, -0.3370940685272217, 0.16748173534870148, 0.23781314492225647, -0.1938321888446808, 0.08604031056165695, -0.5267012715339661, 0.0938861295580864, 0.19810214638710022, -0.23821628093719482, 0.3681204617023468, -0.3649635910987854, -0.05377914011478424, -0.0013588778674602509, 0.13489887118339539, 0.0012995600700378418, -0.06714189052581787, 0.4232494533061981, 0.21226225793361664, 0.43789640069007874, 0.06804228574037552, 0.08424141258001328, 0.004541715607047081, 0.08080026507377625, -0.2294754832983017, 0.20281396806240082, 0.19673994183540344, 0.4024079740047455, -0.21268731355667114, -0.5200225114822388, -0.40589869022369385, 0.4765301048755646, 0.11305727809667587, -0.16179123520851135, -0.049647748470306396, -0.13779661059379578, -0.11923132836818695, 0.17818638682365417, 0.12312297523021698, 0.4212478697299957, 0.13837644457817078, -0.04294353723526001, -0.19605007767677307, -0.24784280359745026, 0.3423401117324829, -0.7567551136016846, -0.30113938450813293, -0.25887951254844666, 0.28308019042015076, 0.07499000430107117, -0.11602260917425156, -0.7164036631584167, -0.13075600564479828, 0.09190855920314789, -0.19980044662952423, -0.23095345497131348, 0.09965474903583527, -0.3373803496360779, -0.05446145310997963, -0.01040860265493393, 0.3596119284629822, -0.13169531524181366, -0.5107806921005249, 0.16256888210773468, -0.09332819283008575 ]
https://github.com/huggingface/datasets/issues/6060
I finally figure it out. The fingerprint of the function will change if other key-value pairs change in `args` even the `args.num_stations_list` is not changed. ```python lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True) ``` My `args` contains the key `rank` which refers the rank of its GPU, so the fingerprints change among the GPUs. I use `partial` in `functools` to generate a partial function that fixs the argument `num_stations_list=args.num_stations_list`, and the fingerprint of this partial function keeps among the GPUs. Finally I can reuse the mapped cache.
Dataset.map() execute twice when in PyTorch DDP mode
### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04`
86
Dataset.map() execute twice when in PyTorch DDP mode ### Describe the bug I use `torchrun --standalone --nproc_per_node=2 train.py` to start training. And write the code following the [docs](https://huggingface.co/docs/datasets/process#distributed-usage). The trick about using `torch.distributed.barrier()` to only execute map at the main process doesn't always work. When I am training model, it will map twice. When I am running a test for dataset and dataloader (just print the batches), it can work. Their code about loading dataset are same. And on another server with 30 CPU cores, I use 2 GPUs and it can't work neither. I have tried to use `rank` and `local_rank` to check, they all didn't make sense. ### Steps to reproduce the bug use `torchrun --standalone --nproc_per_node=2 train.py` or `torchrun --standalone train.py` to run This is my code: ```python if args.distributed and world_size > 1: if args.local_rank > 0: print(f"Rank {args.rank}: Gpu {args.gpu} waiting for main process to perform the mapping", force=True) torch.distributed.barrier() print("Mapping dataset") dataset = dataset.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True), num_proc=8, desc="cut_reorder_keys") dataset = dataset.map(lambda x: random_shift(x, shift_range=(-160, 0), feature_scale=16), num_proc=8, desc="random_shift") dataset_test = dataset_test.map(lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=False), num_proc=8, desc="cut_reorder_keys") if args.local_rank == 0: print("Mapping finished, loading results from main process") torch.distributed.barrier() ``` ### Expected behavior Only the main process will execute `map`, while the sub process will load cache from disk. ### Environment info server with 64 CPU cores (AMD Ryzen Threadripper PRO 5995WX 64-Cores) and 2 RTX 4090 - `python==3.9.16` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `22.04.1-Ubuntu` server with 30 CPU cores (Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz) and 2 RTX 4090 - `python==3.9.0` - `datasets==2.13.1` - `torch==2.0.1+cu117` - `Ubuntu 20.04` I finally figure it out. The fingerprint of the function will change if other key-value pairs change in `args` even the `args.num_stations_list` is not changed. ```python lambda x: cut_reorder_keys(x, num_stations_list=args.num_stations_list, is_pad=True, is_train=True) ``` My `args` contains the key `rank` which refers the rank of its GPU, so the fingerprints change among the GPUs. I use `partial` in `functools` to generate a partial function that fixs the argument `num_stations_list=args.num_stations_list`, and the fingerprint of this partial function keeps among the GPUs. Finally I can reuse the mapped cache.
[ -0.32103100419044495, -0.7901483178138733, 0.07416713982820511, 0.4760359823703766, 0.19198887050151825, -0.20305119454860687, 0.333636999130249, -0.06287026405334473, 0.28612929582595825, 0.10324004292488098, 0.0988529622554779, 0.42667683959007263, 0.10860054194927216, -0.27073511481285095, 0.26226451992988586, -0.11581375449895859, 0.04877207428216934, -0.11253102123737335, -0.25205907225608826, -0.16373468935489655, -0.04876964911818504, 0.04147990792989731, -0.28428107500076294, -0.14575734734535217, -0.2898797392845154, -0.2069510519504547, -0.12485435605049133, 0.048838552087545395, 0.12250620871782303, -0.4142807722091675, 0.07270678877830505, 0.025525208562612534, 0.2511764168739319, 0.7024824619293213, -0.00012532873370219022, 0.12123211473226547, 0.035358965396881104, 0.08784251660108566, -0.11136380583047867, -0.21161513030529022, 0.040127500891685486, 0.006766483187675476, 0.1880064457654953, -0.31016722321510315, -0.07990685105323792, -0.1228446289896965, -0.048925694078207016, -0.19009625911712646, 0.5397399663925171, 0.03262636810541153, 0.056453850120306015, 0.3101402819156647, -0.24512332677841187, -0.1108986958861351, -0.17450827360153198, 0.3002592921257019, -0.07534078508615494, 0.5350342392921448, 0.16150157153606415, -0.08843705803155899, -0.41928064823150635, 0.2667405605316162, -0.24642817676067352, 0.550044596195221, 0.13305068016052246, 0.12014256417751312, 0.03167671337723732, -0.2911275327205658, 0.05965176969766617, 0.06908471882343292, -0.09921068698167801, -0.30998143553733826, 0.15371185541152954, -0.25827112793922424, -0.11648387461900711, -0.2640652656555176, 0.16125977039337158, 0.15867719054222107, -0.1405617594718933, -0.10502299666404724, -0.5622197985649109, 0.14480705559253693, 0.09224528074264526, -0.048315636813640594, -0.07534369826316833, 0.4892403483390808, 0.02302117645740509, 0.37704727053642273, 0.2719419002532959, 0.3056618273258209, -0.009230680763721466, 0.017283812165260315, 0.0891876071691513, -0.06200944632291794, -0.3598806858062744, 0.21913066506385803, 0.2167998105287552, -0.1657853126525879, 0.09063758701086044, -0.07611612230539322, 0.04283556342124939, -0.03956732153892517, 0.32623162865638733, 0.08787097781896591, 0.10524041950702667, 0.34720176458358765, 0.038984719663858414, 0.5393652319908142, 0.2395360767841339, 0.011268243193626404, -0.28527966141700745, 0.14430789649486542, 0.17589369416236877, -0.13361188769340515, 0.11007119715213776, -0.12112648785114288, 0.31967249512672424, 0.06094662845134735, -0.1968836784362793, -0.27893662452697754, -0.21450653672218323, -0.2553021311759949, 0.1042732372879982, 0.3648208677768707, 0.12008309364318848, -0.087459996342659, 0.11024118959903717, 0.1192271038889885, -0.28099972009658813, -0.07104428112506866, -0.08085709810256958, -0.17239344120025635, -0.26921772956848145, 0.13414683938026428, 0.10696448385715485, -0.11755009740591049, 0.2842017412185669, 0.42022088170051575, 0.10877502709627151, -0.09469049423933029, 0.2539523243904114, -0.11998850107192993, 0.17431625723838806, 0.17003843188285828, -0.04282473027706146, 0.09917523711919785, 0.2043856978416443, 0.5848972201347351, -0.01503051072359085, 0.350251704454422, -0.18256273865699768, -0.1469983160495758, 0.3495730757713318, -0.011409945785999298, 0.23411236703395844, 0.29897525906562805, -0.19871576130390167, 0.18534430861473083, 0.3968254327774048, -0.43091845512390137, 0.2522372305393219, -0.21273793280124664, -0.7713404297828674, -0.14055733382701874, 0.3055552840232849, 0.5337104797363281, 0.28961941599845886, -0.1263495832681656, 0.42376217246055603, 0.14521749317646027, 0.3250264823436737, 0.2623722553253174, -0.4677085876464844, 0.32337361574172974, -0.40510082244873047, -0.3190339207649231, 0.15427953004837036, -0.40845954418182373, -0.39752787351608276, 0.35963359475135803, -0.5518220067024231, 0.059446968138217926, 0.08789782226085663, 0.07109933346509933, 0.25532397627830505, 0.26625514030456543, 0.22006580233573914, 0.04205203056335449, 0.025809304788708687, 0.3425559997558594, -0.24576586484909058, 0.2578607201576233, 0.545812726020813, 0.007495075464248657, -0.15884000062942505, 0.1128162294626236, 0.08242455124855042, 0.08996100723743439, 0.36403363943099976, 0.10886331647634506, -0.11402643471956253, 0.007277727127075195, -0.39600488543510437, -0.20402032136917114, 0.04767940193414688, -0.07438138872385025, -0.22941842675209045, 0.3985094130039215, -0.12211257219314575, -0.028364986181259155, -0.0037024393677711487, 0.014123335480690002, 0.18085558712482452, -0.0402129590511322, -0.34806162118911743, -0.3720846474170685, -0.13439540565013885, 0.18901856243610382, 0.07952683418989182, -0.0724213644862175, -0.10399400442838669, 0.28549525141716003, -0.09906434267759323, -0.04219251871109009, -0.30290836095809937, 0.05293065309524536, 0.02331896685063839, -0.05225265026092529, -0.19600875675678253, -0.08475957810878754, 0.300087034702301, -0.3161177337169647, -0.1975407600402832, 0.3197054862976074, 0.11068513989448547, 0.03098534792661667, -0.0342056080698967, -0.1643436849117279, 0.44110795855522156, -0.008304528892040253, 0.06155356764793396, 0.47325947880744934, 0.06943874061107635, -0.1465318202972412, -0.1924816370010376, 0.25467902421951294, 0.14265137910842896, 0.13472706079483032, -0.15512694418430328, -0.1455819308757782, -0.09947420656681061, 0.058443062007427216, -0.05991983041167259, 0.20915746688842773, 0.2657237648963928, 0.20881830155849457, 0.27354371547698975, 0.11554981023073196, -0.22683307528495789, -0.12739193439483643, 0.1331399530172348, 0.023160919547080994, 0.08099952340126038, -0.06695393472909927, -0.11647076904773712, 0.03238584101200104, 0.29902493953704834, -0.017120853066444397, 0.45884209871292114, 0.1188306212425232, 0.2843678295612335, 0.031166626140475273, -0.2166600227355957, -0.029790375381708145, 0.06018131226301193, -0.1503361463546753, 0.09821672737598419, -0.06067062169313431, 0.413851261138916, -0.04729703068733215, -0.35904112458229065, -0.06880336254835129, 0.33778756856918335, 0.07448829710483551, -0.24584439396858215, 0.1695542186498642, -0.241023451089859, 0.014985278248786926, -0.2882787883281708, 0.279346764087677, -0.16765975952148438, 0.1733199954032898, -0.11825311183929443, 0.4081527590751648, 0.1852991282939911, 0.39765307307243347, 0.35181379318237305, 0.041423261165618896, -0.1488129198551178, -0.14785906672477722, 0.2478780746459961, -0.09317834675312042, -0.08223912119865417, -0.06049042195081711, 0.050327785313129425, -0.0871376097202301, 0.5514771342277527, 0.11091134697198868, -0.48693427443504333, -0.1813448667526245, 0.08564940094947815, 0.08983299136161804, 0.10212331265211105, -0.29832786321640015, -0.0835379809141159, -0.013610988855361938, -0.27005794644355774, 0.1311352550983429, 0.34428781270980835, -0.46287423372268677, -0.18503767251968384, 0.11620007455348969, 0.00006802752614021301, -0.12305642664432526, -0.1995704621076584, -0.3244553208351135, 0.05849149823188782, -0.15177088975906372, 0.3342583179473877, -0.205897718667984, 0.285815566778183, -0.12700214982032776, 0.09779035300016403, -0.010174442082643509, -0.02102283388376236, -0.030537493526935577, -0.08207440376281738, -0.42676621675491333, -0.04151913523674011, -0.08720071613788605, -0.2174294888973236, -0.21946927905082703, 0.10197065770626068, -0.18046686053276062, 0.4664595127105713, -0.4788520336151123, -0.42627382278442383, -0.23839151859283447, 0.35457751154899597, -0.19474442303180695, 0.2055778205394745, 0.5381614565849304, -0.10454204678535461, 0.05447199195623398, 0.09598629176616669, -0.2025066316127777, 0.3153032064437866, 0.16995061933994293, 0.13322590291500092, 0.28371092677116394, 0.4944392740726471, -0.002390652894973755, 0.8055747747421265, 0.2815593183040619, -0.1330988109111786, 0.09402408450841904, -0.4099043607711792, 0.03872789442539215, -0.1161407083272934, -0.3991627097129822, 0.15716907382011414, -0.12431600689888, -0.13921178877353668, 0.11112987995147705, -0.1367260068655014, -0.08218682557344437, -0.0847591981291771, -0.26178473234176636, 0.04142649471759796, -0.13335683941841125, -0.0016670748591423035, -0.09317905455827713, 0.3270925283432007, -0.03908434510231018, 0.20677557587623596, -0.10299725085496902, 0.12215262651443481, 0.04603707790374756, -0.27475738525390625, 0.344443142414093, -0.009908322244882584, -0.22914323210716248, 0.1980471909046173, -0.38754382729530334, 0.23339878022670746, 0.13931617140769958, 0.09074768424034119, -0.1531815081834793, 0.24404765665531158, 0.3723222315311432, 0.016393158584833145, 0.8515889644622803, 0.20654863119125366, 0.3926394581794739, -0.06385268270969391, -0.5782086849212646, -0.4568251967430115, -0.015657231211662292, -0.17178767919540405, 0.38177841901779175, 0.28464388847351074, -0.04700204357504845, -0.1308157593011856, -0.058146294206380844, -0.0574004240334034, 0.1253233700990677, -0.19049739837646484, -0.2800319194793701, -0.49488329887390137, -0.05831324681639671, -0.4450277090072632, 0.36693570017814636, 0.2846795916557312, -0.11023788154125214, -0.020069720223546028, -0.21457433700561523, 0.09521342068910599, 0.07837872207164764, -0.04237345606088638, 0.2386717051267624, 0.2561565041542053, 0.10197336971759796, 0.18973290920257568, 0.4703606963157654, 0.31322288513183594, 0.01463579572737217, 0.49203065037727356, -0.28032979369163513, -0.12606805562973022, 0.05534517392516136, 0.09950810670852661, 0.1329486072063446, 0.40727347135543823, 0.13329824805259705, 0.05851009115576744, -0.10428708791732788, 0.18158608675003052, -0.3366781175136566, -0.11681513488292694, 0.37885838747024536, 0.12456897646188736, -0.06399190425872803, -0.4345674514770508, 0.19299502670764923, 0.04701348394155502, -0.2752251625061035, 0.6179056763648987, -0.44700753688812256, -0.2240835726261139, 0.07093451172113419, -0.17497432231903076, 0.7820196747779846, -0.1744816154241562, 0.041306205093860626, 0.0809965506196022, -0.05491071566939354, 0.2876678705215454, -0.13424453139305115, 0.38403382897377014, -0.37181469798088074, -0.23508723080158234, 0.05896364897489548, -0.19969579577445984, 0.07527974247932434, -0.019774075597524643, 0.041475579142570496, 0.1268935650587082, -0.03389665484428406, 0.19931696355342865, -0.12998676300048828, 0.17681698501110077, 0.3123518228530884, -0.18389935791492462, -0.03766634687781334, -0.04231409355998039, -0.023523200303316116, 0.28262221813201904, -0.010782252997159958, 0.03039909154176712, 0.19777238368988037, -0.32419753074645996, -0.049074381589889526, 0.1419382393360138, -0.5082389116287231, 0.43468329310417175, -0.15203727781772614, -0.264252245426178, -0.1014367938041687, 0.735869288444519, 0.08062509447336197, -0.22749841213226318, 0.09769903868436813, -0.0021504806354641914, 0.18710893392562866, 0.2432192713022232, -0.3142434060573578, -0.22403186559677124, -0.19225718080997467, -0.06264733523130417, -0.46019798517227173, -0.18495523929595947, -0.07633833587169647, -0.31969571113586426, -0.24082443118095398, 0.5648025870323181, 0.10051076114177704, 0.06293807923793793, 0.04463617876172066, 0.12916617095470428, 0.0443769246339798, -0.247446209192276, -0.06726662814617157, 0.05077717825770378, -0.2799234092235565, 0.11551687121391296, 0.009563341736793518, -0.3812546133995056, 0.05051935836672783, 0.5093289613723755, 0.16595147550106049, 0.40768754482269287, 0.19413147866725922, 0.1248687207698822, -0.04974427446722984, -0.12555640935897827, -0.062313057482242584, 0.15009596943855286, -0.2873275876045227, 0.22064396739006042, -0.06300689280033112, 0.07249099016189575, -0.09506359696388245, 0.13673239946365356, -0.06849803775548935, 0.013889847323298454, -0.08418700098991394, -0.09499192982912064, -0.31692948937416077, -0.1809070110321045, 0.03409748151898384, -0.0005236519500613213, 0.3702937066555023, 0.3343854248523712, 0.2498791217803955, 0.4636760950088501, -0.14911621809005737, 0.04224524646997452, 0.23245388269424438, 0.3340829312801361, -0.023512454703450203, -0.008763470686972141, 0.04821523278951645, -0.0160430409014225, -0.08510634303092957, 0.3576095700263977, -0.10078448057174683, -0.052683331072330475, -0.15263932943344116, 0.23410794138908386, -0.20396681129932404, -0.06581909954547882, -0.17026540637016296, -0.4797412157058716, 0.06136393919587135, -0.32725340127944946, 0.40052443742752075, 0.4074571430683136, -0.035150185227394104, -0.09914932399988174, 0.25876718759536743, 0.05589265748858452, -0.2011529803276062, -0.00876532681286335, -0.3253212571144104, -0.34483879804611206, 0.14392027258872986, -0.007134565152227879, 0.05552556738257408, -0.03736123442649841, -0.37686672806739807, -0.15646715462207794, 0.41800734400749207, -0.07706829905509949, 0.007746649906039238, -0.2281447798013687, -0.11427351087331772, -0.0873553454875946, 0.40227723121643066, 0.09043355286121368, -0.3119918406009674, -0.07325480133295059, -0.13250640034675598, 0.01673976704478264, -0.35503333806991577, -0.11912642419338226, 0.31738561391830444, 0.009169202297925949, 0.13769260048866272, 0.42766618728637695, 0.2895326316356659, -0.03956472873687744, -0.21204042434692383, 0.011784441769123077, 0.1576681286096573, -0.35620948672294617, 0.07280118763446808, -0.18851517140865326, -0.09778635203838348, 0.01162794604897499, 0.2780613601207733, 0.0850769430398941, 0.10676440596580505, 0.09130354225635529, 0.030378853902220726, 0.6768695116043091, 0.0920587033033371, 0.14612546563148499, 0.26083117723464966, -0.2278212606906891, 0.28829869627952576, 0.07550755143165588, -0.3025502562522888, -0.0710994154214859, -0.07912856340408325, 0.1973545104265213, -0.5555619597434998, -0.39933228492736816, -0.31075039505958557, 0.18628162145614624, -0.21436002850532532, -0.05778402090072632, 0.13677923381328583, -0.13642288744449615, 0.07552652060985565, 0.2659595012664795, 0.1297883689403534, 0.029939716681838036, 0.5465022921562195, 0.09842737019062042, -0.25007161498069763, -0.2736552357673645, -0.4249807596206665, 0.12966743111610413, 0.15650281310081482, -0.3208833932876587, 0.23554933071136475, 0.19289299845695496, -0.14153268933296204, -0.20708702504634857, 0.3230242133140564, 0.22245298326015472, 0.2408062070608139, -0.14938431978225708, 0.1486433744430542, 0.15672411024570465, 0.26859769225120544, -0.12406465411186218, 0.11281496286392212, -0.05504320561885834, 0.26080211997032166, 0.13793975114822388, -0.07691347599029541, -0.11137478053569794, -0.03642915561795235, 0.26485326886177063, 0.13187755644321442, -0.04035180062055588, 0.5132675170898438, -0.3210429549217224, -0.03484959155321121, -0.0998164713382721, 0.06669826805591583, -0.22419282793998718, 0.2018771469593048, 0.27154606580734253, -0.20290392637252808, -0.025898955762386322, -0.1484331488609314, -0.022203102707862854, -0.12431511282920837, 0.2903858721256256, -0.05832153186202049, 0.13950927555561066, -0.5078446865081787, -0.1249920204281807, -0.6539648771286011, 0.40354204177856445, -0.3416747450828552, 0.10131336748600006, -0.045467451214790344, 0.01246209442615509, -0.09291023015975952, 0.08096955716609955, 0.04091886430978775, -0.3370940685272217, 0.16748173534870148, 0.23781314492225647, -0.1938321888446808, 0.08604031056165695, -0.5267012715339661, 0.0938861295580864, 0.19810214638710022, -0.23821628093719482, 0.3681204617023468, -0.3649635910987854, -0.05377914011478424, -0.0013588778674602509, 0.13489887118339539, 0.0012995600700378418, -0.06714189052581787, 0.4232494533061981, 0.21226225793361664, 0.43789640069007874, 0.06804228574037552, 0.08424141258001328, 0.004541715607047081, 0.08080026507377625, -0.2294754832983017, 0.20281396806240082, 0.19673994183540344, 0.4024079740047455, -0.21268731355667114, -0.5200225114822388, -0.40589869022369385, 0.4765301048755646, 0.11305727809667587, -0.16179123520851135, -0.049647748470306396, -0.13779661059379578, -0.11923132836818695, 0.17818638682365417, 0.12312297523021698, 0.4212478697299957, 0.13837644457817078, -0.04294353723526001, -0.19605007767677307, -0.24784280359745026, 0.3423401117324829, -0.7567551136016846, -0.30113938450813293, -0.25887951254844666, 0.28308019042015076, 0.07499000430107117, -0.11602260917425156, -0.7164036631584167, -0.13075600564479828, 0.09190855920314789, -0.19980044662952423, -0.23095345497131348, 0.09965474903583527, -0.3373803496360779, -0.05446145310997963, -0.01040860265493393, 0.3596119284629822, -0.13169531524181366, -0.5107806921005249, 0.16256888210773468, -0.09332819283008575 ]
https://github.com/huggingface/datasets/issues/6058
This can also mean one of the files was not downloaded correctly. We log an erroneous file's name before raising the reader's error, so this is how you can find the problematic file. Then, you should delete it and call `load_dataset` again. (I checked all the uploaded files, and they seem to be valid Parquet files, so I don't think this is a bug on their side)
laion-coco download error
### Describe the bug The full trace: ``` /home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/load.py:1744: FutureWarning: 'ignore_verifications' was de precated in favor of 'verification_mode' in version 2.9.1 and will be removed in 3.0.0. You can remove this warning by passing 'verification_mode=no_checks' instead. warnings.warn( Downloading and preparing dataset parquet/laion--laion-coco to /home/bian/.cache/huggingface/datasets/laion___parquet/laion-- laion-coco-cb4205d7f1863066/0.0.0/bcacc8bdaa0614a5d73d0344c813275e590940c6ea8bc569da462847103a1afd... Downloading data: 100%|█| 1.89G/1.89G [04:57<00:00, Downloading data files: 100%|█| 1/1 [04:59<00:00, 2 Extracting data files: 100%|█| 1/1 [00:00<00:00, 13 Generating train split: 0 examples [00:00, ? examples/s]<_io.BufferedReader name='/home/bian/.cache/huggingface/datasets/downlo ads/26d7a016d25bbd9443115cfa3092136e8eb2f1f5bcd4154 0cb9234572927f04c'> Traceback (most recent call last): File "/home/bian/data/ZOC/download_laion_coco.py", line 4, in <module> dataset = load_dataset("laion/laion-coco", ignore_verifications=True) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset builder_instance.download_and_prepare( File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare self._download_and_prepare( File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 1842, in _prepare_split_single generator = self._generate_tables(**gen_kwargs) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 67, in _generate_tables parquet_file = pq.ParquetFile(f) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/pyarrow/parquet/core.py", line 323, in __init__ self.reader.open( File "pyarrow/_parquet.pyx", line 1227, in pyarrow._parquet.ParquetReader.open File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file . ``` I have carefully followed the instructions in #5264 but still get the same error. Other helpful information: ``` ds = load_dataset("parquet", data_files= ...: "https://huggingface.co/datasets/laion/l ...: aion-coco/resolve/d22869de3ccd39dfec1507 ...: f7ded32e4a518dad24/part-00000-2256f782-1 ...: 26f-4dc6-b9c6-e6757637749d-c000.snappy.p ...: arquet") Found cached dataset parquet (/home/bian/.cache/huggingface/datasets/parquet/default-a02eea00aeb08b0e/0.0.0/bb8ccf89d9ee38581ff5e51506d721a9b37f14df8090dc9b2d8fb4a40957833f) 100%|██████████████| 1/1 [00:00<00:00, 4.55it/s] ``` ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset("laion/laion-coco", ignore_verifications=True/False) ``` ### Expected behavior Properly load Laion-coco dataset ### Environment info datasets==2.11.0 torch==1.12.1 python 3.10
67
laion-coco download error ### Describe the bug The full trace: ``` /home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/load.py:1744: FutureWarning: 'ignore_verifications' was de precated in favor of 'verification_mode' in version 2.9.1 and will be removed in 3.0.0. You can remove this warning by passing 'verification_mode=no_checks' instead. warnings.warn( Downloading and preparing dataset parquet/laion--laion-coco to /home/bian/.cache/huggingface/datasets/laion___parquet/laion-- laion-coco-cb4205d7f1863066/0.0.0/bcacc8bdaa0614a5d73d0344c813275e590940c6ea8bc569da462847103a1afd... Downloading data: 100%|█| 1.89G/1.89G [04:57<00:00, Downloading data files: 100%|█| 1/1 [04:59<00:00, 2 Extracting data files: 100%|█| 1/1 [00:00<00:00, 13 Generating train split: 0 examples [00:00, ? examples/s]<_io.BufferedReader name='/home/bian/.cache/huggingface/datasets/downlo ads/26d7a016d25bbd9443115cfa3092136e8eb2f1f5bcd4154 0cb9234572927f04c'> Traceback (most recent call last): File "/home/bian/data/ZOC/download_laion_coco.py", line 4, in <module> dataset = load_dataset("laion/laion-coco", ignore_verifications=True) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/load.py", line 1791, in load_dataset builder_instance.download_and_prepare( File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 891, in download_and_prepare self._download_and_prepare( File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 986, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 1748, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/builder.py", line 1842, in _prepare_split_single generator = self._generate_tables(**gen_kwargs) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py", line 67, in _generate_tables parquet_file = pq.ParquetFile(f) File "/home/bian/anaconda3/envs/sd/lib/python3.10/site-packages/pyarrow/parquet/core.py", line 323, in __init__ self.reader.open( File "pyarrow/_parquet.pyx", line 1227, in pyarrow._parquet.ParquetReader.open File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Parquet magic bytes not found in footer. Either the file is corrupted or this is not a parquet file . ``` I have carefully followed the instructions in #5264 but still get the same error. Other helpful information: ``` ds = load_dataset("parquet", data_files= ...: "https://huggingface.co/datasets/laion/l ...: aion-coco/resolve/d22869de3ccd39dfec1507 ...: f7ded32e4a518dad24/part-00000-2256f782-1 ...: 26f-4dc6-b9c6-e6757637749d-c000.snappy.p ...: arquet") Found cached dataset parquet (/home/bian/.cache/huggingface/datasets/parquet/default-a02eea00aeb08b0e/0.0.0/bb8ccf89d9ee38581ff5e51506d721a9b37f14df8090dc9b2d8fb4a40957833f) 100%|██████████████| 1/1 [00:00<00:00, 4.55it/s] ``` ### Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset("laion/laion-coco", ignore_verifications=True/False) ``` ### Expected behavior Properly load Laion-coco dataset ### Environment info datasets==2.11.0 torch==1.12.1 python 3.10 This can also mean one of the files was not downloaded correctly. We log an erroneous file's name before raising the reader's error, so this is how you can find the problematic file. Then, you should delete it and call `load_dataset` again. (I checked all the uploaded files, and they seem to be valid Parquet files, so I don't think this is a bug on their side)
[ -0.15487776696681976, -0.20536863803863525, 0.004702802747488022, 0.28530481457710266, 0.23897713422775269, -0.14961321651935577, -0.010635366663336754, 0.2726270854473114, -0.08417070657014847, -0.0020769834518432617, -0.060449421405792236, 0.6115534901618958, -0.060624439269304276, 0.30978482961654663, -0.17548024654388428, 0.04989982396364212, -0.007291331887245178, 0.17123199999332428, 0.23024509847164154, 0.0019138753414154053, -0.23779547214508057, 0.15755946934223175, 0.007896050810813904, 0.11645638942718506, 0.034524235874414444, -0.31728824973106384, -0.22661030292510986, 0.09242218732833862, -0.5408951640129089, -0.47294309735298157, 0.4456937611103058, 0.011240139603614807, 0.28644952178001404, 0.12541793286800385, -0.00010623532580211759, 0.07807016372680664, 0.5441407561302185, -0.08902529627084732, -0.195256307721138, -0.29674047231674194, -0.5597663521766663, -0.3942487835884094, 0.1312566101551056, -0.3221542239189148, 0.16338296234607697, 0.29520994424819946, -0.13588236272335052, -0.045067790895700455, 0.3466789722442627, 0.3782697021961212, 0.26190975308418274, 0.22517147660255432, 0.24584168195724487, -0.0009549148380756378, 0.378614604473114, -0.12808477878570557, -0.10302704572677612, 0.32138147950172424, 0.08951088786125183, -0.0580764003098011, 0.027673840522766113, 0.27633070945739746, 0.07943063229322433, -0.37361711263656616, 0.01147769857198, -0.10492049157619476, 0.20708027482032776, -0.39190390706062317, -0.14094002544879913, 0.1483941674232483, 0.2994803786277771, -0.09057332575321198, -0.35456064343452454, -0.08983178436756134, 0.11353912949562073, -0.7718368768692017, 0.26674842834472656, 0.37409090995788574, -0.14954873919487, -0.006752518471330404, -0.2331901341676712, -0.05451085418462753, -0.004946887493133545, 0.043082863092422485, 0.05620640516281128, 0.23143813014030457, -0.056619904935359955, -0.07317598164081573, 0.23167717456817627, 0.002847125753760338, 0.19119957089424133, -0.03861859068274498, -0.12009705603122711, -0.0038023237138986588, -0.2686809301376343, -0.28205785155296326, -0.014528762549161911, 0.30035635828971863, 0.14780041575431824, 0.2930165231227875, 0.10951842367649078, -0.14752545952796936, -0.015575937926769257, -0.05546831339597702, 0.17364159226417542, 0.43869295716285706, -0.10006355494260788, -0.04316725581884384, 0.11872931569814682, 0.729966402053833, 0.25425124168395996, -0.09058286249637604, -0.04478621110320091, 0.047501515597105026, -0.11860786378383636, 0.04579968750476837, 0.2251579761505127, -0.2714976966381073, -0.3570239543914795, 0.15868812799453735, -0.075693279504776, 0.2238248884677887, 0.1281823366880417, 0.3871776759624481, -0.34985318779945374, 0.12641814351081848, 0.004613988101482391, 0.24828827381134033, 0.014703571796417236, -0.13623279333114624, -0.2036544382572174, 0.17634890973567963, -0.18999630212783813, -0.024110157042741776, 0.014175981283187866, -0.21730971336364746, 0.35924142599105835, 0.17882582545280457, -0.034079600125551224, -0.08008735626935959, 0.033763691782951355, -0.26828548312187195, -0.2033919095993042, 0.11805939674377441, -0.2461947798728943, -0.10887840390205383, 0.22942222654819489, -0.12411487847566605, -0.09255484491586685, -0.06519501656293869, -0.07111147046089172, -0.34265270829200745, 0.0020329877734184265, 0.2765890061855316, -0.26607033610343933, 0.002015600446611643, 0.14268271625041962, -0.010576333850622177, 0.15042254328727722, 0.17559710144996643, -0.009780175983905792, -0.1006988137960434, -0.1164093166589737, -0.1477375477552414, 0.1892223060131073, 0.24895796179771423, 0.05431012064218521, 0.02652934193611145, -0.41396626830101013, -0.15733247995376587, 0.35345110297203064, -0.04863091930747032, -0.1618429720401764, 0.021026477217674255, -0.24900996685028076, -0.19617633521556854, 0.07630802690982819, -0.3820570707321167, -0.3286439776420593, 0.24341925978660583, -0.13280296325683594, 0.3499625623226166, -0.04068869724869728, -0.03299960121512413, -0.14407163858413696, -0.03876480460166931, 0.23759686946868896, -0.03125518187880516, -0.03885796666145325, -0.07315807044506073, -0.5278937816619873, -0.344357430934906, 0.31836944818496704, 0.01930784434080124, 0.054807811975479126, 0.07396788150072098, -0.08359396457672119, 0.332044780254364, 0.3133707046508789, 0.043539680540561676, -0.04109193757176399, 0.1526736617088318, 0.4646117687225342, 0.12242117524147034, -0.29526999592781067, 0.12730589509010315, -0.21858620643615723, 0.17702336609363556, 0.2176867127418518, 0.19129060208797455, -0.4587014317512512, -0.3075040876865387, -0.17260128259658813, 0.1730252057313919, -0.09985139220952988, -0.19431526958942413, 0.22268889844417572, 0.0936155691742897, 0.3055357336997986, 0.12604191899299622, -0.09633368253707886, 0.5437778234481812, -0.2290767878293991, 0.2426520437002182, -0.2364729344844818, 0.09871768206357956, -0.2429071068763733, -0.07298729568719864, 0.24225088953971863, 0.18340809643268585, 0.2509137690067291, -0.13187609612941742, 0.005806241184473038, 0.32343530654907227, 0.09883324801921844, 0.09747587144374847, -0.20040246844291687, -0.3050965666770935, 0.30781102180480957, -0.23599310219287872, 0.05137764662504196, -0.06461222469806671, 0.022267550230026245, 0.21952146291732788, -0.029032327234745026, 0.1884899139404297, -0.15963327884674072, -0.12726448476314545, 0.24711215496063232, -0.035640887916088104, 0.18321481347084045, -0.010527729988098145, -0.0865955725312233, -0.13246001303195953, 0.3627273142337799, 0.017051342874765396, 0.10167312622070312, 0.013879498466849327, -0.4468129277229309, -0.008887853473424911, 0.25568869709968567, 0.05235159397125244, -0.025002513080835342, 0.05689706280827522, 0.20668312907218933, -0.04545663669705391, 0.1440446674823761, 0.3086923360824585, 0.3959004282951355, 0.15747517347335815, -0.05933430790901184, 0.10582763701677322, -0.18000295758247375, -0.16940701007843018, 0.3339895009994507, 0.01599300280213356, 0.29941463470458984, 0.08341702818870544, 0.21994033455848694, 0.11824391782283783, -0.2954822778701782, -0.21389487385749817, 0.09957291930913925, 0.414616197347641, -0.04937141388654709, -0.11360910534858704, -0.2335440218448639, 0.011521793901920319, -0.09149337559938431, -0.21899783611297607, -0.22861994802951813, -0.30988937616348267, -0.023489590734243393, 0.20585401356220245, 0.0208730548620224, 0.02894393354654312, -0.5628068447113037, 0.005978316068649292, -0.002955392003059387, -0.09694213420152664, -0.31408995389938354, -0.043831709772348404, -0.27598509192466736, 0.13422642648220062, 0.09235207736492157, -0.2728227972984314, 0.13897354900836945, -0.19118836522102356, -0.0827491506934166, -0.012320077046751976, -0.430147647857666, 0.12305721640586853, -0.22450529038906097, -0.01898767612874508, 0.336218923330307, 0.0809445008635521, 0.01580473780632019, -0.3781093657016754, 0.23739778995513916, -0.04562823474407196, -0.27291375398635864, -0.04491998255252838, 0.18668922781944275, 0.16187217831611633, -0.4017922282218933, -0.3504786193370819, -0.35254591703414917, -0.39214301109313965, 0.2549787163734436, 0.1655338853597641, -0.01921660825610161, 0.3638671636581421, 0.049231018871068954, 0.2201680839061737, 0.13402725756168365, -0.023801423609256744, -0.16811710596084595, -0.41638630628585815, 0.2356041967868805, -0.15122583508491516, -0.3130321502685547, -0.06340979039669037, -0.19559462368488312, 0.39996615052223206, 0.06361725926399231, -0.5727651119232178, -0.22978314757347107, -0.2292153686285019, 0.14706359803676605, -0.17272035777568817, -0.4902194142341614, 0.1918562650680542, 0.09401640295982361, -0.09934894740581512, -0.1156974658370018, 0.11157438158988953, 0.07158219814300537, -0.18146251142024994, 0.4321109652519226, -0.10686831176280975, 0.39072734117507935, 0.34350132942199707, 0.2639129161834717, 0.18562379479408264, -0.09934636205434799, 0.5776379704475403, 0.04080922156572342, 0.3864721655845642, 0.1265273541212082, -0.14508505165576935, -0.015414318069815636, -0.06715080142021179, -0.12462909519672394, -0.017212066799402237, -0.18972577154636383, -0.18846997618675232, -0.3269195556640625, -0.006079472601413727, -0.02771085500717163, -0.22162869572639465, -0.18135976791381836, 0.24004998803138733, 0.1510750651359558, 0.026559360325336456, 0.08694563060998917, -0.020275384187698364, -0.10350918769836426, 0.18872031569480896, 0.22990721464157104, -0.12694527208805084, -0.10171829164028168, -0.334196537733078, -0.3872663974761963, -0.5768503546714783, 0.06170732155442238, 0.06149967759847641, 0.28188514709472656, 0.09789171814918518, -0.20566602051258087, -0.1847800314426422, -0.18865260481834412, 0.504622220993042, -0.04998752474784851, 0.2466639280319214, 0.042901284992694855, -0.07239605486392975, -0.38593029975891113, -0.1125396341085434, -0.31614363193511963, -0.07868247479200363, 0.28568267822265625, 0.810253381729126, -0.3607228994369507, 0.12222982943058014, 0.11922144889831543, 0.0407579243183136, 0.06692419946193695, 0.06274542957544327, -0.33481478691101074, -0.3739314675331116, -0.23958073556423187, 0.35447245836257935, 0.013154342770576477, 0.533847451210022, -0.3330959975719452, -0.1754084825515747, 0.1409168839454651, 0.19873426854610443, -0.09418116509914398, 0.11524254083633423, 0.11304496228694916, 0.13065677881240845, 0.2147710919380188, -0.1818481683731079, 0.32129910588264465, 0.29620444774627686, 0.4171769618988037, 0.12654396891593933, -0.5414103269577026, -0.19968639314174652, 0.012566626071929932, 0.002788703888654709, 0.20765191316604614, 0.06581789255142212, -0.15121044218540192, -0.12596184015274048, 0.15994620323181152, 0.06290818005800247, 0.2748781740665436, 0.2803894877433777, -0.19018980860710144, -0.38015517592430115, 0.07798322290182114, 0.22481587529182434, -0.0779990702867508, 0.052906811237335205, 0.06648492813110352, -0.17847119271755219, -0.22335000336170197, 0.17634278535842896, 0.21986079216003418, 0.9673250317573547, 0.03806326165795326, -0.15546728670597076, 0.52410888671875, -0.18578970432281494, 0.7209032773971558, -0.3975984752178192, 0.2597419023513794, -0.1592371165752411, -0.5294055342674255, 0.14232376217842102, -0.0017226114869117737, 0.2135067880153656, 0.016856707632541656, -0.33164113759994507, -0.0149175263941288, -0.13341881334781647, 0.10494880378246307, 0.08619491755962372, 0.2433769404888153, -0.2499430924654007, -0.07520344853401184, -0.2853231728076935, 0.2685803472995758, 0.09813672304153442, 0.1994336098432541, -0.20749813318252563, -0.13616281747817993, -0.1799488365650177, -0.2696918547153473, -0.14262431859970093, 0.3255200982093811, -0.2352461814880371, 0.0700666755437851, -0.2655591070652008, 0.10675299167633057, -0.08694241940975189, 0.3069359362125397, 0.3053963780403137, 0.2565351724624634, -0.09749162942171097, 0.10577192902565002, 0.0052041467279195786, -0.23189310729503632, 0.0847095251083374, -0.044739577919244766, 0.0505242645740509, -0.25735771656036377, -0.2448464035987854, 0.11555559188127518, -0.16058149933815002, 0.07200886309146881, 0.32636934518814087, -0.3075440526008606, 0.06945748627185822, -0.13638387620449066, 0.07406187057495117, -0.005760136991739273, 0.16014307737350464, -0.188429594039917, 0.1892978549003601, -0.0785096287727356, -0.21594910323619843, -0.12806420028209686, -0.14079079031944275, -0.37288451194763184, -0.183702290058136, 0.4213292598724365, -0.049184396862983704, 0.3816685676574707, 0.31629031896591187, -0.036608487367630005, -0.12581661343574524, -0.2445911020040512, -0.25169825553894043, -0.23213998973369598, -0.24144040048122406, 0.0020747147500514984, -0.08428075909614563, 0.09013150632381439, -0.13580957055091858, 0.40935370326042175, 0.31311362981796265, 0.1378573179244995, 0.26335617899894714, -0.5009859800338745, -0.26316338777542114, 0.19088761508464813, 0.009136511012911797, 0.2683996558189392, 0.07552710175514221, 0.2718113958835602, 0.1270947903394699, -0.007449006661772728, -0.36941856145858765, -0.07521305978298187, -0.4141747057437897, 0.07093867659568787, 0.2076917439699173, -0.07943429052829742, 0.27015480399131775, 0.052297912538051605, 0.2260718196630478, 0.390363484621048, -0.07763597369194031, -0.24799832701683044, 0.016967788338661194, 0.09023882448673248, 0.22136813402175903, 0.0877760499715805, 0.06281585991382599, 0.03923841565847397, 0.06728783249855042, 0.13092955946922302, -0.08818542957305908, -0.0728025883436203, 0.029207536950707436, 0.0004367902874946594, 0.035612817853689194, 0.3610228896141052, -0.14047344028949738, -0.10436388850212097, 0.0075821708887815475, 0.15579912066459656, 0.09760567545890808, 0.11929425597190857, 0.028764598071575165, -0.0218365341424942, 0.2513141334056854, -0.20680859684944153, -0.2758009433746338, 0.1902257204055786, 0.17178493738174438, -0.06664948165416718, -0.07513513416051865, 0.2164621353149414, 0.030683405697345734, 0.41346949338912964, -0.03658946603536606, -0.1801336109638214, 0.26248887181282043, 0.32842057943344116, -0.31897392868995667, -0.0004004277288913727, 0.04651440307497978, -0.03630327805876732, -0.18955042958259583, 0.27669283747673035, 0.04354067146778107, -0.051081582903862, 0.2063230276107788, 0.03855243697762489, 0.5935812592506409, -0.005225858651101589, 0.42859283089637756, 0.3360736072063446, -0.35240525007247925, -0.0002449527382850647, 0.11488652974367142, -0.12306815385818481, 0.29173874855041504, 0.10208956152200699, -0.22918576002120972, -0.07107183337211609, 0.035284288227558136, 0.16849642992019653, 0.0577346533536911, -0.28940796852111816, -0.22918355464935303, 0.2788386940956116, -0.2606717348098755, -0.046892307698726654, 0.03813626244664192, 0.19787292182445526, -0.034791041165590286, -0.08184398710727692, -0.40284964442253113, 0.3394213616847992, -0.13817057013511658, 0.07250034064054489, -0.1672440767288208, -0.24524861574172974, -0.2895022928714752, 0.24210111796855927, 0.15126731991767883, -0.060137663036584854, 0.20222243666648865, 0.0737868919968605, -0.1647811233997345, -0.2873619794845581, -0.15350136160850525, 0.3667319416999817, 0.16511008143424988, -0.4184558093547821, 0.22546230256557465, 0.09797526895999908, -0.26443684101104736, -0.1311446726322174, 0.09893304109573364, 0.23873069882392883, 0.2902928590774536, 0.17272867262363434, 0.10450854897499084, 0.14161476492881775, 0.03163047134876251, -0.11920909583568573, 0.18868443369865417, 0.5572324991226196, 0.38358139991760254, 0.33014851808547974, 0.214289590716362, -0.2573789656162262, -0.016920121386647224, 0.08509865403175354, -0.015355730429291725, -0.1821388453245163, 0.2940109968185425, 0.23422226309776306, 0.014141492545604706, -0.19400958716869354, 0.1626824140548706, -0.24475011229515076, 0.24977350234985352, -0.07827329635620117, 0.03140319138765335, 0.2024812400341034, -0.07485000044107437, 0.12178102135658264, -0.14401833713054657, 0.21334969997406006, 0.37698259949684143, -0.4260251522064209, -0.27143245935440063, -0.44297295808792114, -0.4412631094455719, 0.3065304160118103, -0.06990799307823181, -0.20057061314582825, -0.04087206721305847, 0.0069069936871528625, -0.1252218633890152, 0.2537592351436615, -0.21839068830013275, 0.21728244423866272, 0.14990094304084778, 0.0793418139219284, -0.2277328073978424, 0.17727777361869812, 0.040419843047857285, -0.0690557062625885, 0.08179092407226562, -0.24633558094501495, 0.17802327871322632, -0.10240202397108078, 0.13600212335586548, 0.09539896249771118, -0.189337357878685, -0.23920275270938873, -0.2581064999103546, 0.7553983926773071, 0.13437983393669128, 0.15385091304779053, -0.022628337144851685, -0.338055819272995, -0.1763984113931656, -0.06558622419834137, -0.15980152785778046, 0.39506399631500244, 0.027388732880353928, 0.12672840058803558, -0.10495355725288391, 0.3990633487701416, -0.45954737067222595, 0.6067324876785278, 0.3019903898239136, -0.239789217710495, -0.013242349028587341, -0.038617685437202454, 0.021662697196006775, -0.15384027361869812, 0.171031653881073, 0.25602564215660095, -0.036656226962804794, 0.1129644364118576, -0.23927432298660278, -0.4325621426105499, 0.26285338401794434, -0.5577970743179321, -0.15533089637756348, 0.14279016852378845, 0.18009021878242493, 0.2502572238445282, -0.264350950717926, -0.24534136056900024, 0.10437451303005219, 0.25524741411209106, 0.009321479126811028, -0.3113737106323242, 0.06594082713127136, -0.04967592656612396, -0.06560599058866501, 0.016537413001060486, 0.2830211818218231, -0.056718118488788605, -0.26335251331329346, 0.23545438051223755, -0.14513370394706726 ]
https://github.com/huggingface/datasets/issues/6057
Hi! It's hard to explain this behavior without more information. Can you profile the slower version with the following code ```python import cProfile, pstats from datasets import load_dataset with cProfile.Profile() as profiler: ds = load_dataset(...) stats = pstats.Stats(profiler).sort_stats("cumtime") stats.print_stats() ``` and share the output?
Why is the speed difference of gen example so big?
```python def _generate_examples(self, metadata_path, images_dir, conditioning_images_dir): with open(metadata_path, 'r') as file: metadata = json.load(file) for idx, item in enumerate(metadata): image_path = item.get('image_path') text_content = item.get('text_content') image_data = open(image_path, "rb").read() yield idx, { "text": text_content, "image": { "path": image_path, "bytes": image_data, }, "conditioning_image": { "path": image_path, "bytes": image_data, }, } ``` Hello, I use the above function to deal with my local data set, but I am very surprised that the speed at which I generate example is very different. When I start a training task, **sometimes 1000examples/s, sometimes only 10examples/s.** ![image](https://github.com/huggingface/datasets/assets/46072190/cdc17661-8267-4fd8-b30c-b74d505efd9b) I'm not saying that speed is changing all the time. I mean, the reading speed is different in different training, which will cause me to start training over and over again until the speed of this generation of examples is normal.
44
Why is the speed difference of gen example so big? ```python def _generate_examples(self, metadata_path, images_dir, conditioning_images_dir): with open(metadata_path, 'r') as file: metadata = json.load(file) for idx, item in enumerate(metadata): image_path = item.get('image_path') text_content = item.get('text_content') image_data = open(image_path, "rb").read() yield idx, { "text": text_content, "image": { "path": image_path, "bytes": image_data, }, "conditioning_image": { "path": image_path, "bytes": image_data, }, } ``` Hello, I use the above function to deal with my local data set, but I am very surprised that the speed at which I generate example is very different. When I start a training task, **sometimes 1000examples/s, sometimes only 10examples/s.** ![image](https://github.com/huggingface/datasets/assets/46072190/cdc17661-8267-4fd8-b30c-b74d505efd9b) I'm not saying that speed is changing all the time. I mean, the reading speed is different in different training, which will cause me to start training over and over again until the speed of this generation of examples is normal. Hi! It's hard to explain this behavior without more information. Can you profile the slower version with the following code ```python import cProfile, pstats from datasets import load_dataset with cProfile.Profile() as profiler: ds = load_dataset(...) stats = pstats.Stats(profiler).sort_stats("cumtime") stats.print_stats() ``` and share the output?
[ -0.20529882609844208, -0.3432773947715759, -0.09249883890151978, 0.2385820597410202, 0.2068561315536499, 0.049263812601566315, 0.26420408487319946, 0.32078856229782104, -0.2661501467227936, 0.2926473617553711, 0.5328456163406372, 0.21491041779518127, -0.043615199625492096, 0.10802309215068817, -0.18307211995124817, -0.3868451714515686, 0.22690072655677795, 0.16428977251052856, -0.12168622016906738, -0.25882720947265625, 0.05786551535129547, -0.01905481144785881, -0.14793197810649872, -0.09008581936359406, -0.17056915163993835, -0.06558884680271149, 0.20518901944160461, 0.00901325698941946, -0.22900283336639404, -0.3079967796802521, 0.0288127139210701, -0.14590241014957428, 0.12953440845012665, 0.47516465187072754, -0.00012132641859352589, 0.0908200815320015, 0.2897564470767975, 0.07786580175161362, -0.28383907675743103, -0.070725217461586, 0.14413604140281677, 0.020824521780014038, -0.02859913744032383, -0.2296665906906128, -0.06843657046556473, -0.27725833654403687, 0.08733228594064713, -0.2837848663330078, 0.23441796004772186, 0.11991629004478455, 0.10227726399898529, 0.03543459624052048, -0.48056450486183167, 0.024460922926664352, 0.1960984766483307, 0.4710928201675415, -0.39563485980033875, 0.30094534158706665, 0.09031841158866882, -0.04675816744565964, -0.041463933885097504, 0.23974718153476715, 0.001895017921924591, 0.2771681845188141, 0.3752955198287964, 0.2047756463289261, 0.31945744156837463, 0.06079999357461929, -0.01631302386522293, 0.46078911423683167, 0.272599458694458, 0.1776922047138214, -0.3443892002105713, -0.2711447477340698, -0.2549285590648651, -0.28515976667404175, -0.10423552244901657, 0.26401299238204956, -0.3617183268070221, -0.0538882240653038, -0.7276851534843445, 0.3080611228942871, -0.15109021961688995, 0.040892593562603, 0.19816657900810242, 0.030214956030249596, -0.04376871883869171, 0.18496739864349365, 0.2895275354385376, 0.06897018849849701, 0.2699654698371887, -0.4208589196205139, 0.1925792247056961, 0.12800979614257812, 0.08569464087486267, -0.1085883155465126, 0.002437351271510124, -0.2074327915906906, -0.044677574187517166, 0.06851401925086975, 0.0931972935795784, -0.07083479315042496, 0.018515799194574356, -0.018378151580691338, -0.07227586209774017, 0.2766759693622589, -0.04576799273490906, 0.19323870539665222, -0.032139651477336884, 0.3323453366756439, -0.47364968061447144, 0.1729508489370346, 0.07262416183948517, -0.12668967247009277, 0.16458213329315186, -0.1377021074295044, -0.32954561710357666, -0.13470767438411713, -0.3779008984565735, 0.047138627618551254, -0.6401582360267639, -0.20026257634162903, -0.011387934908270836, 0.022496744990348816, -0.2784406244754791, -0.02445799857378006, -0.04220300912857056, 0.17523393034934998, -0.3503195643424988, 0.08901965618133545, -0.23412154614925385, -0.06490987539291382, -0.046846434473991394, 0.3981722891330719, -0.15730446577072144, 0.0801190584897995, 0.3337746858596802, 0.23869960010051727, -0.04495132341980934, 0.15008114278316498, 0.6041497588157654, -0.3454263210296631, 0.10906185209751129, -0.06346775591373444, -0.30507248640060425, 0.2249651402235031, 0.04475408047437668, 0.031036995351314545, -0.2726577818393707, 0.11376694589853287, -0.07872738689184189, -0.34187573194503784, 0.27405571937561035, 0.07674507796764374, -0.17503777146339417, -0.02302480675280094, -0.19336773455142975, 0.3922954797744751, -0.26392635703086853, -0.07981976866722107, 0.013663936406373978, -0.06560923904180527, -0.5163552165031433, -0.1585233509540558, 0.11228485405445099, 0.235923632979393, -0.07042092829942703, -0.06305696070194244, 0.11198137700557709, 0.31849873065948486, 0.43536117672920227, 0.3387717306613922, -0.39320603013038635, 0.2502804398536682, -0.17315514385700226, -0.23038643598556519, 0.39318639039993286, -0.28582048416137695, 0.010667107999324799, 0.6612653732299805, -0.0482783317565918, 0.29679760336875916, 0.434225857257843, -0.0156107097864151, 0.09782424569129944, -0.32564517855644226, -0.025443226099014282, 0.5316306948661804, 0.23363114893436432, 0.21801750361919403, -0.3605808615684509, -0.3174096345901489, 0.09878407418727875, 0.0337277427315712, -0.5166739225387573, 0.14764900505542755, -0.03090188279747963, -0.06530077010393143, 0.5358562469482422, -0.3311828374862671, -0.16557565331459045, 0.3136575520038605, 0.23174940049648285, -0.14747107028961182, -0.01793523132801056, 0.3193310499191284, 0.005227625370025635, 0.20182862877845764, 0.027537137269973755, 0.08453573286533356, 0.2465798407793045, 0.031537190079689026, -0.1032748818397522, -0.1761889010667801, -0.028637822717428207, -0.29290980100631714, 0.020976126194000244, -0.07892999053001404, 0.463514506816864, -0.06278980523347855, 0.4031832814216614, 0.16396783292293549, -0.29886364936828613, -0.09032166004180908, -0.3360387980937958, 0.04848766326904297, 0.3408481180667877, -0.14332324266433716, -0.128653883934021, -0.23290975391864777, -0.15386028587818146, -0.11909481137990952, -0.4815046787261963, 0.20927748084068298, 0.2919481098651886, 0.34718894958496094, 0.21507135033607483, 0.15763770043849945, -0.008327944204211235, 0.017488054931163788, 0.3014411926269531, 0.1333165466785431, -0.004360523074865341, 0.02369837462902069, -0.611149787902832, 0.5663591623306274, 0.31874871253967285, 0.3390655815601349, 0.17700527608394623, -0.47564423084259033, -0.05450849235057831, 0.11751480400562286, -0.08960078656673431, 0.04390206187963486, 0.3592694401741028, 0.39865678548812866, 0.3479410409927368, 0.1524561494588852, -0.18858808279037476, 0.15539583563804626, 0.4061821699142456, -0.2435789406299591, -0.41287317872047424, 0.23070627450942993, -0.010129719972610474, -0.3260203003883362, 0.05653345584869385, 0.15313836932182312, 0.7508707642555237, 0.0016423389315605164, 0.22728976607322693, 0.02145722322165966, -0.12258466333150864, -0.05035378783941269, 0.3192189931869507, -0.03228166699409485, 0.40204307436943054, -0.3389255404472351, 0.20434865355491638, 0.06382202357053757, -0.28383713960647583, -0.2533768117427826, -0.056882843375205994, 0.37837886810302734, 0.12599864602088928, 0.45281702280044556, -0.07798629999160767, 0.32891029119491577, -0.25047850608825684, 0.07427360117435455, 0.11895473301410675, -0.019807998090982437, -0.19612959027290344, 0.1100999265909195, 0.22409822046756744, -0.25812724232673645, 0.23047608137130737, -0.13684597611427307, -0.0017851218581199646, -0.16383348405361176, -0.04461769387125969, 0.027514267712831497, -0.46602433919906616, -0.022571872919797897, 0.09941865503787994, 0.2942677438259125, 0.05568192899227142, -0.3423824906349182, -0.3294084072113037, 0.009749643504619598, -0.4420345425605774, -0.07292678952217102, 0.07587985694408417, 0.5220247507095337, 0.0867135226726532, 0.1273784190416336, -0.1917075216770172, -0.0911642462015152, 0.19054687023162842, -0.270809531211853, -0.25209659337997437, -0.13325193524360657, -0.37947794795036316, 0.2924080193042755, 0.06946492940187454, -0.04041241109371185, 0.001903800293803215, -0.10390456765890121, 0.440674751996994, 0.2869488596916199, 0.11036776751279831, 0.2984849810600281, 0.1300368458032608, -0.04961918666958809, 0.24479055404663086, 0.37679874897003174, -0.19000160694122314, -0.7350786924362183, 0.03463117778301239, -0.2476157397031784, -0.07380052655935287, -0.5117011666297913, -0.28575897216796875, 0.12097285687923431, 0.2654034197330475, -0.5609097480773926, -0.25411877036094666, -0.6531519293785095, 0.18801167607307434, -0.28108149766921997, -0.013575393706560135, 0.13502688705921173, -0.12185753881931305, -0.041720569133758545, -0.14304721355438232, -0.0859636589884758, -0.041535574942827225, 0.016433585435152054, 0.057363927364349365, -0.18678942322731018, 0.2526779770851135, -0.041939154267311096, 0.48447853326797485, 0.4196361303329468, -0.3678358197212219, -0.05941106751561165, -0.009194531477987766, -0.12595103681087494, -0.4184323251247406, 0.25800615549087524, 0.1764853447675705, 0.03079967200756073, -0.32480767369270325, 0.034155040979385376, 0.013227995485067368, -0.14855602383613586, -0.022280655801296234, 0.0839647650718689, -0.08971623331308365, -0.19706624746322632, 0.03575745224952698, -0.048230353742837906, 0.12206190079450607, 0.04036404937505722, 0.2251434624195099, -0.46278756856918335, -0.022106725722551346, -0.01754678785800934, 0.10870678722858429, 0.2628375291824341, 0.052969880402088165, -0.45663344860076904, -0.1845518946647644, -0.21914568543434143, -0.0033397451043128967, 0.1746635138988495, -0.09846091270446777, 0.21584966778755188, -0.20448482036590576, 0.39662379026412964, 0.005193985998630524, 0.40872901678085327, -0.22355881333351135, -0.017104171216487885, -0.08658023178577423, -0.31901252269744873, -0.41558295488357544, -0.1843450963497162, -0.17196673154830933, -0.0012590624392032623, 0.24297639727592468, 0.7056465744972229, -0.0669875219464302, -0.4081957936286926, 0.39632025361061096, 0.4817972183227539, 0.33274737000465393, -0.22881726920604706, -0.2931652069091797, -0.14856579899787903, 0.20880353450775146, -0.06607837975025177, -0.44116973876953125, 0.15746672451496124, -0.2624850869178772, -0.17788295447826385, -0.15004605054855347, 0.3392128646373749, 0.03252405300736427, 0.26043176651000977, 0.2809804379940033, -0.010929368436336517, 0.36780834197998047, 0.22229447960853577, -0.24957141280174255, -0.07350359857082367, 0.11230917274951935, 0.07890135049819946, 0.05377694219350815, -0.005389263853430748, 0.271543025970459, -0.25385725498199463, 0.5091025829315186, 0.15475285053253174, -0.0498373880982399, -0.03996141999959946, 0.2650928497314453, -0.18470333516597748, 0.04108988866209984, 0.6644743084907532, 0.061439670622348785, -0.07940821349620819, -0.7278594374656677, 0.6203233599662781, 0.5127935409545898, -0.09597167372703552, 0.2912047207355499, -0.6081721782684326, 0.20857024192810059, 0.21392202377319336, 0.06155823916196823, 0.7920982837677002, 0.04384661465883255, 0.35329192876815796, 0.34237363934516907, 0.05145391821861267, 0.2600758373737335, 0.0777437835931778, 0.0926971286535263, -0.25045856833457947, -0.30286020040512085, 0.1495044231414795, -0.29523998498916626, 0.31121084094047546, 0.1579277068376541, -0.022434614598751068, 0.05772155523300171, -0.14229817688465118, -0.011028800159692764, -0.20977279543876648, 0.030943259596824646, -0.11643606424331665, -0.0018145088106393814, -0.27411824464797974, -0.01668904349207878, 0.24691247940063477, 0.18883946537971497, 0.12019677460193634, -0.22806347906589508, -0.5834856629371643, -0.008506730198860168, -0.09066501259803772, -0.19118013978004456, -0.15846015512943268, 0.2638622522354126, 0.2738145589828491, -0.6233022212982178, -0.12883946299552917, 0.1897839903831482, 0.17435556650161743, 0.10821659862995148, -0.022640999406576157, 0.1955936849117279, -0.09121228009462357, 0.37653833627700806, 0.2663915753364563, -0.4464002847671509, 0.24750886857509613, -0.11483893543481827, -0.13164524734020233, -0.053321920335292816, -0.41441014409065247, 0.08129444718360901, -0.2885870933532715, -0.02751762792468071, -0.16573409736156464, 0.05844230204820633, -0.13690942525863647, 0.16679659485816956, -0.1692749559879303, -0.12843400239944458, 0.06070346385240555, 0.0840570330619812, -0.09837479889392853, 0.43192803859710693, -0.08332516252994537, -0.5684735774993896, -0.02910883165895939, 0.18397296965122223, 0.29044872522354126, 0.10924974083900452, 0.4684309661388397, -0.2667027711868286, 0.04281143844127655, -0.07212038338184357, 0.4877130389213562, 0.07594525814056396, -0.2713932991027832, 0.2857750952243805, -0.035850994288921356, 0.027174144983291626, 0.30554503202438354, 0.19273845851421356, -0.1950104683637619, 0.13744033873081207, -0.12712112069129944, -0.004612267017364502, -0.1622922271490097, -0.23691798746585846, -0.14915145933628082, 0.007521515246480703, -0.24513116478919983, -0.0649842768907547, -0.049519531428813934, -0.043231964111328125, -0.19106367230415344, 0.23186998069286346, 0.006179004907608032, 0.06461252272129059, -0.06486330181360245, -0.15957553684711456, 0.42162322998046875, 0.20223534107208252, 0.09747208654880524, 0.050371650606393814, -0.23196546733379364, -0.13647039234638214, -0.35445451736450195, 0.1666436344385147, -0.1801883578300476, -0.26186805963516235, 0.29472243785858154, 0.23370563983917236, 0.05107063427567482, -0.037079259753227234, 0.14226774871349335, 0.12047980725765228, 0.07761742174625397, 0.00818876177072525, -0.18874919414520264, 0.2134053111076355, 0.030996717512607574, -0.0441974401473999, -0.39256641268730164, 0.3932928144931793, 0.07207556813955307, 0.052288755774497986, 0.28355440497398376, -0.27398523688316345, -0.2568889260292053, -0.1107216477394104, -0.38670530915260315, 0.12043622881174088, 0.15281730890274048, -0.04413747042417526, 0.23120832443237305, -0.1098596453666687, 0.10425038635730743, 0.46422863006591797, 0.048952434211969376, -0.12779393792152405, 0.1359025239944458, 0.11098122596740723, 0.11409096419811249, -0.3255152702331543, -0.07907631248235703, -0.06388118118047714, 0.20060127973556519, 0.2457256317138672, 0.01967771351337433, 0.2791125476360321, -0.09393543004989624, -0.3755297064781189, 0.14023128151893616, 0.007672617211937904, 0.11889167875051498, 0.6737570762634277, 0.2731773853302002, -0.12283892929553986, -0.023887965828180313, 0.08734025061130524, 0.2699283957481384, 0.07991927117109299, 0.23322558403015137, 0.319411039352417, -0.04874087870121002, 0.07133390009403229, -0.055067241191864014, -0.3345828354358673, 0.041304703801870346, 0.3441240191459656, -0.4221808612346649, 0.11432072520256042, -0.032685503363609314, 0.3818528950214386, -0.0572638101875782, 0.04026833921670914, -0.19409453868865967, -0.08426547050476074, 0.2583141624927521, -0.4000912010669708, -0.15420156717300415, 0.0555729866027832, -0.2156064808368683, 0.19169363379478455, -0.23489850759506226, 0.06944331526756287, 0.19219821691513062, -0.053533755242824554, 0.2215004414319992, -0.011471502482891083, -0.1182025671005249, -0.21026119589805603, 0.32899153232574463, 0.035243064165115356, -0.013111948035657406, 0.022508956491947174, -0.20111475884914398, 0.01932958886027336, 0.10270295292139053, 0.45435282588005066, 0.1630426049232483, 0.03672207146883011, 0.04752036929130554, 0.02929133176803589, -0.05544324591755867, 0.019250690937042236, 0.04613243788480759, 0.11349287629127502, -0.2065388262271881, 0.121869295835495, -0.026566296815872192, -0.20137424767017365, 0.2493787705898285, -0.02529950812458992, -0.053362879902124405, -0.4651040732860565, 0.08441608399152756, -0.2485186904668808, 0.17037639021873474, -0.20966623723506927, 0.1856115162372589, -0.22050818800926208, 0.04289376363158226, -0.10116924345493317, -0.02729383483529091, 0.06372793018817902, 0.062389444559812546, -0.004512622952461243, -0.40748023986816406, 0.5165233612060547, 0.0416366308927536, 0.3064759373664856, -0.10443547368049622, -0.14626139402389526, -0.1596473902463913, -0.08893264830112457, -0.5015447735786438, 0.15333819389343262, 0.04225559160113335, 0.27314507961273193, -0.017560817301273346, 0.09511888027191162, 0.1948651373386383, 0.2577345073223114, -0.2444559633731842, 0.4895918369293213, -0.22459325194358826, -0.18409134447574615, -0.19513405859470367, -0.13345426321029663, -0.20653103291988373, -0.4389227032661438, 0.13892939686775208, -0.14263933897018433, 0.019167460501194, -0.08883578330278397, 0.16319583356380463, 0.16561031341552734, 0.3971683382987976, 0.42984455823898315, 0.2432103157043457, 0.004572823643684387, -0.11991523951292038, -0.5304661989212036, -0.1573333442211151, 0.2193300426006317, 0.0005001537501811981, 0.31649550795555115, 0.007918434217572212, 0.2669508457183838, -0.14324109256267548, -0.03449083864688873, 0.08651234209537506, 0.3672931492328644, 0.026568546891212463, -0.4549596309661865, -0.18364453315734863, 0.17990778386592865, -0.2702321410179138, 0.15140238404273987, 0.07085879147052765, 0.30945974588394165, 0.056173015385866165, -0.24900281429290771, -0.22523421049118042, 0.027479834854602814, 0.5451722145080566, -0.3527749180793762, -0.01880393549799919, -0.2764955759048462, -0.07314907759428024, 0.0009454116225242615, -0.026787545531988144, -0.05587545782327652, 0.15594860911369324, 0.34419339895248413, -0.0231865756213665, 0.016639135777950287, 0.525915801525116, 0.33844444155693054, -0.014144659042358398, 0.22289904952049255, 0.3095562160015106, -0.14245499670505524, -0.1382731795310974, 0.2796635031700134, -0.15022608637809753 ]
https://github.com/huggingface/datasets/issues/6051
Hi! `_select_contiguous` fetches a (zero-copy) slice of the dataset's Arrow table to build a shard, so I don't think this part is the problem. To me, the issue seems to be the step where we embed external image files' bytes (a lot of file reads). You can use `.map` with multiprocessing to perform this step before `push_to_hub` in a faster manner and cache it to disk: ```python from datasets.table import embed_table_storage # load_dataset(...) format = dataset.format dataset = dataset.with_format("arrow") dataset = dataset.map(embed_table_storage, batched=True) dataset = dataset.with_format(**format) # push_to_hub(...) ``` (In Datasets 3.0, these external bytes will be written to an Arrow file when generating a dataset to avoid this "embed" step)
Skipping shard in the remote repo and resume upload
### Describe the bug For some reason when I try to resume the upload of my dataset, it is very slow to reach the index of the shard from which to resume the uploading. From my understanding, the problem is in this part of the code: arrow_dataset.py ```python for index, shard in logging.tqdm( enumerate(itertools.chain([first_shard], shards_iter)), desc="Pushing dataset shards to the dataset hub", total=num_shards, disable=not logging.is_progress_bar_enabled(), ): shard_path_in_repo = path_in_repo(index, shard) # Upload a shard only if it doesn't already exist in the repository if shard_path_in_repo not in data_files: ``` In particular, iterating the generator is slow during the call: ```python self._select_contiguous(start, length, new_fingerprint=new_fingerprint) ``` I wonder if it is possible to avoid calling this function for shards that are already uploaded and just start from the correct shard index. ### Steps to reproduce the bug 1. Start the upload ```python dataset = load_dataset("imagefolder", data_dir=DATA_DIR, split="train", drop_labels=True) dataset.push_to_hub("repo/name") ``` 2. Stop and restart the upload after hundreds of shards ### Expected behavior Skip the uploaded shards faster. ### Environment info - `datasets` version: 2.5.1 - Platform: Linux-4.18.0-193.el8.x86_64-x86_64-with-glibc2.17 - Python version: 3.8.16 - PyArrow version: 12.0.1 - Pandas version: 2.0.2
111
Skipping shard in the remote repo and resume upload ### Describe the bug For some reason when I try to resume the upload of my dataset, it is very slow to reach the index of the shard from which to resume the uploading. From my understanding, the problem is in this part of the code: arrow_dataset.py ```python for index, shard in logging.tqdm( enumerate(itertools.chain([first_shard], shards_iter)), desc="Pushing dataset shards to the dataset hub", total=num_shards, disable=not logging.is_progress_bar_enabled(), ): shard_path_in_repo = path_in_repo(index, shard) # Upload a shard only if it doesn't already exist in the repository if shard_path_in_repo not in data_files: ``` In particular, iterating the generator is slow during the call: ```python self._select_contiguous(start, length, new_fingerprint=new_fingerprint) ``` I wonder if it is possible to avoid calling this function for shards that are already uploaded and just start from the correct shard index. ### Steps to reproduce the bug 1. Start the upload ```python dataset = load_dataset("imagefolder", data_dir=DATA_DIR, split="train", drop_labels=True) dataset.push_to_hub("repo/name") ``` 2. Stop and restart the upload after hundreds of shards ### Expected behavior Skip the uploaded shards faster. ### Environment info - `datasets` version: 2.5.1 - Platform: Linux-4.18.0-193.el8.x86_64-x86_64-with-glibc2.17 - Python version: 3.8.16 - PyArrow version: 12.0.1 - Pandas version: 2.0.2 Hi! `_select_contiguous` fetches a (zero-copy) slice of the dataset's Arrow table to build a shard, so I don't think this part is the problem. To me, the issue seems to be the step where we embed external image files' bytes (a lot of file reads). You can use `.map` with multiprocessing to perform this step before `push_to_hub` in a faster manner and cache it to disk: ```python from datasets.table import embed_table_storage # load_dataset(...) format = dataset.format dataset = dataset.with_format("arrow") dataset = dataset.map(embed_table_storage, batched=True) dataset = dataset.with_format(**format) # push_to_hub(...) ``` (In Datasets 3.0, these external bytes will be written to an Arrow file when generating a dataset to avoid this "embed" step)
[ -0.37916725873947144, 0.050338298082351685, 0.09748844802379608, -0.04825657233595848, 0.0023998524993658066, -0.2192309945821762, 0.3753833770751953, 0.14875097572803497, -0.31085875630378723, 0.21819648146629333, 0.3058130443096161, 0.35616397857666016, 0.168587327003479, -0.14990901947021484, 0.006437409669160843, 0.10368353128433228, -0.07220559567213058, 0.19826672971248627, 0.06753405928611755, -0.3354041278362274, -0.23867186903953552, -0.13017749786376953, -0.22051560878753662, -0.10501468181610107, -0.19179463386535645, -0.05285792797803879, 0.26170864701271057, 0.4899827539920807, 0.12371708452701569, -0.1780560463666916, 0.3291616439819336, 0.06668885052204132, -0.045283228158950806, 0.20339907705783844, -0.00013153962208889425, 0.030507639050483704, 0.3061808943748474, -0.0223049595952034, -0.0931025892496109, 0.12928719818592072, -0.3902130424976349, 0.06908413767814636, -0.07806713134050369, -0.35901331901550293, 0.11118124425411224, 0.2647044062614441, 0.0062773749232292175, -0.047562651336193085, 0.08632456511259079, -0.10147972404956818, -0.024293556809425354, 0.34963539242744446, -0.172193706035614, -0.018620675429701805, 0.26178842782974243, 0.2782246768474579, -0.09691058844327927, 0.28093579411506653, 0.2297539860010147, 0.19835227727890015, -0.19519095122814178, 0.38167715072631836, -0.37152454257011414, 0.2381310760974884, -0.021854504942893982, 0.008465658873319626, 0.10850021243095398, -0.07012498378753662, 0.06671220064163208, 0.0855388268828392, 0.0326862670481205, -0.06929684430360794, -0.32681241631507874, -0.2611367106437683, -0.05794648826122284, -0.6687776446342468, 0.24140894412994385, -0.188992440700531, -0.2216159701347351, 0.24602657556533813, -0.17905908823013306, -0.24691474437713623, 0.013045623898506165, 0.0689031183719635, 0.16610807180404663, -0.1870868057012558, 0.27418389916419983, 0.08819164335727692, 0.06579594314098358, 0.0991082414984703, -0.12394464015960693, -0.12267442047595978, 0.27583828568458557, -0.00044127926230430603, -0.4796256721019745, -0.022571153938770294, 0.21988007426261902, -0.029476933181285858, 0.09809407591819763, 0.6454092860221863, -0.14463314414024353, 0.26762083172798157, 0.2168571949005127, 0.023235835134983063, 0.12660187482833862, -0.14276883006095886, -0.06810887157917023, 0.27285972237586975, 0.2373184859752655, 0.1778414249420166, -0.014912180602550507, 0.047944750636816025, -0.026853159070014954, -0.2830369472503662, 0.3757820427417755, 0.24065163731575012, 0.2974235415458679, -0.0593549907207489, -0.0932810977101326, -0.03799380362033844, -0.17479270696640015, -0.11309037357568741, 0.05684222653508186, 0.1463182419538498, 0.11523573845624924, -0.11697757244110107, -0.5092552304267883, 0.10168345272541046, -0.39076870679855347, -0.23062434792518616, -0.020202774554491043, -0.07020283490419388, -0.05442195013165474, 0.27261391282081604, 0.091241255402565, -0.2112971544265747, 0.01276736706495285, 0.06231343373656273, 0.6031613349914551, 0.27672797441482544, 0.3480810523033142, -0.09001416712999344, 0.1838912069797516, 0.30397719144821167, -0.08536110818386078, 0.34808671474456787, 0.1656491756439209, -0.2572823762893677, -0.2373301237821579, 0.4679039418697357, -0.1931057870388031, -0.5917116403579712, 0.03272932022809982, -0.11661627143621445, -0.10907649248838425, 0.05152516812086105, -0.6531387567520142, -0.2790509760379791, 0.12065991759300232, 0.040279775857925415, 0.08621327579021454, 0.05067204311490059, -0.2118501514196396, -0.19280782341957092, 0.36011332273483276, 0.48108962178230286, -0.4101935625076294, -0.022151470184326172, -0.3223768472671509, 0.12646757066249847, 0.47132056951522827, 0.4305627644062042, -0.29458969831466675, 0.04404748976230621, -0.41049259901046753, 0.5247135758399963, 0.28796425461769104, -0.22558633983135223, -0.5721176266670227, 0.039295557886362076, -0.48435258865356445, 0.32388877868652344, 0.15673969686031342, 0.13182419538497925, 0.13671186566352844, -0.12546196579933167, -0.004781585186719894, 0.3936070501804352, -0.18206040561199188, 0.001715727150440216, -0.31898370385169983, -0.009443134069442749, 0.011900968849658966, 0.26334095001220703, 0.20262403786182404, 0.05922721326351166, 0.059776149690151215, -0.38970747590065, 0.3126400411128998, 0.0005275392904877663, 0.013343516737222672, 0.05199349299073219, 0.507081151008606, -0.5280715227127075, 0.10874025523662567, -0.027055256068706512, -0.25525104999542236, 0.38179558515548706, 0.33905619382858276, -0.18038329482078552, -0.3452441394329071, -0.09034083783626556, -0.18540361523628235, -0.0512537956237793, -0.30155158042907715, 0.37874677777290344, -0.13737529516220093, 0.00687282532453537, -0.014863774180412292, 0.12188079953193665, -0.17054125666618347, -0.08840154111385345, -0.5698513388633728, 0.1645531952381134, -0.2536315321922302, 0.5751935243606567, 0.31777524948120117, -0.07245305180549622, -0.15342582762241364, -0.19951176643371582, 0.2012120485305786, -0.34820812940597534, 0.030093852430582047, 0.3512898087501526, -0.012870622798800468, 0.5196890830993652, 0.3709699213504791, 0.11189065873622894, 0.01981428824365139, -0.10645736008882523, -0.14318469166755676, -0.08530187606811523, -0.06504832953214645, -0.09259583055973053, 0.1294752061367035, 0.5261217355728149, -0.3205982446670532, 0.45225998759269714, 0.07392320781946182, -0.07035759091377258, 0.31199318170547485, -0.3051133155822754, -0.1915167272090912, -0.006131939589977264, 0.2697067856788635, 0.364821195602417, -0.18960276246070862, 0.09061284363269806, -0.3023585081100464, 0.2800285220146179, 0.5543308258056641, -0.1046583354473114, -0.0799066424369812, 0.22055533528327942, 0.1772354394197464, -0.017236050218343735, 0.02713858149945736, 0.5404200553894043, 0.34878575801849365, -0.0479559451341629, 0.12723201513290405, -0.3816000521183014, -0.07951062172651291, -0.1905898004770279, 0.08392742276191711, 0.165553018450737, -0.013910401612520218, 0.2760903835296631, 0.09724929928779602, -0.1240324079990387, -0.2392222285270691, -0.037939056754112244, 0.1593766212463379, 0.025502821430563927, 0.010599017143249512, 0.14770299196243286, -0.34348592162132263, 0.14981989562511444, -0.06780563294887543, -0.025899888947606087, -0.22826793789863586, -0.23995769023895264, -0.027416903525590897, 0.05088140815496445, -0.07822834700345993, 0.39767545461654663, 0.33281409740448, 0.057491570711135864, -0.07592233270406723, -0.5630615949630737, -0.14521926641464233, -0.08924385905265808, 0.21376724541187286, -0.12471278756856918, 0.4185417890548706, 0.3350202739238739, 0.30616894364356995, -0.1365841031074524, -0.15892434120178223, -0.4925885498523712, 0.07764080911874771, 0.09429776668548584, 0.08561964333057404, 0.21924914419651031, -0.1057567372918129, 0.034262631088495255, -0.19161100685596466, 0.0565585121512413, 0.25269198417663574, 0.04997234791517258, -0.021165411919355392, 0.30399584770202637, -0.23809510469436646, 0.28339242935180664, 0.198584645986557, 0.03046495094895363, -0.011287018656730652, -0.16362303495407104, 0.07614748179912567, 0.27502620220184326, 0.10867879539728165, -0.12696395814418793, -0.15408571064472198, -0.07867055386304855, -0.1359664797782898, -0.2505670487880707, 0.03547816723585129, -0.49920207262039185, 0.4371092617511749, 0.024475418031215668, -0.022025732323527336, -0.00649561733007431, -0.3170781135559082, 0.03262236341834068, 0.49684205651283264, -0.5602250099182129, -0.17755374312400818, -0.282866507768631, 0.2638385593891144, 0.010496735572814941, -0.12880772352218628, 0.3593306243419647, -0.06906139850616455, -0.04014526680111885, 0.06957733631134033, 0.0458635538816452, 0.13623690605163574, 0.27097856998443604, -0.13223668932914734, 0.15627901256084442, 0.4056360721588135, -0.013250477612018585, 1.425247073173523, 0.023546434938907623, 0.10168065130710602, 0.1481160670518875, 0.10512803494930267, -0.003967190161347389, -0.1891113817691803, -0.2473946362733841, -0.19967064261436462, -0.05970029532909393, -0.2648088335990906, -0.2690992057323456, -0.13786715269088745, 0.006304491311311722, -0.014929637312889099, -0.2350541651248932, 0.06809104979038239, -0.5601545572280884, 0.10386930406093597, -0.05887157469987869, 0.30687353014945984, 0.3096941113471985, 0.0402669832110405, -0.37660300731658936, -0.0486648827791214, 0.1225404217839241, 0.15589942038059235, 0.7305280566215515, -0.1400030553340912, -0.20777375996112823, -0.08891315758228302, -0.4380953907966614, 0.06976961344480515, 0.24937544763088226, -0.14342424273490906, 0.40496373176574707, -0.20378683507442474, 0.2707136571407318, 0.007185004651546478, 0.23336464166641235, -0.13335560262203217, 0.20223543047904968, 0.11086776852607727, -0.3764575123786926, -0.1365184783935547, 0.10492122173309326, 0.1396869719028473, 0.3806248903274536, 0.13390910625457764, 0.2962866723537445, -0.27696719765663147, -0.040763381868600845, 0.1488843411207199, 0.3443637192249298, -0.3039056956768036, -0.23304492235183716, -0.2848272919654846, 0.03936242312192917, -0.5592683553695679, 0.16831040382385254, 0.030322596430778503, -0.06880538165569305, -0.14111748337745667, -0.10541420429944992, -0.22090545296669006, 0.020499013364315033, -0.27706223726272583, 0.005460217595100403, 0.34445661306381226, -0.27552133798599243, 0.3923221230506897, 0.05176101624965668, -0.15019123256206512, 0.46846774220466614, 0.515225887298584, 0.17015564441680908, 0.19010406732559204, -0.09496204555034637, -0.15471631288528442, 0.23093119263648987, 0.5172679424285889, -0.27372559905052185, 0.33058953285217285, -0.15454810857772827, 0.2858734428882599, -0.26616403460502625, -0.37564322352409363, 0.2967554032802582, -0.13346044719219208, 0.0545792318880558, 0.07556730508804321, 0.3022235035896301, -0.2905499339103699, -0.018377535045146942, 0.2184232622385025, 0.6414000988006592, 0.18315471708774567, 0.10632448643445969, 0.07466226816177368, 1.0935250520706177, 0.06787335872650146, 0.14259383082389832, 0.023942362517118454, 0.2322644740343094, 0.20526713132858276, 0.04167667031288147, 0.12911705672740936, -0.06401291489601135, -0.38996613025665283, 0.08172985166311264, -0.25839513540267944, -0.054174501448869705, 0.08106223493814468, -0.0002420172095298767, 0.2690970003604889, -0.1557665467262268, 0.13601425290107727, -0.1360916644334793, -0.1893099844455719, 0.16903018951416016, -0.14523738622665405, 0.1869228184223175, -0.1994219571352005, 0.30521464347839355, -0.14510756731033325, 0.04266469553112984, -0.05675823241472244, 0.05658616125583649, -0.0005394071340560913, -0.2520968019962311, 0.022076934576034546, 0.1968252807855606, 0.04773004353046417, 0.0032455772161483765, -0.5262995362281799, -0.11580854654312134, -0.12080836296081543, 0.1849648356437683, -0.14043016731739044, 0.022910168394446373, 0.14182865619659424, 0.25904715061187744, 0.21974977850914001, -0.10372485965490341, -0.2090875506401062, 0.1681848168373108, 0.010991163551807404, -0.05250868946313858, -0.006918659433722496, -0.243012472987175, -0.4647599160671234, -0.25855714082717896, 0.18476760387420654, 0.14824199676513672, 0.3321565091609955, 0.04590466618537903, 0.17266416549682617, -0.16621848940849304, -0.3143475353717804, -0.06885883212089539, 0.2724091708660126, 0.23198865354061127, 0.20718854665756226, -0.09704215079545975, -0.20842909812927246, -0.14038881659507751, 0.14715109765529633, 0.055748891085386276, 0.08752237260341644, 0.3134475350379944, -0.15637844800949097, -0.2584993243217468, -0.015444215387105942, -0.005257941782474518, -0.08479759097099304, -0.7229940891265869, 0.2779175043106079, -0.09644808620214462, 0.49072781205177307, -0.04572729766368866, -0.21261177957057953, -0.11195126175880432, -0.2000487595796585, -0.6360458731651306, -0.06520851701498032, 0.0459844172000885, -0.018101733177900314, 0.13092859089374542, 0.07060191035270691, -0.44265016913414, -0.09006727486848831, -0.1270216405391693, 0.12859787046909332, -0.08447715640068054, 0.1878172755241394, -0.27372288703918457, 0.2508312165737152, 0.20734398066997528, 0.10395735502243042, -0.021748341619968414, -0.08931075036525726, -0.141379714012146, 0.2660559415817261, -0.021916186437010765, 0.010466080158948898, -0.09339098632335663, 0.28727981448173523, -0.013452334329485893, 0.022764071822166443, 0.3965553343296051, -0.11293274164199829, -0.04779079556465149, -0.10789863020181656, -0.05002874881029129, -0.06261496245861053, 0.07971407473087311, -0.16892610490322113, 0.787385880947113, -0.11161239445209503, -0.17409726977348328, 0.040994614362716675, -0.14438924193382263, 0.47227513790130615, -0.27905622124671936, 0.1663876324892044, -0.021585650742053986, -0.054189421236515045, 0.02311456948518753, -0.23091062903404236, 0.17579041421413422, 0.1956235021352768, 0.33968403935432434, -0.2483472228050232, -0.30970966815948486, -0.2515910565853119, 0.5282265543937683, 0.3403039574623108, -0.04745257645845413, -0.257820725440979, 0.1707051694393158, 0.04429495334625244, -0.3581776022911072, -0.4562704861164093, 0.3839898705482483, -0.008632835000753403, 0.09267251938581467, 0.15970653295516968, -0.05923640727996826, 0.028824299573898315, 0.11559019982814789, 0.10354959964752197, -0.02270958013832569, -0.4264754056930542, -0.17100995779037476, 0.09393009543418884, 0.13006314635276794, -0.11984537541866302, 0.1693786084651947, 0.34771665930747986, 0.30696484446525574, 0.3209528923034668, -0.21181268990039825, 0.5837371349334717, 0.09084485471248627, 0.08204403519630432, -0.05989109352231026, -0.4741106629371643, 0.07093016803264618, 0.31556132435798645, -0.027843385934829712, -0.03211122006177902, 0.20148463547229767, 0.1693291813135147, 0.3702471852302551, 0.12862201035022736, -0.3248203694820404, 0.17444869875907898, 0.05823741853237152, -0.06454693526029587, 0.1545313000679016, -0.028890304267406464, -0.30564457178115845, 0.05964858829975128, 0.010387006215751171, 0.33463287353515625, 0.5342025756835938, 0.17586824297904968, 0.33297720551490784, -0.11814451217651367, 0.19946794211864471, -0.36719053983688354, 0.15502427518367767, -0.20344257354736328, -0.3532313108444214, 0.4187937080860138, -0.06991332769393921, -0.07639754563570023, 0.026408879086375237, 0.04599188268184662, -0.015347687527537346, -0.012358751147985458, 0.26463809609413147, 0.23065555095672607, 0.03870447725057602, -0.046608660370111465, 0.2855086028575897, -0.2786390781402588, 0.19617579877376556, 0.10069864988327026, -0.10542815923690796, -0.1318911910057068, -0.042661771178245544, 0.13532654941082, 0.22388988733291626, -0.45014938712120056, 0.2720321714878082, 0.05800982564687729, -0.12752820551395416, -0.20583924651145935, 0.06023852527141571, -0.06180379539728165, -0.07177473604679108, 0.25856131315231323, -0.31723475456237793, -0.15313799679279327, -0.08989186584949493, -0.017901092767715454, -0.5782346129417419, 0.3833733797073364, 0.22635753452777863, 0.11598721146583557, -0.41164013743400574, -0.2451356053352356, -0.5445482730865479, 0.2730289399623871, -0.2579135596752167, 0.24688324332237244, 0.3866937756538391, 0.5223089456558228, 0.11593133211135864, 0.2979747951030731, 0.3860938549041748, -0.287220299243927, -0.3653688132762909, 0.3642432987689972, -0.20797234773635864, -0.4147811233997345, -0.11462073028087616, -0.5639609694480896, -0.20859645307064056, -0.44423115253448486, 0.307922899723053, 0.051180221140384674, -0.04219788685441017, 0.17533652484416962, -0.33400970697402954, 0.5419372916221619, 0.2562048137187958, 0.28879109025001526, 0.055820032954216, -0.1836816966533661, 0.030568264424800873, -0.25634145736694336, 0.21569986641407013, -0.10522334277629852, -0.23002497851848602, -0.0820169448852539, -0.18292365968227386, 0.33583152294158936, -0.10111505538225174, 0.01526377722620964, -0.30350297689437866, -0.15961569547653198, -0.019456282258033752, 0.10249019414186478, -0.2358545958995819, 0.01186610758304596, 0.059121787548065186, 0.17514830827713013, -0.16278213262557983, -0.0642026886343956, 0.09673052281141281, 0.3908114433288574, -0.19396209716796875, -0.23686188459396362, 0.5835202932357788, -0.4232328534126282, 0.021740272641181946, -0.16351279616355896, 0.17569845914840698, 0.10859993100166321, -0.1555684506893158, -0.177475243806839, -0.15527869760990143, 0.3254247307777405, 0.22589297592639923, -0.02027185633778572, 0.08229203522205353, 0.14980429410934448, 0.09893438965082169, -0.16361874341964722, 0.089311882853508, 0.014964785426855087, -0.09784131497144699, -0.024482034146785736, -0.20954424142837524 ]
https://github.com/huggingface/datasets/issues/6051
Hi, thanks, this solution saves some time. But can't we avoid embedding all external image files bytes with each push, skipping the images that have already been pushed into the repo? Edit: Ok I missed the part of cache it manually on the disk the first time, this solves the problem. Thank you
Skipping shard in the remote repo and resume upload
### Describe the bug For some reason when I try to resume the upload of my dataset, it is very slow to reach the index of the shard from which to resume the uploading. From my understanding, the problem is in this part of the code: arrow_dataset.py ```python for index, shard in logging.tqdm( enumerate(itertools.chain([first_shard], shards_iter)), desc="Pushing dataset shards to the dataset hub", total=num_shards, disable=not logging.is_progress_bar_enabled(), ): shard_path_in_repo = path_in_repo(index, shard) # Upload a shard only if it doesn't already exist in the repository if shard_path_in_repo not in data_files: ``` In particular, iterating the generator is slow during the call: ```python self._select_contiguous(start, length, new_fingerprint=new_fingerprint) ``` I wonder if it is possible to avoid calling this function for shards that are already uploaded and just start from the correct shard index. ### Steps to reproduce the bug 1. Start the upload ```python dataset = load_dataset("imagefolder", data_dir=DATA_DIR, split="train", drop_labels=True) dataset.push_to_hub("repo/name") ``` 2. Stop and restart the upload after hundreds of shards ### Expected behavior Skip the uploaded shards faster. ### Environment info - `datasets` version: 2.5.1 - Platform: Linux-4.18.0-193.el8.x86_64-x86_64-with-glibc2.17 - Python version: 3.8.16 - PyArrow version: 12.0.1 - Pandas version: 2.0.2
53
Skipping shard in the remote repo and resume upload ### Describe the bug For some reason when I try to resume the upload of my dataset, it is very slow to reach the index of the shard from which to resume the uploading. From my understanding, the problem is in this part of the code: arrow_dataset.py ```python for index, shard in logging.tqdm( enumerate(itertools.chain([first_shard], shards_iter)), desc="Pushing dataset shards to the dataset hub", total=num_shards, disable=not logging.is_progress_bar_enabled(), ): shard_path_in_repo = path_in_repo(index, shard) # Upload a shard only if it doesn't already exist in the repository if shard_path_in_repo not in data_files: ``` In particular, iterating the generator is slow during the call: ```python self._select_contiguous(start, length, new_fingerprint=new_fingerprint) ``` I wonder if it is possible to avoid calling this function for shards that are already uploaded and just start from the correct shard index. ### Steps to reproduce the bug 1. Start the upload ```python dataset = load_dataset("imagefolder", data_dir=DATA_DIR, split="train", drop_labels=True) dataset.push_to_hub("repo/name") ``` 2. Stop and restart the upload after hundreds of shards ### Expected behavior Skip the uploaded shards faster. ### Environment info - `datasets` version: 2.5.1 - Platform: Linux-4.18.0-193.el8.x86_64-x86_64-with-glibc2.17 - Python version: 3.8.16 - PyArrow version: 12.0.1 - Pandas version: 2.0.2 Hi, thanks, this solution saves some time. But can't we avoid embedding all external image files bytes with each push, skipping the images that have already been pushed into the repo? Edit: Ok I missed the part of cache it manually on the disk the first time, this solves the problem. Thank you
[ -0.3249988257884979, -0.07473849505186081, 0.0636654794216156, 0.043887339532375336, 0.06393709778785706, -0.15074089169502258, 0.41193485260009766, 0.19467419385910034, -0.2961759567260742, 0.24161314964294434, 0.26046231389045715, 0.25967612862586975, 0.14979708194732666, -0.14033912122249603, 0.08380479365587234, 0.1349770575761795, -0.03686690330505371, 0.19382557272911072, 0.1789330244064331, -0.30946093797683716, -0.22010399401187897, -0.10850914567708969, -0.1232675313949585, -0.1997072994709015, -0.23670196533203125, -0.0345759317278862, 0.23952636122703552, 0.5196133852005005, 0.13116741180419922, -0.1673688292503357, 0.23931969702243805, 0.1051410436630249, -0.0006360486149787903, 0.2632821202278137, -0.00013120136281941086, 0.03730900585651398, 0.31174784898757935, -0.043468035757541656, -0.018552474677562714, 0.13429151475429535, -0.37047845125198364, 0.02764923870563507, -0.08023977279663086, -0.42987900972366333, 0.16600137948989868, 0.2973264157772064, 0.08046851307153702, -0.1152128353714943, 0.2113766372203827, -0.10540448129177094, -0.025940582156181335, 0.32439714670181274, -0.28899872303009033, 0.08299491554498672, 0.37752535939216614, 0.2428855150938034, -0.07135593146085739, 0.186331644654274, 0.21247047185897827, 0.2526629567146301, -0.22372937202453613, 0.47131773829460144, -0.3995858430862427, 0.2872884273529053, 0.052483949810266495, 0.02483636513352394, 0.06735455989837646, -0.20551013946533203, -0.00105210579931736, 0.10110501199960709, 0.05569010227918625, -0.11492288112640381, -0.35929280519485474, -0.29027438163757324, -0.14588040113449097, -0.7246290445327759, 0.1879645735025406, -0.13661548495292664, -0.22082729637622833, 0.21355940401554108, -0.3488257825374603, -0.29365789890289307, -0.05654674023389816, 0.07252427190542221, 0.1607828438282013, -0.36656540632247925, 0.2603970766067505, 0.053468815982341766, 0.02436290681362152, 0.14761005342006683, 0.0011033117771148682, -0.14658138155937195, 0.2790694534778595, -0.04797784239053726, -0.4045160412788391, -0.04564372077584267, 0.17374327778816223, 0.008800027891993523, 0.13953135907649994, 0.5941048264503479, -0.19594953954219818, 0.2973805367946625, 0.19732993841171265, 0.09483152627944946, 0.09007647633552551, -0.0596211738884449, -0.09619215130805969, 0.22986136376857758, 0.2709514796733856, 0.13142924010753632, -0.10305935144424438, -0.035212744027376175, 0.006005488336086273, -0.20058846473693848, 0.4036942720413208, 0.20347487926483154, 0.25877848267555237, -0.08650043606758118, -0.048211850225925446, -0.07079186290502548, -0.0751851350069046, -0.1199907511472702, -0.007782584056258202, 0.18869629502296448, 0.09311145544052124, -0.1242169439792633, -0.5065885186195374, 0.1290598064661026, -0.300204873085022, -0.25748321413993835, -0.037384625524282455, -0.04507943242788315, -0.03789135441184044, 0.27264273166656494, 0.14535918831825256, -0.26214730739593506, 0.12934482097625732, -0.014886114746332169, 0.6737459897994995, 0.29363399744033813, 0.3898293375968933, -0.17477229237556458, 0.3201056122779846, 0.37342774868011475, -0.0972893238067627, 0.2554723620414734, 0.2341720163822174, -0.15837478637695312, -0.23114795982837677, 0.4247191846370697, -0.24810117483139038, -0.5607308149337769, 0.06025264412164688, -0.12240736931562424, -0.14690344035625458, 0.09548722207546234, -0.7098557949066162, -0.2595454454421997, 0.15722408890724182, 0.020917393267154694, 0.08469799906015396, 0.0698593407869339, -0.2048453986644745, -0.1739206463098526, 0.3420916795730591, 0.520728588104248, -0.3369383215904236, -0.05212235450744629, -0.2594474256038666, 0.1501452922821045, 0.4565015733242035, 0.41824930906295776, -0.2548315227031708, 0.047107547521591187, -0.4831460118293762, 0.4612574577331543, 0.2876201272010803, -0.35219842195510864, -0.546180009841919, 0.08882254362106323, -0.35701680183410645, 0.32648080587387085, 0.2508336007595062, 0.19237495958805084, 0.23052385449409485, -0.1595926135778427, -0.022957585752010345, 0.439247727394104, -0.24691638350486755, 0.07577081769704819, -0.32276207208633423, -0.06737498939037323, -0.0064257062040269375, 0.2747865319252014, 0.20599159598350525, 0.14248305559158325, 0.11964340507984161, -0.342547744512558, 0.2123047113418579, -0.004955727607011795, 0.00407269224524498, 0.062310971319675446, 0.46593260765075684, -0.5392104387283325, 0.158748596906662, -0.007563374936580658, -0.34488576650619507, 0.36396026611328125, 0.24458223581314087, -0.18172146379947662, -0.3654733896255493, -0.09065153449773788, -0.17830464243888855, -0.14565515518188477, -0.3036244511604309, 0.2940063774585724, -0.12360052764415741, 0.04979139566421509, -0.10271459817886353, 0.1592714935541153, -0.2261277735233307, 0.05073819309473038, -0.5411616563796997, 0.16132989525794983, -0.22963392734527588, 0.5251863598823547, 0.2846016585826874, -0.07523304224014282, -0.17807024717330933, -0.23025038838386536, 0.15962836146354675, -0.3979754149913788, 0.009937576949596405, 0.3253127336502075, 0.023594267666339874, 0.5760390758514404, 0.3497966229915619, 0.17196542024612427, 0.08217308670282364, -0.15044760704040527, -0.13086402416229248, -0.0725284144282341, -0.086064413189888, -0.11109776794910431, 0.0483301542699337, 0.49016907811164856, -0.2193523496389389, 0.40283602476119995, 0.05291491746902466, -0.10951917618513107, 0.2501082420349121, -0.30666041374206543, -0.2633360028266907, -0.04043780267238617, 0.2549576163291931, 0.3590063154697418, -0.08130310475826263, 0.04031357169151306, -0.19002506136894226, 0.24061071872711182, 0.5471376776695251, 0.023625634610652924, -0.10912222415208817, 0.21921178698539734, 0.14383822679519653, -0.028000473976135254, 0.10279659181833267, 0.5566015243530273, 0.2925680875778198, 0.04249108210206032, 0.10740798711776733, -0.3307643234729767, -0.016755085438489914, -0.13739174604415894, 0.05557222291827202, 0.17946477234363556, 0.05876275897026062, 0.26539966464042664, 0.1674465835094452, -0.025594625622034073, -0.2711643874645233, -0.019708767533302307, 0.12014807760715485, -0.025984887033700943, 0.02426619827747345, 0.11171833425760269, -0.3096759617328644, 0.061669230461120605, -0.015298513695597649, 0.05641839653253555, -0.25956735014915466, -0.22167640924453735, 0.017668094485998154, 0.017312156036496162, -0.07103664427995682, 0.3930664658546448, 0.3094066381454468, 0.1353892982006073, -0.05691486597061157, -0.5811392664909363, -0.2408185601234436, -0.03592419624328613, 0.2773137092590332, -0.12896665930747986, 0.5342963933944702, 0.25929728150367737, 0.4033617079257965, -0.16680949926376343, -0.1418849229812622, -0.5394368767738342, 0.002937883138656616, 0.12309911102056503, 0.11546981334686279, 0.27363255620002747, -0.16675764322280884, 0.0693756490945816, -0.24675004184246063, 0.06057076156139374, 0.21719399094581604, 0.029526889324188232, -0.11811789870262146, 0.22444802522659302, -0.205790713429451, 0.3206961452960968, 0.13615112006664276, 0.018555982038378716, -0.07748906314373016, -0.19109126925468445, -0.010463224723935127, 0.26856517791748047, 0.13416160643100739, -0.024485405534505844, -0.1187000572681427, -0.13710138201713562, -0.13358670473098755, -0.23487445712089539, 0.07778620719909668, -0.6401602029800415, 0.4053158164024353, -0.008201692253351212, -0.025903286412358284, 0.012617260217666626, -0.2814108729362488, -0.0181210245937109, 0.576806366443634, -0.638498842716217, -0.36369869112968445, -0.23981726169586182, 0.24544134736061096, -0.000539952889084816, -0.10943527519702911, 0.36419057846069336, -0.08476053923368454, -0.047200217843055725, 0.0202178955078125, 0.08391843736171722, 0.09346713125705719, 0.20406511425971985, -0.09498017281293869, 0.1798700988292694, 0.4755662977695465, 0.0038989856839179993, 1.3633390665054321, -0.05297204107046127, 0.08340504765510559, 0.27416273951530457, 0.07453207671642303, 0.10760894417762756, -0.23997706174850464, -0.2533923387527466, -0.1478615701198578, -0.08372297137975693, -0.2845190167427063, -0.26663562655448914, -0.1350109875202179, -0.029187362641096115, -0.0815744698047638, -0.18475019931793213, -0.028517022728919983, -0.4532405734062195, 0.029152294620871544, -0.1050114780664444, 0.331781804561615, 0.35265371203422546, -0.0758184939622879, -0.3927381932735443, -0.07478310167789459, 0.13172364234924316, 0.17056584358215332, 0.7642404437065125, -0.08412623405456543, -0.19708040356636047, -0.06015835702419281, -0.43801265954971313, 0.04373101145029068, 0.2948542833328247, -0.21214605867862701, 0.35458898544311523, -0.12780879437923431, 0.24737821519374847, 0.003870312124490738, 0.3589032292366028, -0.13950160145759583, 0.16312682628631592, 0.06565448641777039, -0.3822280764579773, -0.08420424163341522, 0.09987276047468185, 0.17175711691379547, 0.359761118888855, 0.1293073445558548, 0.3913695216178894, -0.2701526880264282, -0.02124951407313347, 0.08370799571275711, 0.3694416582584381, -0.2697576880455017, -0.2597271502017975, -0.2941189408302307, 0.041860438883304596, -0.5921725034713745, 0.16156350076198578, 0.13951265811920166, -0.11073040217161179, -0.1991124451160431, -0.15059025585651398, -0.2355508804321289, 0.07491253316402435, -0.23505140841007233, 0.0008154734969139099, 0.40211963653564453, -0.27099180221557617, 0.30106884241104126, -0.003251205198466778, -0.07159032672643661, 0.44541028141975403, 0.43365347385406494, 0.10719853639602661, 0.1844756156206131, -0.06955528259277344, -0.18215371668338776, 0.16767647862434387, 0.530929684638977, -0.22162409126758575, 0.2499503493309021, -0.19498111307621002, 0.2753533124923706, -0.17710402607917786, -0.28021514415740967, 0.24943475425243378, -0.17943063378334045, 0.1379294991493225, 0.09582195430994034, 0.321088969707489, -0.2658573091030121, 0.012774750590324402, 0.2140541523694992, 0.5415531396865845, 0.16087394952774048, 0.07011935114860535, 0.08662968873977661, 1.1595654487609863, 0.051010001450777054, 0.24217168986797333, 0.012096643447875977, 0.2571679651737213, 0.21352188289165497, -0.09465000033378601, 0.15209707617759705, -0.05149256810545921, -0.33636584877967834, 0.049773603677749634, -0.3003861606121063, -0.08770637959241867, 0.12170203775167465, -0.033589862287044525, 0.24168473482131958, -0.0917171835899353, 0.23917341232299805, -0.15286515653133392, -0.15438826382160187, 0.11907614022493362, -0.18765152990818024, 0.08786436170339584, -0.16514083743095398, 0.28276315331459045, -0.16239862143993378, 0.015507485717535019, -0.08211326599121094, 0.06476318836212158, 0.029510237276554108, -0.15355311334133148, 0.0012905225157737732, 0.10234904289245605, 0.10494732856750488, -0.09680163860321045, -0.5856074094772339, -0.19038942456245422, -0.05052272602915764, 0.3058319687843323, -0.22028236091136932, -0.016838576644659042, 0.13108882308006287, 0.22661447525024414, 0.21582335233688354, -0.19209024310112, -0.2599458396434784, 0.18854746222496033, -0.055635299533605576, -0.023381531238555908, 0.0013353340327739716, -0.25788378715515137, -0.5171259641647339, -0.16354727745056152, 0.22269125282764435, 0.2056203931570053, 0.33682456612586975, 0.002935066819190979, 0.14804403483867645, -0.1383076012134552, -0.27817487716674805, -0.06244637072086334, 0.26950803399086, 0.2225036770105362, 0.26845696568489075, -0.07145726680755615, -0.18645316362380981, -0.13392412662506104, 0.14023932814598083, 0.05391193926334381, 0.002011507749557495, 0.3313451409339905, -0.272015780210495, -0.2416803389787674, -0.013137340545654297, 0.06153899431228638, -0.15693487226963043, -0.7108501195907593, 0.28243914246559143, -0.05015146732330322, 0.46633380651474, -0.12848463654518127, -0.2492114007472992, -0.10723541676998138, -0.12579181790351868, -0.5731110572814941, -0.06327101588249207, -0.014137785881757736, -0.02197309210896492, -0.007281856145709753, 0.17476153373718262, -0.37312328815460205, -0.10312722623348236, -0.10625436902046204, 0.1319672018289566, -0.10975850373506546, 0.20203062891960144, -0.3130601942539215, 0.2103726714849472, 0.196412593126297, 0.11853804439306259, 0.004722844809293747, -0.0837152749300003, -0.1886049509048462, 0.29902178049087524, -0.13352739810943604, -0.010676249861717224, -0.05054078251123428, 0.27729788422584534, 0.044569700956344604, 0.021983079612255096, 0.370998740196228, -0.05507507175207138, -0.059287283569574356, -0.0918831005692482, 0.0032506585121154785, -0.0797484740614891, 0.0827985480427742, -0.15534374117851257, 0.8998820781707764, -0.06999225914478302, -0.1342601478099823, 0.012747988104820251, -0.07245802134275436, 0.5003685355186462, -0.23557251691818237, 0.14853334426879883, -0.08105587959289551, 0.00815156102180481, 0.06948553025722504, -0.21819499135017395, 0.27020546793937683, 0.17382965981960297, 0.31260383129119873, -0.2524367570877075, -0.2869211435317993, -0.15324456989765167, 0.45327168703079224, 0.23985478281974792, -0.127458393573761, -0.24399268627166748, 0.20712314546108246, 0.05332024395465851, -0.33123764395713806, -0.39837121963500977, 0.48154953122138977, -0.11843323707580566, 0.06722259521484375, 0.09124018251895905, 0.12162916362285614, 0.08155782520771027, 0.2503710985183716, 0.12730619311332703, 0.245433047413826, -0.550119161605835, -0.2059081643819809, -0.08532539010047913, 0.14647597074508667, -0.08068525046110153, 0.14931991696357727, 0.38270214200019836, 0.3109820485115051, 0.22449038922786713, -0.19329696893692017, 0.5477530360221863, 0.02340202033519745, 0.10677167028188705, -0.08143633604049683, -0.49227508902549744, 0.12547282874584198, 0.332522988319397, 0.013951636850833893, -0.010655811056494713, 0.11824928224086761, 0.17242485284805298, 0.4404658377170563, 0.12218448519706726, -0.26630061864852905, 0.23222370445728302, 0.10969927161931992, -0.02912270650267601, 0.23961301147937775, -0.038118697702884674, -0.2669752240180969, 0.029971055686473846, 0.019822858273983, 0.3098461329936981, 0.44908806681632996, 0.2146017700433731, 0.1906459480524063, 0.011161506175994873, 0.1656087189912796, -0.28503939509391785, 0.17289526760578156, -0.21715399622917175, -0.29394853115081787, 0.3897014558315277, -0.08821408450603485, -0.04496896639466286, 0.15165725350379944, 0.0246503297239542, -0.002203226089477539, 0.031683262437582016, 0.1791696548461914, 0.26641279458999634, 0.05002666264772415, -0.11361686885356903, 0.21939243376255035, -0.27386903762817383, 0.07246324419975281, 0.05259039252996445, -0.09365379810333252, -0.1515357792377472, -0.02346230112016201, 0.08883582055568695, 0.12763871252536774, -0.412669837474823, 0.17094901204109192, 0.04803795740008354, -0.12827041745185852, -0.18965189158916473, 0.03898336738348007, -0.13738329708576202, -0.07906295359134674, 0.30707404017448425, -0.3448338210582733, -0.15306229889392853, -0.03501488268375397, -0.014584975317120552, -0.6176914572715759, 0.355031281709671, 0.3175193667411804, 0.13312986493110657, -0.4350466728210449, -0.2861952483654022, -0.5738698244094849, 0.34908926486968994, -0.22629696130752563, 0.1964225172996521, 0.388606995344162, 0.5609866976737976, 0.1255309283733368, 0.30058786273002625, 0.3146231770515442, -0.2853310704231262, -0.3492348790168762, 0.2933134138584137, -0.2733760476112366, -0.3349831998348236, -0.10300438106060028, -0.4664691984653473, -0.1834883987903595, -0.42972081899642944, 0.29819348454475403, 0.0608641654253006, -0.04085732623934746, 0.17039835453033447, -0.2518635094165802, 0.5118827223777771, 0.2348913848400116, 0.31712958216667175, 0.08305861055850983, -0.21225185692310333, -0.008823417127132416, -0.2351500391960144, 0.23581713438034058, -0.15614455938339233, -0.24260610342025757, -0.2406640499830246, -0.13140437006950378, 0.3790498971939087, -0.1779223531484604, -0.16108915209770203, -0.29518258571624756, 0.024121146649122238, -0.04319491982460022, 0.021449897438287735, -0.08270689845085144, -0.014378264546394348, 0.06097112596035004, 0.14023858308792114, -0.16594800353050232, -0.09753482788801193, 0.10529923439025879, 0.34199023246765137, -0.279488205909729, -0.23477748036384583, 0.5797296762466431, -0.43341559171676636, 0.03060319274663925, -0.14639917016029358, 0.18831923604011536, 0.02761203423142433, -0.11775145679712296, -0.15971094369888306, -0.10427198559045792, 0.3427578806877136, 0.23948673903942108, -0.09096759557723999, 0.23175859451293945, 0.22074827551841736, 0.09730955958366394, -0.13206613063812256, -0.043643850833177567, 0.011840809136629105, -0.01726318895816803, -0.13704727590084076, -0.16917002201080322 ]
https://github.com/huggingface/datasets/issues/6048
The `audiofolder` loader is not available in version `2.3.2`, hence the error. Please run the `pip install -U datasets` command to update the `datasets` installation to make `load_dataset("audiofolder", ...)` work.
when i use datasets.load_dataset, i encounter the http connect error!
### Describe the bug `common_voice_test = load_dataset("audiofolder", data_dir="./dataset/",cache_dir="./cache",split=datasets.Split.TEST)` when i run the code above, i got the error as below: -------------------------------------------- ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.3.2/datasets/audiofolder/audiofolder.py (ConnectionError(MaxRetryError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /huggingface/datasets/2.3.2/datasets/audiofolder/audiofolder.py (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f299ed082e0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"))) -------------------------------------------------- My all data is on local machine, why does it need to connect the internet? how can i fix it, because my machine cannot connect the internet. ### Steps to reproduce the bug 1 ### Expected behavior no error when i use the load_dataset func ### Environment info python=3.8.15
30
when i use datasets.load_dataset, i encounter the http connect error! ### Describe the bug `common_voice_test = load_dataset("audiofolder", data_dir="./dataset/",cache_dir="./cache",split=datasets.Split.TEST)` when i run the code above, i got the error as below: -------------------------------------------- ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.3.2/datasets/audiofolder/audiofolder.py (ConnectionError(MaxRetryError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /huggingface/datasets/2.3.2/datasets/audiofolder/audiofolder.py (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f299ed082e0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"))) -------------------------------------------------- My all data is on local machine, why does it need to connect the internet? how can i fix it, because my machine cannot connect the internet. ### Steps to reproduce the bug 1 ### Expected behavior no error when i use the load_dataset func ### Environment info python=3.8.15 The `audiofolder` loader is not available in version `2.3.2`, hence the error. Please run the `pip install -U datasets` command to update the `datasets` installation to make `load_dataset("audiofolder", ...)` work.
[ -0.47941577434539795, 0.1300177127122879, 0.04848112910985947, 0.24561111629009247, 0.19157904386520386, 0.01985028386116028, 0.06988286972045898, 0.007370714098215103, -0.1016228049993515, 0.028838418424129486, -0.2577299177646637, 0.01850464567542076, 0.1683361828327179, -0.15974661707878113, -0.1285632997751236, -0.06466734409332275, -0.024791836738586426, 0.12850940227508545, -0.16534392535686493, 0.08053967356681824, -0.21475277841091156, 0.1903691589832306, -0.1938651204109192, -0.03275187313556671, -0.14702977240085602, -0.11619352549314499, -0.0726776272058487, 0.3367161452770233, -0.06737694144248962, -0.594063401222229, 0.31360238790512085, -0.035747967660427094, 0.22081467509269714, 0.4350430369377136, -0.0001266242325073108, 0.06172556430101395, 0.4740000367164612, -0.07114338129758835, -0.36867108941078186, -0.3259327709674835, -0.5980449318885803, 0.038487814366817474, 0.12239374220371246, 0.003993436694145203, 0.154055655002594, 0.07706427574157715, -0.023525239899754524, -0.3481135666370392, 0.475612998008728, 0.4065169394016266, 0.07598276436328888, 0.25521719455718994, 0.28974053263664246, 0.06216048076748848, 0.16136810183525085, -0.233689546585083, -0.04548942670226097, 0.5535507202148438, 0.2534653842449188, -0.023892253637313843, 0.08605881035327911, -0.02198001742362976, 0.07648058235645294, 0.27188926935195923, 0.1442669779062271, 0.0567733533680439, -0.172334223985672, -0.3504340350627899, -0.02472563274204731, 0.2942163944244385, 0.6490099430084229, -0.25542888045310974, -0.39423516392707825, 0.020923152565956116, -0.07723623514175415, -0.20820152759552002, 0.28768935799598694, 0.14277967810630798, -0.17714160680770874, 0.34328514337539673, -0.3466852307319641, -0.26573410630226135, -0.2763727307319641, 0.4135652184486389, 0.08170996606349945, 0.1528474986553192, -0.21139051020145416, 0.3451630473136902, 0.15783977508544922, -0.005400004796683788, 0.14445793628692627, -0.06607065349817276, -0.07215443253517151, 0.15900515019893646, -0.3528973460197449, 0.01561882346868515, -0.18035459518432617, 0.26800215244293213, 0.15659764409065247, 0.31372642517089844, -0.03618479520082474, -0.04986374080181122, -0.09375873953104019, 0.1735037863254547, 0.393210768699646, 0.08728271722793579, -0.13330858945846558, -0.0671277716755867, 0.5524075031280518, 0.29085713624954224, 0.10432995855808258, -0.09206325560808182, 0.04405948147177696, -0.21599715948104858, 0.39860785007476807, -0.10868313908576965, 0.5447562336921692, -0.2019084095954895, -0.2878791093826294, 0.053565919399261475, -0.2815687358379364, 0.024769913405179977, -0.06812044978141785, 0.32188063859939575, -0.3127775490283966, 0.15214458107948303, -0.06031058728694916, 0.39055874943733215, -0.053796105086803436, -0.0332212969660759, -0.026554342359304428, -0.34485477209091187, 0.19422496855258942, 0.13986727595329285, 0.23085567355155945, -0.22548171877861023, 0.18466538190841675, 0.10718318819999695, 0.12661591172218323, -0.1855621486902237, 0.07685041427612305, -0.15652132034301758, -0.19431304931640625, 0.37380605936050415, 0.2970426678657532, 0.1516684591770172, 0.21479499340057373, -0.07936013489961624, -0.10795926302671432, 0.0378720685839653, -0.3297215402126312, -0.48366039991378784, -0.0039199115708470345, 0.056413684040308, -0.16651207208633423, 0.09685929119586945, -0.3504061698913574, -0.3185964822769165, 0.11681097000837326, -0.3892194926738739, -0.08369234204292297, -0.29880014061927795, -0.16498520970344543, -0.1449933648109436, 0.3499513268470764, 0.5565469264984131, -0.09663882106542587, -0.04961354285478592, -0.24264104664325714, -0.0894426628947258, 0.14360177516937256, 0.25731030106544495, -0.09466889500617981, 0.10247013717889786, -0.3067256212234497, -0.07125035673379898, 0.5349610447883606, -0.3749430179595947, -0.8387014865875244, 0.4603310525417328, -0.24144130945205688, 0.10099188983440399, -0.13148635625839233, 0.08368205279111862, 0.16381174325942993, 0.15164144337177277, 0.24607764184474945, 0.3705843687057495, -0.07084167003631592, -0.015419729053974152, -0.0065443068742752075, -0.3953342139720917, 0.19337528944015503, 0.021140150725841522, -0.17845413088798523, 0.3218350112438202, 0.35466673970222473, -0.10856762528419495, 0.2765178680419922, 0.08526366949081421, 0.350960910320282, 0.261484831571579, 0.4050922393798828, 0.13284331560134888, -0.006078321486711502, -0.019409917294979095, -0.4544905722141266, 0.18549737334251404, 0.09421508759260178, 0.09080527722835541, -0.4055131673812866, -0.015952594578266144, -0.38281333446502686, 0.00841280072927475, -0.415389746427536, 0.15728455781936646, -0.05827774107456207, 0.3836781084537506, 0.22258925437927246, 0.06573867052793503, -0.08128189295530319, 0.4021593928337097, 0.10012058913707733, 0.1190391406416893, -0.41958871483802795, 0.4322969615459442, -0.24038849771022797, 0.033118944615125656, 0.08061681687831879, 0.15614557266235352, 0.24728280305862427, -0.13935425877571106, -0.13717839121818542, 0.4770045876502991, -0.05102232098579407, 0.3334675133228302, -0.02956128492951393, 0.26732149720191956, 0.06057825684547424, -0.5514340400695801, 0.09206381440162659, 0.23484715819358826, 0.20145153999328613, -0.1011495366692543, 0.19196240603923798, 0.04278538376092911, 0.12573465704917908, 0.5579738616943359, 0.03626810014247894, 0.17806145548820496, 0.20035070180892944, 0.13285918533802032, -0.16653256118297577, 0.014486491680145264, -0.10863304138183594, -0.1218254417181015, 0.4207504391670227, -0.22375933825969696, -0.12037394940853119, -0.07765299081802368, 0.05528111010789871, -0.14684215188026428, 0.22812195122241974, 0.25010478496551514, -0.08724123239517212, -0.2762187719345093, 0.04602836072444916, 0.14275258779525757, 0.5572825074195862, 0.028135541826486588, 0.17406103014945984, 0.2508935034275055, -0.008713331073522568, -0.11726453900337219, 0.08991728723049164, 0.0699884444475174, 0.13916665315628052, 0.40254998207092285, 0.23055025935173035, -0.04228462651371956, -0.2980729341506958, -0.3458719253540039, -0.11262397468090057, 0.31905269622802734, -0.46936511993408203, 0.1950106918811798, -0.1519826352596283, 0.06118478626012802, -0.12763711810112, -0.28888949751853943, -0.3728131353855133, -0.3325304388999939, -0.2236146777868271, 0.4213787019252777, 0.1495753526687622, 0.05036865174770355, -0.2642519474029541, 0.21649985015392303, 0.19253961741924286, -0.22475029528141022, -0.1136961430311203, -0.02767905965447426, -0.2964276969432831, -0.0879436731338501, 0.06477325409650803, -0.07810657471418381, 0.16199049353599548, -0.23541682958602905, -0.13455381989479065, -0.16853010654449463, 0.08096638321876526, 0.0020929924212396145, 0.104920893907547, 0.40680980682373047, 0.2408231496810913, 0.48649340867996216, 0.1999262273311615, -0.1195310726761818, 0.4028122127056122, -0.044326432049274445, 0.026157625019550323, 0.08773434162139893, -0.13743337988853455, 0.11356580257415771, 0.21510738134384155, -0.5167571306228638, -0.43059682846069336, -0.4296395778656006, 0.3812849819660187, -0.1446073055267334, 0.11521102488040924, 0.10361483693122864, 0.1372959166765213, 0.05431240051984787, -0.05178207531571388, 0.33719688653945923, -0.2967989444732666, -0.4987970292568207, 0.23244152963161469, -0.040863871574401855, -0.30472496151924133, 0.015574157238006592, 0.07681064307689667, 0.37232470512390137, 0.15196837484836578, -0.6588557958602905, -0.20696642994880676, -0.20257897675037384, 0.25310346484184265, -0.1728622019290924, 0.2607788145542145, 0.25258901715278625, 0.0019491501152515411, 0.06963662058115005, -0.0071633607149124146, -0.05912553519010544, -0.08796653896570206, 0.2235729694366455, 0.2642642855644226, 0.33024534583091736, 0.5863556265830994, -0.1867770254611969, 0.7246809005737305, 0.29352685809135437, 0.2839004695415497, 0.40479645133018494, -0.26786381006240845, 0.5165358781814575, -0.047235552221536636, -0.25693121552467346, 0.021427113562822342, -0.2228546291589737, -0.07718796283006668, 0.09150473028421402, 0.20775043964385986, -0.0031315386295318604, -0.39720267057418823, -0.14950288832187653, -0.22822239995002747, -0.24474379420280457, 0.05505562573671341, -0.15760396420955658, 0.274056613445282, 0.07283690571784973, -0.07795735448598862, 0.022694557905197144, -0.07029576599597931, -0.10476560890674591, 0.32860058546066284, 0.05998606979846954, 0.1737821102142334, -0.31974971294403076, -0.11616463214159012, -0.37604495882987976, 0.26888102293014526, 0.13673743605613708, 0.9046515226364136, -0.22944167256355286, 0.07294246554374695, 0.010411728173494339, 0.03208080679178238, 0.532007098197937, -0.3814966380596161, 0.24803362786769867, 0.024063915014266968, 0.20083555579185486, -0.44701823592185974, 0.07361644506454468, -0.011231325566768646, -0.008738424628973007, 0.1287740170955658, 0.28673726320266724, -0.10087920725345612, 0.10505361109972, -0.09989608824253082, 0.34406542778015137, -0.15633419156074524, -0.1058354452252388, -0.24572759866714478, -0.31466126441955566, -0.41457998752593994, -0.010339915752410889, -0.148023784160614, 0.21409767866134644, 0.022850245237350464, -0.10525095462799072, 0.2942323684692383, 0.003905482590198517, -0.09559280425310135, -0.030244026333093643, -0.24121490120887756, 0.02460506558418274, 0.10387293994426727, 0.35585927963256836, -0.09729179739952087, 0.248558908700943, 0.7927825450897217, -0.12370726466178894, -0.25256791710853577, -0.04314099997282028, 0.22315923869609833, 0.1938658058643341, 0.2054794877767563, 0.009026095271110535, 0.00814606063067913, 0.47445881366729736, 0.19368338584899902, -0.2935163378715515, 0.13261544704437256, 0.3258752226829529, -0.0771399438381195, -0.1267898827791214, -0.46767735481262207, 0.3165726363658905, -0.11423912644386292, -0.19390012323856354, 0.3330547511577606, 0.210785910487175, -0.011916827410459518, 0.024718325585126877, -0.38988158106803894, 0.9231319427490234, 0.36786088347435, 0.21946799755096436, 0.15637055039405823, -0.2968287765979767, 0.11903569102287292, -0.3175811767578125, 0.16415122151374817, -0.07776394486427307, 0.058305539190769196, -0.15401053428649902, -0.3301290273666382, 0.09014593809843063, -0.16323313117027283, -0.154154971241951, 0.39005208015441895, -0.12505856156349182, 0.1431208699941635, 0.19602683186531067, 0.1265757977962494, -0.5058623552322388, -0.08831539750099182, -0.2009735107421875, 0.06716565042734146, -0.09429650753736496, 0.41315019130706787, -0.020032815635204315, -0.026424966752529144, -0.047880224883556366, -0.48907482624053955, -0.26681727170944214, 0.23452772200107574, -0.3856329321861267, 0.22037294507026672, 0.02563009411096573, -0.13394272327423096, 0.10413679480552673, 0.1691688597202301, -0.057145070284605026, -0.006685150787234306, -0.40051892399787903, 0.07058455049991608, -0.12218230217695236, 0.17200998961925507, 0.16679328680038452, -0.027393529191613197, -0.03189387544989586, -0.018582217395305634, -0.4697936773300171, 0.060973264276981354, -0.1461799591779709, -0.25381457805633545, 0.25525963306427, 0.04404761269688606, 0.0734349712729454, -0.3332982063293457, -0.02745092287659645, -0.15430967509746552, 0.0684492439031601, -0.21351774036884308, -0.017046183347702026, 0.06364546716213226, -0.22227242588996887, 0.14019815623760223, 0.05362113565206528, -0.1309981346130371, 0.059293631464242935, 0.6414232850074768, -0.11039610207080841, 0.17034687101840973, 0.39887136220932007, 0.05578164756298065, -0.01690862327814102, -0.11548680067062378, 0.2002120316028595, 0.1490994095802307, -0.32088297605514526, 0.03702424094080925, -0.19063624739646912, 0.2645595371723175, -0.25893884897232056, 0.10585525631904602, 0.0898335799574852, 0.1759091168642044, -0.04648558050394058, -0.5655022859573364, -0.28995051980018616, 0.1145281195640564, 0.13360321521759033, 0.11950816214084625, -0.0314926952123642, -0.17461347579956055, 0.01379692554473877, -0.1523551642894745, -0.16116252541542053, -0.027789749205112457, -0.2357373833656311, 0.08031902462244034, 0.2567161023616791, -0.28534650802612305, 0.4107420742511749, -0.14900775253772736, -0.03703901916742325, -0.15676815807819366, -0.22542886435985565, 0.014728013426065445, -0.06220005080103874, 0.24237877130508423, 0.23377972841262817, -0.5439654588699341, -0.1580491065979004, -0.2884153127670288, -0.10702560842037201, 0.03674517571926117, 0.33167076110839844, 0.04061993956565857, -0.09573069959878922, -0.10393337905406952, -0.16102942824363708, -0.09987848997116089, -0.1782839596271515, 0.11180561035871506, -0.019902702420949936, 0.24321214854717255, 0.1117313802242279, 0.2577207088470459, 0.05108796805143356, -0.15572090446949005, -0.2312244027853012, 0.21747325360774994, 0.3098255693912506, -0.133454367518425, 0.462651789188385, -0.2785987854003906, -0.059322405606508255, 0.05803709477186203, 0.4906999468803406, 0.44313985109329224, -0.2632525563240051, 0.0920015200972557, 0.03213934227824211, 0.05333075299859047, -0.07896731048822403, -0.17026659846305847, 0.07008247822523117, -0.03958839178085327, 0.048023566603660583, 0.07473675161600113, 0.08774058520793915, -0.3366416096687317, -0.2944854497909546, -0.06561952084302902, 0.4967125356197357, -0.08726534247398376, 0.021746918559074402, 0.31248462200164795, -0.06976428627967834, 0.11958535015583038, 0.10105251520872116, 0.017050258815288544, 0.12124528735876083, 0.21734923124313354, -0.2987900674343109, 0.08227728307247162, 0.04997570440173149, 0.10362635552883148, 0.10990824550390244, -0.437208890914917, 0.031216565519571304, -0.09358520805835724, -0.001214146614074707, -0.1866215318441391, 0.04080400988459587, 0.32968565821647644, -0.44505226612091064, 0.10341265797615051, -0.2882237136363983, -0.04475478455424309, 0.06844322383403778, -0.28389695286750793, 0.00726114958524704, -0.24149155616760254, -0.0975041538476944, -0.075874462723732, -0.01664840243756771, -0.30374833941459656, 0.11094861477613449, -0.04273761808872223, -0.0906253531575203, -0.5665924549102783, -0.21058019995689392, 0.33709830045700073, -0.09234876930713654, -0.26661139726638794, 0.33489489555358887, 0.40267664194107056, -0.1532086431980133, 0.06089526414871216, 0.41407662630081177, 0.7394435405731201, 0.1910044252872467, 0.1606758087873459, 0.2619001865386963, 0.08413992822170258, -0.20153912901878357, -0.042047251015901566, 0.2203235924243927, 0.10124577581882477, 0.17816327512264252, 0.28802722692489624, 0.09362772852182388, 0.03751344606280327, 0.34345677495002747, -0.0696936845779419, 0.2381635308265686, -0.21904051303863525, 0.32330575585365295, -0.3449884057044983, -0.06966948509216309, -0.1655760556459427, 0.21880999207496643, -0.5301278829574585, 0.1894240379333496, 0.4102366864681244, -0.27794507145881653, 0.18720930814743042, -0.24439333379268646, -0.02841171622276306, -0.19788402318954468, 0.4610694646835327, 0.4557262361049652, 0.2500721514225006, -0.0682087317109108, -0.18769729137420654, -0.574560821056366, 0.11802941560745239, -0.23860229551792145, -0.03101646527647972, -0.07531332969665527, 0.1261988878250122, -0.19064652919769287, 0.41071754693984985, 0.021522995084524155, 0.1761244535446167, -0.2209453582763672, 0.0672089159488678, 0.05047325789928436, -0.324869304895401, 0.11496180295944214, 0.3605027496814728, -0.161431223154068, -0.4947203993797302, 0.3339604139328003, -0.12833073735237122, -0.1055947095155716, 0.09269785135984421, -0.009840622544288635, -0.11017397046089172, -0.25603151321411133, 0.4218607544898987, 0.38317015767097473, 0.6233527064323425, -0.05770222842693329, 0.026658453047275543, -0.3133482038974762, -0.3151436746120453, -0.0016494318842887878, -0.09357540309429169, -0.10826870799064636, 0.3669776916503906, -0.2473505437374115, -0.20195509493350983, -0.45843231678009033, 0.040527068078517914, -0.011593922972679138, 0.15867510437965393, 0.07123560458421707, -0.029907021671533585, -0.2554801106452942, 0.22823168337345123, 0.03435228392481804, -0.3365876078605652, 0.016117505729198456, -0.025526463985443115, -0.21077632904052734, -0.26254090666770935, 0.38596615195274353, -0.2822519540786743, -0.2740158438682556, -0.33205994963645935, 0.4361236095428467, -0.027788009494543076, -0.23187397420406342, -0.20252081751823425, 0.21196392178535461, 0.43809252977371216, -0.11342915892601013, -0.43478837609291077, 0.16071385145187378, -0.230851411819458, 0.11639438569545746, 0.05238063633441925, 0.4389037489891052, -0.06807354092597961, -0.29406359791755676, 0.15873834490776062, -0.2209116518497467 ]
https://github.com/huggingface/datasets/issues/6046
You can reply "#self-assign" to this issue to automatically get assigned to it :) Let me know if you have any questions or if I can help
Support proxy and user-agent in fsspec calls
Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies
27
Support proxy and user-agent in fsspec calls Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies You can reply "#self-assign" to this issue to automatically get assigned to it :) Let me know if you have any questions or if I can help
[ -0.2932550609111786, -0.21538400650024414, -0.03676239401102066, -0.3464750051498413, 0.17299112677574158, -0.43857520818710327, 0.18761730194091797, -0.01703154668211937, 0.47794869542121887, 0.343362033367157, -0.4074530005455017, 0.04429791495203972, 0.2771555781364441, 0.4175857603549957, 0.06572681665420532, 0.21069151163101196, -0.034265659749507904, -0.014645542949438095, -0.2727147340774536, 0.002863943576812744, -0.12830644845962524, 0.12993162870407104, 0.22202931344509125, 0.08070544898509979, -0.19141021370887756, 0.26252686977386475, -0.08558085560798645, 0.3385965824127197, -0.02417798899114132, -0.34047624468803406, 0.34344497323036194, 0.34952110052108765, 0.11364664137363434, -0.010872021317481995, -0.00010124589607585222, 0.14235936105251312, 0.19623708724975586, -0.019133076071739197, -0.17413246631622314, 0.13964246213436127, -0.16585832834243774, 0.16458168625831604, -0.00748097151517868, -0.18768088519573212, -0.16942858695983887, 0.07553227245807648, 0.12790903449058533, -0.09441175311803818, 0.3670305907726288, 0.378521203994751, 0.29471486806869507, 0.17382656037807465, -0.19265589118003845, -0.071075439453125, 0.18546874821186066, -0.07215243577957153, -0.029864713549613953, -0.36062073707580566, 0.0786370262503624, -0.1877264529466629, -0.06354131549596786, -0.15466351807117462, -0.04226361960172653, 0.10136911273002625, 0.14710234105587006, -0.1898774802684784, 0.24254965782165527, -0.14115312695503235, -0.039008885622024536, 0.2741793394088745, 0.2625356912612915, 0.03163519129157066, -0.1620427966117859, 0.1396266371011734, -0.19367359578609467, 0.09176009148359299, 0.29259878396987915, -0.3489088714122772, -0.14595293998718262, 0.05241940915584564, 0.4501984119415283, -0.2119801640510559, -0.2317843735218048, 0.14765754342079163, 0.014532364904880524, 0.2698485255241394, 0.05180278420448303, 0.035695239901542664, 0.1575661152601242, -0.02297987788915634, -0.12893672287464142, -0.021798137575387955, -0.09627047926187515, -0.18529032170772552, -0.3087383508682251, -0.13149438798427582, 0.24243387579917908, 0.20224922895431519, -0.03733302652835846, 0.11259455233812332, -0.12491355836391449, 0.2773599326610565, -0.05783151835203171, 0.41413503885269165, -0.2823522686958313, 0.07235918939113617, -0.0647716224193573, 0.019971709698438644, 0.2871769964694977, -0.017350511625409126, -0.00341709703207016, -0.06343642622232437, 0.17531660199165344, -0.09999600797891617, -0.49701258540153503, 0.03188823536038399, -0.1731165647506714, -0.15029703080654144, -0.046700071543455124, -0.1659376323223114, 0.1293994039297104, 0.24087005853652954, 0.17421232163906097, 0.42989176511764526, 0.08649478107690811, 0.47458499670028687, 0.21942013502120972, -0.009121041744947433, -0.45605653524398804, -0.013750508427619934, -0.17901717126369476, 0.1947336196899414, -0.1869814395904541, 0.24304254353046417, 0.07013779878616333, 0.2652209997177124, 0.10221020877361298, -0.1993199586868286, 0.268419474363327, 0.19272670149803162, 0.1846465766429901, -0.17711803317070007, 0.006320498883724213, 0.32467707991600037, 0.16043147444725037, -0.22845672070980072, -0.08144889026880264, -0.07691022753715515, -0.10452733933925629, -0.18177232146263123, -0.15776708722114563, -0.3076270818710327, 0.04279528558254242, 0.21779459714889526, 0.1334962397813797, -0.2303818166255951, -0.3449230492115021, -0.07188870012760162, -0.26878246665000916, 0.1073574349284172, 0.10338592529296875, 0.0285709910094738, -0.25299298763275146, 0.0068588294088840485, 0.05452703684568405, 0.21774792671203613, 0.29308298230171204, -0.2278260588645935, -0.017874382436275482, -0.22167256474494934, 0.09929627180099487, -0.10425306856632233, 0.08265429735183716, -0.0084896981716156, -0.2671736180782318, 0.4547155797481537, 0.22517676651477814, -0.6981154680252075, -0.13000795245170593, 0.331479549407959, 0.08307978510856628, -0.1121375635266304, 0.1736457794904709, -0.1486310362815857, 0.30856993794441223, -0.006066452711820602, -0.10083097219467163, 0.5093599557876587, 0.019850226119160652, 0.19270259141921997, -0.2353094220161438, -0.3834993541240692, -0.3059079945087433, 0.15343204140663147, 0.32358086109161377, 0.28035637736320496, 0.08512508124113083, -0.1802426427602768, 0.3828815817832947, -0.05468394234776497, 0.17911997437477112, -0.16257545351982117, 0.37023264169692993, 0.5157551765441895, 0.04862407222390175, 0.08151280879974365, 0.16399650275707245, 0.19106875360012054, -0.3810206651687622, 0.11565259099006653, 0.39837631583213806, -0.16508491337299347, -0.08329300582408905, -0.05714065954089165, -0.009022967889904976, -0.05385759472846985, 0.2469758689403534, 0.18046757578849792, -0.17037734389305115, -0.10344010591506958, 0.15021196007728577, 0.5207731127738953, 0.20787668228149414, 0.15415695309638977, -0.01396189071238041, 0.4949028193950653, -0.07930852472782135, -0.1483963578939438, 0.07515504211187363, 0.06178758665919304, 0.38161084055900574, -0.05825243145227432, -0.17180931568145752, 0.23771709203720093, 0.24612092971801758, 0.115150585770607, 0.2682812511920929, 0.3252604603767395, 0.17214156687259674, -0.04443710669875145, 0.05768235772848129, 0.05304188281297684, 0.16435855627059937, 0.1371462047100067, 0.31010857224464417, 0.2342500239610672, 0.35086217522621155, 0.09675563871860504, 0.2280837893486023, 0.18922463059425354, 0.23183628916740417, -0.2568715214729309, 0.11882662773132324, 0.03601856529712677, 0.03765213489532471, 0.046847932040691376, 0.07006768882274628, -0.08347965031862259, 0.08213821053504944, 0.18504655361175537, -0.04990103840827942, 0.30043089389801025, 0.16644620895385742, 0.1541813313961029, 0.115973562002182, -0.1530645489692688, 0.5463871955871582, -0.19993197917938232, 0.1090666726231575, 0.3133530616760254, -0.09628082811832428, -0.020908519625663757, 0.02404056489467621, -0.05977858230471611, 0.18993887305259705, -0.20315390825271606, 0.02779867872595787, -0.11921101808547974, 0.02268778532743454, -0.11838480830192566, -0.40410441160202026, -0.311351478099823, -0.20693251490592957, -0.12641410529613495, -0.3906465172767639, -0.02285623922944069, -0.3260370194911957, -0.22322554886341095, 0.3702195882797241, 0.24522915482521057, 0.23435789346694946, -0.35298067331314087, 0.13472366333007812, 0.42684608697891235, -0.23722849786281586, 0.15352702140808105, -0.29356443881988525, 0.3563958406448364, -0.2650773525238037, 0.34757617115974426, -0.39517927169799805, 0.22539439797401428, -0.24459567666053772, 0.11691095679998398, 0.07743796706199646, 0.2169106900691986, 0.12120352685451508, 0.19968968629837036, -0.08763612806797028, -0.2635097801685333, -0.165164977312088, 0.19624465703964233, 0.22496286034584045, 0.05446338653564453, -0.06156614422798157, 0.03650921210646629, 0.25617456436157227, 0.0998099222779274, 0.18375995755195618, -0.1945047527551651, -0.0009301081299781799, 0.07412901520729065, -0.06951703131198883, -0.16207492351531982, -0.17479188740253448, -0.02236461266875267, -0.32329025864601135, -0.33197712898254395, -0.02277928590774536, -0.3357173800468445, 0.17814704775810242, -0.12321542948484421, -0.02326694130897522, -0.12902861833572388, -0.19386105239391327, -0.2236594557762146, -0.2816044092178345, -0.46146756410598755, 0.14171582460403442, -0.29508471488952637, -0.17490515112876892, -0.018733777105808258, 0.05416727811098099, -0.22184714674949646, -0.12155495584011078, -0.24638529121875763, -0.5855593681335449, -0.23624634742736816, 0.17973224818706512, -0.12507523596286774, -0.01064535602927208, 0.35333719849586487, -0.06751276552677155, -0.3103395402431488, -0.1718393862247467, 0.009092815220355988, 0.29979920387268066, 0.22593866288661957, 0.09219633042812347, -0.09656412899494171, 0.08696813881397247, 0.14805465936660767, 0.23998421430587769, 0.08767185360193253, 0.3688735067844391, 0.6560508608818054, -0.14326737821102142, 0.06439919769763947, -0.08596327155828476, -0.00451071560382843, 0.31823021173477173, -0.07184630632400513, 0.06323597580194473, 0.29558342695236206, 0.13400180637836456, 0.06496227532625198, -0.10337839275598526, -0.034029778093099594, 0.03645039349794388, -0.43796858191490173, -0.11451569944620132, -0.21908965706825256, -0.02159445360302925, -0.02659212052822113, -0.04246988892555237, -0.15917843580245972, 0.04126720875501633, 0.29914021492004395, 0.3694363236427307, -0.040983524173498154, 0.00235183909535408, -0.04101559519767761, 0.05541248619556427, -0.5763211250305176, 0.34905776381492615, -0.09332576394081116, 0.19682677090168, -0.3936777710914612, 0.006723999977111816, 0.12073485553264618, -0.11428026854991913, 0.2993941307067871, -0.2903355062007904, 0.1735221892595291, -0.022174492478370667, 0.02951282262802124, -0.03725948557257652, 0.014048755168914795, 0.24225693941116333, -0.014988590031862259, -0.08321724086999893, -0.2159947156906128, -0.05038665235042572, -0.2812776565551758, -0.41608569025993347, -0.7275912165641785, -0.21683716773986816, -0.11818995326757431, -0.07794369012117386, -0.3499261438846588, -0.06323909014463425, -0.04076462611556053, -0.08453010022640228, -0.26407235860824585, -0.050455205142498016, -0.3248072862625122, 0.07771708816289902, -0.07379002869129181, 0.14174360036849976, 0.09704019129276276, -0.13308629393577576, -0.15604135394096375, -0.02295944094657898, 0.08734406530857086, 0.22199606895446777, 0.20931260287761688, 0.36676380038261414, -0.11607587337493896, -0.11451441049575806, 0.05781721696257591, -0.03791791945695877, 0.030401263386011124, 0.3698388636112213, -0.09135745465755463, 0.35998666286468506, -0.15467803180217743, 0.21298637986183167, -0.35014593601226807, 0.1860279142856598, 0.07688305526971817, 0.07555415481328964, 0.3621528744697571, -0.045661602169275284, 0.34229564666748047, -0.09599336981773376, -0.2280859649181366, 0.06720316410064697, 0.45709651708602905, -0.30411580204963684, 0.6211251616477966, -0.2099296897649765, 0.6750496625900269, 0.17184454202651978, 0.05400601774454117, 0.24474969506263733, -0.2686428427696228, -0.1925731599330902, -0.5099818706512451, -0.07426387071609497, 0.022573813796043396, 0.1759176254272461, -0.11376235634088516, 0.05015680938959122, 0.27543455362319946, -0.05116468667984009, -0.16056843101978302, 0.1207912415266037, 0.04262398183345795, -0.20981889963150024, 0.0004237741231918335, 0.31772273778915405, -0.22249843180179596, -0.38289016485214233, -0.14651885628700256, 0.43457895517349243, 0.06956645846366882, 0.1180214136838913, 0.0006483942270278931, -0.1361190676689148, -0.037835001945495605, -0.13011597096920013, -0.11240574717521667, 0.2449849247932434, -0.1987030953168869, 0.10360727459192276, -0.0003678109496831894, 0.6059920787811279, -0.039374884217977524, -0.38844674825668335, 0.11130761355161667, -0.1449613720178604, -0.13177911937236786, 0.30175691843032837, 0.13431520760059357, 0.3882025182247162, -0.13848629593849182, -0.3000059723854065, 0.14747202396392822, -0.20614346861839294, -0.33365708589553833, -0.07452444732189178, -0.07376012206077576, -0.4089708924293518, 0.09341508150100708, -0.21559220552444458, 0.4514751434326172, 0.08342981338500977, 0.4393669366836548, 0.14202968776226044, -0.042190052568912506, -0.06488156318664551, 0.24640174210071564, -0.10959217697381973, -0.22443781793117523, 0.41367220878601074, 0.0409739650785923, -0.027724817395210266, -0.035230133682489395, 0.10897698998451233, -0.23065316677093506, 0.31258755922317505, 0.22783958911895752, -0.3061384856700897, -0.22657519578933716, -0.23704764246940613, -0.1088726818561554, -0.016907669603824615, 0.2093370407819748, 0.04597240313887596, 0.000019706785678863525, -0.614836573600769, -0.027763960883021355, 0.14119410514831543, -0.036947526037693024, 0.01396538782864809, -0.020017758011817932, -0.23210325837135315, -0.09379327297210693, -0.019545316696166992, -0.37606197595596313, 0.16456951200962067, -0.12325697392225266, 0.40216299891471863, 0.004463709890842438, 0.13196127116680145, -0.45143431425094604, -0.11129121482372284, -0.24008788168430328, 0.04292241111397743, -0.31894850730895996, -0.24894583225250244, 0.15069398283958435, -0.12916184961795807, 0.17484493553638458, 0.039621688425540924, -0.37602609395980835, -0.26454663276672363, -0.25090253353118896, 0.08578694611787796, 0.17940175533294678, -0.14258497953414917, -0.056606944650411606, -0.08559662848711014, -0.10696446895599365, -0.011360984295606613, 0.11781807243824005, 0.339072585105896, -0.291908323764801, 0.021551597863435745, 0.23366901278495789, -0.09423097968101501, 0.015178874135017395, 0.3219013512134552, 0.28055447340011597, 0.22068968415260315, -0.27475839853286743, 0.007738687098026276, -0.307628333568573, -0.09484389424324036, 0.34368255734443665, 0.24262163043022156, 0.38032206892967224, 0.14696820080280304, 0.10797037184238434, 0.19883497059345245, -0.11579274386167526, -0.00836692750453949, -0.05711391940712929, -0.014241650700569153, 0.08822903037071228, 0.05439579486846924, 0.15726520121097565, 0.34116867184638977, -0.00804850086569786, 0.07388243079185486, 0.19075720012187958, -0.26471734046936035, 0.2006387561559677, -0.009542994201183319, 0.35927167534828186, -0.0363684743642807, 0.19134041666984558, 0.1142645850777626, -0.2841613292694092, 0.031028158962726593, -0.13181087374687195, -0.5889086127281189, -0.36284002661705017, 0.25931939482688904, 0.16117385029792786, -0.14505328238010406, 0.1477634310722351, 0.4316440224647522, 0.22497998178005219, 0.37327471375465393, -0.2636863589286804, 0.2913430631160736, 0.04068770632147789, -0.5772364139556885, -0.03232573717832565, -0.40906065702438354, -0.15175709128379822, 0.05787288397550583, -0.0392783023416996, 0.2526974678039551, -0.14590629935264587, -0.2998805642127991, -0.2075706273317337, 0.03692036122083664, -0.1192474216222763, -0.38403046131134033, 0.0697934478521347, 0.1303483545780182, -0.37743282318115234, -0.23593007028102875, 0.16621416807174683, -0.10308638215065002, 0.2833329439163208, 0.10562707483768463, 0.09538701176643372, 0.11175404489040375, -0.3310357928276062, 0.09798934310674667, 0.34468114376068115, -0.05168914422392845, 0.20049870014190674, -0.16682718694210052, -0.1671125292778015, 0.16475525498390198, 0.050991982221603394, 0.19170866906642914, 0.13534347712993622, -0.31969237327575684, -0.026059556752443314, 0.21715790033340454, 0.10378734022378922, -0.2207752764225006, -0.15726958215236664, 0.10479774326086044, -0.07309503853321075, 0.12498081475496292, 0.21576163172721863, -0.24629616737365723, -0.02437480539083481, -0.3848251402378082, 0.18960168957710266, -0.04851563647389412, 0.4645485281944275, 0.388430655002594, 0.32551735639572144, -0.08503321558237076, 0.05847134068608284, -0.4536982774734497, 0.006956163793802261, 0.15219639241695404, -0.4129169285297394, 0.23992817103862762, -0.22035539150238037, 0.1368541121482849, -0.13552641868591309, 0.32976067066192627, -0.04066949337720871, -0.05259428918361664, -0.0937262773513794, 0.03037741780281067, -0.05665234848856926, -0.024133577942848206, -0.0018416752573102713, -0.20429539680480957, -0.15972629189491272, 0.20998376607894897, 0.10014210641384125, -0.24596816301345825, 0.17586155235767365, -0.08803195506334305, 0.4879894256591797, 0.10051581263542175, -0.25409969687461853, 0.2741960883140564, -0.07033911347389221, 0.1296755075454712, 0.22944359481334686, -0.40220797061920166, 0.18169498443603516, 0.3833293318748474, 0.17875847220420837, 0.200489342212677, -0.3300868272781372, 0.22969591617584229, -0.5608978271484375, 0.390007346868515, -0.009468323551118374, 0.17685317993164062, -0.32702723145484924, 0.05247420817613602, 0.11239665001630783, -0.20100009441375732, -0.16411292552947998, -0.7290145754814148, -0.20613478124141693, 0.018274903297424316, -0.07583718001842499, 0.18332718312740326, -0.2883632481098175, 0.02328825369477272, -0.10628368705511093, -0.27502942085266113, -0.1989370882511139, 0.21921300888061523, -0.21237745881080627, 0.18530815839767456, -0.27874261140823364, 0.2583288252353668, 0.05862046033143997, -0.00866624340415001, -0.12709349393844604, -0.13087478280067444, 0.5269294381141663, 0.008717842400074005, -0.02870207279920578, -0.3996548056602478, 0.3970084488391876, -0.16167327761650085, 0.11772152781486511, -0.009626701474189758, 0.0025941282510757446, -0.11531327664852142, 0.005394861102104187, 0.07599549740552902, 0.23724643886089325, -0.015123527497053146, 0.11032126843929291, -0.24671992659568787, 0.046818241477012634, 0.1394936889410019, 0.3032229244709015, 0.0990888774394989, -0.07873287051916122 ]
https://github.com/huggingface/datasets/issues/6046
Actually i am quite new to figure it out how everything goes and done > You can reply "#self-assign" to this issue to automatically get assigned to it :) > Let me know if you have any questions or if I can help when i wrote #self-assign it automatically got converted to some number is it correct or i have done it some wrong way, I am quite new to open source thus wanna try to learn and explore it
Support proxy and user-agent in fsspec calls
Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies
80
Support proxy and user-agent in fsspec calls Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies Actually i am quite new to figure it out how everything goes and done > You can reply "#self-assign" to this issue to automatically get assigned to it :) > Let me know if you have any questions or if I can help when i wrote #self-assign it automatically got converted to some number is it correct or i have done it some wrong way, I am quite new to open source thus wanna try to learn and explore it
[ -0.18757732212543488, -0.25471335649490356, -0.026860706508159637, -0.33133217692375183, 0.18308435380458832, -0.46210718154907227, 0.10263780504465103, -0.0518229678273201, 0.47567886114120483, 0.31738150119781494, -0.39469096064567566, 0.12045934796333313, 0.2528075873851776, 0.4866553544998169, 0.09826994687318802, 0.100507453083992, -0.009645521640777588, -0.05600063502788544, -0.3421279489994049, 0.005169227719306946, -0.2190406620502472, 0.14257049560546875, 0.19919650256633759, 0.05600111559033394, -0.16036459803581238, 0.23608462512493134, -0.1501661241054535, 0.2688262164592743, -0.09991715103387833, -0.42438894510269165, 0.2951878309249878, 0.39626067876815796, 0.12743616104125977, -0.040056902915239334, -0.00010483864753041416, 0.05972328037023544, 0.18570400774478912, -0.02602579817175865, -0.12346357852220535, 0.08795084804296494, -0.13623613119125366, 0.12974593043327332, -0.017170246690511703, -0.19287028908729553, -0.09647053480148315, 0.07416139543056488, 0.1028178483247757, -0.1819477677345276, 0.3791636824607849, 0.3631869852542877, 0.2567847669124603, 0.10110387206077576, -0.07823669910430908, -0.03952857479453087, 0.24758757650852203, -0.022868242114782333, -0.032308995723724365, -0.37387698888778687, 0.19945478439331055, -0.14146658778190613, -0.024134550243616104, -0.16597606241703033, -0.07741710543632507, 0.0571269728243351, 0.2647356688976288, -0.18406756222248077, 0.219137042760849, -0.30974292755126953, -0.13041923940181732, 0.33378666639328003, 0.3687454164028168, -0.025885116308927536, -0.17157897353172302, 0.17798541486263275, -0.1902446746826172, 0.12289098650217056, 0.22221389412879944, -0.3129290044307709, -0.1645757406949997, 0.09600420296192169, 0.5454896092414856, -0.24534450471401215, -0.2624135911464691, 0.1625603288412094, 0.05089014768600464, 0.3430238366127014, 0.0003667473793029785, 0.09425018727779388, 0.18867743015289307, 0.0251070037484169, -0.11698342859745026, -0.08263927698135376, -0.11336074024438858, -0.07807676494121552, -0.2835782766342163, -0.13950856029987335, 0.2205001264810562, 0.19407540559768677, 0.06065957248210907, 0.13978421688079834, -0.18454119563102722, 0.19114747643470764, -0.23766842484474182, 0.48867449164390564, -0.29544907808303833, 0.06842920929193497, -0.08529117703437805, 0.11537160724401474, 0.24209386110305786, -0.10918223112821579, 0.12081350386142731, -0.07942147552967072, 0.12216523289680481, -0.07704304158687592, -0.5240926742553711, 0.0780625194311142, -0.0808735117316246, -0.13715822994709015, -0.028515350073575974, -0.14139437675476074, 0.09701350331306458, 0.184828519821167, 0.2200831025838852, 0.3762449026107788, 0.059741128236055374, 0.5047339797019958, 0.22506015002727509, -0.039590105414390564, -0.43088382482528687, -0.08370806276798248, -0.12955079972743988, 0.24761712551116943, -0.2371956706047058, 0.25357386469841003, -0.0013229399919509888, 0.19533562660217285, 0.14602038264274597, -0.17384891211986542, 0.2248876392841339, 0.13675209879875183, 0.22596734762191772, -0.21348021924495697, -0.043704159557819366, 0.2698003947734833, 0.031621053814888, -0.291140079498291, -0.08415189385414124, -0.09060072898864746, -0.19876763224601746, -0.09562531113624573, -0.2394513487815857, -0.2949417531490326, -0.03695106506347656, 0.18222172558307648, 0.16588610410690308, -0.23144586384296417, -0.341386079788208, -0.0053400867618620396, -0.3088116943836212, 0.10153014957904816, 0.1827722191810608, -0.012802500277757645, -0.17947141826152802, -0.0016443058848381042, 0.10901440680027008, 0.2478560358285904, 0.3535516858100891, -0.2629450559616089, -0.00718940794467926, -0.22219812870025635, 0.15964600443840027, -0.18464545905590057, 0.1279570460319519, -0.029672227799892426, -0.25472137331962585, 0.3863101899623871, 0.29406145215034485, -0.6970908045768738, -0.08794835954904556, 0.31316348910331726, 0.14369900524616241, -0.09286133944988251, 0.21784453094005585, -0.0511113777756691, 0.3332342505455017, -0.011947795748710632, -0.15968705713748932, 0.5335992574691772, -0.07299502938985825, 0.16004182398319244, -0.23570051789283752, -0.41219377517700195, -0.35957223176956177, 0.1352468878030777, 0.33295539021492004, 0.3494904637336731, 0.09793905913829803, -0.2325795292854309, 0.3597624897956848, -0.07931910455226898, 0.18985429406166077, -0.25097164511680603, 0.4542321562767029, 0.5339587926864624, 0.06572961807250977, -0.006991684436798096, 0.2041224241256714, 0.13919228315353394, -0.41246819496154785, 0.04629136249423027, 0.4581383466720581, -0.1835518479347229, -0.11543981730937958, -0.02561831846833229, 0.024307698011398315, -0.055075209587812424, 0.1602715253829956, 0.1815570592880249, -0.17427855730056763, -0.18296484649181366, 0.09762756526470184, 0.5389408469200134, 0.18290118873119354, 0.1758311241865158, -0.021093878895044327, 0.4569642245769501, -0.07384681701660156, -0.12059539556503296, 0.07449162006378174, 0.10621634125709534, 0.39096173644065857, -0.055292025208473206, -0.16915443539619446, 0.1751767098903656, 0.2730969488620758, 0.09812090545892715, 0.29433685541152954, 0.40712013840675354, 0.1789952516555786, -0.08093596249818802, 0.11437525600194931, 0.019324891269207, 0.18496021628379822, 0.07335330545902252, 0.35876038670539856, 0.22940827906131744, 0.3219781517982483, 0.07220789790153503, 0.13784101605415344, 0.2149333357810974, 0.1483355462551117, -0.23339182138442993, 0.06991029530763626, 0.08210195600986481, -0.03178969398140907, 0.08773787319660187, 0.08749768137931824, -0.04931207746267319, 0.07120589166879654, 0.14886286854743958, -0.018733220174908638, 0.24142548441886902, 0.11186294257640839, 0.19998887181282043, 0.11475290358066559, -0.1472226083278656, 0.49686601758003235, -0.1861313283443451, 0.11111754179000854, 0.314134418964386, -0.22118474543094635, 0.014111841097474098, 0.06251975893974304, -0.0015115998685359955, 0.16154193878173828, -0.13316112756729126, 0.04296516254544258, -0.10466166585683823, -0.06544998288154602, 0.014340627938508987, -0.23320229351520538, -0.43778273463249207, -0.24270430207252502, -0.07561096549034119, -0.4070464074611664, -0.0705762505531311, -0.277948260307312, -0.15624544024467468, 0.32151859998703003, 0.268776535987854, 0.29364779591560364, -0.25530678033828735, 0.05709253251552582, 0.39644908905029297, -0.22581641376018524, 0.18170076608657837, -0.29418396949768066, 0.44448545575141907, -0.34641921520233154, 0.4123321771621704, -0.38658589124679565, 0.2024349719285965, -0.2200017273426056, 0.07125528156757355, 0.16631312668323517, 0.10298579186201096, 0.19157302379608154, 0.21977508068084717, -0.05555463954806328, -0.2932629883289337, -0.2028767466545105, 0.19028788805007935, 0.20243221521377563, 0.08370447158813477, -0.03691769018769264, 0.005390781909227371, 0.2574881613254547, 0.1031375452876091, 0.053445033729076385, -0.14857369661331177, -0.00688127800822258, 0.0019335225224494934, -0.14753738045692444, -0.15662206709384918, -0.18309131264686584, -0.036228030920028687, -0.40852847695350647, -0.3696596920490265, 0.07081475853919983, -0.34560614824295044, 0.2308402955532074, -0.15448929369449615, -0.07805609703063965, -0.05525245890021324, -0.12298794835805893, -0.19022169709205627, -0.20808842778205872, -0.4615981876850128, 0.16367244720458984, -0.2613450884819031, -0.14254677295684814, -0.05618108808994293, -0.04556914418935776, -0.22130794823169708, -0.13604991137981415, -0.27428948879241943, -0.6137534976005554, -0.17885664105415344, 0.2163672149181366, -0.17198780179023743, 0.09760914742946625, 0.37112006545066833, -0.02897285856306553, -0.23780325055122375, -0.17961588501930237, 0.014123775064945221, 0.23530103266239166, 0.3088909387588501, 0.07650406658649445, 0.047717854380607605, 0.07612800598144531, 0.09779258072376251, 0.38798728585243225, 0.07973723113536835, 0.3619968593120575, 0.6255518794059753, -0.005781297571957111, 0.019209295511245728, -0.10248954594135284, -0.028653912246227264, 0.3264048099517822, -0.08716597408056259, 0.1388334333896637, 0.28666916489601135, 0.15047134459018707, 0.13322553038597107, -0.08665113896131516, -0.06219405680894852, 0.015322387218475342, -0.354512095451355, -0.07125582545995712, -0.3338339924812317, 0.014012273401021957, -0.16194814443588257, -0.16387343406677246, -0.18384774029254913, 0.09520453214645386, 0.27560335397720337, 0.3494260907173157, 0.0374753437936306, 0.030275441706180573, -0.05707491189241409, 0.061713188886642456, -0.5540211200714111, 0.39323630928993225, -0.11822416633367538, 0.041083868592977524, -0.30157580971717834, 0.1071237102150917, 0.13552771508693695, -0.06283257901668549, 0.2323555201292038, -0.18097902834415436, 0.04587133228778839, -0.0019146203994750977, 0.07901418209075928, 0.060336530208587646, 0.04201197624206543, 0.24627867341041565, -0.0407572016119957, -0.06735721230506897, -0.3001447021961212, -0.0389338880777359, -0.3113595247268677, -0.33371859788894653, -0.7408836483955383, -0.19085289537906647, -0.1197558045387268, -0.026694059371948242, -0.42182421684265137, -0.02729940414428711, -0.016943451017141342, 0.028619706630706787, -0.17738571763038635, -0.05952388420701027, -0.34527069330215454, 0.06738164275884628, -0.02583787590265274, 0.21710996329784393, -0.021400585770606995, -0.16009289026260376, -0.1360425502061844, 0.0011550858616828918, 0.007351402193307877, 0.20245474576950073, 0.23781420290470123, 0.36218369007110596, -0.17894653975963593, -0.12347479909658432, 0.085475854575634, -0.004610415548086166, 0.1292596459388733, 0.28644582629203796, -0.021010078489780426, 0.37381482124328613, -0.19187545776367188, 0.2287674844264984, -0.4242938756942749, 0.17433889210224152, 0.08624415844678879, 0.12455161660909653, 0.3027764558792114, -0.15580785274505615, 0.42446109652519226, -0.08812855929136276, -0.2857170104980469, 0.2007926106452942, 0.49318039417266846, -0.2667285203933716, 0.660148561000824, -0.1541360467672348, 0.8263934850692749, 0.180210679769516, 0.030056919902563095, 0.1817026436328888, -0.4120723307132721, -0.12323184311389923, -0.6022040843963623, -0.14711669087409973, 0.0016734302043914795, 0.2459128201007843, -0.1762082874774933, 0.0015738680958747864, 0.3875705897808075, -0.11756037175655365, -0.3144151568412781, 0.10248719155788422, 0.05979514122009277, -0.3387691080570221, 0.023086823523044586, 0.34002548456192017, -0.18494388461112976, -0.4423976540565491, -0.07197645306587219, 0.3763026297092438, -0.00031568482518196106, 0.18071740865707397, 0.008808448910713196, -0.15062804520130157, -0.034284837543964386, -0.08316121995449066, -0.15880045294761658, 0.19141536951065063, -0.1696391999721527, 0.05923838913440704, 0.08535636961460114, 0.6295823454856873, 0.055471271276474, -0.30813294649124146, 0.17997246980667114, -0.1827104538679123, -0.07062698900699615, 0.2865147590637207, 0.1840728521347046, 0.41451746225357056, -0.062261536717414856, -0.27292874455451965, 0.2137731909751892, -0.23575811088085175, -0.3691176772117615, 0.033791426569223404, -0.09990033507347107, -0.4008350372314453, -0.003528684377670288, -0.2691449522972107, 0.6076215505599976, 0.07579397410154343, 0.40995433926582336, 0.1935148537158966, -0.03063274174928665, -0.011700443923473358, 0.2137986272573471, -0.0015024151653051376, -0.3031134605407715, 0.45513516664505005, 0.008139275945723057, -0.01707369089126587, -0.0030304985120892525, -0.04976930469274521, -0.1845085620880127, 0.32664424180984497, 0.18478801846504211, -0.37185677886009216, -0.19046562910079956, -0.1590251326560974, -0.0738062709569931, -0.05364958569407463, 0.21806107461452484, 0.01763659343123436, 0.04854441061615944, -0.6499881744384766, -0.04412703216075897, 0.1614605039358139, 0.00045398931251838803, 0.12706519663333893, -0.011838793754577637, -0.2269144058227539, -0.12186959385871887, -0.08434954285621643, -0.46112877130508423, 0.12507647275924683, -0.1363176703453064, 0.32103222608566284, 0.002789422869682312, 0.25341054797172546, -0.4144750237464905, -0.1827583611011505, -0.273196280002594, 0.08140064775943756, -0.2294396311044693, -0.2421438843011856, -0.011101190000772476, -0.06904708594083786, 0.13537564873695374, 0.03585316985845566, -0.4067811071872711, -0.19505810737609863, -0.3272155821323395, 0.13000230491161346, 0.09550085663795471, -0.16213761270046234, -0.07575121521949768, -0.08807448297739029, -0.1104796901345253, -0.015689926221966743, 0.08945134282112122, 0.31959885358810425, -0.3096655607223511, 0.06145255267620087, 0.26992738246917725, -0.05659810081124306, 0.043875038623809814, 0.4139321446418762, 0.36194300651550293, 0.21636924147605896, -0.25280827283859253, 0.09133937954902649, -0.2956027090549469, -0.12629209458827972, 0.32168036699295044, 0.25023341178894043, 0.4709448218345642, 0.06222783401608467, 0.18724536895751953, 0.3016929626464844, -0.029994651675224304, -0.02395414374768734, -0.14381438493728638, -0.09644981473684311, 0.1235896497964859, 0.1412264108657837, 0.18525287508964539, 0.3092012107372284, 0.033136509358882904, 0.09270945191383362, 0.2431696653366089, -0.2672719359397888, 0.14226621389389038, -0.03224228322505951, 0.38500696420669556, 0.003710225224494934, 0.24165873229503632, 0.0586070790886879, -0.2788885235786438, 0.08079906553030014, -0.07474605739116669, -0.6889020800590515, -0.3375464081764221, 0.2540850341320038, 0.17025598883628845, -0.13586920499801636, 0.15662041306495667, 0.2259039580821991, 0.15531381964683533, 0.3499734699726105, -0.28077250719070435, 0.3945970833301544, 0.09578824788331985, -0.6041725873947144, 0.0327533558011055, -0.42910507321357727, -0.18896484375, 0.09781111776828766, -0.0577874556183815, 0.2081013023853302, -0.12412865459918976, -0.35137704014778137, -0.11816203594207764, 0.07398399710655212, -0.11439477652311325, -0.4263971447944641, 0.09792540967464447, 0.10333801805973053, -0.4077253043651581, -0.2780078053474426, 0.2062508761882782, -0.16133499145507812, 0.27466630935668945, 0.12261324375867844, 0.06231868267059326, 0.16433295607566833, -0.3562149703502655, 0.1252308487892151, 0.38741418719291687, -0.11171142756938934, 0.24485281109809875, -0.23394767940044403, -0.17686676979064941, 0.1406072974205017, 0.11325600743293762, 0.17884528636932373, 0.17454595863819122, -0.33296599984169006, -0.04993071034550667, 0.23532158136367798, 0.13176319003105164, -0.1316138207912445, -0.2021297812461853, 0.09513270854949951, -0.09225897490978241, 0.026851695030927658, 0.15619325637817383, -0.1747279018163681, -0.031922776252031326, -0.4632221460342407, 0.15135672688484192, -0.16179321706295013, 0.4885766804218292, 0.4345533549785614, 0.21481433510780334, -0.014659120701253414, 0.1627373844385147, -0.5346630215644836, 0.04198582097887993, 0.1657344251871109, -0.4399719834327698, 0.1616559773683548, -0.20535218715667725, 0.11178448796272278, -0.14695096015930176, 0.22115039825439453, 0.008540146052837372, -0.026353012770414352, -0.10012480616569519, 0.009490951895713806, -0.01707778126001358, 0.015525471419095993, 0.09837503731250763, -0.3047924339771271, -0.08688327670097351, 0.12197161465883255, 0.13091707229614258, -0.27405160665512085, 0.18259847164154053, -0.14558956027030945, 0.53053879737854, 0.18316997587680817, -0.26015859842300415, 0.28487488627433777, -0.08539912104606628, 0.1444077044725418, 0.25165504217147827, -0.32125213742256165, 0.13126829266548157, 0.4128122329711914, 0.11905089765787125, 0.12946663796901703, -0.3366624712944031, 0.3274650573730469, -0.5764453411102295, 0.41154128313064575, 0.023390891030430794, 0.20427165925502777, -0.3113611936569214, 0.06428953260183334, 0.22152772545814514, -0.22085078060626984, -0.12271377444267273, -0.7590773701667786, -0.23392713069915771, 0.024747446179389954, -0.1287337839603424, 0.0973297506570816, -0.3111281991004944, 0.05656653642654419, -0.18462952971458435, -0.33483192324638367, -0.17419001460075378, 0.11883331090211868, -0.3199882507324219, 0.11544563621282578, -0.23111018538475037, 0.2506943643093109, 0.13072469830513, 0.016781464219093323, -0.13633811473846436, -0.026058435440063477, 0.47712355852127075, 0.07018856704235077, 0.032708145678043365, -0.3983347415924072, 0.43102124333381653, -0.19057327508926392, 0.14944526553153992, -0.05808638781309128, -0.01791190356016159, -0.021617276594042778, 0.022109564393758774, 0.11708299070596695, 0.28175392746925354, 0.020650971680879593, 0.15420788526535034, -0.2583787143230438, -0.03654739633202553, 0.0751747414469719, 0.4150342047214508, 0.14625389873981476, -0.1358078122138977 ]
https://github.com/huggingface/datasets/issues/6046
Ah yea github tries to replace the #self-assign with an issue link. I guess you can try to copy-paste instead to see if it works Anyway let me assign you manually
Support proxy and user-agent in fsspec calls
Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies
31
Support proxy and user-agent in fsspec calls Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies Ah yea github tries to replace the #self-assign with an issue link. I guess you can try to copy-paste instead to see if it works Anyway let me assign you manually
[ -0.21246172487735748, -0.12840954959392548, -0.012975260615348816, -0.4304368495941162, 0.32901328802108765, -0.3642611503601074, 0.2749650478363037, -0.04147215932607651, 0.4883716106414795, 0.3668379783630371, -0.45113515853881836, 0.20567217469215393, 0.22914642095565796, 0.4269667863845825, 0.14110927283763885, 0.25100114941596985, -0.05627980828285217, -0.18674497306346893, -0.16543351113796234, -0.013205550611019135, -0.1839398443698883, 0.2057473510503769, 0.21673086285591125, 0.07195240259170532, -0.1560295820236206, 0.3220239281654358, 0.0370391309261322, 0.3286905586719513, -0.08574236929416656, -0.3995008170604706, 0.35731807351112366, 0.3864227533340454, 0.05351883918046951, -0.1391819417476654, -0.00010365709022153169, 0.16484901309013367, 0.3218994736671448, -0.03917674347758293, -0.23265914618968964, -0.003350265324115753, -0.20459040999412537, 0.1360751986503601, 0.027839846909046173, -0.2609374523162842, -0.16628602147102356, 0.22452501952648163, 0.22893314063549042, -0.061560120433568954, 0.39152681827545166, 0.39438116550445557, 0.2853517532348633, 0.1559440791606903, -0.027930796146392822, -0.27633577585220337, 0.30269694328308105, -0.1028127372264862, -0.06050184369087219, -0.12350001931190491, 0.08055388927459717, -0.18442928791046143, -0.025838050991296768, -0.21892262995243073, -0.013906136155128479, 0.1502939909696579, 0.19732606410980225, -0.1322687566280365, 0.35587093234062195, -0.14494629204273224, -0.07927070558071136, 0.19664326310157776, 0.23143717646598816, -0.031498685479164124, -0.13988201320171356, 0.19893255829811096, -0.17523035407066345, 0.11336283385753632, 0.21719205379486084, -0.23321837186813354, -0.15692923963069916, 0.03207574784755707, 0.4789779484272003, -0.1664506196975708, -0.2613259553909302, 0.21918237209320068, -0.007955767214298248, 0.40096375346183777, -0.02905782125890255, 0.12045921385288239, 0.29381799697875977, 0.0335322730243206, -0.19478799402713776, 0.012486517429351807, -0.1118718683719635, -0.19172154366970062, -0.20752950012683868, -0.040833692997694016, 0.2888050079345703, 0.0715758204460144, -0.008866652846336365, 0.14361871778964996, -0.13212347030639648, 0.23100239038467407, -0.08381739258766174, 0.39919358491897583, -0.3464437425136566, 0.1373668611049652, 0.014767028391361237, 0.1707960069179535, 0.23885977268218994, 0.023366879671812057, 0.07704156637191772, -0.05196921154856682, 0.10610613226890564, -0.11720532923936844, -0.5063778758049011, 0.07408272475004196, -0.13768061995506287, -0.10756330192089081, -0.150293231010437, -0.08743564784526825, 0.06742885708808899, 0.23768408596515656, 0.05130789801478386, 0.44766223430633545, 0.126024529337883, 0.2866545021533966, 0.3355162739753723, 0.08725285530090332, -0.45306047797203064, 0.07930861413478851, -0.2121884524822235, 0.21706953644752502, -0.26055923104286194, 0.13946598768234253, 0.017041020095348358, 0.19528362154960632, 0.14814631640911102, -0.25455376505851746, 0.25102880597114563, 0.17696580290794373, -0.009880565106868744, -0.059617914259433746, -0.007285561412572861, 0.29642534255981445, 0.11222709715366364, -0.22096827626228333, -0.05715412646532059, -0.2489495426416397, -0.1640845686197281, -0.14868533611297607, -0.08770236372947693, -0.3128824532032013, -0.01409980095922947, 0.19644393026828766, 0.18870198726654053, -0.24227328598499298, -0.48638737201690674, -0.02115076221525669, -0.26314982771873474, 0.22988753020763397, 0.08181944489479065, -0.09592872858047485, -0.14180627465248108, 0.0024702809751033783, 0.12157562375068665, 0.22553375363349915, 0.3257889747619629, -0.23720553517341614, -0.044189464300870895, -0.25762873888015747, 0.25757139921188354, -0.054373469203710556, 0.09044256806373596, -0.023455511778593063, -0.21023304760456085, 0.4354894161224365, 0.234932079911232, -0.7193493843078613, -0.23449936509132385, 0.2666187882423401, 0.07317912578582764, -0.09925787895917892, 0.03949587792158127, -0.0030052363872528076, 0.2584803104400635, 0.013133589178323746, 0.03553135693073273, 0.42790451645851135, 0.06562063097953796, 0.11166708171367645, -0.2991527318954468, -0.38883164525032043, -0.3962840437889099, 0.08455045521259308, 0.2665970027446747, 0.4117199182510376, 0.16224806010723114, -0.2622014582157135, 0.3659069538116455, -0.09520566463470459, 0.19288372993469238, -0.14926579594612122, 0.5190827250480652, 0.4524959921836853, -0.02806568332016468, 0.10361567884683609, 0.06605279445648193, 0.253589391708374, -0.3233790099620819, 0.1694369912147522, 0.45079582929611206, -0.13485607504844666, -0.12822823226451874, 0.030596911907196045, -0.0059508103877305984, -0.13328498601913452, 0.18866980075836182, 0.14936448633670807, -0.13208696246147156, -0.10695221275091171, 0.12673896551132202, 0.43762072920799255, 0.06138785183429718, 0.1328158974647522, 0.0064363256096839905, 0.4257390797138214, -0.1120169535279274, -0.14452725648880005, -0.017585650086402893, 0.10522638261318207, 0.30436402559280396, -0.03816141188144684, -0.11361122131347656, 0.1319546401500702, 0.23081374168395996, -0.056421104818582535, 0.17900127172470093, 0.17757122218608856, 0.04766988754272461, -0.13847868144512177, -0.17178045213222504, 0.09181813895702362, 0.15033434331417084, 0.07847099006175995, 0.28480270504951477, 0.2628938555717468, 0.24300186336040497, 0.09233815968036652, 0.0968763679265976, 0.22405675053596497, 0.3152790367603302, -0.12265272438526154, 0.030772410333156586, 0.03413611650466919, 0.03604549542069435, 0.03732425719499588, 0.1088019534945488, -0.12457297742366791, 0.009035900235176086, 0.13482306897640228, -0.16396117210388184, 0.24200403690338135, 0.07619184255599976, 0.1657068133354187, 0.13360989093780518, -0.10159827023744583, 0.3577122092247009, -0.02843032032251358, 0.12700387835502625, 0.2963446378707886, -0.07160666584968567, 0.022767087444663048, 0.0014072544872760773, -0.09527213871479034, 0.14384153485298157, -0.26505813002586365, -0.007987398654222488, -0.08443135768175125, 0.06095238775014877, -0.14757254719734192, -0.27502721548080444, -0.25051558017730713, -0.20429088175296783, 0.037574976682662964, -0.5208536386489868, -0.1482727974653244, -0.2682071030139923, -0.2135418951511383, 0.40468811988830566, 0.1793125867843628, 0.16170448064804077, -0.4449322819709778, 0.09466589242219925, 0.4369491934776306, -0.27559012174606323, 0.1834944784641266, -0.2039264589548111, 0.2404175102710724, -0.2934924364089966, 0.2571713626384735, -0.3078649640083313, 0.10348088294267654, -0.20512697100639343, 0.11007562279701233, 0.09276705980300903, -0.0017500817775726318, 0.15913276374340057, 0.19353339076042175, -0.17865872383117676, -0.36138099431991577, -0.17704817652702332, 0.11858313530683517, 0.16105827689170837, 0.1699141263961792, -0.009622752666473389, 0.044565748423337936, 0.31834471225738525, 0.1292029321193695, 0.1924467533826828, -0.1504533290863037, -0.04064074158668518, -0.008966553956270218, -0.14387810230255127, -0.26458054780960083, -0.28241240978240967, 0.012140458449721336, -0.3123384416103363, -0.3781483769416809, 0.1273488700389862, -0.14211085438728333, 0.20836609601974487, 0.006195142865180969, -0.1266116052865982, -0.1128929853439331, -0.08006609976291656, -0.27204370498657227, -0.30119550228118896, -0.5375024080276489, 0.22811301052570343, -0.24414804577827454, -0.22304445505142212, 0.0016354545950889587, 0.05976618081331253, -0.1357644945383072, -0.09103792905807495, -0.18264469504356384, -0.5904744267463684, -0.17292986810207367, 0.18625882267951965, -0.07022502273321152, 0.020066561177372932, 0.25579211115837097, -0.04671661555767059, -0.2908453643321991, -0.15400296449661255, -0.05006338655948639, 0.5036152005195618, 0.4430556297302246, 0.05640357360243797, -0.02313118800520897, 0.10775754600763321, 0.09992910921573639, 0.489725261926651, 0.10815166682004929, 0.2719413638114929, 0.6556809544563293, -0.2657482326030731, -0.017373941838741302, -0.0698506161570549, -0.07217371463775635, 0.2125902771949768, -0.003920607268810272, 0.1467365026473999, 0.3224225342273712, 0.07661093771457672, 0.013399573042988777, -0.07341694086790085, -0.005053400993347168, -0.010509975254535675, -0.4443988502025604, -0.12050367891788483, -0.2632617950439453, -0.06274731457233429, -0.11821659654378891, -0.04584619775414467, -0.19875741004943848, 0.016677238047122955, 0.2993786633014679, 0.33718833327293396, -0.08075062930583954, 0.043372463434934616, -0.045144952833652496, 0.09465990215539932, -0.6289858818054199, 0.432884156703949, -0.17386940121650696, 0.07877612113952637, -0.4039385914802551, -0.015989691019058228, 0.1944674551486969, -0.12272916734218597, 0.17237022519111633, -0.3246554434299469, 0.14853528141975403, 0.08433166146278381, 0.10732458531856537, -0.07315461337566376, -0.04988294094800949, 0.2630077600479126, 0.09625554829835892, -0.03526220843195915, -0.2521107792854309, -0.13697615265846252, -0.20951426029205322, -0.289866179227829, -0.8375256061553955, -0.1111363098025322, 0.002334222197532654, -0.19204404950141907, -0.4245913624763489, -0.13890036940574646, 0.02458246797323227, 0.047016024589538574, -0.10100983828306198, 0.011923253536224365, -0.19638216495513916, 0.10557612031698227, -0.07890529930591583, 0.1970740705728531, -0.00038239359855651855, -0.13603679835796356, -0.044431596994400024, -0.07063471525907516, 0.03818506747484207, 0.14236889779567719, 0.18070334196090698, 0.5016218423843384, -0.15578259527683258, -0.08698183298110962, 0.0634956955909729, -0.0059866830706596375, 0.027791135013103485, 0.4006882309913635, -0.064070925116539, 0.2801978588104248, -0.09625180810689926, 0.15130850672721863, -0.3068392276763916, 0.2447216808795929, 0.087166927754879, -0.06741847842931747, 0.30217060446739197, -0.11698807775974274, 0.34278780221939087, -0.21113911271095276, -0.225145161151886, 0.1760111153125763, 0.5051014423370361, -0.2419067919254303, 0.5634380578994751, -0.12988755106925964, 0.709465503692627, 0.0674293264746666, 0.020948994904756546, 0.18040095269680023, -0.31548231840133667, -0.12723679840564728, -0.5465604662895203, -0.0072626713663339615, -0.10310304909944534, 0.33978748321533203, -0.1036069244146347, -0.028276100754737854, 0.3000214695930481, -0.09931059926748276, -0.0567079558968544, 0.03961040452122688, 0.06115932762622833, -0.23525141179561615, 0.025361310690641403, 0.18630942702293396, -0.17436766624450684, -0.2578413784503937, -0.07910443842411041, 0.425955206155777, -0.05456148833036423, 0.3364654779434204, -0.002087339758872986, -0.1527082473039627, -0.1491771936416626, -0.13462430238723755, -0.19251325726509094, 0.32324281334877014, -0.20779578387737274, 0.1470128744840622, 0.08474759012460709, 0.6423373222351074, -0.017536472529172897, -0.37816086411476135, 0.15444040298461914, -0.2328704297542572, -0.07574335485696793, 0.35250765085220337, 0.09232193976640701, 0.4888172149658203, -0.13575229048728943, -0.24338753521442413, 0.1449378877878189, -0.23853501677513123, -0.3084064722061157, -0.0032864995300769806, -0.07368346303701401, -0.5476623773574829, -0.03422297537326813, -0.12581472098827362, 0.4420228600502014, 0.10242798924446106, 0.3130250573158264, 0.26145216822624207, 0.0282914936542511, -0.026920393109321594, 0.19965532422065735, -0.0853811651468277, -0.28308889269828796, 0.3672677278518677, -0.03438498079776764, -0.09266629815101624, 0.028783831745386124, 0.17075085639953613, -0.2516990602016449, 0.4051509499549866, 0.18531198799610138, -0.3409925699234009, -0.1989559531211853, -0.20645247399806976, -0.20622801780700684, -0.036107853055000305, 0.09406432509422302, 0.13147617876529694, -0.06587433815002441, -0.561038613319397, -0.08625371754169464, 0.3194763660430908, -0.03794194385409355, 0.007087232545018196, 0.09506060183048248, -0.13211756944656372, -0.11144480109214783, -0.1046680137515068, -0.4693058729171753, 0.24899908900260925, -0.11660581827163696, 0.5133146047592163, 0.0017234757542610168, 0.10408157855272293, -0.4305587410926819, -0.022319557145237923, -0.31966432929039, 0.018055465072393417, -0.2568729519844055, -0.2420477420091629, 0.19496271014213562, -0.19490434229373932, 0.1765976846218109, -0.015101251192390919, -0.30893656611442566, -0.24509161710739136, -0.345093309879303, 0.09285548329353333, 0.12082042545080185, -0.04362120106816292, -0.008349739015102386, -0.05981507897377014, -0.1742575317621231, 0.026554547250270844, 0.30298662185668945, 0.34762758016586304, -0.3701561987400055, 0.12672734260559082, 0.2690824568271637, -0.09183160960674286, 0.05007420480251312, 0.316397488117218, 0.3066672384738922, 0.3210085928440094, -0.2876277565956116, 0.042963672429323196, -0.3245849907398224, -0.04125905781984329, 0.2509487569332123, 0.2460310310125351, 0.40383195877075195, 0.18124914169311523, 0.09439349174499512, 0.14889615774154663, -0.12890860438346863, -0.04059000313282013, -0.05206376314163208, -0.11665274202823639, 0.07263056188821793, 0.022685863077640533, 0.15527157485485077, 0.28000932931900024, -0.030699636787176132, 0.1865980327129364, 0.30443814396858215, -0.2890591621398926, 0.25647300481796265, -0.03722698241472244, 0.3805273175239563, 0.02369387447834015, 0.022503599524497986, 0.044585321098566055, -0.215352863073349, 0.027448806911706924, -0.05740665644407272, -0.6282974481582642, -0.2606881856918335, 0.3015061318874359, 0.09266603738069534, -0.1437368094921112, 0.1362481713294983, 0.32771575450897217, 0.2618348002433777, 0.3234046399593353, -0.15712742507457733, 0.2605866491794586, 0.10141700506210327, -0.6144983768463135, 0.13870467245578766, -0.3621829152107239, -0.06041261926293373, 0.14394055306911469, 0.006568446755409241, 0.10132169723510742, -0.1682121753692627, -0.31885045766830444, -0.1432686746120453, 0.08150561898946762, -0.13517054915428162, -0.5012128949165344, 0.07602691650390625, 0.0411449670791626, -0.39300423860549927, -0.13738638162612915, 0.11406170576810837, -0.15873095393180847, 0.33069872856140137, 0.09951424598693848, 0.13232213258743286, 0.06907028704881668, -0.3325543999671936, 0.06155337393283844, 0.3953467011451721, -0.06849028170108795, 0.24933403730392456, -0.26022204756736755, -0.23975178599357605, 0.20462922751903534, 0.14905503392219543, 0.2676471471786499, 0.08853466808795929, -0.2328113466501236, -0.09411142021417618, 0.22980429232120514, 0.11631949245929718, -0.18495523929595947, -0.16957968473434448, 0.14725258946418762, -0.11643829196691513, 0.14673343300819397, 0.18259252607822418, -0.19882962107658386, -0.09671825915575027, -0.39064323902130127, 0.2618876099586487, -0.056089602410793304, 0.5689523220062256, 0.26595914363861084, 0.20843808352947235, -0.028000710532069206, 0.0628378838300705, -0.5004041194915771, -0.03042125701904297, 0.07129460573196411, -0.28086939454078674, 0.2609003782272339, -0.2617403268814087, 0.1446167528629303, -0.046456627547740936, 0.28746330738067627, -0.10406693071126938, -0.13490985333919525, -0.08716632425785065, 0.04075846076011658, -0.0582612082362175, 0.033668097108602524, 0.012385359033942223, -0.15543925762176514, -0.13430142402648926, 0.30262070894241333, 0.18076157569885254, -0.2768172323703766, 0.2159685343503952, -0.2593127191066742, 0.42818397283554077, 0.23494143784046173, -0.15062159299850464, 0.3148280382156372, -0.04430260881781578, 0.03388253599405289, 0.23145227134227753, -0.3087151050567627, -0.0045745838433504105, 0.32089757919311523, 0.15438613295555115, 0.20706316828727722, -0.356212317943573, 0.3880395293235779, -0.6009936928749084, 0.37625375390052795, -0.008624210953712463, 0.16888213157653809, -0.2719493806362152, -0.006541036069393158, 0.13902771472930908, -0.24604114890098572, -0.10196296125650406, -0.6867203116416931, -0.3050488233566284, 0.15623712539672852, -0.03725752979516983, 0.12999066710472107, -0.3411063849925995, -0.05534002184867859, -0.12574365735054016, -0.1736055463552475, -0.27850884199142456, 0.21907548606395721, -0.2951206862926483, 0.15823864936828613, -0.27569591999053955, 0.2766934633255005, 0.16731888055801392, 0.09251701086759567, -0.22069838643074036, -0.07370076328516006, 0.47895756363868713, -0.017637252807617188, -0.08623447269201279, -0.2785152196884155, 0.40399760007858276, -0.13932734727859497, 0.21814149618148804, -0.15888479351997375, 0.07445016503334045, -0.02165491320192814, -0.10926228761672974, 0.014443270862102509, 0.2597413659095764, -0.15408587455749512, 0.07989589869976044, -0.26033321022987366, -0.021128494292497635, 0.10912527143955231, 0.23560470342636108, 0.08098482340574265, -0.12400992214679718 ]
https://github.com/huggingface/datasets/issues/6046
thanks a lot @lhoestq ! though i have a very lil idea of the issue, i am new. as i said before, but gonna try my best shot to do it. can you please suggest some tips or anything from your side, how basically we approach it will be really helpfull. Will try my best!
Support proxy and user-agent in fsspec calls
Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies
55
Support proxy and user-agent in fsspec calls Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies thanks a lot @lhoestq ! though i have a very lil idea of the issue, i am new. as i said before, but gonna try my best shot to do it. can you please suggest some tips or anything from your side, how basically we approach it will be really helpfull. Will try my best!
[ -0.1989521086215973, -0.22095397114753723, -0.009241923689842224, -0.2762700617313385, 0.25704318284988403, -0.4781002998352051, 0.06524592638015747, 0.011893544346094131, 0.4420257806777954, 0.2897850573062897, -0.4086255133152008, 0.09876810014247894, 0.2533799707889557, 0.4359215497970581, 0.046439819037914276, 0.09458281844854355, -0.04226468876004219, -0.004303935915231705, -0.2544797658920288, 0.05668720602989197, -0.09115954488515854, 0.14527875185012817, 0.18923060595989227, 0.043481770902872086, -0.2181645631790161, 0.18152271211147308, -0.12394110858440399, 0.35690656304359436, -0.1068340390920639, -0.38404279947280884, 0.34372514486312866, 0.3119018077850342, 0.15990827977657318, -0.005534321069717407, -0.0001055968677974306, 0.11706653982400894, 0.23458266258239746, 0.01736285537481308, -0.045927077531814575, 0.15316316485404968, -0.04058688133955002, 0.15617041289806366, -0.0323544442653656, -0.14774097502231598, -0.21120159327983856, 0.10505623370409012, -0.07877621054649353, -0.18514569103717804, 0.4838407039642334, 0.4189112186431885, 0.24413368105888367, 0.1350642442703247, -0.16774600744247437, -0.05294981598854065, 0.18808311223983765, -0.011591918766498566, -0.056051649153232574, -0.44484513998031616, 0.22471189498901367, -0.23405492305755615, -0.04626849293708801, -0.1282660961151123, -0.06599454581737518, 0.017750948667526245, 0.1311185657978058, -0.24350249767303467, 0.19149048626422882, -0.1909027248620987, -0.001557446550577879, 0.26509517431259155, 0.33958619832992554, 0.0974837988615036, -0.1774628758430481, 0.196586012840271, -0.20979802310466766, 0.11643931269645691, 0.28992944955825806, -0.4323878288269043, -0.13081152737140656, 0.10327860713005066, 0.4474140703678131, -0.18811851739883423, -0.2867201268672943, 0.13797640800476074, 0.07382912188768387, 0.2155190259218216, 0.038001883774995804, 0.028380893170833588, 0.18881751596927643, -0.02226962521672249, -0.10921969264745712, 0.031016983091831207, -0.18290801346302032, -0.17157162725925446, -0.3200976252555847, -0.17773635685443878, 0.24018825590610504, 0.20589515566825867, -0.015582773834466934, 0.1034557968378067, -0.19795376062393188, 0.260139137506485, -0.12036078423261642, 0.4250967502593994, -0.2859121859073639, 0.10762204974889755, 0.03547244518995285, 0.045309823006391525, 0.27108779549598694, -0.03580006957054138, 0.03440728038549423, -0.04286238178610802, 0.16060252487659454, -0.10918273031711578, -0.48881280422210693, 0.07856613397598267, -0.1778329461812973, -0.2832888960838318, -0.010979220271110535, -0.18529823422431946, 0.08066385239362717, 0.18414580821990967, 0.171940416097641, 0.41577234864234924, 0.0682951807975769, 0.48705071210861206, 0.20953524112701416, 0.012713531032204628, -0.4021245241165161, -0.08363627642393112, -0.14858651161193848, 0.24107840657234192, -0.2554325461387634, 0.2522638142108917, 0.1072896420955658, 0.2264958620071411, 0.14527080953121185, -0.11897283792495728, 0.19665271043777466, 0.16611525416374207, 0.20668071508407593, -0.19455420970916748, -0.06930139660835266, 0.25658363103866577, 0.14484632015228271, -0.2235969603061676, -0.07615256309509277, -0.10076349228620529, -0.058972619473934174, -0.112938791513443, -0.1934354156255722, -0.32886314392089844, -0.004562086425721645, 0.17071346938610077, 0.06720809638500214, -0.23223356902599335, -0.36558467149734497, -0.08206066489219666, -0.27848294377326965, 0.1585635542869568, 0.08653480559587479, 0.026429366320371628, -0.2535613775253296, -0.009982680901885033, 0.09760409593582153, 0.16165892779827118, 0.2607730031013489, -0.22696393728256226, 0.008371789008378983, -0.19314908981323242, 0.16370387375354767, -0.003476584330201149, 0.04583844169974327, -0.07173340767621994, -0.2664697766304016, 0.41166800260543823, 0.25226664543151855, -0.7025852799415588, -0.06729073822498322, 0.43105870485305786, 0.19752177596092224, -0.11763983964920044, 0.25505730509757996, -0.22293440997600555, 0.2974127233028412, -0.01583225093781948, -0.1919616162776947, 0.5440675616264343, -0.07678566873073578, 0.249770849943161, -0.25875136256217957, -0.3427421748638153, -0.22490400075912476, 0.18030570447444916, 0.30856648087501526, 0.23173873126506805, 0.07525215297937393, -0.2650761604309082, 0.3712770342826843, -0.10974287986755371, 0.20035451650619507, -0.16882050037384033, 0.42182549834251404, 0.5945957899093628, 0.0620446652173996, 0.06746603548526764, 0.2098093330860138, 0.1927238255739212, -0.3747637867927551, 0.13637709617614746, 0.3838263750076294, -0.1408682018518448, -0.1494801640510559, -0.07091204077005386, -0.023767150938510895, -0.13109754025936127, 0.18506067991256714, 0.16967543959617615, -0.17058473825454712, -0.11741997301578522, 0.22290372848510742, 0.47955837845802307, 0.21644437313079834, 0.14238247275352478, 0.024093102663755417, 0.517180323600769, -0.1292051076889038, -0.19789128005504608, 0.07836079597473145, 0.09602028131484985, 0.4748384952545166, -0.020216241478919983, -0.2181834578514099, 0.16203030943870544, 0.28594228625297546, 0.12038245797157288, 0.32809048891067505, 0.3080902695655823, 0.21487899124622345, -0.08533415198326111, 0.121503084897995, 0.004118718206882477, 0.14432665705680847, 0.05479784309864044, 0.3416665494441986, 0.2370903193950653, 0.3641612231731415, 0.11945450305938721, 0.19254478812217712, 0.23317906260490417, 0.14806100726127625, -0.3197517991065979, 0.167925626039505, 0.09916634112596512, 0.05750681832432747, 0.08135521411895752, 0.009118258953094482, -0.11710512638092041, 0.12409023940563202, 0.21040454506874084, -0.05837538465857506, 0.2942485809326172, 0.10429427027702332, 0.21350841224193573, 0.14551666378974915, -0.18901008367538452, 0.5554082989692688, -0.22410205006599426, 0.039893463253974915, 0.28542518615722656, -0.19697897136211395, -0.04008783772587776, 0.067384734749794, 0.035474855452775955, 0.15642720460891724, -0.2127535343170166, 0.0807332769036293, -0.13149240612983704, -0.0016518272459506989, -0.031165258958935738, -0.29602086544036865, -0.3679502010345459, -0.15261989831924438, -0.09066462516784668, -0.40290260314941406, -0.10984081029891968, -0.3271942436695099, -0.23406775295734406, 0.2915990948677063, 0.1983356773853302, 0.3298076093196869, -0.3006075620651245, 0.04348541423678398, 0.4209132492542267, -0.1609315574169159, 0.20131653547286987, -0.23282529413700104, 0.31603607535362244, -0.24861054122447968, 0.45345088839530945, -0.3893010914325714, 0.20271483063697815, -0.21351248025894165, 0.07000291347503662, 0.17511151731014252, 0.22952327132225037, 0.12444547563791275, 0.2699545919895172, -0.02480105683207512, -0.26367852091789246, -0.28324705362319946, 0.191427081823349, 0.16496236622333527, 0.09382479637861252, -0.07078306376934052, -0.03669724240899086, 0.21752490103244781, 0.08174426853656769, 0.1660785675048828, -0.19253626465797424, 0.012673258781433105, 0.12932676076889038, -0.12942670285701752, -0.20016831159591675, -0.17079174518585205, -0.08143410086631775, -0.39015963673591614, -0.3073555827140808, -0.0204818993806839, -0.39597105979919434, 0.17164376378059387, -0.17303785681724548, 0.012122604995965958, -0.14977753162384033, -0.17784494161605835, -0.13761404156684875, -0.21294677257537842, -0.4455324411392212, 0.15284651517868042, -0.28482577204704285, -0.2166418880224228, 0.014183200895786285, 0.11678910255432129, -0.296146422624588, -0.12514476478099823, -0.24251213669776917, -0.5632138252258301, -0.255839467048645, 0.2056862711906433, -0.14925013482570648, -0.03875679895281792, 0.31554412841796875, -0.0527019128203392, -0.248203843832016, -0.1832459568977356, -0.06577019393444061, 0.24511262774467468, 0.21871745586395264, 0.0862777829170227, -0.07383415848016739, 0.17621064186096191, 0.1783556491136551, 0.2598680853843689, 0.09346778690814972, 0.3534920811653137, 0.6295060515403748, -0.01974397338926792, 0.003504696302115917, -0.0702277272939682, -0.06814656406641006, 0.34946802258491516, -0.09047593176364899, 0.19208179414272308, 0.2201264351606369, 0.16849392652511597, 0.10283107310533524, -0.09063202142715454, -0.03018767759203911, 0.10044585168361664, -0.35263797640800476, 0.010587507858872414, -0.189541757106781, -0.03270241990685463, -0.08155986666679382, -0.04460299760103226, -0.16078853607177734, 0.0586332231760025, 0.325065016746521, 0.3905390799045563, -0.0299987755715847, 0.02510979026556015, -0.07125305384397507, 0.062249984592199326, -0.534241259098053, 0.33060067892074585, -0.03636239841580391, 0.22117304801940918, -0.37286698818206787, 0.10552070289850235, 0.09498386085033417, -0.01153944618999958, 0.28308871388435364, -0.29767826199531555, 0.13158705830574036, 0.015014618635177612, -0.07073769718408585, 0.038663506507873535, 0.018510490655899048, 0.21090254187583923, 0.016603983938694, -0.022156136110424995, -0.1964186131954193, 0.01796257495880127, -0.31800320744514465, -0.45092207193374634, -0.7635587453842163, -0.19269782304763794, -0.15846142172813416, 0.00527297705411911, -0.3446904122829437, -0.06657402217388153, -0.09117627143859863, -0.015465296804904938, -0.27898481488227844, -0.17045564949512482, -0.3613988757133484, 0.11246370524168015, -0.0445447638630867, 0.18868456780910492, 0.0018834546208381653, -0.13239504396915436, -0.18447111546993256, 0.029923662543296814, 0.045057933777570724, 0.22470897436141968, 0.21837539970874786, 0.328000545501709, -0.13689938187599182, -0.1392044872045517, -0.0004135575145483017, -0.11105559021234512, 0.0885547548532486, 0.2962278723716736, -0.10549202561378479, 0.3842526972293854, -0.19184595346450806, 0.21703314781188965, -0.3743848502635956, 0.13700641691684723, 0.11182071268558502, 0.1288708597421646, 0.3519291579723358, -0.10121452808380127, 0.3106764256954193, -0.06814990192651749, -0.22083786129951477, 0.10873685777187347, 0.44458475708961487, -0.2545183300971985, 0.6669684052467346, -0.29250115156173706, 0.6747591495513916, 0.24945883452892303, 0.019722159951925278, 0.2476736307144165, -0.33555376529693604, -0.16698439419269562, -0.46675318479537964, -0.16454556584358215, 0.005220279097557068, 0.17595550417900085, -0.09645815193653107, 0.03293515741825104, 0.3776986002922058, -0.12671492993831635, -0.3026541769504547, 0.153181791305542, 0.0326526015996933, -0.32166993618011475, 0.0021339766681194305, 0.31696072220802307, -0.14187730848789215, -0.3823450207710266, -0.12811948359012604, 0.3712736666202545, 0.02365652658045292, 0.0758688747882843, 0.07872070372104645, -0.23395751416683197, -0.0861324742436409, -0.061219945549964905, -0.13336960971355438, 0.25157222151756287, -0.1840229630470276, 0.12685345113277435, 0.034538451582193375, 0.5861201286315918, 0.2153310328722, -0.3281922936439514, 0.16434834897518158, -0.1882026642560959, -0.14671605825424194, 0.28807830810546875, 0.17480209469795227, 0.3252541124820709, -0.11920508742332458, -0.2723939120769501, 0.21117635071277618, -0.1751994490623474, -0.4199555516242981, -0.07295940071344376, -0.09731632471084595, -0.3799123764038086, 0.052458614110946655, -0.3061772286891937, 0.5168997049331665, -0.055097077041864395, 0.40301066637039185, 0.10184097290039062, -0.08470652997493744, -0.061671338975429535, 0.22432582080364227, 0.024557361379265785, -0.240987628698349, 0.47171956300735474, 0.055162545293569565, -0.007805682718753815, 0.03197494521737099, 0.04941603168845177, -0.24253138899803162, 0.2964012026786804, 0.1986863911151886, -0.22211933135986328, -0.2711230218410492, -0.2016344517469406, -0.16950586438179016, -0.007579635828733444, 0.2085810750722885, -0.01891120709478855, 0.08145717531442642, -0.6237215399742126, 0.019808724522590637, 0.10036522150039673, -0.028409868478775024, 0.05077210068702698, 0.025503970682621002, -0.25214794278144836, -0.11175261437892914, -0.07088547199964523, -0.4434075951576233, 0.1065807193517685, -0.1833643913269043, 0.38057366013526917, -0.015229307115077972, 0.2608688771724701, -0.40760743618011475, -0.06316959857940674, -0.1738865077495575, 0.08646489679813385, -0.2715757489204407, -0.31309831142425537, 0.08238928020000458, -0.12152302265167236, 0.13679273426532745, 0.04236149415373802, -0.3685568869113922, -0.19275785982608795, -0.25541990995407104, 0.12445658445358276, 0.1750936210155487, -0.16123329102993011, -0.05234250798821449, -0.08660712093114853, -0.1062459647655487, 0.021484091877937317, 0.06988749653100967, 0.3066248893737793, -0.275808721780777, 0.09616817533969879, 0.23023854196071625, -0.10223641991615295, 0.03111319988965988, 0.3453047275543213, 0.27423715591430664, 0.21601331233978271, -0.28777623176574707, 0.03481563925743103, -0.2724299728870392, -0.13434365391731262, 0.3476298451423645, 0.18030887842178345, 0.36063864827156067, 0.15481966733932495, 0.16481007635593414, 0.19677285850048065, -0.07679851353168488, -0.007724840193986893, -0.07978831231594086, -0.0175112746655941, 0.03851460665464401, 0.17841237783432007, 0.1925850510597229, 0.3342589735984802, 0.09494411945343018, 0.09364533424377441, 0.20113606750965118, -0.24766357243061066, 0.16767874360084534, -0.079466812312603, 0.3863513469696045, -0.026619911193847656, 0.27057769894599915, 0.11015920341014862, -0.2738862931728363, -0.010074920020997524, -0.1956751048564911, -0.6534702181816101, -0.3818565607070923, 0.19442903995513916, 0.2033756971359253, -0.1504971981048584, 0.11051423847675323, 0.30940183997154236, 0.2024989277124405, 0.3811759352684021, -0.3345259428024292, 0.3225739300251007, 0.07060405611991882, -0.6080697178840637, 0.000688867294229567, -0.3800925016403198, -0.16256527602672577, 0.025126686319708824, -0.1114962100982666, 0.46122729778289795, -0.05497240275144577, -0.33329102396965027, -0.15545624494552612, 0.026892848312854767, -0.1541348695755005, -0.3251473903656006, 0.0921630859375, 0.15930117666721344, -0.4709062874317169, -0.27171412110328674, 0.13060306012630463, -0.06953712552785873, 0.25983330607414246, 0.13014216721057892, -0.034551043063402176, 0.0978049486875534, -0.4419577717781067, 0.13609769940376282, 0.28257593512535095, -0.06025588512420654, 0.2494928538799286, -0.13826048374176025, -0.17244403064250946, 0.15135863423347473, 0.04896826297044754, 0.2522951662540436, 0.1817772090435028, -0.37848183512687683, -0.04216255247592926, 0.2807775139808655, 0.03155825287103653, -0.05839206650853157, -0.13095475733280182, 0.055892299860715866, -0.05342564731836319, 0.059901561588048935, 0.15974479913711548, -0.23343443870544434, -0.08467776328325272, -0.4081878662109375, 0.17928624153137207, -0.017419546842575073, 0.4590414762496948, 0.49554434418678284, 0.24302427470684052, -0.06909757852554321, -0.008984480053186417, -0.5004288554191589, 0.05358479544520378, 0.16584116220474243, -0.40488892793655396, 0.18686722218990326, -0.2221646010875702, 0.11354285478591919, -0.09634524583816528, 0.24040916562080383, 0.003281830810010433, -0.0002983119338750839, -0.1283169686794281, -0.002751067280769348, -0.037915170192718506, -0.04766756296157837, 0.11987270414829254, -0.28167474269866943, -0.08079308271408081, 0.12346992641687393, 0.10014508664608002, -0.2945147752761841, 0.19158461689949036, -0.11425572633743286, 0.6152050495147705, 0.09286336600780487, -0.34574249386787415, 0.3258322775363922, 0.06680852174758911, 0.15480457246303558, 0.2428990602493286, -0.3588184714317322, 0.22007474303245544, 0.4802602231502533, 0.14441880583763123, 0.07615575194358826, -0.36512309312820435, 0.20689386129379272, -0.5225694179534912, 0.38489145040512085, 0.028650784865021706, 0.2838889956474304, -0.29400306940078735, 0.044185563921928406, 0.2109076976776123, -0.21720583736896515, -0.1332388073205948, -0.7549611926078796, -0.14777974784374237, 0.10843611508607864, -0.11851418763399124, 0.17875635623931885, -0.3636186718940735, 0.07190634310245514, -0.2049962878227234, -0.32671621441841125, -0.25340867042541504, 0.21781828999519348, -0.2037215232849121, 0.0983288437128067, -0.26322489976882935, 0.26641565561294556, 0.10047990828752518, 0.03313369303941727, -0.21233347058296204, -0.0991542637348175, 0.5329732298851013, 0.06429412961006165, 0.04175566881895065, -0.39264610409736633, 0.38008278608322144, -0.16701273620128632, 0.10098487883806229, -0.12380661815404892, -0.01833444833755493, -0.12939420342445374, 0.07230278849601746, 0.07763457298278809, 0.29071325063705444, 0.026352431625127792, 0.16516083478927612, -0.18927961587905884, 0.014507509768009186, 0.15340948104858398, 0.37200137972831726, 0.09300439804792404, -0.02768886461853981 ]
https://github.com/huggingface/datasets/issues/6046
The HfFileSystem from the `huggingface_hub` package can already read the HTTP_PROXY and HTTPS_PROXY environment variables. So the remaining thing missing is the `user_agent` that the user may include in a `DownloadConfig` object. The user agent can be used for regular http calls but also calls to the HfFileSystem. - for http, the `user_agent` isn't passed from `DownloadConfig` to `get_datasets_user_agent` in `_prepare_single_hop_path_and_storage_options` in `streaming_download_manager.py` so we need to include it - for HfFileSystem I think it requires a PR in https://github.com/huggingface/huggingface_hub to include it in the `HfFileSystem.__init__`
Support proxy and user-agent in fsspec calls
Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies
86
Support proxy and user-agent in fsspec calls Since we switched to the new HfFileSystem we no longer apply user's proxy and user-agent. Using the HTTP_PROXY and HTTPS_PROXY environment variables works though since we use aiohttp to call the HF Hub. This can be implemented in `_prepare_single_hop_path_and_storage_options`. Though ideally the `HfFileSystem` could support passing at least the proxies The HfFileSystem from the `huggingface_hub` package can already read the HTTP_PROXY and HTTPS_PROXY environment variables. So the remaining thing missing is the `user_agent` that the user may include in a `DownloadConfig` object. The user agent can be used for regular http calls but also calls to the HfFileSystem. - for http, the `user_agent` isn't passed from `DownloadConfig` to `get_datasets_user_agent` in `_prepare_single_hop_path_and_storage_options` in `streaming_download_manager.py` so we need to include it - for HfFileSystem I think it requires a PR in https://github.com/huggingface/huggingface_hub to include it in the `HfFileSystem.__init__`
[ -0.15255115926265717, -0.35849153995513916, -0.01634177193045616, -0.18941760063171387, 0.29788413643836975, -0.33972498774528503, 0.009545538574457169, -0.01874988153576851, 0.4224053919315338, 0.19645893573760986, -0.579752504825592, 0.03939490765333176, 0.04456962272524834, 0.5652250051498413, 0.18675914406776428, -0.08144511282444, 0.01497100293636322, 0.04002905264496803, -0.34539011120796204, 0.1500554233789444, -0.09837425500154495, 0.20383933186531067, 0.28804823756217957, 0.05034314841032028, -0.08051282167434692, 0.2572726905345917, -0.24427776038646698, 0.38884463906288147, -0.30567577481269836, -0.5073792934417725, 0.38973096013069153, 0.3806442320346832, 0.1845681518316269, 0.07926309108734131, -0.00011001423263223842, 0.03612580895423889, 0.12201642990112305, -0.11527912318706512, -0.2683757245540619, -0.08824104070663452, 0.02102503925561905, -0.03926510736346245, 0.15375541150569916, -0.1264200359582901, -0.047646138817071915, 0.07057510316371918, 0.07389096915721893, 0.028037115931510925, 0.493576318025589, 0.2526066303253174, 0.20937806367874146, 0.2630995512008667, -0.08001786470413208, -0.06011117249727249, 0.25516951084136963, 0.14989392459392548, -0.04538089781999588, -0.1278085559606552, 0.2160075157880783, -0.0385320670902729, -0.0024822577834129333, -0.11658117175102234, -0.16522058844566345, 0.022128473967313766, 0.4332267940044403, -0.0746975839138031, 0.09591522812843323, -0.3258190155029297, -0.21120934188365936, 0.380389004945755, 0.29940128326416016, -0.14490166306495667, -0.37730780243873596, -0.15274590253829956, -0.0770488828420639, -0.11396270990371704, 0.2004636973142624, -0.22254379093647003, -0.3625330924987793, 0.038690485060214996, 0.3275541365146637, -0.2375122606754303, -0.19013431668281555, 0.1163257285952568, 0.09383507072925568, 0.19537392258644104, -0.034991305321455, -0.03844969719648361, 0.44568294286727905, 0.03144179284572601, -0.24897970259189606, -0.11852291226387024, -0.046808283776044846, 0.0023402608931064606, -0.2792077362537384, -0.103885717689991, 0.26969489455223083, 0.3987215459346771, 0.054502181708812714, 0.20442134141921997, -0.1704760491847992, 0.1229834333062172, -0.16291633248329163, 0.4026595652103424, -0.26064562797546387, 0.1059688851237297, -0.04434874281287193, -0.06966297328472137, 0.23098881542682648, 0.18520858883857727, 0.2517987787723541, -0.1491684913635254, 0.21249857544898987, 0.018626008182764053, -0.516431987285614, 0.03266773745417595, -0.13460075855255127, -0.10787138342857361, 0.008450977504253387, -0.27598634362220764, 0.16693240404129028, 0.07486283779144287, 0.23033609986305237, 0.44202566146850586, -0.09722237288951874, 0.3539528250694275, 0.15566788613796234, 0.1278596818447113, -0.2371269166469574, 0.08968214690685272, -0.17224806547164917, 0.08778195083141327, -0.09045206755399704, 0.3182786703109741, 0.0825711339712143, -0.17053984105587006, 0.32599547505378723, -0.19092346727848053, 0.3005306124687195, 0.30423516035079956, -0.006162770092487335, -0.060662008821964264, -0.14778530597686768, 0.33278822898864746, -0.031821444630622864, -0.19240179657936096, 0.040110766887664795, -0.018041014671325684, -0.23154740035533905, -0.2579558193683624, -0.042419176548719406, -0.4548214077949524, 0.12479551881551743, 0.1396915763616562, -0.03734175115823746, -0.15578046441078186, -0.35704097151756287, 0.039584629237651825, -0.4165908098220825, 0.03719086945056915, 0.2010081261396408, -0.0338650606572628, -0.26809167861938477, -0.13255205750465393, 0.21263033151626587, 0.44247135519981384, 0.3278055191040039, -0.4585343599319458, -0.04574921727180481, -0.33602240681648254, 0.043279509991407394, -0.09240955114364624, 0.029659029096364975, -0.08902628719806671, -0.2091427445411682, 0.3691747486591339, 0.3392993211746216, -0.6602674126625061, -0.1861741840839386, 0.29945749044418335, 0.14183132350444794, 0.212711364030838, 0.435899943113327, -0.10942302644252777, 0.32651659846305847, -0.05054015666246414, -0.1685566008090973, 0.3612266778945923, -0.0490991473197937, 0.12893220782279968, -0.08077928423881531, -0.5235947370529175, -0.21430958807468414, 0.2616001069545746, 0.14555084705352783, 0.28694581985473633, 0.036810170859098434, -0.3176528513431549, 0.364876389503479, -0.035630013793706894, 0.14654438197612762, -0.23991504311561584, 0.3492611050605774, 0.6648348569869995, -0.11140061914920807, -0.0008603036403656006, -0.10225066542625427, 0.2628248929977417, -0.3448432683944702, 0.14893442392349243, 0.209176167845726, -0.32904988527297974, -0.1033032089471817, -0.07080522924661636, 0.04574303328990936, -0.21891437470912933, 0.09558846056461334, 0.1318054348230362, 0.1184307336807251, -0.08696982264518738, 0.02622470259666443, 0.6676401495933533, 0.22784286737442017, 0.37223735451698303, -0.15770719945430756, 0.3853129744529724, -0.021395452320575714, -0.1273067742586136, 0.07517516613006592, 0.08470471203327179, 0.281863272190094, -0.1031205952167511, -0.04643458500504494, 0.3020649552345276, 0.14740636944770813, 0.18508194386959076, 0.10219874233007431, 0.3867523968219757, 0.2536301612854004, 0.01873687654733658, 0.11478812992572784, 0.028478842228651047, 0.31523939967155457, 0.03417772799730301, 0.25395581126213074, 0.36859995126724243, 0.3032049536705017, 0.13934674859046936, 0.22415146231651306, 0.19008147716522217, 0.12389767169952393, -0.08782321959733963, 0.00833873450756073, 0.1465115249156952, 0.02591824159026146, -0.07810959219932556, 0.0890461653470993, -0.18044041097164154, -0.08897365629673004, 0.2021051049232483, 0.04938517138361931, 0.19519810378551483, -0.06685607880353928, 0.30009233951568604, 0.010456986725330353, -0.18578046560287476, 0.41412609815597534, -0.1522994339466095, 0.35804176330566406, 0.2893220782279968, -0.05716239660978317, 0.2875250279903412, 0.15058623254299164, -0.10949821770191193, 0.2647271752357483, -0.06898480653762817, -0.19071125984191895, -0.13758200407028198, -0.19671572744846344, -0.03196979686617851, -0.25426483154296875, -0.37859857082366943, -0.24950996041297913, -0.06095903366804123, -0.37051257491111755, -0.08913564682006836, -0.3014519214630127, -0.5132077932357788, 0.24472802877426147, 0.058366697281599045, 0.13623139262199402, -0.29409846663475037, -0.05023423209786415, 0.5491871237754822, -0.14372731745243073, 0.059202440083026886, -0.1773126721382141, 0.3163720369338989, -0.3467000126838684, 0.1646914780139923, -0.5633503198623657, 0.22224390506744385, -0.11150668561458588, 0.04370569437742233, 0.15964239835739136, 0.04199569672346115, 0.12970004975795746, 0.07722164690494537, -0.07002397626638412, -0.23282739520072937, -0.1307741105556488, 0.14984773099422455, 0.05427763983607292, 0.046061381697654724, 0.1161302775144577, 0.003012821078300476, 0.18526645004749298, 0.12929384410381317, 0.2341700941324234, -0.20836634933948517, -0.0397254154086113, -0.04629692807793617, 0.06814861297607422, -0.07654938101768494, -0.18494075536727905, 0.0007716715335845947, -0.5862961411476135, -0.4623447358608246, 0.3028572201728821, -0.21348115801811218, 0.18193642795085907, -0.11906541883945465, -0.010322269052267075, 0.09736894071102142, -0.32038456201553345, -0.033987753093242645, -0.17636309564113617, -0.5031936168670654, 0.11306889355182648, -0.21164019405841827, -0.16530242562294006, -0.00006799399852752686, 0.11555273830890656, -0.3019869923591614, -0.05976486951112747, -0.3680887520313263, -0.5210739374160767, -0.22543735802173615, 0.1274389773607254, 0.02275257185101509, 0.25419214367866516, 0.4216254949569702, -0.049133531749248505, -0.14385564625263214, -0.09911763668060303, -0.1306575983762741, 0.14464786648750305, 0.3233795464038849, 0.0025166012346744537, -0.07134915888309479, 0.1788504719734192, 0.01533462107181549, 0.49678289890289307, 0.263542503118515, 0.38795891404151917, 0.6306177377700806, -0.02007337473332882, 0.17547985911369324, -0.08132833242416382, -0.08304290473461151, 0.3110814094543457, -0.1654362678527832, 0.2636888921260834, 0.2840709686279297, 0.17488540709018707, 0.2936675250530243, -0.2807260751724243, -0.056885749101638794, -0.01703815907239914, -0.36986297369003296, 0.013746814802289009, -0.05567193776369095, -0.06842070072889328, -0.0566900297999382, -0.030703209340572357, -0.08231362700462341, 0.08295094966888428, 0.18136245012283325, 0.6074857115745544, 0.011215642094612122, 0.2415909469127655, 0.03616592288017273, -0.021159254014492035, -0.6797740459442139, 0.3161737024784088, 0.08727839589118958, 0.08277656883001328, -0.240263432264328, -0.11285072565078735, 0.043630097061395645, -0.004235986620187759, 0.3135039806365967, -0.17114706337451935, -0.13074100017547607, -0.025618452578783035, -0.18236276507377625, -0.08877717703580856, -0.013869844377040863, 0.14705795049667358, -0.07865934073925018, -0.09690111875534058, -0.06287223100662231, -0.21089082956314087, -0.38798776268959045, -0.3566424250602722, -0.4573049545288086, -0.07625153660774231, -0.07784734666347504, -0.1326364278793335, -0.4149910807609558, -0.22661912441253662, -0.025981523096561432, -0.13286350667476654, -0.19164727628231049, -0.12641878426074982, -0.13963228464126587, 0.1825130134820938, 0.08760349452495575, 0.18543221056461334, 0.08397012948989868, -0.08431802690029144, -0.2611416280269623, -0.012088030576705933, 0.11381569504737854, 0.1640820950269699, 0.21284228563308716, 0.6268504858016968, -0.18677961826324463, -0.2696228623390198, 0.030147720128297806, 0.14823327958583832, 0.0414118766784668, 0.40423583984375, -0.05477749556303024, 0.4135139584541321, 0.02189166471362114, 0.21793481707572937, -0.42396780848503113, 0.13605323433876038, 0.25394776463508606, 0.07468153536319733, 0.3084755539894104, -0.3249231278896332, 0.5205183625221252, -0.07996437698602676, -0.21516633033752441, 0.22221937775611877, 0.5501289963722229, -0.2436056137084961, 0.3837999403476715, -0.3096604347229004, 0.8854304552078247, 0.21255917847156525, 0.2806152403354645, 0.3977246880531311, -0.5644601583480835, 0.11216744780540466, -0.36419373750686646, -0.09790350496768951, 0.030697345733642578, 0.19840268790721893, -0.21529430150985718, 0.022329367697238922, 0.3828366994857788, -0.24784551560878754, -0.39424067735671997, 0.20218881964683533, 0.018444254994392395, -0.05856690928339958, 0.09717319905757904, 0.2919777035713196, -0.4738703668117523, -0.4405995011329651, -0.2416217029094696, 0.3200090527534485, 0.05297424644231796, 0.29299622774124146, -0.00939096137881279, -0.23646269738674164, -0.14342887699604034, -0.06477127969264984, -0.21167205274105072, 0.1204267293214798, -0.3399164080619812, -0.022605707868933678, 0.0372253842651844, 0.4931086003780365, 0.0664808452129364, -0.2049906700849533, 0.015085307881236076, -0.28317731618881226, -0.16412751376628876, 0.09128778427839279, -0.02240791916847229, 0.4108135402202606, -0.007144588977098465, -0.24187996983528137, 0.4082528054714203, -0.18875983357429504, -0.24276785552501678, 0.08943867683410645, -0.0891905128955841, -0.18002460896968842, 0.12498003244400024, -0.27250078320503235, 0.3806520104408264, -0.07967612892389297, 0.27230483293533325, 0.11682110279798508, -0.015022210776805878, -0.1123366430401802, 0.13918910920619965, 0.018441099673509598, -0.3477264940738678, 0.2775323688983917, -0.10555875301361084, 0.052607595920562744, -0.141851544380188, 0.11077150702476501, -0.2713581919670105, 0.11848287284374237, 0.1669139713048935, -0.28255951404571533, -0.22192203998565674, -0.1803775280714035, -0.20909783244132996, -0.10213354229927063, 0.016877926886081696, 0.08823008835315704, 0.12430721521377563, -0.4418368637561798, -0.12204234302043915, 0.11732315272092819, 0.10878348350524902, -0.054996948689222336, 0.023879259824752808, -0.3202037513256073, -0.22361460328102112, 0.05991251394152641, -0.3000349700450897, 0.1695900708436966, -0.1416795402765274, 0.297683447599411, 0.04390651732683182, 0.13647110760211945, -0.3739563226699829, -0.1190449669957161, 0.0008442774415016174, -0.06932075321674347, 0.011041663587093353, -0.0675106942653656, 0.3197396993637085, -0.08840923756361008, 0.06226877123117447, 0.1310001015663147, -0.5954180359840393, -0.17488425970077515, -0.3649854362010956, 0.13842357695102692, 0.17794446647167206, -0.2367589771747589, -0.07388211786746979, -0.024426184594631195, -0.10890321433544159, -0.056075334548950195, 0.21833699941635132, 0.28516942262649536, -0.195654958486557, 0.050965726375579834, 0.28623658418655396, -0.010959222912788391, -0.046330053359270096, 0.30046185851097107, 0.25947415828704834, 0.18987809121608734, -0.16677770018577576, 0.02566399797797203, -0.4220987558364868, -0.10299811512231827, 0.4229772984981537, 0.268521785736084, 0.4467018246650696, 0.06469778716564178, 0.3304975628852844, 0.2746517062187195, 0.0030155256390571594, -0.16863754391670227, 0.0990925133228302, 0.23166552186012268, 0.16916121542453766, 0.16495928168296814, 0.43138545751571655, 0.20757853984832764, 0.017107509076595306, 0.10161683708429337, 0.2617485523223877, -0.15880197286605835, 0.16254352033138275, 0.10141977667808533, 0.38120096921920776, 0.04615722596645355, 0.21822641789913177, -0.042981356382369995, -0.11890275776386261, 0.3247615098953247, 0.041241325438022614, -0.30805742740631104, -0.18276774883270264, 0.3036702573299408, 0.2142777144908905, 0.06685428321361542, 0.2656063735485077, 0.15175555646419525, -0.10562174022197723, 0.3091627359390259, -0.5278845429420471, 0.23442737758159637, 0.04402805119752884, -0.6410590410232544, -0.09068455547094345, -0.3380410671234131, -0.13677619397640228, 0.09636200964450836, -0.1714499294757843, 0.5596610307693481, -0.29275190830230713, -0.39106035232543945, -0.07650933414697647, 0.19724886119365692, -0.021356336772441864, -0.3216979503631592, 0.2918871343135834, 0.08403530716896057, -0.3834136724472046, -0.16236388683319092, 0.1496380865573883, -0.3636731505393982, 0.37204521894454956, 0.017397258430719376, 0.18947145342826843, -0.04649987444281578, -0.4895194470882416, 0.08823002129793167, 0.22625043988227844, -0.059890877455472946, 0.03501768410205841, 0.042405541986227036, -0.19508081674575806, 0.11686388403177261, 0.13830341398715973, 0.33768367767333984, 0.027206480503082275, -0.25559234619140625, 0.0699969083070755, 0.1859748661518097, 0.14392133057117462, -0.11570446193218231, -0.18763220310211182, 0.16884031891822815, 0.07660795003175735, 0.020154185593128204, 0.12377990037202835, -0.2082972377538681, -0.125835582613945, -0.506521463394165, 0.14493703842163086, -0.22368104755878448, 0.6164548993110657, 0.22596681118011475, 0.26959314942359924, -0.0015448546037077904, 0.08784693479537964, -0.5867307186126709, 0.21185874938964844, 0.208045095205307, -0.21533960103988647, 0.21575245261192322, -0.12170657515525818, 0.07165279984474182, 0.11138150095939636, 0.308712363243103, 0.12374091893434525, 0.012177333235740662, -0.10658366233110428, 0.042587146162986755, -0.17566898465156555, -0.17196686565876007, 0.16703161597251892, -0.3628386855125427, -0.12365572899580002, 0.015319474041461945, 0.14307810366153717, -0.11588966846466064, 0.13045701384544373, -0.10612905770540237, 0.5997533798217773, -0.08678635209798813, -0.1235806792974472, 0.08008414506912231, -0.13312754034996033, 0.13255736231803894, 0.2069128453731537, -0.2311500757932663, 0.16600482165813446, 0.15109989047050476, 0.044733926653862, 0.02577221766114235, -0.0990116074681282, 0.1072050929069519, -0.6892326474189758, 0.38761091232299805, -0.036205630749464035, 0.19930244982242584, -0.2598203718662262, -0.037736959755420685, 0.17183296382427216, 0.00363057479262352, -0.18901602923870087, -0.6684247255325317, -0.3326469361782074, 0.19029255211353302, -0.2702455520629883, 0.04731481894850731, -0.5070385932922363, 0.25857311487197876, -0.008887417614459991, -0.45119956135749817, -0.16193950176239014, 0.12348975986242294, -0.3065977692604065, 0.04324181750416756, 0.0011982247233390808, 0.3934805989265442, -0.051482949405908585, 0.017364807426929474, -0.3217448592185974, -0.10007263720035553, 0.7145665884017944, 0.14739827811717987, 0.13863354921340942, -0.3065528869628906, 0.30812108516693115, 0.08872166275978088, 0.16763463616371155, -0.43614065647125244, 0.17144040763378143, -0.11620403826236725, -0.01330900751054287, -0.016284063458442688, 0.4266972541809082, -0.16692502796649933, 0.006964489817619324, -0.2677515745162964, 0.012039929628372192, 0.1004677563905716, 0.21790754795074463, 0.14142563939094543, -0.18020948767662048 ]
https://github.com/huggingface/datasets/issues/6043
Hello @exs-avianello, I have reproduced the bug successfully and have understood the problem. But I am confused regarding this part of the statement, "`pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`". Can you please elaborate on it? Thanks!
Compression kwargs have no effect when saving datasets as csv
### Describe the bug Attempting to save a dataset as a compressed csv file, the compression kwargs provided to `.to_csv()` that get piped to panda's `pandas.DataFrame.to_csv` do not have any effect - resulting in the dataset not getting compressed. A warning is raised if explicitly providing a `compression` kwarg, but no warnings are raised if relying on the defaults. This can lead to datasets secretly not getting compressed for users expecting the behaviour to match panda's `.to_csv()`, where the compression format is automatically inferred from the destination path suffix. ### Steps to reproduce the bug ```python # dataset is not compressed (but at least a warning is emitted) import datasets dataset = datasets.load_dataset("rotten_tomatoes", split="train") dataset.to_csv("uncompressed.csv") print(os.path.getsize("uncompressed.csv")) # 1008607 dataset.to_csv("compressed.csv.gz", compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}) print(os.path.getsize("compressed.csv.gz")) # 1008607 ``` ```shell >>> RuntimeWarning: compression has no effect when passing a non-binary object as input. csv_str = batch.to_pandas().to_csv( ``` ```python # dataset is not compressed and no warnings are emitted dataset.to_csv("compressed.csv.gz") print(os.path.getsize("compressed.csv.gz")) # 1008607 # compare with dataset.to_pandas().to_csv("pandas.csv.gz") print(os.path.getsize("pandas.csv.gz")) # 418561 ``` --- I think that this is because behind the scenes `pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`, but users that are providing a path-like to `datasets.Dataset.to_csv` are likely not to expect / know that - leading to a mismatch in their understanding of the expected behaviour of the `compression` kwarg. ### Expected behavior The dataset to be saved as a compressed csv file when providing a `compression` kwarg, or when relying on the default `compression='infer'` ### Environment info `datasets == 2.13.1`
38
Compression kwargs have no effect when saving datasets as csv ### Describe the bug Attempting to save a dataset as a compressed csv file, the compression kwargs provided to `.to_csv()` that get piped to panda's `pandas.DataFrame.to_csv` do not have any effect - resulting in the dataset not getting compressed. A warning is raised if explicitly providing a `compression` kwarg, but no warnings are raised if relying on the defaults. This can lead to datasets secretly not getting compressed for users expecting the behaviour to match panda's `.to_csv()`, where the compression format is automatically inferred from the destination path suffix. ### Steps to reproduce the bug ```python # dataset is not compressed (but at least a warning is emitted) import datasets dataset = datasets.load_dataset("rotten_tomatoes", split="train") dataset.to_csv("uncompressed.csv") print(os.path.getsize("uncompressed.csv")) # 1008607 dataset.to_csv("compressed.csv.gz", compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}) print(os.path.getsize("compressed.csv.gz")) # 1008607 ``` ```shell >>> RuntimeWarning: compression has no effect when passing a non-binary object as input. csv_str = batch.to_pandas().to_csv( ``` ```python # dataset is not compressed and no warnings are emitted dataset.to_csv("compressed.csv.gz") print(os.path.getsize("compressed.csv.gz")) # 1008607 # compare with dataset.to_pandas().to_csv("pandas.csv.gz") print(os.path.getsize("pandas.csv.gz")) # 418561 ``` --- I think that this is because behind the scenes `pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`, but users that are providing a path-like to `datasets.Dataset.to_csv` are likely not to expect / know that - leading to a mismatch in their understanding of the expected behaviour of the `compression` kwarg. ### Expected behavior The dataset to be saved as a compressed csv file when providing a `compression` kwarg, or when relying on the default `compression='infer'` ### Environment info `datasets == 2.13.1` Hello @exs-avianello, I have reproduced the bug successfully and have understood the problem. But I am confused regarding this part of the statement, "`pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`". Can you please elaborate on it? Thanks!
[ -0.13724341988563538, 0.02748793363571167, -0.0180482380092144, -0.14137500524520874, 0.33309558033943176, 0.2379491776227951, 0.31833237409591675, 0.3750106394290924, -0.13855519890785217, 0.20809561014175415, 0.17708688974380493, 0.2951294481754303, -0.058476340025663376, -0.05372987687587738, 0.155302494764328, 0.05285600945353508, 0.2873185873031616, 0.1390489637851715, 0.11191807687282562, -0.0782729834318161, -0.3637012243270874, 0.09732934832572937, -0.1162436380982399, 0.0022080466151237488, -0.16833272576332092, -0.14933225512504578, -0.2958087921142578, 0.13100497424602509, -0.047334954142570496, -0.2787572741508484, 0.35638055205345154, -0.056116510182619095, 0.25053152441978455, 0.378162145614624, -0.00010954697791021317, -0.09355275332927704, 0.4269465208053589, -0.07604040205478668, -0.48275047540664673, -0.20793581008911133, -0.21949681639671326, -0.7127155661582947, -0.1963191032409668, -0.3589136004447937, 0.11117634177207947, -0.2660926282405853, 0.05312807112932205, -0.5082576274871826, 0.331145703792572, 0.271469384431839, 0.2184760570526123, 0.12363237887620926, -0.06572487950325012, -0.14970266819000244, -0.25564515590667725, 0.10283856838941574, -0.318138062953949, 0.20033307373523712, -0.3759746849536896, -0.06642375886440277, -0.014130737632513046, -0.04049219191074371, -0.2260449379682541, -0.0998687893152237, 0.15581464767456055, 0.1554240882396698, -0.11011017858982086, -0.2354593575000763, 0.18992076814174652, 0.08777789771556854, 0.14260777831077576, -0.2861338257789612, -0.5548035502433777, -0.33059707283973694, 0.1464426964521408, -0.604539155960083, 0.1636265516281128, 0.38179442286491394, -0.1480395346879959, -0.07576633989810944, -0.2978512644767761, 0.4286031424999237, -0.16724476218223572, 0.029890788719058037, 0.18793343007564545, 0.011167902499437332, -0.2289820909500122, -0.07579931616783142, 0.19740617275238037, 0.1383870542049408, -0.06656147539615631, -0.6948902010917664, -0.020268013700842857, 0.11507022380828857, -0.25422486662864685, 0.08969905972480774, 0.10116876661777496, -0.059264689683914185, 0.06199251115322113, -0.1494598686695099, 0.14000490307807922, -0.09014537930488586, 0.5071130394935608, -0.0201290100812912, 0.14455965161323547, 0.34561941027641296, 0.07857370376586914, 0.18765610456466675, 0.18971362709999084, 0.1757396012544632, 0.08274640887975693, -0.10992982983589172, -0.018595419824123383, -0.23748335242271423, 0.34857800602912903, 0.09231272339820862, 0.2640860676765442, 0.023589037358760834, -0.18292838335037231, 0.053283534944057465, 0.15072286128997803, 0.22960476577281952, -0.32425740361213684, 0.07490667700767517, 0.005681365728378296, 0.1451353281736374, -0.27059972286224365, 0.23776158690452576, 0.015752695500850677, 0.41154560446739197, -0.21476607024669647, -0.07949638366699219, -0.05031789466738701, 0.003841869533061981, 0.1101776659488678, -0.572717547416687, 0.1732664704322815, 0.35241371393203735, 0.1662813127040863, 0.059426844120025635, -0.1677183359861374, -0.12603554129600525, 0.24956496059894562, 0.3158297836780548, 0.07121969759464264, 0.2581990361213684, 0.26730334758758545, -0.2145337462425232, -0.19470445811748505, 0.07935425639152527, -0.2911232113838196, -0.054701853543519974, 0.07576262205839157, 0.12357379496097565, -0.2878726124763489, 0.024527916684746742, -0.37532541155815125, 0.2521760165691376, 0.27114686369895935, -0.04840550199151039, 0.06396270543336868, -0.04949198663234711, -0.10914869606494904, -0.3853204548358917, 0.347876638174057, 0.13493530452251434, -0.4409624934196472, 0.09462789446115494, -0.24872986972332, 0.34007373452186584, 0.5808011889457703, 0.2847411632537842, -0.1077059730887413, -0.26675814390182495, -0.07117563486099243, 0.17583312094211578, 0.26208364963531494, 0.040020644664764404, -0.36356985569000244, 0.1630471795797348, -0.040767356753349304, 0.5474810004234314, 0.22723308205604553, -0.13493749499320984, 0.08194056898355484, 0.015090260654687881, -0.043419502675533295, 0.2921588122844696, -0.06375414878129959, -0.02307940647006035, -0.5035680532455444, -0.22750449180603027, 0.42742955684661865, -0.23614023625850677, -0.024693746119737625, 0.2494005709886551, 0.029758339747786522, -0.2868894040584564, 0.1280498504638672, -0.13596105575561523, 0.10809888690710068, 0.21043987572193146, 0.08321961015462875, -0.291797935962677, 0.20575743913650513, 0.2654615044593811, -0.07574518024921417, 0.15363307297229767, 0.0165005624294281, -0.14176888763904572, -0.2896972596645355, -0.26592618227005005, -0.12834806740283966, -0.14435002207756042, -0.058498237282037735, -0.3277127742767334, 0.10157322883605957, 0.08570092916488647, 0.2228846549987793, 0.32059627771377563, -0.07173978537321091, 0.09653756022453308, 0.018524333834648132, -0.05981152504682541, -0.19752752780914307, -0.04586014896631241, -0.09600897133350372, -0.2238958775997162, 0.20704232156276703, -0.015670545399188995, 0.015884267166256905, -0.07453048229217529, -0.2616425156593323, 0.2506681978702545, -0.15272094309329987, 0.3393530249595642, -0.22270721197128296, -0.19602657854557037, 0.09832032024860382, 0.32764744758605957, 0.03208314627408981, 0.46097952127456665, 0.22146384418010712, 0.1900784969329834, -0.382247656583786, 0.5861093401908875, 0.06781135499477386, 0.091131791472435, -0.05208999663591385, 0.04155319929122925, 0.15167075395584106, 0.03268611431121826, -0.2110033929347992, 0.09025467187166214, -0.1896549016237259, -0.3968675136566162, 0.17590934038162231, 0.15469029545783997, -0.08685755729675293, 0.03516186773777008, 0.49472349882125854, 0.03706222027540207, -0.0747799426317215, 0.33275675773620605, -0.1545664370059967, -0.2748936414718628, 0.19782127439975739, 0.37532758712768555, 0.49737536907196045, 0.11363475024700165, 0.1430368572473526, -0.3242459297180176, -0.16373886168003082, -0.25603023171424866, 0.317518949508667, 0.11597895622253418, 0.06969431042671204, 0.24592489004135132, 0.025342267006635666, 0.30808281898498535, -0.15005117654800415, 0.3834778070449829, -0.05985127389431, -0.09294340759515762, -0.24677276611328125, 0.3547062575817108, -0.34866324067115784, -0.0965077206492424, 0.061142537742853165, 0.01272231712937355, -0.05678067356348038, -0.314037948846817, -0.11665216088294983, -0.03519153594970703, -0.24282202124595642, 0.06492055952548981, -0.29374080896377563, 0.2787095308303833, 0.1887405663728714, -0.33005592226982117, -0.19436725974082947, 0.0002701766788959503, -0.23775874078273773, 0.13681261241436005, -0.0014336928725242615, -0.3281872868537903, 0.07073373347520828, 0.1775684654712677, 0.07304000109434128, 0.011593429371714592, -0.1050066202878952, -0.15774810314178467, -0.2600916624069214, 0.27417224645614624, -0.06345877051353455, 0.10949278622865677, -0.26159003376960754, -0.49296262860298157, 0.13549187779426575, -0.0016173869371414185, 0.017384342849254608, 0.32479047775268555, 0.26337623596191406, -0.20268172025680542, -0.18367181718349457, -0.13213515281677246, -0.17758439481258392, -0.2296420782804489, 0.12193557620048523, -0.19921022653579712, -0.10009706020355225, 0.5425713658332825, 0.4389154314994812, 0.027376685291528702, 0.26852187514305115, -0.09751295298337936, 0.010527379810810089, -0.4845799207687378, 0.8407242298126221, -0.12131548672914505, -0.5743756294250488, -0.16719481348991394, -0.18350252509117126, 0.11246192455291748, 0.07266519963741302, -0.22869843244552612, 0.20956206321716309, -0.387229859828949, 0.21781548857688904, 0.311832994222641, 0.03825150430202484, 0.05805428326129913, -0.10947068780660629, -0.19391638040542603, -0.11263050138950348, -0.1524779349565506, -0.06871896982192993, 0.26877880096435547, 0.3930383622646332, -0.04058374464511871, 0.282368004322052, 0.15262338519096375, 0.25944623351097107, 0.2485009729862213, -0.050747428089380264, 0.3954215347766876, -0.002106841653585434, 0.5783189535140991, -0.051347050815820694, -0.4424196183681488, 0.00012047216296195984, -0.24484483897686005, -0.18434882164001465, 0.2353966236114502, 0.010773628950119019, -0.11391482502222061, 0.040038056671619415, -0.08676942437887192, -0.03868350386619568, -0.2839300036430359, -0.01127410028129816, -0.11956727504730225, 0.06510334461927414, 0.181604266166687, 0.1345929205417633, -0.13520731031894684, -0.07825091481208801, 0.0340447723865509, 0.23329472541809082, 0.37654638290405273, 0.06364963948726654, 0.17685945332050323, -0.0663263350725174, -0.5151926875114441, 0.1300683468580246, 0.12081003189086914, 0.35162362456321716, -0.038219913840293884, -0.22704070806503296, -0.06903916597366333, -0.0026886016130447388, 0.5561445355415344, -0.040125444531440735, -0.1713314652442932, 0.3147468566894531, 0.152258038520813, -0.2895188629627228, -0.1826518177986145, 0.051713138818740845, 0.021821528673171997, -0.045352011919021606, 0.30733704566955566, 0.16143053770065308, 0.024407871067523956, -0.2689231336116791, 0.29786673188209534, -0.016928203403949738, -0.0924912542104721, -0.5677170157432556, -0.1855853796005249, -0.10094519704580307, 0.04365365952253342, 0.0372486412525177, 0.2345774918794632, -0.5441378355026245, -0.16727259755134583, -0.1977311372756958, -0.2709204852581024, 0.2773929834365845, 0.01733039692044258, 0.3572557866573334, 0.07775461673736572, 0.002076268196105957, -0.08842319250106812, 0.14832304418087006, 0.1987093687057495, 0.24041002988815308, 0.09148091822862625, -0.5016943216323853, 0.0009617377072572708, -0.21416781842708588, 0.2784629166126251, 0.1405928134918213, -0.5508819818496704, -0.015106942504644394, -0.14274826645851135, 0.1131523847579956, -0.30763083696365356, -0.10332176089286804, 0.3864040970802307, -0.018999185413122177, -0.4575035274028778, -0.1398215889930725, 0.39602652192115784, 0.19603073596954346, 0.048859670758247375, 0.14097744226455688, -0.055906686931848526, -0.19610118865966797, 0.12446904927492142, 0.19413962960243225, 0.6024675369262695, 0.07752547413110733, 0.30305737257003784, 0.19823318719863892, -0.003191724419593811, 0.5606458783149719, 0.1298227608203888, 0.2993418872356415, 0.054654985666275024, -0.42479407787323, -0.022586125880479813, 0.07031512260437012, 0.3517008423805237, 0.2083103060722351, -0.42646855115890503, 0.23317086696624756, -0.32205113768577576, 0.08125081658363342, -0.13129255175590515, 0.03898204118013382, -0.20004475116729736, -0.32625216245651245, -0.5076841711997986, 0.21867698431015015, 0.2409474104642868, 0.23609314858913422, 0.3020073473453522, -0.39309999346733093, -0.3389475643634796, -0.16174878180027008, -0.18082880973815918, 0.25723347067832947, 0.0630844458937645, 0.029291462153196335, -0.3069649338722229, -0.4416878819465637, 0.03343445062637329, 0.24352297186851501, 0.30424854159355164, 0.11230472475290298, -0.12919645011425018, -0.19059421122074127, -0.09313270449638367, 0.20497359335422516, -0.176803320646286, -0.24525700509548187, 0.14789840579032898, 0.16027730703353882, 0.2562398612499237, 0.10944772511720657, -0.155691996216774, -0.08896484971046448, 0.2964646816253662, -0.05189626291394234, -0.15685851871967316, -0.28449323773384094, -0.15814384818077087, -0.3429037034511566, 0.020745456218719482, -0.23245102167129517, 0.17413073778152466, -0.06672406196594238, 0.1983814537525177, 0.3605707883834839, -0.2852545380592346, -0.17641635239124298, -0.08062531054019928, 0.438468337059021, -0.1294245421886444, 0.05938560515642166, 0.3699686825275421, -0.33919990062713623, -0.273346483707428, -0.05083703249692917, 0.1959964632987976, -0.10015608370304108, -0.0367266982793808, 0.4621031582355499, 0.10293755680322647, 0.1751837134361267, -0.20319339632987976, 0.13602393865585327, 0.21365730464458466, -0.05019783973693848, -0.1969929039478302, -0.25243082642555237, -0.28143298625946045, -0.052490536123514175, 0.10006527602672577, 0.2826327979564667, 0.057528138160705566, -0.10831108689308167, 0.3191879689693451, 0.055637866258621216, -0.26746171712875366, -0.2332882583141327, 0.10642769187688828, 0.014889989048242569, 0.2505996823310852, 0.19542419910430908, 0.11136326938867569, -0.23220574855804443, 0.1067073866724968, 0.1416596621274948, 0.23815330862998962, -0.3106572926044464, -0.21596935391426086, 0.050824761390686035, 0.025957200676202774, -0.025917233899235725, 0.18805256485939026, -0.08051519840955734, -0.10858561098575592, -0.33883988857269287, 0.01915862411260605, 0.01848895102739334, -0.07813385874032974, 0.03156782314181328, -0.01308431290090084, 0.24138593673706055, 0.03970245271921158, -0.17425554990768433, -0.41935107111930847, 0.19693928956985474, 0.07176047563552856, 0.1484731137752533, 0.09677663445472717, 0.0858725756406784, -0.17505063116550446, -0.21835213899612427, -0.2752378582954407, -0.05661822110414505, 0.27871406078338623, -0.17184534668922424, -0.18250885605812073, 0.1269518882036209, 0.04164484888315201, 0.36440545320510864, -0.06356723606586456, -0.04436763375997543, 0.14363908767700195, 0.1747070699930191, -0.2562864422798157, -0.028781160712242126, -0.4430631399154663, 0.01080399751663208, -0.15535223484039307, -0.02401837706565857, 0.13601744174957275, -0.10315755754709244, -0.003923248499631882, -0.11956343054771423, 0.5044576525688171, -0.05443068966269493, 0.4863688051700592, 0.5873802304267883, 0.231728658080101, 0.32267266511917114, -0.09063190221786499, -0.150709331035614, -0.047800540924072266, -0.0357324592769146, -0.052545879036188126, 0.14383207261562347, 0.44975030422210693, 0.06682649999856949, -0.32814282178878784, -0.3288443386554718, 0.2801923453807831, 0.11178208887577057, -0.40861788392066956, 0.4094955027103424, 0.4652364253997803, 0.3948674201965332, -0.4611782729625702, -0.03453974053263664, -0.2509806156158447, 0.09934408962726593, -0.05301057547330856, -0.004624612629413605, 0.06986768543720245, -0.002070777118206024, -0.05814318358898163, 0.01445411890745163, 0.0979313850402832, 0.03837007284164429, 0.1895492970943451, 0.05313069373369217, 0.04037708789110184, 0.02190668322145939, 0.07179047167301178, 0.15044140815734863, 0.4917081892490387, -0.09549084305763245, -0.04751155525445938, 0.24172817170619965, -0.09135724604129791, -0.14255405962467194, 0.2685909867286682, 0.7944126725196838, 0.29249176383018494, 0.3717188835144043, 0.10885752737522125, 0.1771140843629837, -0.14472922682762146, 0.13343429565429688, 0.40256381034851074, 0.09976381063461304, -0.11628848314285278, 0.13347536325454712, 0.21831603348255157, -0.12268000096082687, 0.17692947387695312, 0.031892649829387665, 0.09234041720628738, -0.17194251716136932, 0.2366713434457779, 0.02474013715982437, -0.1211448386311531, 0.022251326590776443, -0.08727157860994339, 0.07522566616535187, -0.09453243762254715, 0.32950782775878906, 0.055580440908670425, 0.05878080427646637, -0.25505703687667847, 0.10763509571552277, 0.10599976778030396, 0.3496682941913605, 0.14919531345367432, -0.1828054040670395, -0.3688054084777832, 0.1819131076335907, -0.34118950366973877, -0.02861189842224121, -0.07126152515411377, -0.19174930453300476, -0.15154330432415009, 0.01782488077878952, -0.14574390649795532, 0.11911088973283768, -0.14971603453159332, 0.2951979637145996, 0.10027553141117096, 0.14419737458229065, -0.13607797026634216, 0.00661863200366497, 0.061255279928445816, -0.04486268758773804, -0.01984347030520439, -0.399508535861969, 0.2967498004436493, -0.2314700186252594, 0.07111363857984543, -0.09059155732393265, 0.11093230545520782, -0.005860000848770142, 0.4651544690132141, 0.15462493896484375, 0.16604383289813995, 0.14880120754241943, -0.23343318700790405, -0.025547627359628677, -0.3979882597923279, 0.3415314257144928, -0.15252169966697693, 0.07143259048461914, 0.13693483173847198, 0.19651411473751068, -0.16405388712882996, -0.23615039885044098, -0.06386278569698334, 0.3424186408519745, 0.246079221367836, -0.25258851051330566, 0.010722152888774872, -0.02127819135785103, -0.06762019544839859, -0.13085630536079407, 0.21569013595581055, 0.1074594184756279, -0.14398273825645447, 0.17642368376255035, -0.018191106617450714, -0.5468441247940063, 0.3067378103733063, -0.483036071062088, -0.23949521780014038, -0.05571301281452179, 0.11631154268980026, 0.21467462182044983, 0.11986967921257019, -0.1417011171579361, -0.03347907215356827, 0.2606557011604309, -0.011356556788086891, 0.10467307269573212, 0.258112370967865, -0.22574149072170258, 0.14774522185325623, -0.14776864647865295, 0.15546366572380066, 0.0535745806992054, -0.12015222012996674, 0.1274186074733734, -0.39817509055137634 ]
https://github.com/huggingface/datasets/issues/6043
Hi @aryanxk02 ! Sure, what I actually meant is that when passing a path-like `path_or_buf` here https://github.com/huggingface/datasets/blob/14f6edd9222e577dccb962ed5338b79b73502fa5/src/datasets/arrow_dataset.py#L4708-L4714 it gets converted to a file object behind the scenes here https://github.com/huggingface/datasets/blob/14f6edd9222e577dccb962ed5338b79b73502fa5/src/datasets/io/csv.py#L92-L94 and the eventual pandas `.to_csv()` calls that write to it always get `path_or_buf=None`, making pandas ignore the `compression` kwarg in the `to_csv_kwargs` https://github.com/huggingface/datasets/blob/14f6edd9222e577dccb962ed5338b79b73502fa5/src/datasets/io/csv.py#L107-L109
Compression kwargs have no effect when saving datasets as csv
### Describe the bug Attempting to save a dataset as a compressed csv file, the compression kwargs provided to `.to_csv()` that get piped to panda's `pandas.DataFrame.to_csv` do not have any effect - resulting in the dataset not getting compressed. A warning is raised if explicitly providing a `compression` kwarg, but no warnings are raised if relying on the defaults. This can lead to datasets secretly not getting compressed for users expecting the behaviour to match panda's `.to_csv()`, where the compression format is automatically inferred from the destination path suffix. ### Steps to reproduce the bug ```python # dataset is not compressed (but at least a warning is emitted) import datasets dataset = datasets.load_dataset("rotten_tomatoes", split="train") dataset.to_csv("uncompressed.csv") print(os.path.getsize("uncompressed.csv")) # 1008607 dataset.to_csv("compressed.csv.gz", compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}) print(os.path.getsize("compressed.csv.gz")) # 1008607 ``` ```shell >>> RuntimeWarning: compression has no effect when passing a non-binary object as input. csv_str = batch.to_pandas().to_csv( ``` ```python # dataset is not compressed and no warnings are emitted dataset.to_csv("compressed.csv.gz") print(os.path.getsize("compressed.csv.gz")) # 1008607 # compare with dataset.to_pandas().to_csv("pandas.csv.gz") print(os.path.getsize("pandas.csv.gz")) # 418561 ``` --- I think that this is because behind the scenes `pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`, but users that are providing a path-like to `datasets.Dataset.to_csv` are likely not to expect / know that - leading to a mismatch in their understanding of the expected behaviour of the `compression` kwarg. ### Expected behavior The dataset to be saved as a compressed csv file when providing a `compression` kwarg, or when relying on the default `compression='infer'` ### Environment info `datasets == 2.13.1`
52
Compression kwargs have no effect when saving datasets as csv ### Describe the bug Attempting to save a dataset as a compressed csv file, the compression kwargs provided to `.to_csv()` that get piped to panda's `pandas.DataFrame.to_csv` do not have any effect - resulting in the dataset not getting compressed. A warning is raised if explicitly providing a `compression` kwarg, but no warnings are raised if relying on the defaults. This can lead to datasets secretly not getting compressed for users expecting the behaviour to match panda's `.to_csv()`, where the compression format is automatically inferred from the destination path suffix. ### Steps to reproduce the bug ```python # dataset is not compressed (but at least a warning is emitted) import datasets dataset = datasets.load_dataset("rotten_tomatoes", split="train") dataset.to_csv("uncompressed.csv") print(os.path.getsize("uncompressed.csv")) # 1008607 dataset.to_csv("compressed.csv.gz", compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}) print(os.path.getsize("compressed.csv.gz")) # 1008607 ``` ```shell >>> RuntimeWarning: compression has no effect when passing a non-binary object as input. csv_str = batch.to_pandas().to_csv( ``` ```python # dataset is not compressed and no warnings are emitted dataset.to_csv("compressed.csv.gz") print(os.path.getsize("compressed.csv.gz")) # 1008607 # compare with dataset.to_pandas().to_csv("pandas.csv.gz") print(os.path.getsize("pandas.csv.gz")) # 418561 ``` --- I think that this is because behind the scenes `pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`, but users that are providing a path-like to `datasets.Dataset.to_csv` are likely not to expect / know that - leading to a mismatch in their understanding of the expected behaviour of the `compression` kwarg. ### Expected behavior The dataset to be saved as a compressed csv file when providing a `compression` kwarg, or when relying on the default `compression='infer'` ### Environment info `datasets == 2.13.1` Hi @aryanxk02 ! Sure, what I actually meant is that when passing a path-like `path_or_buf` here https://github.com/huggingface/datasets/blob/14f6edd9222e577dccb962ed5338b79b73502fa5/src/datasets/arrow_dataset.py#L4708-L4714 it gets converted to a file object behind the scenes here https://github.com/huggingface/datasets/blob/14f6edd9222e577dccb962ed5338b79b73502fa5/src/datasets/io/csv.py#L92-L94 and the eventual pandas `.to_csv()` calls that write to it always get `path_or_buf=None`, making pandas ignore the `compression` kwarg in the `to_csv_kwargs` https://github.com/huggingface/datasets/blob/14f6edd9222e577dccb962ed5338b79b73502fa5/src/datasets/io/csv.py#L107-L109
[ -0.13724341988563538, 0.02748793363571167, -0.0180482380092144, -0.14137500524520874, 0.33309558033943176, 0.2379491776227951, 0.31833237409591675, 0.3750106394290924, -0.13855519890785217, 0.20809561014175415, 0.17708688974380493, 0.2951294481754303, -0.058476340025663376, -0.05372987687587738, 0.155302494764328, 0.05285600945353508, 0.2873185873031616, 0.1390489637851715, 0.11191807687282562, -0.0782729834318161, -0.3637012243270874, 0.09732934832572937, -0.1162436380982399, 0.0022080466151237488, -0.16833272576332092, -0.14933225512504578, -0.2958087921142578, 0.13100497424602509, -0.047334954142570496, -0.2787572741508484, 0.35638055205345154, -0.056116510182619095, 0.25053152441978455, 0.378162145614624, -0.00010954697791021317, -0.09355275332927704, 0.4269465208053589, -0.07604040205478668, -0.48275047540664673, -0.20793581008911133, -0.21949681639671326, -0.7127155661582947, -0.1963191032409668, -0.3589136004447937, 0.11117634177207947, -0.2660926282405853, 0.05312807112932205, -0.5082576274871826, 0.331145703792572, 0.271469384431839, 0.2184760570526123, 0.12363237887620926, -0.06572487950325012, -0.14970266819000244, -0.25564515590667725, 0.10283856838941574, -0.318138062953949, 0.20033307373523712, -0.3759746849536896, -0.06642375886440277, -0.014130737632513046, -0.04049219191074371, -0.2260449379682541, -0.0998687893152237, 0.15581464767456055, 0.1554240882396698, -0.11011017858982086, -0.2354593575000763, 0.18992076814174652, 0.08777789771556854, 0.14260777831077576, -0.2861338257789612, -0.5548035502433777, -0.33059707283973694, 0.1464426964521408, -0.604539155960083, 0.1636265516281128, 0.38179442286491394, -0.1480395346879959, -0.07576633989810944, -0.2978512644767761, 0.4286031424999237, -0.16724476218223572, 0.029890788719058037, 0.18793343007564545, 0.011167902499437332, -0.2289820909500122, -0.07579931616783142, 0.19740617275238037, 0.1383870542049408, -0.06656147539615631, -0.6948902010917664, -0.020268013700842857, 0.11507022380828857, -0.25422486662864685, 0.08969905972480774, 0.10116876661777496, -0.059264689683914185, 0.06199251115322113, -0.1494598686695099, 0.14000490307807922, -0.09014537930488586, 0.5071130394935608, -0.0201290100812912, 0.14455965161323547, 0.34561941027641296, 0.07857370376586914, 0.18765610456466675, 0.18971362709999084, 0.1757396012544632, 0.08274640887975693, -0.10992982983589172, -0.018595419824123383, -0.23748335242271423, 0.34857800602912903, 0.09231272339820862, 0.2640860676765442, 0.023589037358760834, -0.18292838335037231, 0.053283534944057465, 0.15072286128997803, 0.22960476577281952, -0.32425740361213684, 0.07490667700767517, 0.005681365728378296, 0.1451353281736374, -0.27059972286224365, 0.23776158690452576, 0.015752695500850677, 0.41154560446739197, -0.21476607024669647, -0.07949638366699219, -0.05031789466738701, 0.003841869533061981, 0.1101776659488678, -0.572717547416687, 0.1732664704322815, 0.35241371393203735, 0.1662813127040863, 0.059426844120025635, -0.1677183359861374, -0.12603554129600525, 0.24956496059894562, 0.3158297836780548, 0.07121969759464264, 0.2581990361213684, 0.26730334758758545, -0.2145337462425232, -0.19470445811748505, 0.07935425639152527, -0.2911232113838196, -0.054701853543519974, 0.07576262205839157, 0.12357379496097565, -0.2878726124763489, 0.024527916684746742, -0.37532541155815125, 0.2521760165691376, 0.27114686369895935, -0.04840550199151039, 0.06396270543336868, -0.04949198663234711, -0.10914869606494904, -0.3853204548358917, 0.347876638174057, 0.13493530452251434, -0.4409624934196472, 0.09462789446115494, -0.24872986972332, 0.34007373452186584, 0.5808011889457703, 0.2847411632537842, -0.1077059730887413, -0.26675814390182495, -0.07117563486099243, 0.17583312094211578, 0.26208364963531494, 0.040020644664764404, -0.36356985569000244, 0.1630471795797348, -0.040767356753349304, 0.5474810004234314, 0.22723308205604553, -0.13493749499320984, 0.08194056898355484, 0.015090260654687881, -0.043419502675533295, 0.2921588122844696, -0.06375414878129959, -0.02307940647006035, -0.5035680532455444, -0.22750449180603027, 0.42742955684661865, -0.23614023625850677, -0.024693746119737625, 0.2494005709886551, 0.029758339747786522, -0.2868894040584564, 0.1280498504638672, -0.13596105575561523, 0.10809888690710068, 0.21043987572193146, 0.08321961015462875, -0.291797935962677, 0.20575743913650513, 0.2654615044593811, -0.07574518024921417, 0.15363307297229767, 0.0165005624294281, -0.14176888763904572, -0.2896972596645355, -0.26592618227005005, -0.12834806740283966, -0.14435002207756042, -0.058498237282037735, -0.3277127742767334, 0.10157322883605957, 0.08570092916488647, 0.2228846549987793, 0.32059627771377563, -0.07173978537321091, 0.09653756022453308, 0.018524333834648132, -0.05981152504682541, -0.19752752780914307, -0.04586014896631241, -0.09600897133350372, -0.2238958775997162, 0.20704232156276703, -0.015670545399188995, 0.015884267166256905, -0.07453048229217529, -0.2616425156593323, 0.2506681978702545, -0.15272094309329987, 0.3393530249595642, -0.22270721197128296, -0.19602657854557037, 0.09832032024860382, 0.32764744758605957, 0.03208314627408981, 0.46097952127456665, 0.22146384418010712, 0.1900784969329834, -0.382247656583786, 0.5861093401908875, 0.06781135499477386, 0.091131791472435, -0.05208999663591385, 0.04155319929122925, 0.15167075395584106, 0.03268611431121826, -0.2110033929347992, 0.09025467187166214, -0.1896549016237259, -0.3968675136566162, 0.17590934038162231, 0.15469029545783997, -0.08685755729675293, 0.03516186773777008, 0.49472349882125854, 0.03706222027540207, -0.0747799426317215, 0.33275675773620605, -0.1545664370059967, -0.2748936414718628, 0.19782127439975739, 0.37532758712768555, 0.49737536907196045, 0.11363475024700165, 0.1430368572473526, -0.3242459297180176, -0.16373886168003082, -0.25603023171424866, 0.317518949508667, 0.11597895622253418, 0.06969431042671204, 0.24592489004135132, 0.025342267006635666, 0.30808281898498535, -0.15005117654800415, 0.3834778070449829, -0.05985127389431, -0.09294340759515762, -0.24677276611328125, 0.3547062575817108, -0.34866324067115784, -0.0965077206492424, 0.061142537742853165, 0.01272231712937355, -0.05678067356348038, -0.314037948846817, -0.11665216088294983, -0.03519153594970703, -0.24282202124595642, 0.06492055952548981, -0.29374080896377563, 0.2787095308303833, 0.1887405663728714, -0.33005592226982117, -0.19436725974082947, 0.0002701766788959503, -0.23775874078273773, 0.13681261241436005, -0.0014336928725242615, -0.3281872868537903, 0.07073373347520828, 0.1775684654712677, 0.07304000109434128, 0.011593429371714592, -0.1050066202878952, -0.15774810314178467, -0.2600916624069214, 0.27417224645614624, -0.06345877051353455, 0.10949278622865677, -0.26159003376960754, -0.49296262860298157, 0.13549187779426575, -0.0016173869371414185, 0.017384342849254608, 0.32479047775268555, 0.26337623596191406, -0.20268172025680542, -0.18367181718349457, -0.13213515281677246, -0.17758439481258392, -0.2296420782804489, 0.12193557620048523, -0.19921022653579712, -0.10009706020355225, 0.5425713658332825, 0.4389154314994812, 0.027376685291528702, 0.26852187514305115, -0.09751295298337936, 0.010527379810810089, -0.4845799207687378, 0.8407242298126221, -0.12131548672914505, -0.5743756294250488, -0.16719481348991394, -0.18350252509117126, 0.11246192455291748, 0.07266519963741302, -0.22869843244552612, 0.20956206321716309, -0.387229859828949, 0.21781548857688904, 0.311832994222641, 0.03825150430202484, 0.05805428326129913, -0.10947068780660629, -0.19391638040542603, -0.11263050138950348, -0.1524779349565506, -0.06871896982192993, 0.26877880096435547, 0.3930383622646332, -0.04058374464511871, 0.282368004322052, 0.15262338519096375, 0.25944623351097107, 0.2485009729862213, -0.050747428089380264, 0.3954215347766876, -0.002106841653585434, 0.5783189535140991, -0.051347050815820694, -0.4424196183681488, 0.00012047216296195984, -0.24484483897686005, -0.18434882164001465, 0.2353966236114502, 0.010773628950119019, -0.11391482502222061, 0.040038056671619415, -0.08676942437887192, -0.03868350386619568, -0.2839300036430359, -0.01127410028129816, -0.11956727504730225, 0.06510334461927414, 0.181604266166687, 0.1345929205417633, -0.13520731031894684, -0.07825091481208801, 0.0340447723865509, 0.23329472541809082, 0.37654638290405273, 0.06364963948726654, 0.17685945332050323, -0.0663263350725174, -0.5151926875114441, 0.1300683468580246, 0.12081003189086914, 0.35162362456321716, -0.038219913840293884, -0.22704070806503296, -0.06903916597366333, -0.0026886016130447388, 0.5561445355415344, -0.040125444531440735, -0.1713314652442932, 0.3147468566894531, 0.152258038520813, -0.2895188629627228, -0.1826518177986145, 0.051713138818740845, 0.021821528673171997, -0.045352011919021606, 0.30733704566955566, 0.16143053770065308, 0.024407871067523956, -0.2689231336116791, 0.29786673188209534, -0.016928203403949738, -0.0924912542104721, -0.5677170157432556, -0.1855853796005249, -0.10094519704580307, 0.04365365952253342, 0.0372486412525177, 0.2345774918794632, -0.5441378355026245, -0.16727259755134583, -0.1977311372756958, -0.2709204852581024, 0.2773929834365845, 0.01733039692044258, 0.3572557866573334, 0.07775461673736572, 0.002076268196105957, -0.08842319250106812, 0.14832304418087006, 0.1987093687057495, 0.24041002988815308, 0.09148091822862625, -0.5016943216323853, 0.0009617377072572708, -0.21416781842708588, 0.2784629166126251, 0.1405928134918213, -0.5508819818496704, -0.015106942504644394, -0.14274826645851135, 0.1131523847579956, -0.30763083696365356, -0.10332176089286804, 0.3864040970802307, -0.018999185413122177, -0.4575035274028778, -0.1398215889930725, 0.39602652192115784, 0.19603073596954346, 0.048859670758247375, 0.14097744226455688, -0.055906686931848526, -0.19610118865966797, 0.12446904927492142, 0.19413962960243225, 0.6024675369262695, 0.07752547413110733, 0.30305737257003784, 0.19823318719863892, -0.003191724419593811, 0.5606458783149719, 0.1298227608203888, 0.2993418872356415, 0.054654985666275024, -0.42479407787323, -0.022586125880479813, 0.07031512260437012, 0.3517008423805237, 0.2083103060722351, -0.42646855115890503, 0.23317086696624756, -0.32205113768577576, 0.08125081658363342, -0.13129255175590515, 0.03898204118013382, -0.20004475116729736, -0.32625216245651245, -0.5076841711997986, 0.21867698431015015, 0.2409474104642868, 0.23609314858913422, 0.3020073473453522, -0.39309999346733093, -0.3389475643634796, -0.16174878180027008, -0.18082880973815918, 0.25723347067832947, 0.0630844458937645, 0.029291462153196335, -0.3069649338722229, -0.4416878819465637, 0.03343445062637329, 0.24352297186851501, 0.30424854159355164, 0.11230472475290298, -0.12919645011425018, -0.19059421122074127, -0.09313270449638367, 0.20497359335422516, -0.176803320646286, -0.24525700509548187, 0.14789840579032898, 0.16027730703353882, 0.2562398612499237, 0.10944772511720657, -0.155691996216774, -0.08896484971046448, 0.2964646816253662, -0.05189626291394234, -0.15685851871967316, -0.28449323773384094, -0.15814384818077087, -0.3429037034511566, 0.020745456218719482, -0.23245102167129517, 0.17413073778152466, -0.06672406196594238, 0.1983814537525177, 0.3605707883834839, -0.2852545380592346, -0.17641635239124298, -0.08062531054019928, 0.438468337059021, -0.1294245421886444, 0.05938560515642166, 0.3699686825275421, -0.33919990062713623, -0.273346483707428, -0.05083703249692917, 0.1959964632987976, -0.10015608370304108, -0.0367266982793808, 0.4621031582355499, 0.10293755680322647, 0.1751837134361267, -0.20319339632987976, 0.13602393865585327, 0.21365730464458466, -0.05019783973693848, -0.1969929039478302, -0.25243082642555237, -0.28143298625946045, -0.052490536123514175, 0.10006527602672577, 0.2826327979564667, 0.057528138160705566, -0.10831108689308167, 0.3191879689693451, 0.055637866258621216, -0.26746171712875366, -0.2332882583141327, 0.10642769187688828, 0.014889989048242569, 0.2505996823310852, 0.19542419910430908, 0.11136326938867569, -0.23220574855804443, 0.1067073866724968, 0.1416596621274948, 0.23815330862998962, -0.3106572926044464, -0.21596935391426086, 0.050824761390686035, 0.025957200676202774, -0.025917233899235725, 0.18805256485939026, -0.08051519840955734, -0.10858561098575592, -0.33883988857269287, 0.01915862411260605, 0.01848895102739334, -0.07813385874032974, 0.03156782314181328, -0.01308431290090084, 0.24138593673706055, 0.03970245271921158, -0.17425554990768433, -0.41935107111930847, 0.19693928956985474, 0.07176047563552856, 0.1484731137752533, 0.09677663445472717, 0.0858725756406784, -0.17505063116550446, -0.21835213899612427, -0.2752378582954407, -0.05661822110414505, 0.27871406078338623, -0.17184534668922424, -0.18250885605812073, 0.1269518882036209, 0.04164484888315201, 0.36440545320510864, -0.06356723606586456, -0.04436763375997543, 0.14363908767700195, 0.1747070699930191, -0.2562864422798157, -0.028781160712242126, -0.4430631399154663, 0.01080399751663208, -0.15535223484039307, -0.02401837706565857, 0.13601744174957275, -0.10315755754709244, -0.003923248499631882, -0.11956343054771423, 0.5044576525688171, -0.05443068966269493, 0.4863688051700592, 0.5873802304267883, 0.231728658080101, 0.32267266511917114, -0.09063190221786499, -0.150709331035614, -0.047800540924072266, -0.0357324592769146, -0.052545879036188126, 0.14383207261562347, 0.44975030422210693, 0.06682649999856949, -0.32814282178878784, -0.3288443386554718, 0.2801923453807831, 0.11178208887577057, -0.40861788392066956, 0.4094955027103424, 0.4652364253997803, 0.3948674201965332, -0.4611782729625702, -0.03453974053263664, -0.2509806156158447, 0.09934408962726593, -0.05301057547330856, -0.004624612629413605, 0.06986768543720245, -0.002070777118206024, -0.05814318358898163, 0.01445411890745163, 0.0979313850402832, 0.03837007284164429, 0.1895492970943451, 0.05313069373369217, 0.04037708789110184, 0.02190668322145939, 0.07179047167301178, 0.15044140815734863, 0.4917081892490387, -0.09549084305763245, -0.04751155525445938, 0.24172817170619965, -0.09135724604129791, -0.14255405962467194, 0.2685909867286682, 0.7944126725196838, 0.29249176383018494, 0.3717188835144043, 0.10885752737522125, 0.1771140843629837, -0.14472922682762146, 0.13343429565429688, 0.40256381034851074, 0.09976381063461304, -0.11628848314285278, 0.13347536325454712, 0.21831603348255157, -0.12268000096082687, 0.17692947387695312, 0.031892649829387665, 0.09234041720628738, -0.17194251716136932, 0.2366713434457779, 0.02474013715982437, -0.1211448386311531, 0.022251326590776443, -0.08727157860994339, 0.07522566616535187, -0.09453243762254715, 0.32950782775878906, 0.055580440908670425, 0.05878080427646637, -0.25505703687667847, 0.10763509571552277, 0.10599976778030396, 0.3496682941913605, 0.14919531345367432, -0.1828054040670395, -0.3688054084777832, 0.1819131076335907, -0.34118950366973877, -0.02861189842224121, -0.07126152515411377, -0.19174930453300476, -0.15154330432415009, 0.01782488077878952, -0.14574390649795532, 0.11911088973283768, -0.14971603453159332, 0.2951979637145996, 0.10027553141117096, 0.14419737458229065, -0.13607797026634216, 0.00661863200366497, 0.061255279928445816, -0.04486268758773804, -0.01984347030520439, -0.399508535861969, 0.2967498004436493, -0.2314700186252594, 0.07111363857984543, -0.09059155732393265, 0.11093230545520782, -0.005860000848770142, 0.4651544690132141, 0.15462493896484375, 0.16604383289813995, 0.14880120754241943, -0.23343318700790405, -0.025547627359628677, -0.3979882597923279, 0.3415314257144928, -0.15252169966697693, 0.07143259048461914, 0.13693483173847198, 0.19651411473751068, -0.16405388712882996, -0.23615039885044098, -0.06386278569698334, 0.3424186408519745, 0.246079221367836, -0.25258851051330566, 0.010722152888774872, -0.02127819135785103, -0.06762019544839859, -0.13085630536079407, 0.21569013595581055, 0.1074594184756279, -0.14398273825645447, 0.17642368376255035, -0.018191106617450714, -0.5468441247940063, 0.3067378103733063, -0.483036071062088, -0.23949521780014038, -0.05571301281452179, 0.11631154268980026, 0.21467462182044983, 0.11986967921257019, -0.1417011171579361, -0.03347907215356827, 0.2606557011604309, -0.011356556788086891, 0.10467307269573212, 0.258112370967865, -0.22574149072170258, 0.14774522185325623, -0.14776864647865295, 0.15546366572380066, 0.0535745806992054, -0.12015222012996674, 0.1274186074733734, -0.39817509055137634 ]
https://github.com/huggingface/datasets/issues/6043
@exs-avianello When `path_or_buf` is set to None, the `to_csv()` method will return the CSV data as a string instead of saving it to a file. Hence the compression doesn't take place. I think setting `path_or_buf=self.path_or_buf` should work. What you say?
Compression kwargs have no effect when saving datasets as csv
### Describe the bug Attempting to save a dataset as a compressed csv file, the compression kwargs provided to `.to_csv()` that get piped to panda's `pandas.DataFrame.to_csv` do not have any effect - resulting in the dataset not getting compressed. A warning is raised if explicitly providing a `compression` kwarg, but no warnings are raised if relying on the defaults. This can lead to datasets secretly not getting compressed for users expecting the behaviour to match panda's `.to_csv()`, where the compression format is automatically inferred from the destination path suffix. ### Steps to reproduce the bug ```python # dataset is not compressed (but at least a warning is emitted) import datasets dataset = datasets.load_dataset("rotten_tomatoes", split="train") dataset.to_csv("uncompressed.csv") print(os.path.getsize("uncompressed.csv")) # 1008607 dataset.to_csv("compressed.csv.gz", compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}) print(os.path.getsize("compressed.csv.gz")) # 1008607 ``` ```shell >>> RuntimeWarning: compression has no effect when passing a non-binary object as input. csv_str = batch.to_pandas().to_csv( ``` ```python # dataset is not compressed and no warnings are emitted dataset.to_csv("compressed.csv.gz") print(os.path.getsize("compressed.csv.gz")) # 1008607 # compare with dataset.to_pandas().to_csv("pandas.csv.gz") print(os.path.getsize("pandas.csv.gz")) # 418561 ``` --- I think that this is because behind the scenes `pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`, but users that are providing a path-like to `datasets.Dataset.to_csv` are likely not to expect / know that - leading to a mismatch in their understanding of the expected behaviour of the `compression` kwarg. ### Expected behavior The dataset to be saved as a compressed csv file when providing a `compression` kwarg, or when relying on the default `compression='infer'` ### Environment info `datasets == 2.13.1`
40
Compression kwargs have no effect when saving datasets as csv ### Describe the bug Attempting to save a dataset as a compressed csv file, the compression kwargs provided to `.to_csv()` that get piped to panda's `pandas.DataFrame.to_csv` do not have any effect - resulting in the dataset not getting compressed. A warning is raised if explicitly providing a `compression` kwarg, but no warnings are raised if relying on the defaults. This can lead to datasets secretly not getting compressed for users expecting the behaviour to match panda's `.to_csv()`, where the compression format is automatically inferred from the destination path suffix. ### Steps to reproduce the bug ```python # dataset is not compressed (but at least a warning is emitted) import datasets dataset = datasets.load_dataset("rotten_tomatoes", split="train") dataset.to_csv("uncompressed.csv") print(os.path.getsize("uncompressed.csv")) # 1008607 dataset.to_csv("compressed.csv.gz", compression={'method': 'gzip', 'compresslevel': 1, 'mtime': 1}) print(os.path.getsize("compressed.csv.gz")) # 1008607 ``` ```shell >>> RuntimeWarning: compression has no effect when passing a non-binary object as input. csv_str = batch.to_pandas().to_csv( ``` ```python # dataset is not compressed and no warnings are emitted dataset.to_csv("compressed.csv.gz") print(os.path.getsize("compressed.csv.gz")) # 1008607 # compare with dataset.to_pandas().to_csv("pandas.csv.gz") print(os.path.getsize("pandas.csv.gz")) # 418561 ``` --- I think that this is because behind the scenes `pandas.DataFrame.to_csv` is always called with a buf-like `path_or_buf`, but users that are providing a path-like to `datasets.Dataset.to_csv` are likely not to expect / know that - leading to a mismatch in their understanding of the expected behaviour of the `compression` kwarg. ### Expected behavior The dataset to be saved as a compressed csv file when providing a `compression` kwarg, or when relying on the default `compression='infer'` ### Environment info `datasets == 2.13.1` @exs-avianello When `path_or_buf` is set to None, the `to_csv()` method will return the CSV data as a string instead of saving it to a file. Hence the compression doesn't take place. I think setting `path_or_buf=self.path_or_buf` should work. What you say?
[ -0.13724341988563538, 0.02748793363571167, -0.0180482380092144, -0.14137500524520874, 0.33309558033943176, 0.2379491776227951, 0.31833237409591675, 0.3750106394290924, -0.13855519890785217, 0.20809561014175415, 0.17708688974380493, 0.2951294481754303, -0.058476340025663376, -0.05372987687587738, 0.155302494764328, 0.05285600945353508, 0.2873185873031616, 0.1390489637851715, 0.11191807687282562, -0.0782729834318161, -0.3637012243270874, 0.09732934832572937, -0.1162436380982399, 0.0022080466151237488, -0.16833272576332092, -0.14933225512504578, -0.2958087921142578, 0.13100497424602509, -0.047334954142570496, -0.2787572741508484, 0.35638055205345154, -0.056116510182619095, 0.25053152441978455, 0.378162145614624, -0.00010954697791021317, -0.09355275332927704, 0.4269465208053589, -0.07604040205478668, -0.48275047540664673, -0.20793581008911133, -0.21949681639671326, -0.7127155661582947, -0.1963191032409668, -0.3589136004447937, 0.11117634177207947, -0.2660926282405853, 0.05312807112932205, -0.5082576274871826, 0.331145703792572, 0.271469384431839, 0.2184760570526123, 0.12363237887620926, -0.06572487950325012, -0.14970266819000244, -0.25564515590667725, 0.10283856838941574, -0.318138062953949, 0.20033307373523712, -0.3759746849536896, -0.06642375886440277, -0.014130737632513046, -0.04049219191074371, -0.2260449379682541, -0.0998687893152237, 0.15581464767456055, 0.1554240882396698, -0.11011017858982086, -0.2354593575000763, 0.18992076814174652, 0.08777789771556854, 0.14260777831077576, -0.2861338257789612, -0.5548035502433777, -0.33059707283973694, 0.1464426964521408, -0.604539155960083, 0.1636265516281128, 0.38179442286491394, -0.1480395346879959, -0.07576633989810944, -0.2978512644767761, 0.4286031424999237, -0.16724476218223572, 0.029890788719058037, 0.18793343007564545, 0.011167902499437332, -0.2289820909500122, -0.07579931616783142, 0.19740617275238037, 0.1383870542049408, -0.06656147539615631, -0.6948902010917664, -0.020268013700842857, 0.11507022380828857, -0.25422486662864685, 0.08969905972480774, 0.10116876661777496, -0.059264689683914185, 0.06199251115322113, -0.1494598686695099, 0.14000490307807922, -0.09014537930488586, 0.5071130394935608, -0.0201290100812912, 0.14455965161323547, 0.34561941027641296, 0.07857370376586914, 0.18765610456466675, 0.18971362709999084, 0.1757396012544632, 0.08274640887975693, -0.10992982983589172, -0.018595419824123383, -0.23748335242271423, 0.34857800602912903, 0.09231272339820862, 0.2640860676765442, 0.023589037358760834, -0.18292838335037231, 0.053283534944057465, 0.15072286128997803, 0.22960476577281952, -0.32425740361213684, 0.07490667700767517, 0.005681365728378296, 0.1451353281736374, -0.27059972286224365, 0.23776158690452576, 0.015752695500850677, 0.41154560446739197, -0.21476607024669647, -0.07949638366699219, -0.05031789466738701, 0.003841869533061981, 0.1101776659488678, -0.572717547416687, 0.1732664704322815, 0.35241371393203735, 0.1662813127040863, 0.059426844120025635, -0.1677183359861374, -0.12603554129600525, 0.24956496059894562, 0.3158297836780548, 0.07121969759464264, 0.2581990361213684, 0.26730334758758545, -0.2145337462425232, -0.19470445811748505, 0.07935425639152527, -0.2911232113838196, -0.054701853543519974, 0.07576262205839157, 0.12357379496097565, -0.2878726124763489, 0.024527916684746742, -0.37532541155815125, 0.2521760165691376, 0.27114686369895935, -0.04840550199151039, 0.06396270543336868, -0.04949198663234711, -0.10914869606494904, -0.3853204548358917, 0.347876638174057, 0.13493530452251434, -0.4409624934196472, 0.09462789446115494, -0.24872986972332, 0.34007373452186584, 0.5808011889457703, 0.2847411632537842, -0.1077059730887413, -0.26675814390182495, -0.07117563486099243, 0.17583312094211578, 0.26208364963531494, 0.040020644664764404, -0.36356985569000244, 0.1630471795797348, -0.040767356753349304, 0.5474810004234314, 0.22723308205604553, -0.13493749499320984, 0.08194056898355484, 0.015090260654687881, -0.043419502675533295, 0.2921588122844696, -0.06375414878129959, -0.02307940647006035, -0.5035680532455444, -0.22750449180603027, 0.42742955684661865, -0.23614023625850677, -0.024693746119737625, 0.2494005709886551, 0.029758339747786522, -0.2868894040584564, 0.1280498504638672, -0.13596105575561523, 0.10809888690710068, 0.21043987572193146, 0.08321961015462875, -0.291797935962677, 0.20575743913650513, 0.2654615044593811, -0.07574518024921417, 0.15363307297229767, 0.0165005624294281, -0.14176888763904572, -0.2896972596645355, -0.26592618227005005, -0.12834806740283966, -0.14435002207756042, -0.058498237282037735, -0.3277127742767334, 0.10157322883605957, 0.08570092916488647, 0.2228846549987793, 0.32059627771377563, -0.07173978537321091, 0.09653756022453308, 0.018524333834648132, -0.05981152504682541, -0.19752752780914307, -0.04586014896631241, -0.09600897133350372, -0.2238958775997162, 0.20704232156276703, -0.015670545399188995, 0.015884267166256905, -0.07453048229217529, -0.2616425156593323, 0.2506681978702545, -0.15272094309329987, 0.3393530249595642, -0.22270721197128296, -0.19602657854557037, 0.09832032024860382, 0.32764744758605957, 0.03208314627408981, 0.46097952127456665, 0.22146384418010712, 0.1900784969329834, -0.382247656583786, 0.5861093401908875, 0.06781135499477386, 0.091131791472435, -0.05208999663591385, 0.04155319929122925, 0.15167075395584106, 0.03268611431121826, -0.2110033929347992, 0.09025467187166214, -0.1896549016237259, -0.3968675136566162, 0.17590934038162231, 0.15469029545783997, -0.08685755729675293, 0.03516186773777008, 0.49472349882125854, 0.03706222027540207, -0.0747799426317215, 0.33275675773620605, -0.1545664370059967, -0.2748936414718628, 0.19782127439975739, 0.37532758712768555, 0.49737536907196045, 0.11363475024700165, 0.1430368572473526, -0.3242459297180176, -0.16373886168003082, -0.25603023171424866, 0.317518949508667, 0.11597895622253418, 0.06969431042671204, 0.24592489004135132, 0.025342267006635666, 0.30808281898498535, -0.15005117654800415, 0.3834778070449829, -0.05985127389431, -0.09294340759515762, -0.24677276611328125, 0.3547062575817108, -0.34866324067115784, -0.0965077206492424, 0.061142537742853165, 0.01272231712937355, -0.05678067356348038, -0.314037948846817, -0.11665216088294983, -0.03519153594970703, -0.24282202124595642, 0.06492055952548981, -0.29374080896377563, 0.2787095308303833, 0.1887405663728714, -0.33005592226982117, -0.19436725974082947, 0.0002701766788959503, -0.23775874078273773, 0.13681261241436005, -0.0014336928725242615, -0.3281872868537903, 0.07073373347520828, 0.1775684654712677, 0.07304000109434128, 0.011593429371714592, -0.1050066202878952, -0.15774810314178467, -0.2600916624069214, 0.27417224645614624, -0.06345877051353455, 0.10949278622865677, -0.26159003376960754, -0.49296262860298157, 0.13549187779426575, -0.0016173869371414185, 0.017384342849254608, 0.32479047775268555, 0.26337623596191406, -0.20268172025680542, -0.18367181718349457, -0.13213515281677246, -0.17758439481258392, -0.2296420782804489, 0.12193557620048523, -0.19921022653579712, -0.10009706020355225, 0.5425713658332825, 0.4389154314994812, 0.027376685291528702, 0.26852187514305115, -0.09751295298337936, 0.010527379810810089, -0.4845799207687378, 0.8407242298126221, -0.12131548672914505, -0.5743756294250488, -0.16719481348991394, -0.18350252509117126, 0.11246192455291748, 0.07266519963741302, -0.22869843244552612, 0.20956206321716309, -0.387229859828949, 0.21781548857688904, 0.311832994222641, 0.03825150430202484, 0.05805428326129913, -0.10947068780660629, -0.19391638040542603, -0.11263050138950348, -0.1524779349565506, -0.06871896982192993, 0.26877880096435547, 0.3930383622646332, -0.04058374464511871, 0.282368004322052, 0.15262338519096375, 0.25944623351097107, 0.2485009729862213, -0.050747428089380264, 0.3954215347766876, -0.002106841653585434, 0.5783189535140991, -0.051347050815820694, -0.4424196183681488, 0.00012047216296195984, -0.24484483897686005, -0.18434882164001465, 0.2353966236114502, 0.010773628950119019, -0.11391482502222061, 0.040038056671619415, -0.08676942437887192, -0.03868350386619568, -0.2839300036430359, -0.01127410028129816, -0.11956727504730225, 0.06510334461927414, 0.181604266166687, 0.1345929205417633, -0.13520731031894684, -0.07825091481208801, 0.0340447723865509, 0.23329472541809082, 0.37654638290405273, 0.06364963948726654, 0.17685945332050323, -0.0663263350725174, -0.5151926875114441, 0.1300683468580246, 0.12081003189086914, 0.35162362456321716, -0.038219913840293884, -0.22704070806503296, -0.06903916597366333, -0.0026886016130447388, 0.5561445355415344, -0.040125444531440735, -0.1713314652442932, 0.3147468566894531, 0.152258038520813, -0.2895188629627228, -0.1826518177986145, 0.051713138818740845, 0.021821528673171997, -0.045352011919021606, 0.30733704566955566, 0.16143053770065308, 0.024407871067523956, -0.2689231336116791, 0.29786673188209534, -0.016928203403949738, -0.0924912542104721, -0.5677170157432556, -0.1855853796005249, -0.10094519704580307, 0.04365365952253342, 0.0372486412525177, 0.2345774918794632, -0.5441378355026245, -0.16727259755134583, -0.1977311372756958, -0.2709204852581024, 0.2773929834365845, 0.01733039692044258, 0.3572557866573334, 0.07775461673736572, 0.002076268196105957, -0.08842319250106812, 0.14832304418087006, 0.1987093687057495, 0.24041002988815308, 0.09148091822862625, -0.5016943216323853, 0.0009617377072572708, -0.21416781842708588, 0.2784629166126251, 0.1405928134918213, -0.5508819818496704, -0.015106942504644394, -0.14274826645851135, 0.1131523847579956, -0.30763083696365356, -0.10332176089286804, 0.3864040970802307, -0.018999185413122177, -0.4575035274028778, -0.1398215889930725, 0.39602652192115784, 0.19603073596954346, 0.048859670758247375, 0.14097744226455688, -0.055906686931848526, -0.19610118865966797, 0.12446904927492142, 0.19413962960243225, 0.6024675369262695, 0.07752547413110733, 0.30305737257003784, 0.19823318719863892, -0.003191724419593811, 0.5606458783149719, 0.1298227608203888, 0.2993418872356415, 0.054654985666275024, -0.42479407787323, -0.022586125880479813, 0.07031512260437012, 0.3517008423805237, 0.2083103060722351, -0.42646855115890503, 0.23317086696624756, -0.32205113768577576, 0.08125081658363342, -0.13129255175590515, 0.03898204118013382, -0.20004475116729736, -0.32625216245651245, -0.5076841711997986, 0.21867698431015015, 0.2409474104642868, 0.23609314858913422, 0.3020073473453522, -0.39309999346733093, -0.3389475643634796, -0.16174878180027008, -0.18082880973815918, 0.25723347067832947, 0.0630844458937645, 0.029291462153196335, -0.3069649338722229, -0.4416878819465637, 0.03343445062637329, 0.24352297186851501, 0.30424854159355164, 0.11230472475290298, -0.12919645011425018, -0.19059421122074127, -0.09313270449638367, 0.20497359335422516, -0.176803320646286, -0.24525700509548187, 0.14789840579032898, 0.16027730703353882, 0.2562398612499237, 0.10944772511720657, -0.155691996216774, -0.08896484971046448, 0.2964646816253662, -0.05189626291394234, -0.15685851871967316, -0.28449323773384094, -0.15814384818077087, -0.3429037034511566, 0.020745456218719482, -0.23245102167129517, 0.17413073778152466, -0.06672406196594238, 0.1983814537525177, 0.3605707883834839, -0.2852545380592346, -0.17641635239124298, -0.08062531054019928, 0.438468337059021, -0.1294245421886444, 0.05938560515642166, 0.3699686825275421, -0.33919990062713623, -0.273346483707428, -0.05083703249692917, 0.1959964632987976, -0.10015608370304108, -0.0367266982793808, 0.4621031582355499, 0.10293755680322647, 0.1751837134361267, -0.20319339632987976, 0.13602393865585327, 0.21365730464458466, -0.05019783973693848, -0.1969929039478302, -0.25243082642555237, -0.28143298625946045, -0.052490536123514175, 0.10006527602672577, 0.2826327979564667, 0.057528138160705566, -0.10831108689308167, 0.3191879689693451, 0.055637866258621216, -0.26746171712875366, -0.2332882583141327, 0.10642769187688828, 0.014889989048242569, 0.2505996823310852, 0.19542419910430908, 0.11136326938867569, -0.23220574855804443, 0.1067073866724968, 0.1416596621274948, 0.23815330862998962, -0.3106572926044464, -0.21596935391426086, 0.050824761390686035, 0.025957200676202774, -0.025917233899235725, 0.18805256485939026, -0.08051519840955734, -0.10858561098575592, -0.33883988857269287, 0.01915862411260605, 0.01848895102739334, -0.07813385874032974, 0.03156782314181328, -0.01308431290090084, 0.24138593673706055, 0.03970245271921158, -0.17425554990768433, -0.41935107111930847, 0.19693928956985474, 0.07176047563552856, 0.1484731137752533, 0.09677663445472717, 0.0858725756406784, -0.17505063116550446, -0.21835213899612427, -0.2752378582954407, -0.05661822110414505, 0.27871406078338623, -0.17184534668922424, -0.18250885605812073, 0.1269518882036209, 0.04164484888315201, 0.36440545320510864, -0.06356723606586456, -0.04436763375997543, 0.14363908767700195, 0.1747070699930191, -0.2562864422798157, -0.028781160712242126, -0.4430631399154663, 0.01080399751663208, -0.15535223484039307, -0.02401837706565857, 0.13601744174957275, -0.10315755754709244, -0.003923248499631882, -0.11956343054771423, 0.5044576525688171, -0.05443068966269493, 0.4863688051700592, 0.5873802304267883, 0.231728658080101, 0.32267266511917114, -0.09063190221786499, -0.150709331035614, -0.047800540924072266, -0.0357324592769146, -0.052545879036188126, 0.14383207261562347, 0.44975030422210693, 0.06682649999856949, -0.32814282178878784, -0.3288443386554718, 0.2801923453807831, 0.11178208887577057, -0.40861788392066956, 0.4094955027103424, 0.4652364253997803, 0.3948674201965332, -0.4611782729625702, -0.03453974053263664, -0.2509806156158447, 0.09934408962726593, -0.05301057547330856, -0.004624612629413605, 0.06986768543720245, -0.002070777118206024, -0.05814318358898163, 0.01445411890745163, 0.0979313850402832, 0.03837007284164429, 0.1895492970943451, 0.05313069373369217, 0.04037708789110184, 0.02190668322145939, 0.07179047167301178, 0.15044140815734863, 0.4917081892490387, -0.09549084305763245, -0.04751155525445938, 0.24172817170619965, -0.09135724604129791, -0.14255405962467194, 0.2685909867286682, 0.7944126725196838, 0.29249176383018494, 0.3717188835144043, 0.10885752737522125, 0.1771140843629837, -0.14472922682762146, 0.13343429565429688, 0.40256381034851074, 0.09976381063461304, -0.11628848314285278, 0.13347536325454712, 0.21831603348255157, -0.12268000096082687, 0.17692947387695312, 0.031892649829387665, 0.09234041720628738, -0.17194251716136932, 0.2366713434457779, 0.02474013715982437, -0.1211448386311531, 0.022251326590776443, -0.08727157860994339, 0.07522566616535187, -0.09453243762254715, 0.32950782775878906, 0.055580440908670425, 0.05878080427646637, -0.25505703687667847, 0.10763509571552277, 0.10599976778030396, 0.3496682941913605, 0.14919531345367432, -0.1828054040670395, -0.3688054084777832, 0.1819131076335907, -0.34118950366973877, -0.02861189842224121, -0.07126152515411377, -0.19174930453300476, -0.15154330432415009, 0.01782488077878952, -0.14574390649795532, 0.11911088973283768, -0.14971603453159332, 0.2951979637145996, 0.10027553141117096, 0.14419737458229065, -0.13607797026634216, 0.00661863200366497, 0.061255279928445816, -0.04486268758773804, -0.01984347030520439, -0.399508535861969, 0.2967498004436493, -0.2314700186252594, 0.07111363857984543, -0.09059155732393265, 0.11093230545520782, -0.005860000848770142, 0.4651544690132141, 0.15462493896484375, 0.16604383289813995, 0.14880120754241943, -0.23343318700790405, -0.025547627359628677, -0.3979882597923279, 0.3415314257144928, -0.15252169966697693, 0.07143259048461914, 0.13693483173847198, 0.19651411473751068, -0.16405388712882996, -0.23615039885044098, -0.06386278569698334, 0.3424186408519745, 0.246079221367836, -0.25258851051330566, 0.010722152888774872, -0.02127819135785103, -0.06762019544839859, -0.13085630536079407, 0.21569013595581055, 0.1074594184756279, -0.14398273825645447, 0.17642368376255035, -0.018191106617450714, -0.5468441247940063, 0.3067378103733063, -0.483036071062088, -0.23949521780014038, -0.05571301281452179, 0.11631154268980026, 0.21467462182044983, 0.11986967921257019, -0.1417011171579361, -0.03347907215356827, 0.2606557011604309, -0.011356556788086891, 0.10467307269573212, 0.258112370967865, -0.22574149072170258, 0.14774522185325623, -0.14776864647865295, 0.15546366572380066, 0.0535745806992054, -0.12015222012996674, 0.1274186074733734, -0.39817509055137634 ]
https://github.com/huggingface/datasets/issues/6038
Instead of writing the loading script, you can use the built-in loader to [load JSON files](https://huggingface.co/docs/datasets/loading#json): ```python from datasets import load_dataset ds = load_dataset("json", data_files={"train": os.path.join(data_dir["train"]), "dev": os.path.join(data_dir["dev"])}) ```
File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 992, in _download_and_prepare if str(split_generator.split_info.name).lower() == "all": AttributeError: 'str' object has no attribute 'split_info'. Did you mean: 'splitlines'?
Hi, I use the code below to load local file ``` def _split_generators(self, dl_manager): # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files. # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive # urls = _URLS[self.config.name] data_dir = dl_manager.download_and_extract(_URLs) print(data_dir) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": os.path.join(data_dir["train"]), "split": "train", }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": os.path.join(data_dir["dev"]), "split": "dev", }, ), ] ``` and error occured ``` Traceback (most recent call last): File "/home/zhizhou/data1/zhanghao/huggingface/FineTuning_Transformer/load_local_dataset.py", line 2, in <module> dataset = load_dataset("./QA_script.py",data_files='/home/zhizhou/.cache/huggingface/datasets/conversatiom_corps/part_file.json') File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/load.py", line 1809, in load_dataset builder_instance.download_and_prepare( File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 1670, in _download_and_prepare super()._download_and_prepare( File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 992, in _download_and_prepare if str(split_generator.split_info.name).lower() == "all": AttributeError: 'str' object has no attribute 'split_info'. Did you mean: 'splitlines'? ``` Could you help me?
29
File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 992, in _download_and_prepare if str(split_generator.split_info.name).lower() == "all": AttributeError: 'str' object has no attribute 'split_info'. Did you mean: 'splitlines'? Hi, I use the code below to load local file ``` def _split_generators(self, dl_manager): # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files. # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive # urls = _URLS[self.config.name] data_dir = dl_manager.download_and_extract(_URLs) print(data_dir) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": os.path.join(data_dir["train"]), "split": "train", }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, # These kwargs will be passed to _generate_examples gen_kwargs={ "filepath": os.path.join(data_dir["dev"]), "split": "dev", }, ), ] ``` and error occured ``` Traceback (most recent call last): File "/home/zhizhou/data1/zhanghao/huggingface/FineTuning_Transformer/load_local_dataset.py", line 2, in <module> dataset = load_dataset("./QA_script.py",data_files='/home/zhizhou/.cache/huggingface/datasets/conversatiom_corps/part_file.json') File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/load.py", line 1809, in load_dataset builder_instance.download_and_prepare( File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 909, in download_and_prepare self._download_and_prepare( File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 1670, in _download_and_prepare super()._download_and_prepare( File "/home/zhizhou/anaconda3/envs/pytorch/lib/python3.10/site-packages/datasets/builder.py", line 992, in _download_and_prepare if str(split_generator.split_info.name).lower() == "all": AttributeError: 'str' object has no attribute 'split_info'. Did you mean: 'splitlines'? ``` Could you help me? Instead of writing the loading script, you can use the built-in loader to [load JSON files](https://huggingface.co/docs/datasets/loading#json): ```python from datasets import load_dataset ds = load_dataset("json", data_files={"train": os.path.join(data_dir["train"]), "dev": os.path.join(data_dir["dev"])}) ```
[ -0.4313151240348816, 0.14907023310661316, -0.037516966462135315, 0.40986818075180054, 0.3280503451824188, -0.0586542971432209, 0.4319402575492859, 0.40545201301574707, 0.09521973878145218, 0.3033096492290497, 0.20488500595092773, 0.1470300257205963, -0.10485415160655975, 0.17259982228279114, -0.21751010417938232, -0.5215802788734436, -0.389537513256073, 0.35714197158813477, 0.24092519283294678, 0.08727365732192993, -0.25095242261886597, 0.3741830289363861, -0.06347380578517914, 0.1896345615386963, -0.3479039967060089, 0.1670253723859787, 0.050287216901779175, 0.358857125043869, -0.0076163653284311295, -0.43805360794067383, 0.07153388857841492, -0.04888533428311348, 0.24865564703941345, 0.24606254696846008, -0.000113541136670392, 0.1460229456424713, 0.13701403141021729, 0.05711381137371063, -0.4989674985408783, -0.4633192718029022, -0.36874330043792725, -0.16443075239658356, 0.2619192898273468, -0.4126059114933014, -0.040224526077508926, -0.17446647584438324, -0.13323351740837097, -0.30731824040412903, 0.35694268345832825, 0.4003105163574219, 0.18680042028427124, 0.16958267986774445, 0.015366025269031525, -0.2345021367073059, 0.3742247521877289, 0.17111413180828094, -0.016408290714025497, 0.12615084648132324, -0.11584939062595367, 0.08964966237545013, 0.0052979253232479095, 0.1877967119216919, -0.23169580101966858, 0.24944239854812622, 0.2285059541463852, 0.11773818731307983, 0.03664950653910637, -0.26572346687316895, 0.1423514485359192, 0.13484051823616028, 0.2667850852012634, 0.0706525444984436, -0.15757998824119568, -0.3437023460865021, -0.1512736678123474, -0.18501843512058258, 0.22939440608024597, 0.1774062216281891, -0.5901974439620972, 0.15621650218963623, -0.2653082013130188, -0.30199235677719116, -0.20758336782455444, 0.03380272537469864, -0.21902287006378174, 0.23382824659347534, -0.1765572428703308, 0.04953844100236893, 0.21884924173355103, 0.4236374795436859, 0.1034536212682724, -0.037509478628635406, 0.022041240707039833, 0.15787085890769958, -0.03885451331734657, 0.13540752232074738, 0.0033165384083986282, -0.3261865973472595, -0.10409824550151825, 0.26029306650161743, 0.16040338575839996, -0.13917234539985657, 0.35949355363845825, 0.13984951376914978, 0.14286556839942932, 0.2303065061569214, 0.06898725032806396, 0.2629913091659546, 0.12210389971733093, 0.2160634994506836, -0.19666121900081635, -0.16849592328071594, -0.18144012987613678, -0.32029691338539124, 0.06845774501562119, 0.21658125519752502, 0.510967493057251, -0.13581030070781708, -0.27803170680999756, 0.070475734770298, -0.2655808925628662, -0.3289618194103241, 0.15219977498054504, 0.3156053125858307, -0.0025095120072364807, 0.24073371291160583, 0.09115812182426453, 0.02832084149122238, -0.02301706001162529, -0.13761624693870544, -0.21748238801956177, 0.2143297791481018, -0.1625068485736847, 0.0760217159986496, 0.014732234179973602, -0.4119786024093628, 0.03420493006706238, -0.18888118863105774, -0.029942099004983902, -0.20870167016983032, 0.08018634468317032, -0.1520320624113083, 0.11960859596729279, 0.41116636991500854, -0.02849598601460457, 0.2018989771604538, 0.32384902238845825, -0.34069034457206726, -0.14641447365283966, 0.2745588719844818, -0.4231175184249878, -0.7456306219100952, -0.1956607848405838, 0.22383806109428406, -0.07365038245916367, 0.19787706434726715, 0.18858268857002258, -0.275281697511673, 0.2722964584827423, -0.11155232787132263, -0.0907115638256073, -0.18785427510738373, -0.19335491955280304, -0.19065146148204803, 0.42552679777145386, 0.5266321897506714, -0.36417055130004883, -0.20772522687911987, -0.35914865136146545, -0.2326659858226776, 0.43338292837142944, 0.08630181849002838, -0.28574812412261963, 0.47706300020217896, -0.2882121205329895, 0.20215195417404175, 0.8287100791931152, 0.04753676801919937, -0.14322596788406372, 0.7921675443649292, -0.2833513021469116, -0.10017796605825424, 0.33638834953308105, -0.15958648920059204, 0.3306867182254791, 0.056466370820999146, -0.02305063232779503, 0.1600094735622406, -0.009781518019735813, 0.0011952966451644897, -0.34962812066078186, -0.08108177781105042, 0.09016512334346771, 0.2637980580329895, 0.35066086053848267, 0.20901748538017273, 0.06772351264953613, 0.1940929889678955, 0.3326258361339569, -0.09945087134838104, 0.05956047773361206, 0.16271017491817474, 0.11860297620296478, 0.13080792129039764, -0.045683614909648895, -0.24404753744602203, -0.13006997108459473, 0.051901645958423615, -0.27687332034111023, -0.017525535076856613, -0.33716052770614624, -0.0031896382570266724, -0.45244884490966797, 0.16602015495300293, -0.5311633348464966, -0.27376633882522583, 0.1294482946395874, 0.36889541149139404, 0.18978974223136902, -0.16624316573143005, -0.38724058866500854, 0.10817284882068634, -0.12065640836954117, 0.06610436737537384, -0.1096034049987793, 0.48560622334480286, -0.22673159837722778, -0.09191282093524933, -0.21563443541526794, 0.13781008124351501, 0.03138323873281479, -0.1148257851600647, -0.22147870063781738, 0.3860071897506714, 0.003862183541059494, -0.12073838710784912, -0.192733496427536, -0.06927867233753204, -0.039156071841716766, -0.04464393109083176, 0.06297385692596436, 0.028488576412200928, 0.053386617451906204, 0.27049246430397034, -0.009270092472434044, 0.13603512942790985, -0.16328775882720947, 0.3982419967651367, 0.16685904562473297, 0.020834103226661682, 0.15039849281311035, -0.20217835903167725, 0.0890633836388588, -0.30055761337280273, 0.19577592611312866, -0.006556740030646324, 0.25112882256507874, 0.09023034572601318, -0.08966405689716339, -0.002035725861787796, 0.5382500886917114, -0.03702516481280327, -0.13339963555335999, 0.16823574900627136, -0.12548105418682098, 0.09026573598384857, -0.09338351339101791, 0.5734854936599731, 0.3539671301841736, 0.07267527282238007, 0.020978422835469246, 0.1085784062743187, 0.05704560503363609, -0.23908992111682892, 0.3919134736061096, 0.21730175614356995, 0.14637869596481323, 0.47451457381248474, -0.28586849570274353, 0.14161942899227142, -0.264525830745697, -0.45806825160980225, -0.023571833968162537, 0.44838252663612366, -0.2703511118888855, 0.2209179550409317, -0.13487505912780762, -0.12936250865459442, -0.3796803951263428, -0.335942804813385, -0.11206738650798798, -0.3269253671169281, -0.11521773040294647, -0.012369056232273579, -0.19286808371543884, 0.052100591361522675, -0.12624451518058777, -0.05622194707393646, 0.08502225577831268, -0.39152854681015015, -0.15605810284614563, -0.08352260291576385, -0.19451817870140076, 0.0520377978682518, 0.2729250490665436, -0.0005369223654270172, 0.10586856305599213, -0.2496357560157776, -0.027279630303382874, 0.0539742037653923, 0.20223817229270935, 0.30123060941696167, 0.07035194337368011, -0.11552833020687103, 0.22426718473434448, 0.3069312870502472, 0.21398144960403442, -0.5858129262924194, 0.3827558159828186, -0.09081518650054932, -0.050313085317611694, 0.17620129883289337, 0.22010964155197144, -0.03517525643110275, -0.21001267433166504, -0.5178936123847961, -0.31933149695396423, -0.5126546025276184, 0.17072604596614838, 0.14494164288043976, 0.42403101921081543, 0.013678587973117828, 0.1265924870967865, 0.1608293056488037, -0.08143064379692078, 0.11324088275432587, -0.06858327984809875, -0.31857433915138245, 0.12138555198907852, -0.23429393768310547, -0.23631173372268677, -0.16023825109004974, -0.2053743153810501, -0.010847928002476692, -0.027377407997846603, -0.383899450302124, 0.13885429501533508, -0.29363447427749634, 0.11359241604804993, -0.1030973494052887, 0.019744111225008965, 0.552314281463623, 0.21687281131744385, -0.13509832322597504, 0.20246726274490356, 0.20405419170856476, 0.07128483057022095, -0.06832610070705414, -0.07473590970039368, -0.029180370271205902, 0.2704385817050934, -0.19129499793052673, 0.5091884732246399, 0.0007145926356315613, 0.015501417219638824, 0.2249736338853836, -0.18706858158111572, 0.1043551117181778, -0.1149788573384285, -0.5762461423873901, -0.03613942116498947, -0.14984534680843353, -0.3747340440750122, 0.172202467918396, -0.01533262338489294, 0.009097440168261528, -0.4227064251899719, -0.09911118447780609, -0.1308540254831314, -0.367742657661438, 0.03185832500457764, 0.05684094876050949, 0.3535337448120117, -0.20042754709720612, 0.13285182416439056, 0.03943479061126709, 0.129219651222229, 0.10101409256458282, 0.47347861528396606, 0.22218436002731323, -0.11179085075855255, -0.2919957935810089, -0.12013284862041473, -0.18360355496406555, 0.23479756712913513, 0.3783005475997925, 0.017379596829414368, -0.08443375676870346, -0.3006021976470947, 0.0733049139380455, -0.1358090192079544, 0.4533662497997284, 0.11997311562299728, 0.0970596969127655, 0.24979041516780853, -0.20024430751800537, 0.142602801322937, -0.14036273956298828, -0.12164227664470673, 0.10426689684391022, 0.1281290054321289, 0.2800689935684204, -0.08054611086845398, -0.38610032200813293, 0.5534647107124329, 0.19263827800750732, -0.35057201981544495, -0.11423923075199127, -0.23612067103385925, -0.14321133494377136, -0.3630449175834656, -0.097818523645401, -0.14196616411209106, 0.6038714051246643, 0.035181187093257904, 0.0035439282655715942, 0.13438396155834198, -0.2054578959941864, 0.09143804013729095, 0.08005465567111969, 0.22212181985378265, -0.16077184677124023, -0.10854312777519226, 0.0649082362651825, 0.30816930532455444, 0.004154393449425697, 0.5797470211982727, -0.17489397525787354, -0.35874417424201965, 0.29075777530670166, -0.1628842055797577, 0.42689669132232666, 0.10719555616378784, -0.36622026562690735, -0.1440020203590393, -0.02573186345398426, 0.39458706974983215, -0.22466403245925903, 0.17776551842689514, 0.21957984566688538, -0.1736031472682953, -0.030414512380957603, -0.5798048377037048, 0.2997012138366699, -0.09116288274526596, 0.015432745218276978, 0.260934442281723, -0.1237674355506897, -0.04532278701663017, 0.32606232166290283, 0.0247885100543499, 0.8981190323829651, 0.042548395693302155, -0.0019340212456882, 0.26740896701812744, -0.05099490284919739, 0.3269180953502655, -0.145659938454628, 0.15490922331809998, -0.46139824390411377, -0.17500066757202148, -0.13815730810165405, -0.12868794798851013, 0.37235313653945923, 0.12748675048351288, -0.024452917277812958, -0.021714763715863228, -0.13701745867729187, 0.016687609255313873, 0.055150941014289856, 0.3929784297943115, -0.06797217577695847, -0.07930038869380951, -0.22948065400123596, 0.04515174403786659, -0.025952566415071487, 0.45140889286994934, 0.10988438874483109, 0.05653110891580582, 0.047954633831977844, -0.2564219832420349, -0.21766287088394165, 0.19708627462387085, -0.08949755877256393, 0.15077897906303406, -0.020477470010519028, -0.35980546474456787, 0.030154213309288025, 0.21077702939510345, -0.039207346737384796, 0.06539754569530487, 0.012017510831356049, -0.10563990473747253, -0.1885034739971161, -0.06197517365217209, -0.03071604110300541, 0.23423783481121063, 0.46655550599098206, -0.22593307495117188, -0.16645312309265137, 0.25884300470352173, -0.24077798426151276, -0.24701149761676788, 0.047184497117996216, 0.08640605211257935, 0.3314756155014038, -0.5644135475158691, 0.03950528800487518, -0.09285180270671844, 0.06509380787611008, -0.14163847267627716, 0.09390749782323837, 0.006250547245144844, -0.33724647760391235, -0.16681115329265594, -0.02368677780032158, -0.4543449878692627, -0.03739897161722183, 0.26110607385635376, 0.12454479932785034, 0.21207572519779205, 0.5600274205207825, -0.07795451581478119, -0.04063708335161209, -0.35111507773399353, 0.10349832475185394, 0.043075427412986755, -0.6007835865020752, 0.1693735122680664, 0.02607385814189911, -0.02946723997592926, 0.022507697343826294, 0.35165098309516907, 0.06409981101751328, 0.35992634296417236, -0.13692674040794373, -0.7386270761489868, -0.1323564052581787, -0.18987759947776794, 0.11828815937042236, 0.1246429830789566, -0.0033077821135520935, 0.41923803091049194, 0.11296430230140686, 0.09937042742967606, -0.2865521013736725, 0.012999001890420914, -0.20813032984733582, -0.0038076182827353477, 0.030729904770851135, -0.16881436109542847, 0.34705010056495667, 0.08275525271892548, 0.17051243782043457, -0.03067646734416485, -0.10907278954982758, -0.2024650275707245, -0.17876102030277252, 0.1391233503818512, -0.00518170278519392, -0.10657180845737457, -0.2008562833070755, -0.013867288827896118, -0.0018046330660581589, -0.022022616118192673, 0.19692501425743103, 0.1851421296596527, -0.11970151960849762, 0.3793248236179352, 0.23978301882743835, 0.04629248008131981, -0.5541490316390991, 0.2532236576080322, -0.2923316955566406, 0.4187660217285156, 0.1014217883348465, 0.20787905156612396, -0.1518709361553192, -0.041836969554424286, -0.22906088829040527, 0.03639502078294754, 0.1124463900923729, -0.05105103552341461, 0.44393491744995117, -0.39343148469924927, -0.014261037111282349, -0.12426561862230301, 0.3427795171737671, 0.33456429839134216, -0.07392677664756775, 0.30513542890548706, 0.046664945781230927, 0.20498111844062805, -0.23795495927333832, -0.10769189894199371, 0.04174501448869705, -0.20103876292705536, 0.09556323289871216, 0.30282294750213623, -0.09019069373607635, -0.15452450513839722, 0.027556508779525757, 0.1117892861366272, 0.4243025779724121, 0.19945640861988068, 0.006743293255567551, 0.6949056386947632, -0.11830705404281616, 0.12356141209602356, 0.08251366019248962, 0.06443937867879868, 0.16387246549129486, 0.16962853074073792, -0.24851492047309875, 0.08108837902545929, -0.09769374877214432, 0.05340973660349846, 0.059686329215765, -0.4134489893913269, 0.23549515008926392, 0.03643827885389328, -0.1898491382598877, -0.24040992558002472, -0.2135312408208847, 0.3986043930053711, -0.15124750137329102, 0.13146042823791504, 0.07414250075817108, 0.32157230377197266, -0.1583220660686493, 0.002702653408050537, -0.23088878393173218, -0.3619152307510376, -0.42211875319480896, -0.13455460965633392, 0.22791576385498047, -0.08311962336301804, 0.2829242944717407, 0.05354105681180954, -0.06347629427909851, 0.14658042788505554, 0.12477704882621765, 0.025630991905927658, -0.07666938006877899, -0.44819802045822144, 0.23449090123176575, 0.35565197467803955, 0.19403836131095886, 0.18225231766700745, -0.025145210325717926, 0.43227246403694153, 0.27693551778793335, -0.1567186862230301, -0.24857409298419952, -0.19178169965744019, -0.15320289134979248, -0.09668952971696854, 0.020345058292150497, -0.22229087352752686, 0.26034480333328247, 0.4868239462375641, 0.16282258927822113, -0.20368851721286774, 0.28391385078430176, 0.022813569754362106, 0.1466071754693985, -0.09600403159856796, 0.8893523216247559, 0.1482698619365692, -0.19941681623458862, -0.01611051708459854, -0.12910234928131104, -0.3928128480911255, -0.31451496481895447, 0.18227112293243408, -0.062148720026016235, 0.10750128328800201, -0.031114473938941956, 0.09929967671632767, 0.011434104293584824, 0.4037731885910034, 0.2701527774333954, 0.08406105637550354, -0.2807585597038269, -0.24699541926383972, -0.6139657497406006, 0.1876351237297058, 0.08566981554031372, -0.1244039535522461, 0.08033094555139542, 0.13576951622962952, -0.1890190839767456, 0.39931154251098633, -0.17872129380702972, 0.3130197525024414, 0.0009696595370769501, 0.020015407353639603, -0.17493733763694763, -0.026369476690888405, 0.017082596197724342, 0.0996280163526535, -0.0412045419216156, -0.36049896478652954, 0.14887940883636475, -0.4067085385322571, 0.06639540940523148, 0.08900842070579529, -0.2461227923631668, 0.34042444825172424, -0.08779162168502808, 0.005455493927001953, 0.03730081021785736, 0.34798377752304077, -0.07882295548915863, 0.073928602039814, 0.21389786899089813, 0.11478349566459656, -0.14364714920520782, 0.26957932114601135, 0.2807503938674927, 0.40023553371429443, 0.03446779400110245, -0.011745915748178959, -0.6300326585769653, 0.28487640619277954, -0.09762150794267654, 0.23178789019584656, -0.18369045853614807, 0.04751328378915787, -0.08843016624450684, 0.18162977695465088, 0.45225584506988525, -0.0032379720360040665, -0.002656998112797737, -0.0073180533945560455, -0.3985818028450012, -0.3638151288032532, 0.5529705882072449, -0.3081754148006439, -0.3680804967880249, -0.16327303647994995, 0.2154478281736374, 0.06245774030685425, 0.039217352867126465, -0.44566017389297485, -0.029054589569568634, 0.5159177184104919, -0.08212655782699585, -0.052487507462501526, -0.04082469642162323, 0.04913819208741188, 0.18749111890792847, 0.04411785304546356, 0.3311094343662262, 0.028027046471834183, -0.01685493066906929, -0.11835461109876633, -0.13158303499221802 ]
https://github.com/huggingface/datasets/issues/6037
These docs are outdated (version 1.2.1 is over two years old). Please refer to [this](https://huggingface.co/docs/datasets/dataset_script) version instead. Initially, we hosted datasets in this repo, but now you can find them [on the HF Hub](https://huggingface.co/datasets) (e.g. the [`ag_news`](https://huggingface.co/datasets/ag_news/blob/main/ag_news.py) script)
Documentation links to examples are broken
### Describe the bug The links at the bottom of [add_dataset](https://huggingface.co/docs/datasets/v1.2.1/add_dataset.html) to examples of specific datasets are all broken, for example - text classification: [ag_news](https://github.com/huggingface/datasets/blob/master/datasets/ag_news/ag_news.py) (original data are in csv files) ### Steps to reproduce the bug Click on links to examples from latest documentation ### Expected behavior Links should be up to date - it might be more stable to link to https://huggingface.co/datasets/ag_news/blob/main/ag_news.py ### Environment info dataset v1.2.1
38
Documentation links to examples are broken ### Describe the bug The links at the bottom of [add_dataset](https://huggingface.co/docs/datasets/v1.2.1/add_dataset.html) to examples of specific datasets are all broken, for example - text classification: [ag_news](https://github.com/huggingface/datasets/blob/master/datasets/ag_news/ag_news.py) (original data are in csv files) ### Steps to reproduce the bug Click on links to examples from latest documentation ### Expected behavior Links should be up to date - it might be more stable to link to https://huggingface.co/datasets/ag_news/blob/main/ag_news.py ### Environment info dataset v1.2.1 These docs are outdated (version 1.2.1 is over two years old). Please refer to [this](https://huggingface.co/docs/datasets/dataset_script) version instead. Initially, we hosted datasets in this repo, but now you can find them [on the HF Hub](https://huggingface.co/datasets) (e.g. the [`ag_news`](https://huggingface.co/datasets/ag_news/blob/main/ag_news.py) script)
[ 0.02381463348865509, -0.0986577719449997, 0.03794017806649208, 0.19491194188594818, 0.12027567625045776, 0.12439810484647751, 0.19488364458084106, 0.2199345976114273, 0.011479705572128296, 0.0528639554977417, -0.05578690394759178, 0.08662953972816467, -0.07946702837944031, 0.18708573281764984, 0.3534022271633148, -0.28689199686050415, 0.05397767201066017, -0.06264680624008179, -0.21212387084960938, -0.05458678677678108, -0.06715797632932663, 0.3417145609855652, -0.13973456621170044, 0.060674648731946945, -0.28698745369911194, 0.07204844057559967, -0.26013055443763733, 0.15843187272548676, -0.031148329377174377, -0.5359756350517273, 0.13060221076011658, -0.09459654241800308, 0.07277520000934601, 0.23164629936218262, -0.00010822750482475385, -0.060164425522089005, 0.3060930669307709, 0.0828077495098114, -0.3706774115562439, -0.20580096542835236, -0.17781749367713928, -0.07617615908384323, -0.049428779631853104, 0.12147195637226105, -0.0946246087551117, -0.14478865265846252, 0.05672600865364075, 0.10968689620494843, 0.19779475033283234, 0.26880282163619995, 0.2574373185634613, 0.30416446924209595, 0.3577423393726349, -0.4585758447647095, 0.19626648724079132, 0.35704660415649414, -0.21038486063480377, 0.49138641357421875, 0.1562727838754654, -0.09231138229370117, 0.03173080086708069, 0.4766255021095276, 0.20456735789775848, -0.1608654111623764, 0.25048956274986267, 0.13339123129844666, -0.2246100753545761, -0.18149758875370026, 0.12708795070648193, 0.4945080280303955, 0.3722873032093048, -0.1912001520395279, -0.49162954092025757, -0.21988266706466675, -0.020754974335432053, -0.1928466111421585, 0.10467231273651123, 0.3129566013813019, 0.15184015035629272, 0.34379246830940247, -0.017429448664188385, -0.2645469605922699, -0.11403951793909073, 0.2983804941177368, 0.3746602535247803, -0.10560601204633713, -0.2534509599208832, -0.07138453423976898, 0.22202806174755096, -0.1280476450920105, -0.1337202936410904, 0.12280488014221191, -0.19351507723331451, 0.1892528086900711, 0.1606917381286621, 0.07831777632236481, 0.08143876492977142, 0.19650688767433167, 0.49876201152801514, -0.01485094241797924, -0.17914165556430817, 0.03756752610206604, -0.24345199763774872, 0.2153152972459793, -0.046119943261146545, 0.04131399467587471, 0.026867888867855072, 0.12544351816177368, 0.36885344982147217, 0.6128216981887817, 0.19102416932582855, -0.058985885232686996, -0.051848724484443665, -0.19702006876468658, -0.2735053598880768, -0.25475403666496277, 0.1572742462158203, -0.16961655020713806, -0.23957276344299316, 0.1747160255908966, -0.17577636241912842, -0.018959052860736847, -0.1005721166729927, 0.3322920799255371, -0.028086721897125244, -0.2707039713859558, -0.0003238990902900696, 0.3343565762042999, -0.06979724764823914, -0.23110182583332062, -0.22643207013607025, 0.11920332908630371, -0.2096433937549591, 0.2869459390640259, 0.16554144024848938, -0.2259814441204071, 0.376041442155838, 0.10906414687633514, 0.000560978427529335, -0.1498485654592514, -0.15808260440826416, 0.0035108141601085663, 0.05569125711917877, 0.2485351860523224, -0.02545570209622383, 0.17544671893119812, 0.26887047290802, -0.18691924214363098, -0.14254644513130188, -0.19027718901634216, -0.3839261829853058, -0.1793077439069748, -0.2133205384016037, 0.16937832534313202, 0.05968768894672394, -0.003375034313648939, -0.33026108145713806, 0.28702616691589355, -0.18945470452308655, -0.06834663450717926, 0.034605614840984344, 0.11585547029972076, -0.13067439198493958, -0.07843373715877533, 0.4671685993671417, 0.6053535342216492, 0.004481606185436249, -0.1840893179178238, 0.12477259337902069, 0.08674612641334534, -0.21815061569213867, 0.25940555334091187, -0.2732604146003723, 0.1472405046224594, -0.4406779110431671, -0.1441890448331833, 0.06927244365215302, -0.43881160020828247, -0.04152407869696617, 0.04144476354122162, 0.18179433047771454, -0.03335065767168999, -0.1444493979215622, -0.23128420114517212, 0.032614581286907196, 0.05837161839008331, -0.09685128927230835, 0.06999833881855011, 0.13265204429626465, 0.02308516949415207, -0.2375854104757309, -0.20383772253990173, -0.1401764452457428, -0.062057770788669586, 0.028906695544719696, 0.15301331877708435, 0.18808765709400177, -0.05308454856276512, 0.34303271770477295, -0.1566983163356781, 0.08247719705104828, 0.5467971563339233, 0.3661051392555237, 0.15566866099834442, 0.03198329731822014, -0.22884076833724976, -0.3172840178012848, 0.026397593319416046, -0.0635768249630928, 0.31145933270454407, 0.04579904302954674, -0.2315792441368103, -0.3535224497318268, -0.02571222186088562, 0.04460137337446213, -0.6013521552085876, 0.12713134288787842, 0.03743430972099304, 0.027541078627109528, 0.3895162343978882, -0.10576974600553513, 0.28288939595222473, -0.1327037811279297, 0.3726068437099457, -0.2636381685733795, 0.4315038323402405, -0.13863003253936768, -0.03780592232942581, 0.09791381657123566, 0.16483351588249207, 0.1861211508512497, -0.26250746846199036, -0.09125439822673798, 0.5180581212043762, 0.08512318879365921, 0.33249926567077637, 0.1401847004890442, 0.02489001303911209, 0.3159044086933136, -0.41309964656829834, -0.08901847153902054, 0.1741504669189453, -0.11196446418762207, 0.0671435296535492, -0.3065863251686096, 0.16391697525978088, 0.11667658388614655, 0.1814902126789093, 0.39558300375938416, 0.2996402978897095, 0.12639440596103668, -0.0284745916724205, -0.2033020555973053, -0.2883402109146118, 0.1776026487350464, -0.22826343774795532, 0.13413123786449432, -0.12133697420358658, -0.3895455598831177, 0.10213270038366318, 0.22370298206806183, 0.017945438623428345, 0.12391486763954163, 0.32225969433784485, -0.4154702126979828, -0.057700663805007935, 0.33377718925476074, 0.10634170472621918, 0.08352769911289215, 0.0985054299235344, 0.025845972821116447, 0.22055421769618988, -0.15655916929244995, -0.10347804427146912, 0.0646396055817604, 0.033432502299547195, 0.02694547548890114, -0.15214772522449493, 0.02296466752886772, 0.1054508164525032, -0.38750648498535156, -0.08137740194797516, -0.3115633726119995, 0.01663799397647381, -0.4948585033416748, 0.1977170705795288, -0.2517288327217102, -0.27385827898979187, -0.460117369890213, -0.16057133674621582, -0.28777164220809937, -0.285442054271698, -0.08929882198572159, 0.11421196162700653, -0.16104304790496826, 0.1847047507762909, 0.01729494333267212, 0.08515628427267075, -0.24928626418113708, 0.38024652004241943, -0.08812067657709122, 0.12775921821594238, -0.3370988070964813, 0.06538695096969604, 0.016846999526023865, 0.13487324118614197, 0.12468843162059784, -0.2234201729297638, -0.10714749991893768, -0.5157749652862549, -0.6338233947753906, 0.20148929953575134, -0.12968873977661133, 0.2588922083377838, 0.30882394313812256, 0.09507164359092712, -0.24199217557907104, -0.32800617814064026, 0.31553196907043457, -0.2872066795825958, 0.06558807939291, -0.11999592930078506, -0.041718918830156326, -0.09929486364126205, -0.18474745750427246, -0.3987172544002533, -0.03618355840444565, -0.16401225328445435, 0.34509989619255066, 0.08165410906076431, -0.02881581336259842, 0.38051310181617737, 0.09266553819179535, 0.26192232966423035, -0.2817351222038269, 0.13382095098495483, -0.12424136698246002, -0.2749083638191223, 0.09065869450569153, -0.5187424421310425, -0.4204915761947632, 0.022775322198867798, -0.03883548825979233, 0.1320071816444397, -0.25480762124061584, -0.4300435781478882, -0.17728257179260254, -0.23292219638824463, -0.05811532586812973, -0.012180798687040806, 0.18300524353981018, 0.013991408050060272, 0.03963521122932434, -0.09898994863033295, -0.24048155546188354, -0.1620613932609558, 0.00641898438334465, -0.3373321294784546, 0.2725891172885895, -0.17868515849113464, 0.2394476979970932, 0.13902506232261658, 0.3564085364341736, 0.5294393301010132, 0.0501902811229229, 0.24847090244293213, -0.18528838455677032, 0.6270014643669128, -0.12073832750320435, -0.2853991985321045, 0.19191047549247742, -0.10805732011795044, 0.18274493515491486, 0.12537020444869995, 0.4374827444553375, 0.14799655973911285, -0.1285092979669571, -0.08233589679002762, -0.23670950531959534, -0.322298526763916, -0.2650188207626343, -0.08803173899650574, 0.25069761276245117, 0.04694634675979614, 0.09039126336574554, 0.06091878563165665, -0.09745588898658752, 0.24902762472629547, 0.5101959705352783, 0.1207105815410614, 0.11337175220251083, -0.4259703457355499, -0.020767953246831894, -0.34662511944770813, -0.064049631357193, -0.0849454402923584, 0.10782454907894135, -0.16117556393146515, 0.05626380443572998, -0.09180140495300293, 0.15396611392498016, 0.3328201174736023, -0.18908542394638062, 0.033401500433683395, 0.11485534906387329, 0.059803307056427, -0.37322795391082764, 0.008801005780696869, -0.14994335174560547, -0.008080899715423584, 0.3967726230621338, 0.3800738751888275, -0.25188517570495605, -0.11829198151826859, 0.5299793481826782, -0.0037829801440238953, 0.0884542241692543, 0.16673044860363007, 0.00488879531621933, -0.1816803216934204, -0.24244782328605652, -0.17685478925704956, 0.11367300897836685, -0.05313644930720329, -0.18426303565502167, -0.16594111919403076, 0.18376708030700684, -0.004193462431430817, 0.02249203622341156, 0.1117539256811142, 0.25886818766593933, 0.1296466886997223, 0.14298927783966064, 0.25547072291374207, 0.19203072786331177, 0.542877733707428, 0.4280235767364502, -0.2674040198326111, -0.3444725573062897, -0.16443809866905212, 0.023616008460521698, 0.32664743065834045, 0.20042219758033752, -0.09647738933563232, 0.14786608517169952, 0.10422231256961823, 0.09466606378555298, -0.309225857257843, 0.21405629813671112, 0.4553884267807007, 0.0596887432038784, -0.2913713753223419, -0.26106396317481995, 0.4735731780529022, -0.02625254914164543, -0.010559536516666412, 0.28924018144607544, 0.5968013405799866, -0.25962692499160767, 0.06187869980931282, -0.01406797394156456, 0.7958047389984131, 0.15730240941047668, 0.24997740983963013, 0.22636930644512177, -0.3826707601547241, 0.5273591876029968, 0.09350833296775818, -0.11508260667324066, -0.2821081876754761, -0.22435028851032257, -0.053549639880657196, -0.16200003027915955, 0.12853817641735077, -0.061263371258974075, -0.21123184263706207, 0.23627550899982452, -0.10414646565914154, 0.46266958117485046, -0.05233157426118851, 0.09419623017311096, -0.13558465242385864, -0.2444985806941986, -0.35015514492988586, 0.23308025300502777, 0.17190328240394592, 0.31354740262031555, -0.17793509364128113, -0.20428387820720673, -0.04870344698429108, -0.17051011323928833, -0.375441312789917, 0.11094260215759277, -0.10616742819547653, 0.03887099400162697, 0.3252844512462616, -0.1512898951768875, 0.22162775695323944, 0.3164292573928833, 0.4151780307292938, 0.24737092852592468, -0.5191951990127563, 0.12947168946266174, -0.3837486207485199, -0.09170341491699219, -0.030446205288171768, 0.08670803904533386, 0.2964927554130554, -0.02796737104654312, -0.22046716511249542, 0.09742565453052521, 0.010924912989139557, 0.057388052344322205, -0.08695855736732483, -0.2797020673751831, -0.43506303429603577, -0.2178632915019989, 0.09909603744745255, 0.08138703554868698, -0.00986400991678238, -0.4481257498264313, 0.16588501632213593, 0.11075115948915482, 0.13660117983818054, -0.2010733038187027, 0.4017670750617981, -0.05307096242904663, -0.23146937787532806, 0.48042213916778564, -0.4263550043106079, -0.02525053545832634, 0.21250061690807343, 0.2751096189022064, -0.17370107769966125, -0.15345646440982819, 0.1487937867641449, 0.3272150158882141, -0.34553685784339905, -0.005760379135608673, 0.000212203711271286, 0.20859256386756897, -0.04875968024134636, 0.23558491468429565, 0.1880681961774826, -0.14138539135456085, 0.08157606422901154, -0.28848007321357727, -0.350614994764328, 0.41935408115386963, -0.2241654098033905, 0.006092564202845097, -0.11776960641145706, 0.06883224844932556, 0.1923656165599823, -0.046513162553310394, -0.35573825240135193, 0.1567005217075348, -0.08312509208917618, -0.14517876505851746, 0.1895272135734558, 0.16026270389556885, 0.4236471951007843, -0.17220818996429443, 0.05332497879862785, -0.1596766710281372, -0.08280596137046814, -0.12051136791706085, -0.3097729980945587, 0.06326017528772354, 0.08298828452825546, -0.32826098799705505, -0.004363827407360077, -0.0685487613081932, 0.022691570222377777, -0.20050591230392456, 0.27763527631759644, 0.1568916290998459, 0.0014878101646900177, 0.19375228881835938, -0.30085447430610657, 0.13911470770835876, 0.22029680013656616, -0.15515738725662231, 0.10587824136018753, 0.13577303290367126, 0.14768986403942108, -0.2163456827402115, -0.15086011588573456, -0.06457724422216415, 0.014962531626224518, 0.20033994317054749, -0.045824505388736725, -0.027750639244914055, 0.4761669337749481, -0.2172253429889679, -0.0024722516536712646, -0.055722035467624664, 0.5668184757232666, -0.011339446529746056, -0.1654120832681656, 0.30791178345680237, 0.39815083146095276, 0.16638745367527008, -0.16584360599517822, -0.037890270352363586, -0.06474214047193527, 0.011865902692079544, 0.13988454639911652, 0.11198277026414871, 0.379963219165802, 0.011067807674407959, -0.005968164652585983, 0.06976400315761566, 0.2573947310447693, 0.03635775297880173, 0.19424216449260712, 0.30658721923828125, -0.09670655429363251, 0.22277146577835083, 0.15469427406787872, 0.05855093523859978, 0.27786457538604736, -0.12136061489582062, 0.0138070248067379, 0.20736800134181976, -0.1441221386194229, 0.17153456807136536, 0.3275431990623474, -0.22344592213630676, -0.1315763294696808, 0.008813008666038513, 0.042632896453142166, -0.08009658753871918, -0.17650139331817627, 0.5373222827911377, -0.25975096225738525, -0.32586199045181274, -0.10947257280349731, 0.12864845991134644, 0.013625027611851692, -0.22678908705711365, 0.19116492569446564, -0.08765852451324463, -0.02231156826019287, -0.11340609937906265, 0.015811413526535034, -0.386518657207489, 0.19664886593818665, -0.23478692770004272, -0.11590619385242462, -0.48022449016571045, 0.024255648255348206, 0.16292738914489746, 0.4471205770969391, 0.03626944124698639, 0.19410565495491028, -0.08671823143959045, -0.06371015310287476, -0.18523439764976501, 0.44430413842201233, 0.4746798276901245, 0.1036963015794754, 0.2628946304321289, -0.0326322466135025, -0.10738761723041534, 0.08722071349620819, 0.08561939001083374, 0.23103472590446472, 0.1814875602722168, -0.20697256922721863, 0.27748599648475647, 0.12801560759544373, -0.16371406614780426, 0.24603323638439178, -0.11363774538040161, 0.2946648597717285, -0.2579135000705719, 0.26112326979637146, -0.42056038975715637, -0.08997640013694763, -0.20285770297050476, -0.17621387541294098, -0.1455252766609192, 0.15771034359931946, 0.43116942048072815, -0.05503533408045769, 0.1039060577750206, -0.19444182515144348, 0.09671486914157867, 0.3036426305770874, 0.4148002564907074, 0.5329136848449707, 0.10521965473890305, -0.06803786754608154, -0.3841274380683899, -0.36163121461868286, -0.0038389116525650024, -0.2389584630727768, 0.23345978558063507, -0.025269344449043274, -0.250773549079895, -0.12544429302215576, -0.03896677494049072, 0.15500697493553162, -0.1658923178911209, 0.04160803556442261, -0.08617594838142395, -0.2279690057039261, -0.12296785414218903, -0.29193350672721863, 0.15908771753311157, 0.08167274296283722, 0.1414034366607666, 0.18816614151000977, -0.20503157377243042, -0.0369754359126091, -0.048851627856492996, 0.4038335680961609, -0.30703970789909363, -0.14141394197940826, 0.3466363251209259, 0.050225332379341125, 0.09935840964317322, -0.13981188833713531, -0.2792412340641022, -0.49202287197113037, -0.45831841230392456, 0.07504206895828247, 0.34977635741233826, -0.3039742708206177, 0.18015526235103607, -0.03737913817167282, -0.5454699397087097, -0.22841423749923706, 0.271454393863678, 0.35476863384246826, -0.011292651295661926, -0.3199898600578308, 0.325099915266037, -0.102414071559906, -0.18540841341018677, 0.43039441108703613, 0.26058587431907654, -0.285542368888855, 0.04708099365234375, -0.1987481713294983, -0.4600839614868164, 0.4595607817173004, -0.19806544482707977, 0.11411556601524353, -0.16123802959918976, 0.4169618487358093, 0.35028648376464844, -0.337405264377594, -0.8366901874542236, -0.04250970482826233, 0.27293023467063904, 0.23713096976280212, -0.34894588589668274, 0.12415206432342529, -0.04628203809261322, -0.04738112539052963, 0.04962940514087677, 0.4838925004005432, 0.167861670255661, -0.2630135416984558, 0.39301738142967224, -0.09095829725265503 ]
https://github.com/huggingface/datasets/issues/6034
Even if a dataset is cached, we still make requests to check whether the cache is up-to-date. [This](https://huggingface.co/docs/datasets/v2.13.1/en/loading#offline) section in the docs explains how to avoid them and directly load the cached version.
load_dataset hangs on WSL
### Describe the bug load_dataset simply hangs. It happens once every ~5 times, and interestingly hangs for a multiple of 5 minutes (hangs for 5/10/15 minutes). Using the profiler in PyCharm shows that it spends the time at <method 'connect' of '_socket.socket' objects>. However, a local cache is available so I am not sure why socket is needed. ([profiler result](https://ibb.co/0Btbbp8)) It only happens on WSL for me. It works for native Windows and my MacBook. (cache quickly recognized and loaded within a second). ### Steps to reproduce the bug I am using Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux >>> import datasets >>> datasets.load_dataset('ai2_arc', 'ARC-Challenge') # hangs for 5/10/15 minutes ### Expected behavior cache quickly recognized and loaded within a second ### Environment info Please let me know if I should provide more environment information.
33
load_dataset hangs on WSL ### Describe the bug load_dataset simply hangs. It happens once every ~5 times, and interestingly hangs for a multiple of 5 minutes (hangs for 5/10/15 minutes). Using the profiler in PyCharm shows that it spends the time at <method 'connect' of '_socket.socket' objects>. However, a local cache is available so I am not sure why socket is needed. ([profiler result](https://ibb.co/0Btbbp8)) It only happens on WSL for me. It works for native Windows and my MacBook. (cache quickly recognized and loaded within a second). ### Steps to reproduce the bug I am using Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux >>> import datasets >>> datasets.load_dataset('ai2_arc', 'ARC-Challenge') # hangs for 5/10/15 minutes ### Expected behavior cache quickly recognized and loaded within a second ### Environment info Please let me know if I should provide more environment information. Even if a dataset is cached, we still make requests to check whether the cache is up-to-date. [This](https://huggingface.co/docs/datasets/v2.13.1/en/loading#offline) section in the docs explains how to avoid them and directly load the cached version.
[ -0.342157244682312, -0.17921330034732819, 0.04200541973114014, 0.13595989346504211, 0.22275732457637787, 0.20644865930080414, 0.5331807136535645, -0.05518855154514313, 0.7224944233894348, 0.03790527209639549, 0.12820672988891602, 0.10376733541488647, 0.30889615416526794, 0.1409708559513092, 0.13697770237922668, -0.09364134073257446, 0.1692126989364624, 0.02296341210603714, 0.12087808549404144, 0.12117742002010345, -0.1609024703502655, 0.03616750240325928, -0.24637381732463837, -0.15099377930164337, -0.25212058424949646, 0.07533840090036392, -0.0795171856880188, -0.11432988941669464, -0.02389635145664215, -0.3391617238521576, 0.6933760046958923, 0.0673736184835434, 0.038236379623413086, 0.11358601599931717, -0.0001170835384982638, -0.05050632357597351, 0.30736011266708374, 0.1880185902118683, -0.4875229299068451, -0.1512368619441986, -0.2123662233352661, -0.11130890250205994, 0.39849787950515747, 0.13945873081684113, -0.16366973519325256, 0.20921187102794647, 0.029745860025286674, -0.49434489011764526, 0.49888527393341064, -0.06105198338627815, 0.17469947040081024, 0.3052884042263031, -0.04852840304374695, -0.23059621453285217, 0.08363386988639832, -0.0347834974527359, -0.16259348392486572, 0.08684856444597244, 0.3014793395996094, -0.05301531404256821, -0.14977014064788818, 0.17258089780807495, -0.10852240771055222, 0.16945263743400574, 0.33987244963645935, -0.0029812827706336975, -0.24809613823890686, -0.179390549659729, 0.3612949252128601, 0.24421033263206482, 0.6548477411270142, 0.031132839620113373, -0.08806842565536499, -0.2328515350818634, 0.2950546145439148, -0.11348973214626312, 0.42385953664779663, 0.2521868646144867, -0.16213837265968323, 0.24381393194198608, -0.01821451634168625, 0.10829819738864899, -0.1258096694946289, -0.009590614587068558, -0.11005064100027084, 0.14022991061210632, -0.02274303138256073, 0.3952277600765228, 0.05450551584362984, -0.008207106962800026, 0.13814660906791687, -0.21760836243629456, -0.13720393180847168, -0.07972361147403717, -0.6954275369644165, 0.38160282373428345, 0.10481174290180206, 0.5880734324455261, 0.004903264343738556, 0.13882428407669067, -0.01629852131009102, -0.07066202163696289, 0.415665864944458, 0.0736512690782547, 0.31349608302116394, -0.05812438577413559, -0.07855281978845596, -0.29338890314102173, 0.06681880354881287, 0.11927852034568787, -0.27419406175613403, -0.01956983096897602, -0.08754420280456543, -0.06956103444099426, 0.10874051600694656, -0.4019833505153656, 0.3658583462238312, -0.22635608911514282, -0.31728681921958923, 0.1585472822189331, -0.20708554983139038, 0.11556932330131531, 0.23289524018764496, 0.5967627167701721, -0.24906542897224426, 0.5201702117919922, 0.3808348774909973, -0.17035073041915894, -0.23277395963668823, -0.197723850607872, -0.14372649788856506, -0.20258791744709015, -0.07518573105335236, 0.12067758291959763, 0.2665490508079529, -0.0610419400036335, -0.06924616545438766, 0.11098965257406235, 0.1253138929605484, -0.20914621651172638, 0.14552563428878784, 0.06250107288360596, 0.19687438011169434, 0.4266347587108612, -0.036200445145368576, 0.346117228269577, -0.12006450444459915, -0.13414347171783447, -0.13566109538078308, -0.009211577475070953, -0.04390610009431839, -0.11133546382188797, -0.07593416422605515, 0.13128086924552917, -0.204466313123703, -0.20072290301322937, -0.07949833571910858, -0.13844287395477295, 0.05553614720702171, 0.18458208441734314, 0.015841327607631683, -0.19168350100517273, -0.23309463262557983, -0.08953346312046051, 0.43204861879348755, 0.5559825301170349, 0.012093029916286469, 0.04628320783376694, 0.0596485510468483, 0.23510517179965973, -0.12651248276233673, 0.2205309420824051, -0.1263847053050995, -0.028706025332212448, -0.1478535532951355, -0.08424428105354309, 0.286268413066864, -0.2711108922958374, -0.49812090396881104, 0.36142757534980774, -0.16599783301353455, 0.33668988943099976, 0.11227592825889587, 0.42998722195625305, -0.01478927955031395, -0.04459378495812416, -0.11326240748167038, 0.4187086522579193, -0.13995890319347382, -0.00009396672248840332, -0.061943814158439636, -0.1643693447113037, 0.26515939831733704, 0.315603107213974, -0.3727102279663086, -0.3250056505203247, -0.1267274022102356, 0.40436193346977234, 0.22401556372642517, 0.017083454877138138, -0.02510455995798111, -0.04664933308959007, 0.1194324865937233, 0.21648557484149933, 0.17553356289863586, 0.046538010239601135, -0.7529013156890869, 0.3713837265968323, 0.4126583933830261, -0.15519055724143982, 0.0954270213842392, -0.17171646654605865, -0.08499911427497864, 0.36412283778190613, -0.451633095741272, -0.013723332434892654, -0.1289859414100647, 0.011176016181707382, 0.15451247990131378, 0.1475420594215393, -0.11864154785871506, 0.39558979868888855, -0.37016621232032776, 0.028933290392160416, -0.5195817947387695, -0.026135798543691635, -0.007613006979227066, 0.13309061527252197, -0.0876827985048294, 0.06474494934082031, -0.07981684058904648, 0.10039541870355606, -0.13781329989433289, 0.08328120410442352, -0.07498190551996231, 0.3177849352359772, -0.3443482518196106, 0.3515332341194153, -0.042520761489868164, -0.2139388620853424, 0.33107492327690125, -0.08565162122249603, 0.18111670017242432, -0.30969423055648804, -0.20016051828861237, -0.009394533932209015, 0.23794642090797424, 0.3037576377391815, -0.2796919345855713, -0.04082884639501572, 0.2969774007797241, 0.03835781663656235, -0.15057766437530518, 0.057968832552433014, 0.3076646327972412, -0.3832472860813141, 0.39657893776893616, -0.02906215563416481, -0.1135110929608345, 0.30328088998794556, 0.49369361996650696, -0.01675635203719139, 0.021343063563108444, 0.1844659149646759, -0.0284106507897377, -0.2584727108478546, 0.10354994237422943, 0.042257025837898254, 0.3874858617782593, 0.08274178206920624, 0.06430783867835999, 0.04067082703113556, -0.1658497303724289, -0.25025203824043274, 0.027185752987861633, 0.0018525812774896622, -0.13667471706867218, -0.01958595961332321, 0.2513797879219055, 0.05487417057156563, -0.20365828275680542, -0.021508552134037018, -0.28437095880508423, -0.02587464265525341, -0.1945945769548416, 0.3871718645095825, -0.16889697313308716, -0.1052091121673584, -0.045273859053850174, 0.24196510016918182, -0.11598044633865356, -0.27840444445610046, -0.2330109030008316, 0.2954614460468292, 0.048491328954696655, 0.21820709109306335, -0.08274618536233902, 0.47647610306739807, 0.20038069784641266, -0.12498962879180908, -0.541668713092804, -0.3286060690879822, -0.24720323085784912, -0.07923304289579391, 0.48183751106262207, -0.0075736939907073975, 0.325348824262619, -0.16255077719688416, -0.13986125588417053, -0.21485835313796997, -0.3025975227355957, -0.11537303030490875, -0.057616133242845535, 0.06578409671783447, 0.3238908052444458, 0.36987194418907166, 0.01325855404138565, 0.04499306157231331, 0.3545135259628296, -0.42425525188446045, -0.055693093687295914, 0.07129663228988647, -0.1015322357416153, -0.09648028016090393, -0.081307053565979, -0.21081259846687317, -0.18892616033554077, -0.33073198795318604, 0.37307801842689514, 0.007226675748825073, -0.20350617170333862, 0.05193362385034561, 0.17505139112472534, -0.00527123361825943, -0.0974472239613533, 0.1953456699848175, -0.18136431276798248, -0.46988147497177124, 0.3104887008666992, 0.0664861649274826, -0.4040214717388153, 0.25804606080055237, 0.08927439153194427, -0.11228486895561218, 0.014267392456531525, -0.7155365347862244, 0.05411086976528168, -0.420427531003952, 0.26520267128944397, -0.028044994920492172, -0.06905415654182434, 0.05952192097902298, -0.04303988814353943, 0.18561802804470062, -0.02556108683347702, -0.2096366584300995, 0.20498503744602203, 0.10274028033018112, 0.1141229122877121, 0.0029546618461608887, 0.34100341796875, -0.11084094643592834, 0.1456276774406433, 0.19108611345291138, -0.38456177711486816, 0.11956113576889038, 0.18197812139987946, 0.2901114523410797, -0.4231201410293579, -0.1817399263381958, 0.22346791625022888, -0.09256070852279663, -0.06774383783340454, 0.03138967230916023, 0.2145528346300125, -0.047425806522369385, -0.2063150852918625, -0.14459267258644104, 0.02337590605020523, -0.279026597738266, 0.18864934146404266, -0.13092471659183502, -0.04589376598596573, 0.13699564337730408, 0.2464522123336792, -0.08392836153507233, -0.3607742190361023, 0.22709563374519348, 0.2879510819911957, 0.16885405778884888, -0.023517528548836708, -0.14498589932918549, 0.10964417457580566, -0.6280690431594849, 0.2101326733827591, -0.10608342289924622, 0.27490147948265076, -0.2080276608467102, -0.2697126269340515, 0.3286111652851105, -0.33339187502861023, 0.36486542224884033, -0.09909577667713165, 0.15852315723896027, 0.09680656343698502, 0.06612946838140488, -0.2871657609939575, 0.04877406358718872, 0.1507551074028015, -0.027460193261504173, 0.020022843033075333, -0.06322947144508362, -0.14439523220062256, -0.3358599543571472, 0.1628827601671219, 0.48543381690979004, -0.22957706451416016, -0.2828347086906433, -0.3169105648994446, -0.4447595179080963, 0.013757377862930298, -0.08269130438566208, 0.03258282691240311, 0.06956508755683899, -0.01485690101981163, -0.21828652918338776, -0.2868577539920807, 0.08694687485694885, -0.18050315976142883, 0.22297684848308563, -0.1178455650806427, -0.1840873658657074, 0.5251224637031555, 0.13922813534736633, 0.41231468319892883, 0.11828723549842834, 0.5112840533256531, -0.20353585481643677, -0.13833999633789062, 0.09140601754188538, 0.022161152213811874, -0.1849590539932251, 0.41509532928466797, -0.10203029215335846, 0.21155087649822235, 0.07662272453308105, 0.12281681597232819, -0.6578251123428345, 0.049345724284648895, 0.36101773381233215, 0.4220431447029114, -0.17289401590824127, -0.5308786630630493, 0.4196924567222595, -0.15056166052818298, -0.08399994671344757, 0.5754793882369995, -0.011302758008241653, 0.06027428060770035, 0.2838951349258423, -0.055546484887599945, 0.8268208503723145, -0.22404563426971436, 0.2194097340106964, 0.3263190686702728, -0.31338489055633545, 0.3503507375717163, -0.17510837316513062, 0.1447199285030365, -0.29010269045829773, -0.17140625417232513, 0.020613014698028564, -0.15669170022010803, 0.20081432163715363, -0.1517402082681656, 0.03433610498905182, -0.015636637806892395, -0.023927927017211914, 0.41104191541671753, -0.061087291687726974, 0.35940057039260864, -0.35560354590415955, -0.22364374995231628, -0.6419789791107178, 0.1415397673845291, 0.06811604648828506, 0.2919313907623291, -0.1539144068956375, 0.11852788180112839, 0.16816483438014984, -0.22313877940177917, -0.270933598279953, 0.2967940866947174, -0.05917714908719063, 0.020198948681354523, -0.0025360402651131153, -0.24538885056972504, 0.18971604108810425, 0.4283493757247925, -0.07815369963645935, 0.002867556642740965, -0.13031576573848724, 0.6660151481628418, -0.32489076256752014, 0.14338286221027374, 0.20742477476596832, -0.1837543547153473, -0.12296822667121887, -0.06584984064102173, -0.13664788007736206, -0.07987026870250702, -0.0458143912255764, -0.25766223669052124, 0.1948084682226181, 0.22173884510993958, 0.5157133936882019, -0.22379739582538605, 0.006322257220745087, -0.07163423299789429, 0.20392808318138123, -0.1159631758928299, 0.09636212140321732, 0.12821367383003235, 0.016853991895914078, 0.24507668614387512, -0.26500874757766724, -0.22393697500228882, -0.07729838043451309, 0.5229429006576538, -0.36120325326919556, -0.22916704416275024, 0.2920130491256714, 0.4683266282081604, -0.17949441075325012, -0.23259049654006958, 0.28402116894721985, -0.01531946286559105, -0.6017414927482605, -0.08182868361473083, 0.05976971238851547, 0.12204201519489288, 0.06994371116161346, 0.2638106942176819, -0.05456796661019325, -0.2735211253166199, 0.10487911105155945, -0.421937495470047, -0.12064574658870697, -0.0018436983227729797, 0.09633339196443558, 0.06229608505964279, 0.009557142853736877, -0.17650577425956726, 0.04093062877655029, 0.1744808405637741, -0.21325817704200745, -0.1346471905708313, -0.38440901041030884, -0.16549912095069885, 0.05686619132757187, -0.20442230999469757, 0.51226407289505, -0.11780442297458649, 0.07627718895673752, -0.05236354097723961, -0.14888936281204224, -0.1468496024608612, -0.07213164865970612, 0.16950184106826782, -0.27465111017227173, 0.09230229258537292, -0.012646984308958054, -0.37948542833328247, -0.0026836171746253967, -0.24109698832035065, 0.3588106334209442, 0.1270636022090912, -0.2335195243358612, -0.3523976802825928, 0.14178743958473206, 0.37194961309432983, -0.19548818469047546, 0.36932146549224854, -0.24777844548225403, 0.19859379529953003, 0.07543876022100449, -0.002164448844268918, 0.2593308091163635, 0.14943742752075195, 0.1827705204486847, 0.1664024293422699, 0.16652163863182068, -0.33223316073417664, 0.5013356804847717, -0.0773308277130127, -0.10564887523651123, 0.05798184126615524, 0.2600858211517334, 0.502906858921051, -0.11311063170433044, -0.026048921048641205, 0.036824457347393036, 0.12721110880374908, -0.22321486473083496, 0.011791490018367767, 0.2740074694156647, 0.10755414515733719, -0.11250865459442139, 0.04617595300078392, 0.07285717874765396, -0.3200777769088745, -0.2573140859603882, 0.2603164315223694, 0.583171010017395, 0.05214410275220871, 0.005452852696180344, 0.09762425720691681, 0.05541820824146271, 0.04764500632882118, 0.0018088743090629578, 0.2255396842956543, 0.0672062337398529, 0.25832533836364746, -0.02560168132185936, 0.2721092998981476, 0.031215429306030273, 0.5950928330421448, -0.07527706027030945, -0.5527673363685608, -0.01734599471092224, 0.08489907532930374, -0.26085373759269714, -0.13327182829380035, -0.01503678411245346, 0.3239244520664215, 0.036723025143146515, -0.40935271978378296, -0.28605955839157104, 0.26750510931015015, -0.10184796899557114, -0.12432056665420532, 0.037053607404232025, 0.1251434087753296, -0.0900895819067955, -0.019423723220825195, 0.12116874009370804, -0.03323317691683769, 0.4121568500995636, 0.1450025886297226, 0.21735292673110962, -0.3054664433002472, -0.31835877895355225, -0.02655545435845852, 0.08725389093160629, -0.18477553129196167, 0.31571462750434875, 0.3813718557357788, -0.0790242925286293, 0.11382757872343063, -0.08284340798854828, 0.29235532879829407, 0.20128802955150604, -0.18538299202919006, 0.425768107175827, 0.09516431391239166, -0.05846858769655228, -0.08790118247270584, 0.29954856634140015, -0.12351197749376297, 0.04497022181749344, 0.3188915550708771, 0.06837770342826843, -0.06055527180433273, 0.0763990506529808, -0.3119225800037384, 0.33329758048057556, -0.5204005241394043, 0.2824069559574127, -0.2439129799604416, -0.033538736402988434, -0.38695061206817627, 0.3119809031486511, -0.24383392930030823, -0.06936933100223541, 0.24660521745681763, -0.07663849741220474, -0.045939430594444275, -0.275005042552948, 0.04584696888923645, -0.09721207618713379, 0.7401577830314636, 0.11261285841464996, 0.567596971988678, -0.15518635511398315, -0.3938146233558655, -0.37085092067718506, 0.12059324979782104, -0.39565327763557434, -0.09264928102493286, -0.1035914197564125, 0.15472009778022766, 0.014452802017331123, 0.05609072744846344, 0.07211039960384369, 0.16955165565013885, 0.3037029504776001, 0.21947909891605377, -0.23636110126972198, -0.2488979995250702, 0.2533577084541321, 0.010138632729649544, -0.2576386034488678, -0.3993537425994873, 0.2512262761592865, -0.13200464844703674, -0.04970575124025345, -0.2347666323184967, -0.1574135720729828, 0.1130625456571579, -0.11265214532613754, 0.36711573600769043, 0.11412204802036285, 0.2824168801307678, 0.17746961116790771, -0.3472483158111572, -0.3648994266986847, -0.3452364206314087, 0.15685318410396576, -0.01822037249803543, -0.1723708212375641, 0.04002482444047928, -0.17834745347499847, 0.20129790902137756, -0.201948881149292, -0.07526195049285889, -0.0793631449341774, 0.01792459562420845, -0.24565322697162628, 0.004733815789222717, -0.20615904033184052, 0.5829035043716431, 0.16703197360038757, 0.11517594754695892, 0.034184351563453674, -0.11302106082439423, -0.08367706835269928, 0.06998804956674576, 0.4538417458534241, -0.4185118079185486, -0.183689147233963, -0.1283435821533203, 0.25201624631881714, -0.32001760601997375, 0.022393284365534782, -0.498335063457489, 0.017709165811538696, 0.12999165058135986, 0.05678512528538704, -0.25614234805107117, 0.32890260219573975, 0.1778455227613449, 0.048255205154418945, -0.16333149373531342, 0.05950014293193817, -0.07283864170312881, 0.010666973888874054, 0.031355880200862885, -0.3227621912956238 ]
https://github.com/huggingface/datasets/issues/6034
Thanks - that works! However it doesn't resolve the original issue (but I am not sure if it is a WSL problem)
load_dataset hangs on WSL
### Describe the bug load_dataset simply hangs. It happens once every ~5 times, and interestingly hangs for a multiple of 5 minutes (hangs for 5/10/15 minutes). Using the profiler in PyCharm shows that it spends the time at <method 'connect' of '_socket.socket' objects>. However, a local cache is available so I am not sure why socket is needed. ([profiler result](https://ibb.co/0Btbbp8)) It only happens on WSL for me. It works for native Windows and my MacBook. (cache quickly recognized and loaded within a second). ### Steps to reproduce the bug I am using Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux >>> import datasets >>> datasets.load_dataset('ai2_arc', 'ARC-Challenge') # hangs for 5/10/15 minutes ### Expected behavior cache quickly recognized and loaded within a second ### Environment info Please let me know if I should provide more environment information.
22
load_dataset hangs on WSL ### Describe the bug load_dataset simply hangs. It happens once every ~5 times, and interestingly hangs for a multiple of 5 minutes (hangs for 5/10/15 minutes). Using the profiler in PyCharm shows that it spends the time at <method 'connect' of '_socket.socket' objects>. However, a local cache is available so I am not sure why socket is needed. ([profiler result](https://ibb.co/0Btbbp8)) It only happens on WSL for me. It works for native Windows and my MacBook. (cache quickly recognized and loaded within a second). ### Steps to reproduce the bug I am using Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux >>> import datasets >>> datasets.load_dataset('ai2_arc', 'ARC-Challenge') # hangs for 5/10/15 minutes ### Expected behavior cache quickly recognized and loaded within a second ### Environment info Please let me know if I should provide more environment information. Thanks - that works! However it doesn't resolve the original issue (but I am not sure if it is a WSL problem)
[ -0.307853102684021, -0.13641469180583954, 0.03494182229042053, 0.10264703631401062, 0.2216137796640396, 0.19913902878761292, 0.540233314037323, -0.03955627977848053, 0.7148920297622681, -0.0008790940046310425, 0.1685943901538849, 0.16317255795001984, 0.29545485973358154, 0.06408010423183441, 0.12856179475784302, -0.058493614196777344, 0.18344983458518982, 0.035822030156850815, 0.13919949531555176, 0.11932183802127838, -0.166983962059021, -0.05145426094532013, -0.22993095219135284, -0.159173384308815, -0.20693546533584595, 0.10760550200939178, -0.1243213564157486, -0.1695328950881958, 0.055165573954582214, -0.3654209077358246, 0.6622172594070435, 0.08860979974269867, 0.04717783257365227, 0.08753341436386108, -0.00011793139128712937, -0.06863968074321747, 0.32645589113235474, 0.20769551396369934, -0.48109471797943115, -0.11539959907531738, -0.26637130975723267, -0.10236521065235138, 0.4265877604484558, 0.12523621320724487, -0.10182569175958633, 0.22287169098854065, 0.03248953819274902, -0.4769259989261627, 0.4720627963542938, -0.007551800459623337, 0.16939884424209595, 0.21020972728729248, -0.09664765745401382, -0.17356568574905396, 0.14174796640872955, -0.02526775375008583, -0.12456418573856354, 0.07965508103370667, 0.3850213885307312, -0.041805628687143326, -0.15976688265800476, 0.1290605366230011, -0.10766714811325073, 0.16274622082710266, 0.3214062750339508, -0.0005825944244861603, -0.14221642911434174, -0.1568141132593155, 0.3482751250267029, 0.18623414635658264, 0.725314736366272, 0.0010764964390546083, -0.02488190121948719, -0.14136208593845367, 0.3611500859260559, -0.08344932645559311, 0.3880743086338043, 0.25553637742996216, -0.18358653783798218, 0.19690775871276855, 0.05364349111914635, 0.15199556946754456, -0.153227761387825, 0.0215140450745821, -0.0948551818728447, 0.16800567507743835, 0.07792588323354721, 0.4369508624076843, 0.02365761436522007, -0.011507446877658367, 0.30315396189689636, -0.23540012538433075, -0.12159135937690735, -0.07664293050765991, -0.738045334815979, 0.3873823881149292, 0.10632002353668213, 0.5062679648399353, -0.04185144230723381, 0.12712885439395905, -0.008341524749994278, -0.07838830351829529, 0.5045121312141418, 0.0692417323589325, 0.2795722782611847, -0.1449548602104187, -0.0941665843129158, -0.2350914478302002, 0.04745229333639145, 0.06439456343650818, -0.33238905668258667, -0.005149577744305134, -0.13719621300697327, -0.08930550515651703, 0.16189241409301758, -0.39473339915275574, 0.3059127628803253, -0.20113295316696167, -0.3254515528678894, 0.1885138750076294, -0.2861613631248474, 0.13589924573898315, 0.27435144782066345, 0.5571075677871704, -0.2187795639038086, 0.5237745642662048, 0.41140425205230713, -0.17274823784828186, -0.1929856240749359, -0.14134690165519714, -0.13052210211753845, -0.20217454433441162, -0.08178751170635223, 0.07249357551336288, 0.27109119296073914, 0.015193168073892593, -0.13135461509227753, 0.11923171579837799, 0.10406546294689178, -0.2806020677089691, 0.2077571153640747, 0.02308385819196701, 0.17743539810180664, 0.4243820905685425, -0.03946898505091667, 0.37935107946395874, -0.15649166703224182, -0.1211998388171196, -0.13472603261470795, 0.06519812345504761, -0.05655060335993767, -0.06788520514965057, -0.08089178800582886, 0.12515029311180115, -0.20391498506069183, -0.17859216034412384, 0.04739798977971077, -0.23945873975753784, 0.0787295550107956, 0.171906977891922, -0.033179547637701035, -0.27296432852745056, -0.21946454048156738, -0.11001929640769958, 0.3796634078025818, 0.48746222257614136, 0.02616771310567856, 0.11530973017215729, 0.0035126693546772003, 0.2646566331386566, -0.07321876287460327, 0.1802249252796173, -0.12090125679969788, -0.07135730236768723, -0.13593803346157074, -0.06194494664669037, 0.3076288104057312, -0.2976306676864624, -0.5112089514732361, 0.3652982711791992, -0.17522302269935608, 0.2879314720630646, 0.11415980756282806, 0.4875650405883789, -0.07449234277009964, -0.05630218982696533, -0.10738005489110947, 0.4255681037902832, -0.09595376998186111, -0.00016164779663085938, -0.04645765572786331, -0.13848662376403809, 0.29902178049087524, 0.3044421076774597, -0.33514440059661865, -0.34664398431777954, -0.12554660439491272, 0.4804878830909729, 0.246416836977005, 0.04367413744330406, -0.01114744134247303, -0.039804503321647644, 0.15137465298175812, 0.18858881294727325, 0.1793566346168518, 0.10053229331970215, -0.6269557476043701, 0.3404430150985718, 0.42796066403388977, -0.19591863453388214, 0.124956876039505, -0.13139434158802032, -0.08399829268455505, 0.40969157218933105, -0.42742058634757996, 0.049687664955854416, -0.12986604869365692, 0.015735337510704994, 0.07533182203769684, 0.12654344737529755, -0.031011372804641724, 0.3634626865386963, -0.3798764944076538, -0.025650735944509506, -0.42432212829589844, 0.002455979585647583, -0.031384263187646866, 0.0943048745393753, -0.06888877600431442, 0.0348091684281826, -0.06420564651489258, 0.1736561805009842, -0.14350278675556183, 0.004784789402037859, -0.05887793004512787, 0.26656249165534973, -0.3712407350540161, 0.33049824833869934, -0.09050846844911575, -0.23201347887516022, 0.3479923903942108, -0.03198812156915665, 0.20697268843650818, -0.3664490580558777, -0.17867045104503632, -0.08675338327884674, 0.24994662404060364, 0.30720433592796326, -0.2833806276321411, 0.0051670074462890625, 0.3109396994113922, 0.0022982656955718994, -0.11838559806346893, 0.10765403509140015, 0.30744031071662903, -0.4099305272102356, 0.40755265951156616, -0.002317667007446289, -0.10309577733278275, 0.31964385509490967, 0.43132978677749634, -0.038567863404750824, 0.06611926853656769, 0.22275565564632416, -0.03397203981876373, -0.28126242756843567, 0.11848323792219162, 0.04775480926036835, 0.4221612215042114, 0.05555136129260063, 0.06428427249193192, -0.03437414765357971, -0.15875686705112457, -0.24887067079544067, 0.01765105128288269, 0.031630054116249084, -0.13451513648033142, 0.018116822466254234, 0.3012641966342926, 0.04100709781050682, -0.13610555231571198, -0.07707330584526062, -0.25853702425956726, 0.0011051855981349945, -0.17653435468673706, 0.38721126317977905, -0.1810007095336914, -0.06012978404760361, -0.03403741121292114, 0.2721553146839142, -0.021457543596625328, -0.2871580421924591, -0.27090883255004883, 0.2476113885641098, 0.06433449685573578, 0.19699767231941223, -0.07666429877281189, 0.435992568731308, 0.24971233308315277, -0.14187650382518768, -0.5237752795219421, -0.3503187894821167, -0.250326007604599, -0.07567881047725677, 0.48445820808410645, 0.0156111940741539, 0.29676592350006104, -0.10854177176952362, -0.1403144896030426, -0.1796002984046936, -0.25064390897750854, -0.12749867141246796, 0.01725669391453266, 0.045166946947574615, 0.29511553049087524, 0.35549095273017883, 0.03950290381908417, 0.01750924438238144, 0.3323841094970703, -0.39800819754600525, -0.03125860542058945, 0.13183681666851044, -0.09142859280109406, -0.10973846912384033, -0.04580698907375336, -0.17449650168418884, -0.23363052308559418, -0.3324287533760071, 0.2874193787574768, 0.002307511866092682, -0.18989679217338562, 0.005664568394422531, 0.22430866956710815, 0.014611262828111649, -0.025768965482711792, 0.18165792524814606, -0.1461418718099594, -0.3602272570133209, 0.3221205174922943, 0.07190881669521332, -0.375646710395813, 0.24184507131576538, 0.0601477175951004, -0.11281207203865051, 0.05817539989948273, -0.7062673568725586, 0.12967529892921448, -0.43285074830055237, 0.24164064228534698, -0.07251594960689545, -0.10072541981935501, 0.03256847709417343, -0.03726353123784065, 0.1985793262720108, -0.03701236844062805, -0.1848250925540924, 0.2013395130634308, 0.16530834138393402, 0.1704016625881195, 0.004314912483096123, 0.32629144191741943, -0.1002483144402504, 0.08634495735168457, 0.15972521901130676, -0.3951861560344696, 0.08315220475196838, 0.15210717916488647, 0.17638012766838074, -0.3660551905632019, -0.17596516013145447, 0.24631889164447784, -0.0979250818490982, -0.0731377899646759, 0.007319692522287369, 0.2007792890071869, -0.11154325306415558, -0.15782570838928223, -0.1644434779882431, 0.02233925461769104, -0.28304731845855713, 0.24756427109241486, -0.22318309545516968, -0.023521915078163147, 0.1036040186882019, 0.20192982256412506, -0.09186586737632751, -0.3855845332145691, 0.1594732403755188, 0.2790519595146179, 0.12391991168260574, -0.041234005242586136, -0.10118019580841064, 0.08587361127138138, -0.5676041841506958, 0.1599540412425995, -0.1350894719362259, 0.34135961532592773, -0.24370519816875458, -0.26360201835632324, 0.3489260971546173, -0.3634539842605591, 0.3171217441558838, -0.12531472742557526, 0.16674095392227173, 0.13086329400539398, 0.11004334688186646, -0.3096717596054077, 0.009260125458240509, 0.14176812767982483, 0.00944351777434349, -0.01075008139014244, -0.12939578294754028, -0.07368154078722, -0.28892359137535095, 0.1317288875579834, 0.47369804978370667, -0.2158442735671997, -0.33737418055534363, -0.267291784286499, -0.4700451195240021, 0.042385026812553406, -0.09529366344213486, 0.024665266275405884, 0.06971903145313263, -0.009660165756940842, -0.25310394167900085, -0.28627750277519226, 0.10978429019451141, -0.13280066847801208, 0.20019109547138214, -0.10023549944162369, -0.20777642726898193, 0.5707962512969971, 0.08007755875587463, 0.3530787229537964, 0.14940311014652252, 0.44345149397850037, -0.17777106165885925, -0.12787500023841858, 0.1423790454864502, -0.09387899935245514, -0.18630237877368927, 0.3902081847190857, -0.13914957642555237, 0.2531697750091553, -0.00965232402086258, 0.0690433531999588, -0.6373662948608398, 0.04522698372602463, 0.367197722196579, 0.39678487181663513, -0.17090071737766266, -0.546816885471344, 0.375747412443161, -0.18055789172649384, -0.12734004855155945, 0.5919069647789001, -0.18172040581703186, 0.04472890496253967, 0.31824398040771484, -0.009707748889923096, 0.8222495317459106, -0.22637924551963806, 0.20636305212974548, 0.28686097264289856, -0.3700849413871765, 0.2772561311721802, -0.18453417718410492, 0.16325581073760986, -0.3162013292312622, -0.17197951674461365, 0.04097247123718262, -0.24954387545585632, 0.1967928260564804, -0.09945247322320938, 0.0012409090995788574, -0.10722734779119492, -0.09810606390237808, 0.3655861020088196, -0.00015928596258163452, 0.38521575927734375, -0.3620050847530365, -0.1704658567905426, -0.5309043526649475, 0.1522587686777115, 0.020021388307213783, 0.24443000555038452, -0.1364976167678833, 0.17529042065143585, 0.06780748069286346, -0.21171173453330994, -0.29626935720443726, 0.3012285828590393, -0.0013361349701881409, 0.046413395553827286, -0.06376239657402039, -0.2470323145389557, 0.21887698769569397, 0.43046706914901733, -0.16374701261520386, 0.033693552017211914, -0.10284768790006638, 0.7485913038253784, -0.27240878343582153, 0.17387685179710388, 0.2712710499763489, -0.23321852087974548, -0.14424283802509308, -0.051072701811790466, -0.16041859984397888, -0.07122006267309189, -0.0007760301232337952, -0.2601555585861206, 0.14592619240283966, 0.27038565278053284, 0.5648081302642822, -0.18824242055416107, -0.0036027170717716217, -0.08774285018444061, 0.12101959437131882, -0.11121037602424622, 0.10414241254329681, 0.14633825421333313, -0.01825335994362831, 0.327495276927948, -0.3361387252807617, -0.19204017519950867, -0.012418953701853752, 0.5023833513259888, -0.3017037510871887, -0.19322466850280762, 0.309539794921875, 0.45339882373809814, -0.19174553453922272, -0.24116240441799164, 0.3321819305419922, -0.12602321803569794, -0.5803340673446655, -0.1053062379360199, -0.0050011202692985535, 0.06262481212615967, 0.07703474164009094, 0.19770397245883942, -0.11136725544929504, -0.218760684132576, 0.10563929378986359, -0.4630465507507324, -0.10486222058534622, -0.07707658410072327, 0.10828271508216858, 0.08738920092582703, -0.08226354420185089, -0.1747305542230606, 0.04769205302000046, 0.18107165396213531, -0.19696012139320374, -0.1603536605834961, -0.3919491171836853, -0.16061396896839142, -0.0283923652023077, -0.2041873335838318, 0.4379158914089203, -0.14518901705741882, 0.08151276409626007, -0.046261776238679886, -0.07135523110628128, -0.13322952389717102, -0.07426866888999939, 0.1739560067653656, -0.275022029876709, 0.15519404411315918, -0.022278526797890663, -0.4247601628303528, 0.06218042969703674, -0.1900729537010193, 0.2742907702922821, 0.10231779515743256, -0.27066150307655334, -0.3433064818382263, 0.1681792438030243, 0.3347657024860382, -0.16782569885253906, 0.43039798736572266, -0.2946293354034424, 0.2024213671684265, 0.10888750851154327, 0.001363034825772047, 0.3464517593383789, 0.17673778533935547, 0.16767571866512299, 0.13435006141662598, 0.08156494796276093, -0.3720608055591583, 0.5046635270118713, -0.07085618376731873, -0.04262859374284744, -0.02111511304974556, 0.20405486226081848, 0.5800777673721313, -0.12651203572750092, -0.046202417463064194, 0.03418881073594093, 0.1308935582637787, -0.19573849439620972, -0.012792125344276428, 0.25493323802948, 0.10617587715387344, -0.1589757353067398, 0.009950093924999237, 0.03565751761198044, -0.38876813650131226, -0.3296297490596771, 0.2787930369377136, 0.5923909544944763, 0.047132402658462524, -0.034882474690675735, 0.14919734001159668, 0.05153453350067139, 0.03308325260877609, -0.05166667699813843, 0.17524568736553192, 0.01693306490778923, 0.2990221083164215, 0.01008579134941101, 0.2608851194381714, 0.09749716520309448, 0.5604227781295776, -0.0856558084487915, -0.46422308683395386, -0.03936130180954933, 0.06079121679067612, -0.25852474570274353, -0.1481347233057022, 0.006894327700138092, 0.268390029668808, 0.10128669440746307, -0.3811012804508209, -0.24059417843818665, 0.23091627657413483, -0.0955306887626648, -0.11373726278543472, 0.02529238909482956, 0.15089567005634308, -0.12165240943431854, -0.06277873367071152, 0.10000726580619812, -0.004076968878507614, 0.3687613308429718, 0.22256040573120117, 0.2426457703113556, -0.27206799387931824, -0.2762228846549988, -0.005029032472521067, 0.036315999925136566, -0.2332472801208496, 0.27500277757644653, 0.38185393810272217, -0.008389312773942947, 0.13568159937858582, -0.19569088518619537, 0.29831424355506897, 0.2611183822154999, -0.2424527257680893, 0.43612340092658997, 0.12227888405323029, -0.08154857158660889, -0.10303840041160583, 0.3109346032142639, -0.039846695959568024, 0.08593187481164932, 0.30961817502975464, 0.053059887140989304, -0.05476681888103485, 0.09552299976348877, -0.2597992718219757, 0.30145353078842163, -0.4650442600250244, 0.2764703631401062, -0.17140105366706848, -0.07430529594421387, -0.3317963778972626, 0.3220328092575073, -0.22043836116790771, -0.11700086295604706, 0.2977384328842163, -0.0964282751083374, -0.03451542556285858, -0.28907012939453125, 0.037510164082050323, -0.16119718551635742, 0.7567850947380066, 0.039816081523895264, 0.6107362508773804, -0.2209549993276596, -0.4034830927848816, -0.3371284008026123, 0.13596495985984802, -0.47557532787323, -0.1513991504907608, -0.0674462765455246, 0.14466485381126404, 0.009094767272472382, -0.010021288879215717, 0.08107524365186691, 0.19680434465408325, 0.24502409994602203, 0.2785924971103668, -0.243012934923172, -0.3087553381919861, 0.29779040813446045, 0.03344946354627609, -0.2952660918235779, -0.40270498394966125, 0.24702689051628113, -0.09565779566764832, -0.011822011321783066, -0.27218717336654663, -0.27159491181373596, 0.22236952185630798, -0.0003838329575955868, 0.39266976714134216, 0.09138821065425873, 0.34539708495140076, 0.1648072600364685, -0.293337881565094, -0.3362780213356018, -0.37998467683792114, 0.15242421627044678, -0.038266897201538086, -0.17765401303768158, -0.0026317983865737915, -0.17539548873901367, 0.2606276869773865, -0.181458979845047, -0.1454419642686844, -0.15029846131801605, -0.01357705146074295, -0.23263898491859436, -0.045805808156728745, -0.17305058240890503, 0.6169846653938293, 0.1508287489414215, 0.11063012480735779, 0.01880096085369587, -0.13474592566490173, -0.08936457335948944, 0.06935196369886398, 0.4097009301185608, -0.3756684362888336, -0.22073203325271606, -0.07677008956670761, 0.24502186477184296, -0.4569838345050812, 0.13460230827331543, -0.41975289583206177, -0.027585916221141815, 0.1612682044506073, 0.02224859595298767, -0.2705782949924469, 0.28346484899520874, 0.2668405771255493, 0.10239842534065247, -0.16871288418769836, -0.009563043713569641, -0.07326500117778778, 0.05715910345315933, -0.031334031373262405, -0.3462452292442322 ]
https://github.com/huggingface/datasets/issues/6034
We use `requests` to make HTTP requests (and `aiohttp` in the streaming mode), so I don't think we can provide much help regarding the socket issue (it probably has something to do with WSL).
load_dataset hangs on WSL
### Describe the bug load_dataset simply hangs. It happens once every ~5 times, and interestingly hangs for a multiple of 5 minutes (hangs for 5/10/15 minutes). Using the profiler in PyCharm shows that it spends the time at <method 'connect' of '_socket.socket' objects>. However, a local cache is available so I am not sure why socket is needed. ([profiler result](https://ibb.co/0Btbbp8)) It only happens on WSL for me. It works for native Windows and my MacBook. (cache quickly recognized and loaded within a second). ### Steps to reproduce the bug I am using Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux >>> import datasets >>> datasets.load_dataset('ai2_arc', 'ARC-Challenge') # hangs for 5/10/15 minutes ### Expected behavior cache quickly recognized and loaded within a second ### Environment info Please let me know if I should provide more environment information.
34
load_dataset hangs on WSL ### Describe the bug load_dataset simply hangs. It happens once every ~5 times, and interestingly hangs for a multiple of 5 minutes (hangs for 5/10/15 minutes). Using the profiler in PyCharm shows that it spends the time at <method 'connect' of '_socket.socket' objects>. However, a local cache is available so I am not sure why socket is needed. ([profiler result](https://ibb.co/0Btbbp8)) It only happens on WSL for me. It works for native Windows and my MacBook. (cache quickly recognized and loaded within a second). ### Steps to reproduce the bug I am using Ubuntu 22.04.2 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64) Python 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] on linux >>> import datasets >>> datasets.load_dataset('ai2_arc', 'ARC-Challenge') # hangs for 5/10/15 minutes ### Expected behavior cache quickly recognized and loaded within a second ### Environment info Please let me know if I should provide more environment information. We use `requests` to make HTTP requests (and `aiohttp` in the streaming mode), so I don't think we can provide much help regarding the socket issue (it probably has something to do with WSL).
[ -0.3236703872680664, -0.14067848026752472, 0.03590355068445206, 0.10654625296592712, 0.2100633829832077, 0.18540340662002563, 0.5049698352813721, -0.015269273892045021, 0.680539608001709, 0.01739092916250229, 0.11338993906974792, 0.1414891928434372, 0.34116098284721375, 0.03577309101819992, 0.10766857862472534, -0.07406853139400482, 0.17550340294837952, 0.06500911712646484, 0.11135543882846832, 0.12299889326095581, -0.15375781059265137, -0.06267382204532623, -0.20327022671699524, -0.10948073863983154, -0.1724933534860611, 0.06546808779239655, -0.14090436697006226, -0.13770079612731934, -0.008265728130936623, -0.3424351215362549, 0.6133220791816711, 0.0752442479133606, 0.05982280150055885, 0.10568688809871674, -0.00011708335659932345, -0.06142272427678108, 0.31054815649986267, 0.20610320568084717, -0.49345114827156067, -0.12915265560150146, -0.3403574824333191, -0.07774023711681366, 0.3844500780105591, 0.12493494153022766, -0.06349127739667892, 0.22377122938632965, 0.04863133281469345, -0.4840938150882721, 0.49625784158706665, 0.0346120148897171, 0.16478636860847473, 0.22745463252067566, -0.07678577303886414, -0.1452099233865738, 0.16839171946048737, -0.03625006973743439, -0.12573888897895813, 0.08615003526210785, 0.37537506222724915, 0.0023318417370319366, -0.14728572964668274, 0.14742767810821533, -0.13316550850868225, 0.1707284152507782, 0.3109382390975952, -0.02480398677289486, -0.16181866824626923, -0.18617118895053864, 0.33049431443214417, 0.22323182225227356, 0.7000970244407654, 0.022508766502141953, -0.053876347839832306, -0.11541800945997238, 0.3508509695529938, -0.1292250156402588, 0.35915520787239075, 0.2613900899887085, -0.1916636973619461, 0.18800950050354004, 0.10377812385559082, 0.14163389801979065, -0.19735927879810333, 0.08593513071537018, -0.08398286253213882, 0.18255847692489624, 0.08699287474155426, 0.40625086426734924, -0.0020966678857803345, -0.04294558987021446, 0.2600405812263489, -0.23166726529598236, -0.1587613821029663, -0.0895548015832901, -0.7735291123390198, 0.38347816467285156, 0.12426038086414337, 0.48923221230506897, -0.06194645166397095, 0.13566043972969055, 0.04594247788190842, -0.032464660704135895, 0.45454269647598267, 0.07082584500312805, 0.3122718036174774, -0.11618098616600037, -0.0885930210351944, -0.2530040144920349, 0.0495833195745945, 0.11989222466945648, -0.30814194679260254, -0.0098720146343112, -0.10560449957847595, -0.054235391318798065, 0.11689780652523041, -0.43160712718963623, 0.3338160514831543, -0.19977760314941406, -0.33527082204818726, 0.16619658470153809, -0.32413509488105774, 0.12086036801338196, 0.24856868386268616, 0.5592695474624634, -0.22942107915878296, 0.5208085775375366, 0.4289565980434418, -0.12976273894309998, -0.17997518181800842, -0.1700965315103531, -0.1213437020778656, -0.20060139894485474, -0.01865663379430771, 0.0994657501578331, 0.25409990549087524, -0.002234194427728653, -0.1354016214609146, 0.09908172488212585, 0.1660023182630539, -0.25157713890075684, 0.2432178556919098, 0.03662304952740669, 0.19112828373908997, 0.4280681908130646, 0.009996041655540466, 0.34325072169303894, -0.1454576849937439, -0.13745932281017303, -0.1167149767279625, 0.035324543714523315, -0.04312802106142044, -0.06879004836082458, -0.08890799432992935, 0.12955786287784576, -0.18020859360694885, -0.2024393379688263, 0.031249679625034332, -0.250539094209671, 0.03955351933836937, 0.17484039068222046, -0.04358333349227905, -0.26013991236686707, -0.1847861409187317, -0.10323792695999146, 0.3781697750091553, 0.4666088819503784, 0.052415631711483, 0.09741583466529846, -0.03971392288804054, 0.2839284837245941, -0.10913452506065369, 0.2211911529302597, -0.07872936129570007, -0.11581273376941681, -0.10090209543704987, -0.030825339257717133, 0.34545618295669556, -0.2854499816894531, -0.5044124722480774, 0.3629577159881592, -0.14545156061649323, 0.31442558765411377, 0.13135819137096405, 0.4736666679382324, -0.021373922005295753, -0.051525212824344635, -0.0509924553334713, 0.4164676368236542, -0.10356856137514114, -0.007895581424236298, -0.04059590771794319, -0.1458052396774292, 0.24560998380184174, 0.3274379074573517, -0.37021416425704956, -0.32684049010276794, -0.11640775203704834, 0.4098227620124817, 0.2568070888519287, 0.014375119470059872, 0.000009007751941680908, -0.0726606696844101, 0.1873350590467453, 0.21922576427459717, 0.18229520320892334, 0.07367861270904541, -0.5963183045387268, 0.32079797983169556, 0.4002431035041809, -0.13647665083408356, 0.10930655896663666, -0.12663662433624268, -0.07795524597167969, 0.39262092113494873, -0.4141610264778137, 0.11398898810148239, -0.11676424741744995, -0.01528213918209076, 0.056752413511276245, 0.12888997793197632, -0.037651874125003815, 0.42015811800956726, -0.3893734812736511, -0.011054504662752151, -0.44679224491119385, -0.0011629164218902588, -0.04240266978740692, 0.0698639303445816, -0.012045912444591522, 0.02387695573270321, -0.07591398060321808, 0.17290152609348297, -0.15939654409885406, 0.009763885289430618, -0.08914750814437866, 0.2666233777999878, -0.36748239398002625, 0.31580278277397156, -0.08719293773174286, -0.2561822533607483, 0.37135010957717896, -0.022368384525179863, 0.19389717280864716, -0.37136995792388916, -0.16818487644195557, -0.0897841677069664, 0.28562217950820923, 0.306230366230011, -0.2655232548713684, 0.014144346117973328, 0.3131601810455322, 0.02594926208257675, -0.15302440524101257, 0.10619688779115677, 0.2951352298259735, -0.44607898592948914, 0.3661515414714813, -0.014015797525644302, -0.11630429327487946, 0.3038080334663391, 0.4367445409297943, -0.06822597235441208, 0.07975812256336212, 0.23212595283985138, -0.03075850009918213, -0.2740026116371155, 0.13193029165267944, 0.002194225788116455, 0.4441559910774231, 0.05159023404121399, 0.0764356181025505, -0.0198224987834692, -0.14461542665958405, -0.272882878780365, 0.027995236217975616, 0.03312339261174202, -0.1279357671737671, -0.05429139733314514, 0.27598410844802856, 0.03071461245417595, -0.14536845684051514, -0.1003749743103981, -0.31779104471206665, 0.026686711236834526, -0.1967005431652069, 0.3982962667942047, -0.1659698486328125, -0.08776891231536865, -0.006594069302082062, 0.22906258702278137, -0.04391252249479294, -0.2918350398540497, -0.2823713719844818, 0.2611079514026642, 0.05339999496936798, 0.1832219511270523, -0.08135409653186798, 0.4085536003112793, 0.2840079665184021, -0.11238349229097366, -0.5522741675376892, -0.3263282775878906, -0.27795886993408203, -0.057691387832164764, 0.4875044822692871, 0.04647848755121231, 0.2847515046596527, -0.10437995195388794, -0.14041416347026825, -0.15788474678993225, -0.24716424942016602, -0.14661505818367004, -0.0071724047884345055, 0.03532920777797699, 0.27660617232322693, 0.4197551906108856, 0.013751931488513947, 0.023819223046302795, 0.32869696617126465, -0.3571279048919678, -0.02006807178258896, 0.1529417186975479, -0.10414128005504608, -0.10177489370107651, -0.013769328594207764, -0.23090487718582153, -0.22851158678531647, -0.36055582761764526, 0.3211285173892975, -0.0024280846118927, -0.15353406965732574, -0.01162119209766388, 0.2502029240131378, 0.03701348602771759, -0.030442066490650177, 0.18068337440490723, -0.14438588917255402, -0.38048607110977173, 0.3594086170196533, 0.06835099309682846, -0.39297521114349365, 0.23654070496559143, 0.08723720163106918, -0.10634954273700714, 0.06114119663834572, -0.7024459838867188, 0.12062676250934601, -0.43193748593330383, 0.21740570664405823, -0.07969394326210022, -0.1154625415802002, 0.00890372321009636, -0.055833082646131516, 0.1736883819103241, -0.0503079853951931, -0.15981021523475647, 0.16702018678188324, 0.22480355203151703, 0.13284069299697876, 0.017134476453065872, 0.34478968381881714, -0.102057084441185, 0.07167685031890869, 0.2087525725364685, -0.3875352740287781, 0.1289193332195282, 0.18125608563423157, 0.180548757314682, -0.35699164867401123, -0.16198720037937164, 0.2226366400718689, -0.09942165017127991, -0.05508442968130112, 0.0013427622616291046, 0.2051442414522171, -0.1508263349533081, -0.19915956258773804, -0.13403548300266266, 0.03151818364858627, -0.2839393615722656, 0.2473776638507843, -0.2674559950828552, -0.034156035631895065, 0.10838170349597931, 0.19385673105716705, -0.08036474883556366, -0.3757624328136444, 0.14818589389324188, 0.27755093574523926, 0.09854477643966675, -0.04121852666139603, -0.06203964352607727, 0.05681700259447098, -0.5902981758117676, 0.20668277144432068, -0.09559749066829681, 0.36542314291000366, -0.2584359049797058, -0.2194083333015442, 0.34191590547561646, -0.3424953520298004, 0.27383244037628174, -0.18792562186717987, 0.14162874221801758, 0.1386829912662506, 0.1945483237504959, -0.32013803720474243, 0.06476682424545288, 0.09550328552722931, -0.03371405601501465, 0.03963101655244827, -0.12405233830213547, -0.11526604741811752, -0.29793959856033325, 0.10026140511035919, 0.44291192293167114, -0.20385345816612244, -0.31185612082481384, -0.3071828782558441, -0.49534380435943604, 0.04849332571029663, -0.08791724592447281, 0.03041340410709381, 0.03806860372424126, -0.027541082352399826, -0.2591000199317932, -0.22728054225444794, 0.1482791304588318, -0.11800287663936615, 0.19651934504508972, -0.11813649535179138, -0.17702358961105347, 0.5200300216674805, 0.10008460283279419, 0.35610732436180115, 0.14633984863758087, 0.4789847433567047, -0.12169560045003891, -0.1925819218158722, 0.10582540929317474, -0.046868979930877686, -0.18536831438541412, 0.36744341254234314, -0.07147133350372314, 0.24611026048660278, 0.056792303919792175, 0.0943131148815155, -0.5865626335144043, 0.07415212690830231, 0.4055170714855194, 0.37699973583221436, -0.14240822196006775, -0.5626732707023621, 0.3905687928199768, -0.1943485140800476, -0.11035065352916718, 0.6238473653793335, -0.14301009476184845, 0.06844515353441238, 0.3293359875679016, -0.02485542744398117, 0.8391498327255249, -0.22718562185764313, 0.21614399552345276, 0.35668015480041504, -0.4525626003742218, 0.2729279398918152, -0.18706290423870087, 0.15026956796646118, -0.2633911073207855, -0.1575470268726349, 0.04157721996307373, -0.22778071463108063, 0.23205217719078064, -0.10799722373485565, -0.049478206783533096, -0.12251129746437073, -0.06712884455919266, 0.34602105617523193, 0.059536777436733246, 0.40757855772972107, -0.4106326997280121, -0.17200616002082825, -0.5553485751152039, 0.16429667174816132, -0.0026471903547644615, 0.18864601850509644, -0.11126454174518585, 0.1553412675857544, 0.050687968730926514, -0.20270487666130066, -0.2848568558692932, 0.31707602739334106, 0.008076265454292297, 0.03388187661767006, -0.12815965712070465, -0.23130574822425842, 0.2534821033477783, 0.41337424516677856, -0.2246195375919342, -0.021201174706220627, -0.10617265105247498, 0.7579576969146729, -0.2655622065067291, 0.1961231827735901, 0.285505473613739, -0.23836328089237213, -0.12568502128124237, -0.05644870921969414, -0.2081981897354126, -0.016019675880670547, 0.015728507190942764, -0.2481965720653534, 0.1398150622844696, 0.2688460946083069, 0.5626097917556763, -0.20303203165531158, 0.04587794840335846, -0.1086476519703865, 0.1254454255104065, -0.08375892788171768, 0.10559172183275223, 0.15647968649864197, -0.0194864459335804, 0.33482247591018677, -0.31352031230926514, -0.19107668101787567, -0.03624487668275833, 0.4973577857017517, -0.308810830116272, -0.17373138666152954, 0.32574084401130676, 0.4479309320449829, -0.17916929721832275, -0.23901739716529846, 0.31844383478164673, -0.17974501848220825, -0.49121567606925964, -0.11644569039344788, 0.013711195439100266, 0.08336439728736877, 0.020600568503141403, 0.13852930068969727, -0.12387342751026154, -0.20916828513145447, 0.1034906804561615, -0.44289976358413696, -0.08239152282476425, -0.060684241354465485, 0.14692994952201843, 0.09940284490585327, -0.10090802609920502, -0.21856361627578735, 0.06571666151285172, 0.18131838738918304, -0.19967293739318848, -0.16384319961071014, -0.357858806848526, -0.15262779593467712, -0.030040469020605087, -0.2116726189851761, 0.4657902419567108, -0.15662482380867004, 0.08903507888317108, -0.05073808878660202, -0.09843745827674866, -0.1387651562690735, -0.06318321824073792, 0.17524170875549316, -0.2554410994052887, 0.10765064507722855, -0.04915964603424072, -0.42468392848968506, 0.0694972574710846, -0.1824050098657608, 0.28253600001335144, 0.06746833771467209, -0.3053132891654968, -0.3769344687461853, 0.17536534368991852, 0.3103260397911072, -0.1975194215774536, 0.40404948592185974, -0.301023930311203, 0.18070672452449799, 0.10452426224946976, 0.0022405898198485374, 0.3362785279750824, 0.1492282748222351, 0.198817640542984, 0.13870462775230408, 0.11209996044635773, -0.36060842871665955, 0.5439079999923706, -0.07769465446472168, -0.057963721454143524, -0.05471578240394592, 0.20714129507541656, 0.5676318407058716, -0.08601841330528259, -0.06847905367612839, 0.014932062476873398, 0.13961267471313477, -0.17096379399299622, -0.004008937627077103, 0.2553800046443939, 0.09329544007778168, -0.15396827459335327, -0.029544152319431305, -0.026405178010463715, -0.38200658559799194, -0.35226571559906006, 0.26544874906539917, 0.5678744316101074, 0.09619416296482086, -0.02052283100783825, 0.06779119372367859, 0.04248902201652527, -0.006547695025801659, -0.0714271292090416, 0.11385993659496307, 0.05151376500725746, 0.28481870889663696, 0.022622957825660706, 0.2583228349685669, 0.04684866592288017, 0.5493491291999817, -0.08732035011053085, -0.48251205682754517, -0.09266692399978638, 0.05000101402401924, -0.2644367814064026, -0.09747065603733063, 0.05319754034280777, 0.322313129901886, 0.08648378401994705, -0.368723601102829, -0.2558954656124115, 0.19201666116714478, -0.07517746090888977, -0.07179434597492218, -0.015724971890449524, 0.14596834778785706, -0.11600983142852783, -0.08811388164758682, 0.1361619383096695, 0.019267013296484947, 0.36781877279281616, 0.24644935131072998, 0.22921940684318542, -0.26950836181640625, -0.30517029762268066, -0.010029859840869904, 0.04816516861319542, -0.22226852178573608, 0.2513565421104431, 0.43909645080566406, -0.04515412822365761, 0.13408280909061432, -0.1900806427001953, 0.32102060317993164, 0.24401578307151794, -0.24196571111679077, 0.4850069284439087, 0.1498757004737854, -0.09861546754837036, -0.10069270431995392, 0.2709755003452301, -0.031961988657712936, 0.07504488527774811, 0.31342390179634094, 0.06749111413955688, -0.07089269906282425, 0.04820071905851364, -0.2772189676761627, 0.30845901370048523, -0.48213446140289307, 0.2833828032016754, -0.20708370208740234, -0.08549030125141144, -0.3419542908668518, 0.2573605179786682, -0.25109341740608215, -0.057157233357429504, 0.2619644105434418, -0.12118622660636902, -0.051086440682411194, -0.2855537235736847, 0.03578009456396103, -0.1601347029209137, 0.7740057110786438, 0.06392231583595276, 0.6008007526397705, -0.2095930576324463, -0.42096468806266785, -0.34100669622421265, 0.14125892519950867, -0.48315244913101196, -0.14356863498687744, -0.06486296653747559, 0.17234447598457336, 0.03648851066827774, -0.02305133268237114, 0.07448720186948776, 0.16670386493206024, 0.18433867394924164, 0.28185924887657166, -0.28557246923446655, -0.330642431974411, 0.3047248125076294, 0.06576080620288849, -0.30366623401641846, -0.40686702728271484, 0.26367807388305664, -0.09526194632053375, -0.009420208632946014, -0.2569141089916229, -0.28408151865005493, 0.21657532453536987, -0.05486545339226723, 0.42392438650131226, 0.1159474328160286, 0.3394806385040283, 0.14342321455478668, -0.32897430658340454, -0.2933432459831238, -0.34634873270988464, 0.1598329246044159, -0.05262380838394165, -0.20660173892974854, 0.07056145370006561, -0.17075738310813904, 0.22064891457557678, -0.17772755026817322, -0.0632515400648117, -0.13295868039131165, -0.06531972438097, -0.2082812339067459, -0.028645843267440796, -0.18425267934799194, 0.6162387132644653, 0.12240706384181976, 0.09788694232702255, 0.00855603814125061, -0.13458313047885895, -0.10478568077087402, 0.0859699621796608, 0.4295746982097626, -0.376777708530426, -0.2269565314054489, -0.09105134755373001, 0.27267470955848694, -0.4391339421272278, 0.1401270031929016, -0.39490005373954773, -0.0012812912464141846, 0.17496071755886078, 0.03371473774313927, -0.2794203460216522, 0.274480938911438, 0.2693415880203247, 0.08226419985294342, -0.17614683508872986, 0.020482297986745834, -0.07360830903053284, 0.033936046063899994, 0.029312364757061005, -0.32761847972869873 ]
https://github.com/huggingface/datasets/issues/6032
`HfApi` comes from the `huggingface_hub` package. You can use [this](https://huggingface.co/docs/huggingface_hub/v0.16.3/en/package_reference/utilities#huggingface_hub.configure_http_backend) utility to change the `huggingface_hub`'s `Session` proxies (see the example). We plan to implement https://github.com/huggingface/datasets/issues/5080 and make this behavior more consistent eventually.
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info
### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4
32
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info ### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4 `HfApi` comes from the `huggingface_hub` package. You can use [this](https://huggingface.co/docs/huggingface_hub/v0.16.3/en/package_reference/utilities#huggingface_hub.configure_http_backend) utility to change the `huggingface_hub`'s `Session` proxies (see the example). We plan to implement https://github.com/huggingface/datasets/issues/5080 and make this behavior more consistent eventually.
[ -0.21935899555683136, -0.31487172842025757, 0.06531688570976257, 0.3223292827606201, 0.29418638348579407, -0.199843630194664, 0.2187996506690979, -0.05764598771929741, -0.08462776243686676, -0.013216584920883179, -0.3229537308216095, -0.06118042767047882, 0.42318788170814514, 0.3672683537006378, 0.16207338869571686, -0.14923441410064697, -0.0989697128534317, -0.17889755964279175, -0.12950797379016876, 0.10980217158794403, -0.3040319085121155, 0.3686548173427582, -0.08796713501214981, 0.0012357495725154877, -0.08175299316644669, 0.35368549823760986, -0.20472438633441925, 0.3785627484321594, 0.1236368790268898, -0.13532721996307373, 0.6031816601753235, 0.35836172103881836, 0.19493192434310913, 0.1869688779115677, -0.00011897736112587154, 0.32259392738342285, 0.43972769379615784, -0.022785857319831848, -0.36611881852149963, -0.2751176953315735, -0.47205328941345215, -0.19201137125492096, 0.008742723613977432, 0.043329253792762756, -0.13652737438678741, -0.009691905230283737, -0.1055770143866539, -0.055931542068719864, 0.2487073689699173, 0.19582688808441162, 0.15927447378635406, 0.5668257474899292, 0.026543281972408295, -0.12551462650299072, 0.09926530718803406, 0.11436772346496582, -0.0902508795261383, -0.015691500157117844, 0.2056615948677063, 0.28077059984207153, 0.16307687759399414, 0.17966625094413757, -0.15288695693016052, 0.04507944732904434, 0.37483683228492737, 0.04554304480552673, -0.021455232053995132, -0.24504224956035614, 0.11591976135969162, 0.32866978645324707, 0.4840284585952759, -0.38049620389938354, -0.23981818556785583, -0.2683372497558594, -0.06610260158777237, 0.07836156338453293, 0.40967005491256714, 0.13757163286209106, -0.23220294713974, 0.06662707030773163, -0.14980792999267578, -0.3307596743106842, 0.02534782886505127, 0.12547878921031952, 0.18404093384742737, 0.056497879326343536, -0.19461029767990112, 0.17094531655311584, -0.06396484375, -0.08230814337730408, -0.004896678030490875, -0.6193795800209045, 0.09019223600625992, 0.05302850157022476, -0.2249009609222412, 0.11877216398715973, 0.03171356022357941, 0.49939796328544617, 0.18107222020626068, 0.4740120470523834, -0.15770457684993744, 0.2191247195005417, -0.09520464390516281, 0.19665490090847015, 0.1326134353876114, -0.12748607993125916, 0.06450480222702026, 0.1107669472694397, 0.18597643077373505, 0.533806562423706, 0.09074520319700241, -0.11295800656080246, 0.3013765811920166, -0.11389847099781036, -0.33917006850242615, -0.39778685569763184, 0.25597280263900757, -0.13794633746147156, -0.09196697175502777, 0.07739800214767456, -0.06605705618858337, -0.171689972281456, 0.29652708768844604, 0.4534703493118286, -0.31272798776626587, 0.15587350726127625, 0.18166935443878174, 0.22015316784381866, -0.19313810765743256, -0.08049902319908142, -0.23798412084579468, -0.21887272596359253, 0.028961658477783203, 0.3515828847885132, 0.16149286925792694, -0.43648532032966614, 0.3304904103279114, 0.14914855360984802, 0.23647427558898926, 0.027036212384700775, -0.0004897862672805786, -0.009742926806211472, -0.014320764690637589, 0.31741732358932495, 0.067578986287117, 0.006064131855964661, 0.06995843350887299, -0.18920040130615234, -0.059275925159454346, -0.11573870480060577, -0.2177245318889618, -0.20417483150959015, 0.044258177280426025, 0.07870449870824814, -0.17647455632686615, -0.0012418059632182121, -0.3184065818786621, 0.04797929525375366, 0.04467405378818512, 0.05776572227478027, -0.0709172785282135, 0.024036336690187454, -0.16286598145961761, -0.0435384102165699, 0.5825132131576538, 0.5188953876495361, 0.25965040922164917, -0.35611051321029663, 0.057964496314525604, -0.4022950530052185, 0.21086502075195312, -0.10534193366765976, -0.014559799805283546, -0.07838277518749237, -0.2666536569595337, -0.14752639830112457, 0.22189420461654663, -0.5190551280975342, -0.30136600136756897, 0.38504958152770996, 0.1656600385904312, 0.23407268524169922, 0.12991966307163239, -0.05161127820611, -0.14104831218719482, 0.06327903270721436, -0.06323601305484772, 0.3169599771499634, 0.0027289055287837982, 0.022969596087932587, -0.17697006464004517, -0.31504347920417786, -0.2927117347717285, 0.2598171532154083, 0.05321011692285538, 0.5261074900627136, -0.09633366763591766, -0.2839268445968628, 0.3326628506183624, 0.18570935726165771, 0.13332287967205048, 0.08262211829423904, 0.05761759728193283, 0.5053631663322449, 0.16074278950691223, -0.04221959412097931, -0.30391111969947815, 0.19123388826847076, -0.2602299153804779, -0.06930434703826904, -0.07458017766475677, -0.11618354171514511, -0.27536720037460327, -0.07557986676692963, -0.13747641444206238, -0.2718760371208191, 0.020834140479564667, 0.28790783882141113, 0.3152531385421753, -0.039479080587625504, 0.002091512084007263, 0.7432483434677124, 0.03158600628376007, 0.27242374420166016, -0.30090904235839844, 0.5123574137687683, 0.18780933320522308, 0.008914358913898468, 0.03740009665489197, 0.18926319479942322, 0.2366943061351776, -0.010126993060112, -0.0019950196146965027, 0.396431565284729, -0.10235126316547394, 0.1738089621067047, 0.09602019190788269, -0.1817549169063568, 0.24164153635501862, -0.15034933388233185, -0.06009344756603241, 0.02553209662437439, 0.22678017616271973, 0.021012336015701294, 0.07586650550365448, 0.20696894824504852, 0.19885551929473877, 0.48964405059814453, 0.2377461940050125, 0.14872217178344727, 0.12110008299350739, -0.03241656720638275, -0.20323026180267334, -0.09866227209568024, 0.003737780498340726, -0.09740417450666428, 0.4383883476257324, -0.023681603372097015, -0.3819386959075928, 0.056549668312072754, 0.17496761679649353, 0.1719488799571991, -0.28149062395095825, 0.19924546778202057, -0.22688138484954834, 0.1758086234331131, 0.43715208768844604, 0.09575415402650833, 0.29776322841644287, 0.03632882237434387, -0.13986484706401825, 0.3691127896308899, -0.12270127236843109, -0.1940617561340332, 0.21961000561714172, 0.17137262225151062, -0.31178635358810425, -0.24667362868785858, 0.012592360377311707, -0.06615640223026276, -0.26762932538986206, -0.1184844970703125, -0.26007020473480225, -0.21705950796604156, -0.5611112713813782, 0.06462609767913818, -0.308220773935318, -0.23793084919452667, -0.03914036229252815, -0.14753711223602295, -0.18698744475841522, -0.4013141095638275, -0.20840252935886383, 0.2813034653663635, 0.06545817852020264, 0.03699907660484314, -0.21049094200134277, 0.16316984593868256, -0.17247553169727325, -0.38876986503601074, -0.29983511567115784, 0.3397114872932434, -0.23130206763744354, -0.03496703505516052, 0.016729071736335754, -0.023303981870412827, 0.10624770820140839, -0.48533880710601807, -0.17850430309772491, -0.2902378439903259, -0.09371927380561829, 0.24843694269657135, 0.09941109269857407, 0.2477329522371292, 0.10500369966030121, -0.04508987069129944, 0.16067716479301453, -0.11780446022748947, 0.48349499702453613, 0.2820104658603668, 0.04998113960027695, 0.08528934419155121, 0.10917091369628906, 0.04137003421783447, -0.13564372062683105, -0.01549530029296875, -0.10581272840499878, -0.20828883349895477, 0.07220339775085449, 0.11139532923698425, 0.004649309441447258, -0.018593449145555496, 0.1819273978471756, 0.1408608853816986, -0.3092140853404999, 0.19864988327026367, -0.2675544321537018, -0.8593428134918213, 0.22196318209171295, -0.05380643904209137, -0.318801611661911, -0.11154846847057343, -0.006476856768131256, 0.09826722741127014, 0.060972392559051514, -0.4955225884914398, -0.3273472785949707, -0.2972255051136017, 0.39165806770324707, 0.19551344215869904, 0.32566121220588684, 0.010640628635883331, -0.12236850708723068, 0.0405602753162384, -0.18497414886951447, -0.1303962767124176, 0.17859211564064026, -0.301067978143692, 0.3577451705932617, 0.26504313945770264, 0.1993001103401184, -0.18053843080997467, 0.6675544381141663, 0.399779736995697, -0.06036287546157837, 0.6682121753692627, -0.1369912326335907, 0.48577260971069336, 0.017809657379984856, -0.25750625133514404, 0.1663179099559784, 0.05392170324921608, 0.3796888589859009, 0.042180851101875305, 0.28530681133270264, 0.23451095819473267, -0.33531659841537476, 0.06564262509346008, -0.025865331292152405, -0.3403911590576172, -0.40639352798461914, -0.11206167936325073, 0.10352687537670135, 0.13185058534145355, 0.24004091322422028, -0.1982833296060562, -0.10960493981838226, 0.11571689695119858, 0.4443323314189911, 0.2312527894973755, -0.008736487478017807, 0.07714200764894485, -0.1036360114812851, -0.6938775777816772, 0.3556634783744812, -0.06648923456668854, 0.23949448764324188, -0.17430365085601807, 0.02964787930250168, 0.1882743537425995, -0.09497717022895813, 0.5607883930206299, 0.009983906522393227, -0.08927032351493835, 0.14211821556091309, -0.1698109209537506, -0.6273061633110046, -0.053479477763175964, 0.08494880795478821, 0.21825097501277924, 0.07846477627754211, 0.29319891333580017, -0.4171743392944336, -0.18097448348999023, 0.021118011325597763, -0.1268339902162552, -0.037118732929229736, -0.2548975348472595, -0.2857650816440582, -0.49829113483428955, -0.25406375527381897, -0.016346435993909836, -0.1966874599456787, 0.219294011592865, -0.1998196840286255, -0.24609705805778503, 0.20726878941059113, 0.11881227791309357, -0.005862485617399216, 0.020628593862056732, 0.03829712048172951, -0.07245121896266937, 0.274272084236145, 0.15813101828098297, 0.23023512959480286, 0.25526556372642517, 0.7322543263435364, 0.07281804084777832, -0.5043367147445679, -0.07126989960670471, 0.1382785439491272, 0.004041194915771484, 0.12988373637199402, -0.2273050844669342, 0.008571457117795944, 0.24433472752571106, 0.3721839189529419, -0.4830996096134186, 0.10747021436691284, 0.401993989944458, 0.07121473550796509, 0.02684064954519272, -0.4736984074115753, 0.535515546798706, 0.0644846111536026, -0.007584109902381897, 0.3393251299858093, 0.3704896867275238, -0.17150536179542542, -0.11949124932289124, -0.1905996948480606, 0.6800490021705627, 0.137046217918396, 0.03285876289010048, 0.41671717166900635, -0.20468884706497192, 0.27276402711868286, -0.16435827314853668, 0.004524067044258118, -0.058814629912376404, -0.19091522693634033, -0.08009426295757294, -0.1775490939617157, 0.2801840007305145, -0.03601142391562462, -0.2223508059978485, 0.23305532336235046, -0.10491066426038742, -0.01585688441991806, 0.10416349768638611, 0.08582866191864014, -0.6369779706001282, -0.30807703733444214, -0.34151798486709595, 0.17812007665634155, 0.08778147399425507, 0.404445081949234, -0.0018503069877624512, -0.09474900364875793, -0.05458717793226242, -0.14336411654949188, -0.20743727684020996, 0.25105464458465576, -0.15599142014980316, -0.26990053057670593, 0.5422405004501343, 0.19386987388134003, 0.17243289947509766, 0.09761090576648712, 0.26147937774658203, -0.14943662285804749, -0.32030680775642395, 0.1933058798313141, -0.11994210630655289, 0.2620961666107178, -0.013789873570203781, -0.04233989492058754, 0.1767355054616928, -0.09973914176225662, -0.45738154649734497, -0.0036507602781057358, -0.01333678886294365, -0.10770086944103241, 0.013000786304473877, -0.1102171391248703, 0.06535738706588745, -0.21080899238586426, 0.1763397753238678, 0.023483622819185257, 0.1608218103647232, -0.20134896039962769, 0.10281133651733398, 0.10192187875509262, -0.2346261739730835, 0.2396358996629715, -0.10174578428268433, -0.044585563242435455, -0.13510625064373016, 0.6019148826599121, -0.20437556505203247, 0.2746843993663788, 0.33688756823539734, -0.0028488487005233765, -0.1355263888835907, -0.027159102261066437, -0.14501944184303284, -0.30329540371894836, -0.04192684590816498, 0.11189676821231842, 0.14524874091148376, -0.016693830490112305, -0.41404739022254944, 0.042244963347911835, -0.2789249122142792, -0.3230864703655243, 0.14541035890579224, -0.3087240755558014, -0.24474644660949707, -0.07887645065784454, -0.19539488852024078, -0.12999340891838074, 0.14069288969039917, 0.2872932553291321, 0.3576449453830719, -0.013219248503446579, -0.21852853894233704, -0.03892446309328079, -0.17922933399677277, -0.06364867091178894, 0.26564306020736694, 0.08401109278202057, 0.21867915987968445, -0.08923186361789703, -0.011448096483945847, -0.04825218394398689, -0.2782900929450989, -0.09336143732070923, -0.2892761528491974, 0.15959975123405457, 0.01448492705821991, -0.37405306100845337, 0.009065750986337662, -0.034832555800676346, -0.17457032203674316, -0.2543487846851349, 0.4593431055545807, 0.17087748646736145, -0.1405714601278305, -0.13134221732616425, 0.03225485980510712, 0.002448856830596924, -0.34701451659202576, 0.0413520410656929, 0.02311558648943901, 0.27016204595565796, 0.03438476100564003, 0.11267846077680588, -0.2959887981414795, -0.0600675530731678, 0.11153290420770645, 0.09885319322347641, 0.24207648634910583, -0.004300178959965706, 0.647831916809082, -0.09642304480075836, -0.05258246883749962, 0.09814807772636414, 0.1911730170249939, 0.24661387503147125, 0.10890430212020874, 0.09971055388450623, 0.059836968779563904, 0.1099066436290741, -0.15168794989585876, -0.07315105199813843, 0.3717508912086487, 0.06877611577510834, -0.00023800134658813477, 0.06514016538858414, 0.20040073990821838, -0.06622637063264847, 0.17679113149642944, 0.09656395018100739, 0.3529004156589508, 0.01642010733485222, 0.11655592918395996, 0.060132723301649094, 0.03609464317560196, 0.456217885017395, 0.21633146703243256, 0.08152638375759125, -0.12502449750900269, 0.1305389404296875, 0.01941526122391224, 0.30858519673347473, -0.27857735753059387, 0.19980959594249725, 0.07228552550077438, -0.6872008442878723, 0.02143709361553192, -0.09923873096704483, -0.10146679729223251, 0.10613910108804703, -0.3051513731479645, 0.4565276503562927, -0.270254522562027, 0.07271678745746613, -0.38961878418922424, 0.31479212641716003, -0.018438778817653656, -0.5011211633682251, -0.07950009405612946, -0.15277832746505737, -0.19039788842201233, -0.09385611861944199, 0.25198885798454285, -0.4124642014503479, 0.5564993619918823, -0.22922763228416443, -0.11207477748394012, -0.6101829409599304, -0.10567492246627808, 0.1315140724182129, 0.12052256613969803, -0.06415264308452606, 0.3123973608016968, 0.0012013092637062073, -0.19263683259487152, 0.21217316389083862, 0.23643863201141357, 0.36611050367355347, 0.1220487654209137, 0.20724458992481232, -0.12076841294765472, 0.14675667881965637, 0.11718416959047318, -0.3985389173030853, 0.28009647130966187, -0.05152779817581177, -0.1592501848936081, 0.22685536742210388, 0.08412333577871323, -0.14353018999099731, -0.10690475255250931, -0.053714338690042496, 0.6237969994544983, -0.4925615191459656, 0.6402959823608398, -0.39522233605384827, 0.14404699206352234, -0.11857374757528305, -0.1761767566204071, -0.31654468178749084, 0.32422059774398804, 0.37772294878959656, -0.19910190999507904, 0.181482195854187, -0.3631288707256317, 0.030120179057121277, -0.0238021370023489, 0.3451894521713257, 0.31178706884384155, -0.14110685884952545, -0.14954955875873566, -0.06503394991159439, -0.3681561350822449, -0.03477977216243744, 0.13452818989753723, -0.15331727266311646, 0.06269092857837677, 0.16401466727256775, -0.10413643717765808, 0.013447841629385948, -0.019413083791732788, 0.04669228568673134, 0.48865246772766113, -0.16507546603679657, -0.135410875082016, -0.15504634380340576, -0.4814298450946808, 0.19071827828884125, 0.13843414187431335, -0.23033453524112701, 0.20919984579086304, -0.19546093046665192, -0.07837420701980591, 0.1741020679473877, -0.14532187581062317, 0.17887365818023682, -0.3730149269104004, 0.3570299446582794, 0.15847371518611908, 0.03262132406234741, -0.16346822679042816, -0.007799282670021057, -0.2542276680469513, -0.11926130950450897, -0.1665811538696289, -0.19929257035255432, -0.4699385166168213, 0.04197331517934799, -0.26589787006378174, -0.018603507429361343, -0.42800870537757874, 0.3274851441383362, 0.301800400018692, -0.10438445210456848, 0.022968485951423645, 0.04077399522066116, -0.31191861629486084, 0.029876571148633957, 0.1560918539762497, 0.250914603471756, -0.24083398282527924, 0.23016829788684845, -0.07995086908340454, -0.259167343378067, 0.4812617301940918, -0.1779775470495224, -0.14897069334983826, -0.33531057834625244, 0.21908003091812134, -0.101846843957901, -0.17427366971969604, -0.1303234100341797, 0.1567312330007553, 0.2863253355026245, -0.1255139857530594, 0.05024102330207825, 0.09962941706180573, 0.1029583066701889, 0.13872206211090088, -0.1664048284292221, 0.06027241796255112, 0.10725633800029755, -0.12493065744638443, 0.24728649854660034, -0.06554045528173447 ]
https://github.com/huggingface/datasets/issues/6032
@mariosasko are you saying if I do the following: ``` def backend_factory() -> requests.Session: session = requests.Session() session.proxies = { "https": "127.0.0.1:8887", "http": "127.0.0.1:8887", } session.verify = "/etc/ssl/certs/ca-certificates.crt" return session # Set it as the default session factory configure_http_backend(backend_factory=backend_factory) ``` which works nicely with transformer library: ``` def download_gpt_2_model(): tokenizer = GPT2Tokenizer.from_pretrained( "gpt2", force_download=True, resume_download=False ) text = "Replace me by any text you'd like." encoded_input = tokenizer(text, return_tensors="pt") print(encoded_input) model = GPT2Model.from_pretrained( "gpt2", force_download=True, resume_download=False ) output = model(**encoded_input) ``` should work for datasets library as well ? In my case if I just do: ``` def download_sts12_sts_dataset(): dataset = load_dataset( "mteb/sts12-sts", download_mode="force_redownload", verification_mode="basic_checks", revision="main", ) ``` I am getting: `ConnectionError: Couldn't reach https://huggingface.co/datasets/mteb/sts12-sts/resolve/main/dataset_infos.json (ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /datasets/mteb/sts12-sts/resolve/main/dataset_infos.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f429e87a3a0>, 'Connection to huggingface.co timed out. (connect timeout=100)'))")))` which is typical when the proxy server is not defined. Looks like what is set in configure_http_backend(backend_factory=backend_factory) is ignore. If I use env variable instead, it is working ``` def download_sts12_sts_dataset(): os.environ["https_proxy"] = "127.0.0.1:8887" os.environ["http_proxy"] = "127.0.0.1:8887" os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt" dataset = load_dataset( "mteb/sts12-sts", download_mode="force_redownload", verification_mode="basic_checks", revision="main", ) ``` Should I add something ? I am using `huggingface_hub 0.15.1`, `datasets 2.13.0`, `transformers 4.30.2`
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info
### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4
199
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info ### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4 @mariosasko are you saying if I do the following: ``` def backend_factory() -> requests.Session: session = requests.Session() session.proxies = { "https": "127.0.0.1:8887", "http": "127.0.0.1:8887", } session.verify = "/etc/ssl/certs/ca-certificates.crt" return session # Set it as the default session factory configure_http_backend(backend_factory=backend_factory) ``` which works nicely with transformer library: ``` def download_gpt_2_model(): tokenizer = GPT2Tokenizer.from_pretrained( "gpt2", force_download=True, resume_download=False ) text = "Replace me by any text you'd like." encoded_input = tokenizer(text, return_tensors="pt") print(encoded_input) model = GPT2Model.from_pretrained( "gpt2", force_download=True, resume_download=False ) output = model(**encoded_input) ``` should work for datasets library as well ? In my case if I just do: ``` def download_sts12_sts_dataset(): dataset = load_dataset( "mteb/sts12-sts", download_mode="force_redownload", verification_mode="basic_checks", revision="main", ) ``` I am getting: `ConnectionError: Couldn't reach https://huggingface.co/datasets/mteb/sts12-sts/resolve/main/dataset_infos.json (ConnectTimeout(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /datasets/mteb/sts12-sts/resolve/main/dataset_infos.json (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f429e87a3a0>, 'Connection to huggingface.co timed out. (connect timeout=100)'))")))` which is typical when the proxy server is not defined. Looks like what is set in configure_http_backend(backend_factory=backend_factory) is ignore. If I use env variable instead, it is working ``` def download_sts12_sts_dataset(): os.environ["https_proxy"] = "127.0.0.1:8887" os.environ["http_proxy"] = "127.0.0.1:8887" os.environ["REQUESTS_CA_BUNDLE"] = "/etc/ssl/certs/ca-certificates.crt" dataset = load_dataset( "mteb/sts12-sts", download_mode="force_redownload", verification_mode="basic_checks", revision="main", ) ``` Should I add something ? I am using `huggingface_hub 0.15.1`, `datasets 2.13.0`, `transformers 4.30.2`
[ -0.2879653573036194, -0.09048756211996078, 0.062012672424316406, 0.29357796907424927, 0.23151016235351562, -0.19603273272514343, 0.475433349609375, -0.017514346167445183, -0.19411398470401764, -0.08183425664901733, -0.21388950943946838, -0.08288490772247314, 0.5092027187347412, 0.13407891988754272, 0.19329148530960083, -0.10976562649011612, -0.11932724714279175, -0.05202661454677582, -0.26353222131729126, 0.03628212958574295, -0.27031445503234863, 0.27052921056747437, -0.06600666046142578, 0.11572706699371338, -0.03542112931609154, 0.2848629951477051, -0.09077711403369904, 0.2296304702758789, 0.13188600540161133, 0.006921656429767609, 0.4965359568595886, 0.35756468772888184, 0.24036604166030884, 0.3045766353607178, -0.00011974460358032957, 0.4107852578163147, 0.4937436580657959, -0.08646474033594131, -0.35525649785995483, -0.15683546662330627, -0.6016092300415039, -0.10702574253082275, -0.053168460726737976, -0.137226402759552, -0.2184457778930664, -0.0986848771572113, -0.1790734827518463, -0.060959238559007645, 0.27533823251724243, 0.2612878084182739, 0.12040747702121735, 0.5021074414253235, -0.012987390160560608, -0.07501375675201416, 0.2051018923521042, 0.001475924625992775, -0.1020299643278122, -0.20232273638248444, 0.10367529094219208, 0.2339850813150406, 0.25523704290390015, 0.12464068084955215, -0.16086161136627197, 0.06556421518325806, 0.2075725495815277, 0.1329536736011505, 0.08181022852659225, -0.3057713508605957, 0.1337677389383316, 0.32609933614730835, 0.6190248131752014, -0.3777567446231842, -0.2972608208656311, -0.2525046765804291, -0.18289391696453094, 0.06287316977977753, 0.3764117658138275, 0.11254110932350159, -0.2103460431098938, 0.18143877387046814, -0.07286249846220016, -0.30233657360076904, 0.03839656710624695, 0.1270696073770523, 0.0020921751856803894, 0.178129181265831, -0.05015216022729874, 0.31184181571006775, -0.21503576636314392, 0.04706215485930443, 0.11026228964328766, -0.6021696329116821, 0.06604309380054474, 0.05821295455098152, -0.24725858867168427, -0.022790245711803436, 0.07667888700962067, 0.25485965609550476, 0.08412216603755951, 0.6501056551933289, -0.265327513217926, 0.17158909142017365, -0.08394019305706024, 0.13984669744968414, 0.03668411448597908, 0.019512448459863663, -0.1232479065656662, 0.30174797773361206, 0.3266713619232178, 0.36760976910591125, 0.015634708106517792, -0.1186833456158638, 0.16856259107589722, -0.17160391807556152, -0.15572784841060638, -0.1658131629228592, 0.37353622913360596, -0.19959573447704315, -0.08721055835485458, 0.032270681113004684, -0.035925135016441345, -0.27472245693206787, 0.043862633407115936, 0.357734352350235, -0.2513197958469391, 0.38126885890960693, 0.31691205501556396, -0.02804839238524437, -0.2722988426685333, -0.2446707934141159, -0.16544325649738312, -0.2524646520614624, -0.05079203099012375, 0.34429246187210083, 0.08246764540672302, -0.2443040907382965, 0.3514838218688965, 0.12455001473426819, 0.13920149207115173, 0.13631388545036316, 0.2483404576778412, -0.18035489320755005, -0.026936817914247513, 0.4134875535964966, 0.06410765647888184, 0.07523852586746216, 0.06531903147697449, -0.20867493748664856, -0.05110521614551544, 0.0874980017542839, -0.23538626730442047, -0.13638406991958618, 0.05406605452299118, 0.07335474342107773, -0.16235411167144775, 0.002986038103699684, -0.41478821635246277, -0.12536782026290894, 0.3395758867263794, 0.0730338990688324, -0.07187628746032715, -0.16417710483074188, -0.0329425111413002, -0.00698760524392128, 0.5045240521430969, 0.5657961368560791, -0.011333413422107697, -0.3352837562561035, 0.1216578334569931, -0.4142146110534668, 0.23342746496200562, -0.012558032758533955, -0.10217678546905518, 0.15071994066238403, -0.2542097866535187, -0.1445995718240738, 0.46492069959640503, -0.4470161199569702, -0.43712231516838074, 0.41035157442092896, 0.016826242208480835, 0.3192926347255707, 0.11537830531597137, 0.002571322023868561, 0.06310734152793884, -0.0868082270026207, -0.19034016132354736, 0.3953608274459839, -0.03916709125041962, 0.089377261698246, -0.21742236614227295, -0.25546741485595703, -0.01877354085445404, 0.15861746668815613, 0.1333909034729004, 0.559203028678894, -0.23808598518371582, -0.09734727442264557, 0.2662392854690552, 0.09884771704673767, 0.16950324177742004, -0.0438857302069664, 0.05144805833697319, 0.39567944407463074, 0.2381540834903717, 0.15873704850673676, -0.2413289099931717, 0.14131960272789001, -0.3433709740638733, 0.058563411235809326, -0.05504553020000458, 0.01975284516811371, -0.2779092490673065, -0.22085875272750854, -0.23886525630950928, -0.23176147043704987, -0.011279560625553131, 0.4725208580493927, 0.20643682777881622, -0.13642483949661255, 0.07196871191263199, 0.7011692523956299, 0.09696829319000244, 0.2556433379650116, -0.2768362760543823, 0.4166256785392761, 0.11841658502817154, 0.0814708024263382, -0.12239529937505722, -0.0030363183468580246, 0.2939515709877014, -0.11674278229475021, -0.09459280222654343, 0.3544045090675354, -0.006318040192127228, 0.13304053246974945, -0.01659189723432064, -0.04766383767127991, 0.3053276836872101, -0.09792667627334595, -0.024939285591244698, 0.25945845246315, 0.31259989738464355, -0.012572728097438812, 0.08896541595458984, 0.09565500915050507, 0.46033596992492676, 0.4154092073440552, 0.18456828594207764, 0.07246793061494827, 0.25526055693626404, -0.12847180664539337, -0.2143266648054123, 0.028755150735378265, -0.12866905331611633, -0.13240903615951538, 0.45911499857902527, 0.009461455047130585, -0.2364930659532547, 0.19996501505374908, 0.33000606298446655, 0.07661162316799164, -0.21627089381217957, 0.1743611991405487, -0.27312159538269043, 0.07862947881221771, 0.31672024726867676, 0.23706212639808655, 0.4040425419807434, -0.014957083389163017, -0.15940891206264496, 0.2849571704864502, -0.12504558265209198, -0.2137174904346466, 0.2392238825559616, 0.16212692856788635, -0.2434093952178955, -0.12770935893058777, 0.05599668249487877, 0.05819011479616165, -0.040449146181344986, -0.2106296420097351, -0.056948039680719376, -0.019740819931030273, -0.6143613457679749, 0.13143311440944672, -0.20561817288398743, -0.1355467438697815, 0.008074924349784851, 0.028010066598653793, 0.07009477913379669, -0.34261003136634827, -0.22209596633911133, 0.17402401566505432, 0.07801958918571472, 0.03478115051984787, -0.29315727949142456, 0.17476511001586914, 0.028511539101600647, -0.4883086681365967, -0.1942630410194397, 0.30318647623062134, -0.39664146304130554, -0.004778407514095306, 0.006826318800449371, -0.18736815452575684, 0.0799008160829544, -0.42748671770095825, -0.3070641756057739, -0.2833922505378723, -0.15264929831027985, 0.27273717522621155, -0.015369653701782227, 0.28049972653388977, 0.07446679472923279, 0.03678438812494278, 0.35061994194984436, -0.09798775613307953, 0.35666829347610474, 0.34403204917907715, -0.019917234778404236, 0.027041591703891754, 0.03621061146259308, 0.0029303692281246185, -0.14352035522460938, -0.2455986887216568, -0.048737965524196625, -0.20905524492263794, -0.13632558286190033, 0.2007826268672943, 0.07732822000980377, -0.00951903872191906, 0.06863408535718918, 0.001837991178035736, -0.022842280566692352, 0.16614991426467896, -0.27103185653686523, -0.7304021120071411, 0.284740149974823, -0.07126708328723907, -0.2837180197238922, -0.15469050407409668, -0.012010745704174042, 0.12466441094875336, 0.23206478357315063, -0.5957650542259216, -0.31904956698417664, -0.3255792260169983, 0.2985458970069885, 0.18267148733139038, 0.22033576667308807, 0.20926356315612793, -0.10696205496788025, 0.04294028878211975, -0.23291712999343872, -0.23281997442245483, 0.21941155195236206, -0.31263405084609985, 0.38986876606941223, 0.2872178256511688, 0.35475394129753113, -0.12470239400863647, 0.8787166476249695, 0.31937628984451294, -0.17530985176563263, 0.4936841130256653, -0.0612923800945282, 0.24447298049926758, -0.03027510643005371, -0.17346414923667908, 0.09757591038942337, 0.00007113814353942871, 0.31822365522384644, 0.0349784791469574, 0.12245213985443115, -0.09393317997455597, -0.3876515328884125, 0.1838483065366745, -0.17484818398952484, -0.42396682500839233, -0.33689644932746887, -0.16818445920944214, 0.2293681800365448, 0.1503264605998993, 0.2571924924850464, -0.20401528477668762, 0.022729896008968353, 0.1329023241996765, 0.38001275062561035, 0.29468974471092224, -0.056602321565151215, -0.09280169755220413, 0.032954201102256775, -0.5632234215736389, 0.38169488310813904, -0.10516965389251709, 0.39509135484695435, -0.12490186840295792, 0.028539203107357025, 0.11006093770265579, -0.20021896064281464, 0.5922380685806274, -0.0566667839884758, -0.03787658363580704, 0.2874978482723236, -0.27557268738746643, -0.4958268105983734, -0.22117117047309875, 0.0448727086186409, 0.11309896409511566, 0.032721519470214844, 0.19956570863723755, -0.511524498462677, -0.10680948942899704, -0.037598732858896255, -0.18341109156608582, -0.16279849410057068, -0.15159958600997925, -0.22155028581619263, -0.5715349316596985, -0.22987160086631775, -0.06360490620136261, -0.19032937288284302, 0.2078503668308258, -0.2829761505126953, -0.14733144640922546, 0.14038221538066864, 0.16771918535232544, 0.07991252839565277, 0.09578534215688705, 0.08149349689483643, -0.014756079763174057, 0.277874231338501, 0.0022140759974718094, 0.3064363896846771, 0.06427007913589478, 0.6043341159820557, 0.24304580688476562, -0.5631422996520996, 0.13798853754997253, 0.0054679252207279205, -0.07912030816078186, 0.10606429725885391, -0.2079913169145584, -0.023587416857481003, 0.15969610214233398, 0.38294562697410583, -0.3013102114200592, 0.20137187838554382, 0.395693838596344, 0.04313356801867485, -0.0844622552394867, -0.7125821113586426, 0.4117008447647095, 0.08397316932678223, -0.07886813580989838, 0.3187738358974457, 0.10878729820251465, -0.26070091128349304, -0.04427493363618851, -0.16320925951004028, 0.8126475811004639, 0.24068140983581543, 0.05107320100069046, 0.503468930721283, -0.1645607054233551, 0.2512359917163849, -0.43717366456985474, -0.021390439942479134, -0.05242478847503662, -0.13561534881591797, -0.13610875606536865, -0.22404539585113525, 0.33470290899276733, -0.005515324883162975, -0.3025616407394409, 0.2417563796043396, -0.17896366119384766, -0.08539406210184097, 0.30311834812164307, 0.14149360358715057, -0.3960636854171753, -0.2602444589138031, -0.02273244969546795, 0.15000616014003754, 0.059096772223711014, 0.37659767270088196, -0.029569441452622414, -0.0590570792555809, -0.10248778015375137, -0.05526813492178917, -0.3176608681678772, 0.26186347007751465, -0.18707306683063507, -0.1804998815059662, 0.33170363306999207, 0.0722029060125351, 0.21485117077827454, -0.03008493036031723, 0.2553027272224426, -0.07127092778682709, -0.25175386667251587, 0.16557437181472778, -0.2240082174539566, 0.4413565397262573, 0.1659964919090271, -0.09362681210041046, 0.2629469931125641, -0.07554135471582413, -0.4573500454425812, 0.15646690130233765, -0.08746983110904694, -0.3143235146999359, -0.10880811512470245, -0.16567447781562805, 0.21208029985427856, -0.367301881313324, 0.1915983408689499, 0.17518176138401031, -0.03497302904725075, -0.21178992092609406, 0.07891099900007248, 0.10246404260396957, -0.3208245635032654, 0.3720757067203522, -0.19564205408096313, -0.22263188660144806, -0.07167665660381317, 0.5779820084571838, -0.029079195111989975, 0.28258147835731506, 0.470061331987381, -0.10109522938728333, -0.1404646933078766, -0.03800119459629059, -0.18228940665721893, -0.4436393976211548, -0.17054325342178345, 0.1524551957845688, 0.0346597321331501, -0.04691420495510101, -0.35967838764190674, 0.009776031598448753, -0.2798055410385132, -0.0628451257944107, 0.0532926544547081, -0.29979461431503296, -0.06168343871831894, -0.21178370714187622, -0.1836855411529541, -0.14613386988639832, 0.13274891674518585, 0.26372572779655457, 0.3986383378505707, -0.09341377764940262, -0.2080656737089157, -0.09059223532676697, -0.17278096079826355, 0.16682025790214539, 0.2648010849952698, 0.050845131278038025, 0.023786060512065887, -0.03308955579996109, -0.04210960865020752, -0.0254652239382267, -0.2141958624124527, -0.09598156809806824, -0.23605471849441528, 0.2083711326122284, 0.04336497187614441, -0.4800751805305481, 0.07460783421993256, -0.06704495847225189, -0.16888388991355896, -0.15792617201805115, 0.49740874767303467, 0.03725266456604004, -0.13384535908699036, -0.027833301573991776, 0.02379746362566948, 0.013683106750249863, -0.4930204749107361, 0.1212632954120636, -0.051599644124507904, 0.13167227804660797, 0.19919201731681824, 0.20386599004268646, -0.2032044231891632, -0.0005750954151153564, -0.23587380349636078, 0.07877807319164276, 0.3214080333709717, 0.23915661871433258, 0.746548593044281, -0.2833019495010376, 0.0573524609208107, 0.16202950477600098, 0.06749800592660904, 0.14554455876350403, 0.024291928857564926, -0.001143127679824829, 0.12279659509658813, 0.1242365911602974, -0.15536797046661377, -0.0038757026195526123, 0.3541948199272156, 0.021533209830522537, 0.015064075589179993, 0.12821277976036072, 0.12790818512439728, -0.11870872974395752, 0.31977033615112305, 0.07542090862989426, 0.5041711926460266, -0.1303381621837616, 0.2230185866355896, 0.2617778778076172, -0.21816784143447876, 0.5241462588310242, 0.2316775619983673, -0.03994561359286308, -0.2745203971862793, 0.14851076900959015, 0.08981865644454956, 0.22043853998184204, -0.09053075313568115, 0.11866934597492218, -0.041755568236112595, -0.6272898316383362, -0.009013819508254528, -0.019770734012126923, -0.09410613775253296, 0.0966029018163681, -0.1676996946334839, 0.12193326652050018, -0.07192987948656082, 0.15160834789276123, -0.358262300491333, 0.28505510091781616, -0.0034874482080340385, -0.4060075879096985, -0.15994927287101746, -0.09051313996315002, -0.15312351286411285, -0.14095039665699005, 0.17997623980045319, -0.3924475312232971, 0.4063994288444519, -0.14286364614963531, -0.3184391260147095, -0.49360930919647217, -0.025108806788921356, -0.028446467593312263, 0.09675268828868866, -0.08482659608125687, 0.36954164505004883, -0.009111851453781128, -0.16671687364578247, 0.07280333340167999, 0.364895224571228, 0.17504411935806274, 0.29860734939575195, 0.14229893684387207, -0.17350539565086365, 0.1720612496137619, 0.12344217300415039, -0.39358338713645935, 0.3093681335449219, -0.15095645189285278, -0.21302354335784912, 0.18298983573913574, 0.06609337031841278, -0.13025566935539246, 0.010685483925044537, -0.059544291347265244, 0.49804583191871643, -0.4959293007850647, 0.7125441431999207, -0.1834905445575714, 0.12715668976306915, 0.003482505679130554, -0.07187695801258087, -0.34415340423583984, 0.26793643832206726, 0.5596926808357239, -0.1788492351770401, 0.22003738582134247, -0.3073146343231201, 0.02624921128153801, -0.15742522478103638, 0.21371492743492126, 0.275348037481308, -0.2281545102596283, -0.20936402678489685, 0.011593848466873169, -0.2964042127132416, 0.016316037625074387, 0.1299019753932953, -0.3536290228366852, -0.022967996075749397, 0.3412574529647827, 0.09031512588262558, 0.12722837924957275, -0.04294414073228836, 0.03870994970202446, 0.44307276606559753, 0.005279069766402245, -0.1729430854320526, -0.1232098639011383, -0.41955819725990295, 0.40102332830429077, 0.06896734237670898, -0.45328783988952637, 0.17319335043430328, 0.06170021742582321, 0.009230993688106537, 0.11748102307319641, -0.310037225484848, 0.38972675800323486, -0.11317595839500427, 0.5237646102905273, 0.23360729217529297, 0.0757991299033165, -0.10258717834949493, 0.14732137322425842, -0.37361010909080505, -0.13947682082653046, -0.2051151543855667, -0.2950371205806732, -0.4020729064941406, 0.01962144672870636, -0.1535547971725464, 0.11913548409938812, -0.45545250177383423, 0.1838066130876541, 0.1736828088760376, -0.07930649071931839, -0.027429528534412384, -0.08597405254840851, -0.3641718029975891, -0.044741928577423096, 0.015043340623378754, 0.14265158772468567, -0.23897425830364227, 0.0739346519112587, -0.15196725726127625, -0.31834596395492554, 0.436623752117157, -0.2623191177845001, -0.27192360162734985, -0.4151862859725952, 0.23890148103237152, -0.29948216676712036, 0.0017691366374492645, 0.07799206674098969, 0.1318657100200653, 0.4267335534095764, -0.14591702818870544, 0.014067471027374268, 0.2096298635005951, 0.23785285651683807, 0.29908478260040283, -0.17396663129329681, 0.12970049679279327, -0.012593541294336319, -0.12476752698421478, 0.015634775161743164, -0.18039661645889282 ]
https://github.com/huggingface/datasets/issues/6032
`huggingface_hub.configure_http_backend` works for `transformers` because they only use the `huggingface_hub` lib for downloads. Our download logic is a bit more complex (e.g., we also support downloading non-Hub files), so we are not aligned with them yet. In the meantime, it's best to use the env vars.
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info
### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4
46
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info ### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4 `huggingface_hub.configure_http_backend` works for `transformers` because they only use the `huggingface_hub` lib for downloads. Our download logic is a bit more complex (e.g., we also support downloading non-Hub files), so we are not aligned with them yet. In the meantime, it's best to use the env vars.
[ -0.27186834812164307, -0.31287357211112976, 0.07217457890510559, 0.2777330279350281, 0.2889355719089508, -0.19712388515472412, 0.2673001289367676, -0.08293803036212921, -0.08512282371520996, -0.010375790297985077, -0.326313316822052, -0.0373648926615715, 0.4374721050262451, 0.34515780210494995, 0.1390373855829239, -0.12490998208522797, -0.08848109841346741, -0.14895063638687134, -0.12920933961868286, 0.037839777767658234, -0.25948527455329895, 0.36716675758361816, -0.0811178907752037, 0.002599019557237625, -0.11392811685800552, 0.40436282753944397, -0.155666321516037, 0.3601680099964142, 0.13421630859375, -0.06870643049478531, 0.6356081366539001, 0.3461856245994568, 0.2570754885673523, 0.14621983468532562, -0.00012010813225060701, 0.39361393451690674, 0.4892714321613312, -0.07777929306030273, -0.2823590934276581, -0.2583833336830139, -0.5175963640213013, -0.18960753083229065, 0.021880559623241425, -0.021268770098686218, -0.08014175295829773, 0.020508721470832825, -0.0827031210064888, 0.0024901553988456726, 0.2637179493904114, 0.21200406551361084, 0.1351414918899536, 0.6639845371246338, -0.010344207286834717, -0.13297727704048157, 0.08211572468280792, 0.11664993315935135, -0.08376314491033554, -0.11969750374555588, 0.1590728610754013, 0.28923285007476807, 0.13423728942871094, 0.13504263758659363, -0.17617011070251465, -0.004849735647439957, 0.36852580308914185, 0.08581694960594177, 0.02189113385975361, -0.2157481461763382, 0.09329119324684143, 0.33813273906707764, 0.5293997526168823, -0.3853367865085602, -0.29516175389289856, -0.25711721181869507, -0.10517319291830063, 0.11899009346961975, 0.43244215846061707, 0.09269310534000397, -0.2262963354587555, 0.11823033541440964, -0.18918845057487488, -0.33437034487724304, 0.011437661945819855, 0.18607299029827118, 0.1468440294265747, 0.14060592651367188, -0.15592195093631744, 0.18247883021831512, -0.07487107813358307, -0.02216348983347416, 0.07947783917188644, -0.6737771034240723, 0.12806689739227295, -0.0019328035414218903, -0.15894608199596405, 0.03760729730129242, -0.012736164033412933, 0.46530255675315857, 0.15496507287025452, 0.5214198231697083, -0.1941659152507782, 0.2281738519668579, -0.16767853498458862, 0.1961626261472702, 0.12624096870422363, -0.05656874179840088, -0.018548857420682907, 0.1995076984167099, 0.2933010458946228, 0.5258232951164246, 0.13877758383750916, -0.09572015702724457, 0.2681717872619629, -0.12426994740962982, -0.33117175102233887, -0.30944058299064636, 0.2606073021888733, -0.13663902878761292, -0.05178316310048103, 0.021584272384643555, 0.02118828147649765, -0.1614939123392105, 0.34586989879608154, 0.45876413583755493, -0.3466630280017853, 0.28417110443115234, 0.13623479008674622, 0.18424278497695923, -0.21259352564811707, -0.04147198796272278, -0.20877350866794586, -0.17071279883384705, -0.0031679272651672363, 0.3361265957355499, 0.21232455968856812, -0.3192780017852783, 0.3483147621154785, 0.10386987775564194, 0.3129616975784302, 0.0956074595451355, -0.06435613334178925, 0.001847006380558014, -0.048575736582279205, 0.40831637382507324, 0.05648529529571533, 0.042760737240314484, 0.04836738482117653, -0.20014791190624237, -0.1024705171585083, -0.09141052514314651, -0.18468911945819855, -0.24503761529922485, 0.06310413777828217, 0.04891815036535263, -0.2578960657119751, -0.07323311269283295, -0.3545505106449127, -0.017291022464632988, 0.07926221936941147, 0.06614755094051361, -0.028726130723953247, 0.021443739533424377, -0.1268647462129593, -0.05306994915008545, 0.5933396816253662, 0.5449199676513672, 0.2387317568063736, -0.3466113805770874, 0.003689698874950409, -0.3716528117656708, 0.2627798914909363, -0.09097382426261902, -0.020738720893859863, -0.1013757735490799, -0.2384575605392456, -0.20674431324005127, 0.3024282455444336, -0.5959415435791016, -0.35318759083747864, 0.40593090653419495, 0.19665268063545227, 0.22760498523712158, 0.17940230667591095, -0.011923190206289291, -0.11740633100271225, 0.02495609223842621, -0.13952931761741638, 0.3816593587398529, -0.016745220869779587, 0.04130827635526657, -0.1564827263355255, -0.3368373215198517, -0.38814041018486023, 0.2877110242843628, 0.11872169375419617, 0.5857505798339844, -0.17634230852127075, -0.25083115696907043, 0.3095163404941559, 0.17081180214881897, 0.2279393970966339, 0.12423297762870789, 0.022307075560092926, 0.413360059261322, 0.19719301164150238, -0.07741037756204605, -0.36184877157211304, 0.21086746454238892, -0.2695966064929962, -0.07232455909252167, -0.15012907981872559, -0.10972276329994202, -0.29847484827041626, -0.12329170852899551, -0.15898407995700836, -0.24451906979084015, -0.011133432388305664, 0.23950129747390747, 0.26915132999420166, -0.09070231020450592, -0.03310372680425644, 0.7235965132713318, 0.10199414938688278, 0.27781447768211365, -0.2547522485256195, 0.5272226333618164, 0.12952038645744324, 0.04794999584555626, -0.06046630069613457, 0.1450902819633484, 0.18003147840499878, 0.014090918004512787, -0.003709668293595314, 0.32766491174697876, -0.09955252707004547, 0.1494034379720688, 0.13788461685180664, -0.08813652396202087, 0.29918959736824036, -0.23289842903614044, 0.01857689581811428, 0.10972557961940765, 0.239388108253479, 0.016054004430770874, 0.008598723448812962, 0.1574547290802002, 0.13382166624069214, 0.48731034994125366, 0.23000633716583252, 0.15370020270347595, 0.1551150381565094, -0.04615388438105583, -0.2669372260570526, -0.09827309101819992, -0.05457395315170288, -0.09043768793344498, 0.4208107590675354, -0.03214471414685249, -0.2954472303390503, 0.04385257884860039, 0.21598128974437714, 0.16472959518432617, -0.23112821578979492, 0.2268468141555786, -0.22842413187026978, 0.19507655501365662, 0.37833040952682495, 0.15075446665287018, 0.2555938959121704, -0.005895515903830528, -0.10773058235645294, 0.37665992975234985, -0.12528781592845917, -0.16503381729125977, 0.19897836446762085, 0.19888529181480408, -0.3017532527446747, -0.1750366985797882, -0.018023354932665825, -0.03728748485445976, -0.21771395206451416, -0.21590197086334229, -0.22952625155448914, -0.22462092339992523, -0.5632098317146301, 0.09377076476812363, -0.28713053464889526, -0.16633321344852448, -0.014686349779367447, -0.26426759362220764, -0.16966496407985687, -0.39334800839424133, -0.19686844944953918, 0.25564178824424744, 0.012639425694942474, 0.04617270827293396, -0.21954341232776642, 0.11083146929740906, -0.14832192659378052, -0.4808063805103302, -0.337260901927948, 0.31954488158226013, -0.22788727283477783, -0.0638277530670166, -0.027439437806606293, -0.0619625560939312, -0.004075995646417141, -0.4485865533351898, -0.1622670441865921, -0.28786173462867737, -0.04462306946516037, 0.2446361780166626, 0.11194691807031631, 0.1997191458940506, 0.09673435986042023, -0.0738787055015564, 0.1642194241285324, -0.12339801341295242, 0.48232781887054443, 0.31704118847846985, 0.10586125403642654, 0.12342709302902222, 0.1159270703792572, -0.047020431607961655, -0.09712164103984833, 0.010252123698592186, -0.1477561891078949, -0.2555571496486664, 0.014797300100326538, 0.11386865377426147, -0.021033920347690582, 0.037230297923088074, 0.17268233001232147, 0.07123809307813644, -0.19563299417495728, 0.1636420488357544, -0.17271699011325836, -0.7840265035629272, 0.3095991015434265, -0.031670548021793365, -0.3069506287574768, -0.11502806097269058, -0.034740205854177475, 0.06341879069805145, 0.09922188520431519, -0.4482436776161194, -0.35500794649124146, -0.3292943239212036, 0.3563831150531769, 0.2135203331708908, 0.3721851706504822, 0.07562676817178726, -0.1034654825925827, 0.0766441598534584, -0.1642346978187561, -0.10693447291851044, 0.14519663155078888, -0.31427139043807983, 0.3806373178958893, 0.22739455103874207, 0.19325514137744904, -0.2146492898464203, 0.7437685132026672, 0.3798011541366577, -0.04844469949603081, 0.6803185939788818, -0.0631127804517746, 0.4532971978187561, 0.010495327413082123, -0.23268312215805054, 0.061935167759656906, 0.06027128919959068, 0.30046358704566956, 0.013761233538389206, 0.2331496626138687, 0.2101498246192932, -0.3864003121852875, 0.10104254633188248, 0.0005110651254653931, -0.3638145625591278, -0.356852263212204, -0.039367105811834335, 0.051479559391736984, 0.1630254089832306, 0.27083784341812134, -0.17308548092842102, -0.0640455111861229, 0.15922477841377258, 0.4802796542644501, 0.1361517310142517, -0.02939499542117119, 0.07690608501434326, -0.12752628326416016, -0.6671521663665771, 0.35578039288520813, -0.08000421524047852, 0.2704940438270569, -0.08070077002048492, 0.04642100632190704, 0.13404951989650726, -0.13112448155879974, 0.6030445694923401, -0.02028578892350197, -0.14336606860160828, 0.14736038446426392, -0.19522938132286072, -0.6012383103370667, -0.11309891939163208, 0.08036794513463974, 0.18866799771785736, 0.01748865470290184, 0.2750776708126068, -0.4146963655948639, -0.13056904077529907, 0.03825898468494415, -0.1310683637857437, -0.0572957918047905, -0.2390986829996109, -0.28862464427948, -0.5256458520889282, -0.2602573037147522, -0.02261052280664444, -0.18443116545677185, 0.1517907679080963, -0.1785896122455597, -0.25274309515953064, 0.22299517691135406, 0.11513747274875641, 0.0010550133883953094, 0.03955838829278946, 0.016740240156650543, -0.11907626688480377, 0.2482856959104538, 0.06874683499336243, 0.2155415117740631, 0.16302712261676788, 0.7130993008613586, 0.06898246705532074, -0.6087661981582642, -0.0367107018828392, 0.13754509389400482, -0.011718600988388062, 0.12779036164283752, -0.20622359216213226, -0.06825180351734161, 0.30786794424057007, 0.3447652757167816, -0.4293413460254669, 0.11618182063102722, 0.36226528882980347, 0.08763080090284348, -0.010143108665943146, -0.5098757743835449, 0.5994762778282166, 0.05493885278701782, -0.008266225457191467, 0.26865944266319275, 0.3632953464984894, -0.1254987120628357, -0.03431756794452667, -0.19179734587669373, 0.7337644100189209, 0.12854374945163727, 0.06791270524263382, 0.3725484311580658, -0.2004590928554535, 0.3025352656841278, -0.3055955171585083, 0.009029306471347809, -0.06419579684734344, -0.19043803215026855, -0.12514527142047882, -0.17855940759181976, 0.22814100980758667, -0.04180137440562248, -0.25788164138793945, 0.28821274638175964, -0.08685366064310074, -0.0281964261084795, 0.10099029541015625, 0.05475731939077377, -0.6116628646850586, -0.39576607942581177, -0.2713991701602936, 0.14157715439796448, 0.07900255918502808, 0.44865214824676514, -0.008938983082771301, -0.07231657207012177, -0.10188420116901398, -0.14396987855434418, -0.26923254132270813, 0.29702407121658325, -0.04738917946815491, -0.21895018219947815, 0.5246632695198059, 0.16854631900787354, 0.17167197167873383, 0.1429298222064972, 0.3328031599521637, -0.13328541815280914, -0.3332858383655548, 0.21770694851875305, -0.1980968564748764, 0.23150384426116943, -0.02514995075762272, -0.058020658791065216, 0.133350670337677, -0.10264401137828827, -0.5209025144577026, -0.012581625953316689, 0.002599745988845825, -0.12767337262630463, 0.08882631361484528, -0.14187364280223846, 0.1322818100452423, -0.2042071372270584, 0.21137824654579163, 0.036762453615665436, 0.11395350843667984, -0.18480011820793152, 0.0862412229180336, 0.10331414639949799, -0.23015236854553223, 0.31463080644607544, -0.12271745502948761, -0.08762755990028381, -0.08840357512235641, 0.5993087887763977, -0.18815389275550842, 0.2766458988189697, 0.3153321146965027, -0.012028723955154419, -0.14296934008598328, -0.013854563236236572, -0.2077389508485794, -0.36450445652008057, -0.07171457260847092, 0.12464188039302826, 0.13564351201057434, -0.14538784325122833, -0.41174599528312683, 0.024468671530485153, -0.18793940544128418, -0.2765170931816101, 0.1124429926276207, -0.307985782623291, -0.2958996891975403, -0.03828289732336998, -0.1648738980293274, -0.11328351497650146, 0.11261522769927979, 0.18236185610294342, 0.38043221831321716, -0.07537353038787842, -0.19430895149707794, -0.08060787618160248, -0.2480783760547638, -0.07900072634220123, 0.1820307970046997, 0.011666690930724144, 0.24142369627952576, -0.0682961493730545, -0.03402082994580269, -0.10795553028583527, -0.29866376519203186, -0.0658513754606247, -0.25703227519989014, 0.17899145185947418, 0.0574079193174839, -0.38654592633247375, 0.003562089055776596, -0.025991052389144897, -0.21167704463005066, -0.28259357810020447, 0.457907497882843, 0.22347339987754822, -0.10510256141424179, -0.05224224552512169, 0.04726194217801094, -0.009677799418568611, -0.4157153367996216, 0.08784355223178864, 0.0663256049156189, 0.28805890679359436, 0.04705019295215607, 0.17049071192741394, -0.26318562030792236, -0.05769071727991104, 0.059301190078258514, 0.05888883024454117, 0.3166719675064087, 0.03992177173495293, 0.6752414703369141, -0.08619952201843262, 0.04468595236539841, 0.10702240467071533, 0.13054627180099487, 0.28246933221817017, 0.14977478981018066, 0.09382505714893341, 0.10067720711231232, 0.10000370442867279, -0.1767416000366211, -0.05989457666873932, 0.3992367386817932, 0.07847416400909424, 0.019983045756816864, 0.07206480950117111, 0.1906120479106903, -0.10772738605737686, 0.294457346200943, 0.10022582858800888, 0.4439324736595154, 0.029089152812957764, 0.12205475568771362, 0.14229023456573486, 0.05122540891170502, 0.5183061361312866, 0.19465841352939606, 0.08471779525279999, -0.09421662986278534, 0.21522188186645508, -0.019113626331090927, 0.21244393289089203, -0.25886255502700806, 0.21001410484313965, 0.05252829194068909, -0.7062918543815613, 0.024285338819026947, -0.14912043511867523, -0.03923197463154793, 0.07566849887371063, -0.24779711663722992, 0.3518086373806, -0.2609211504459381, 0.19973178207874298, -0.46685388684272766, 0.3120460510253906, 0.010724285617470741, -0.5501345992088318, -0.049961332231760025, -0.13118606805801392, -0.1455634981393814, -0.09224642813205719, 0.2428446114063263, -0.3713873624801636, 0.47703537344932556, -0.192207470536232, -0.1179041713476181, -0.48007264733314514, -0.02404082380235195, 0.05885253846645355, 0.12030242383480072, -0.0477595329284668, 0.279803603887558, 0.07699654251337051, -0.17247799038887024, 0.14953403174877167, 0.20245549082756042, 0.3203202486038208, 0.11806311458349228, 0.15326935052871704, -0.09788668155670166, 0.1563388556241989, 0.11038122326135635, -0.41571933031082153, 0.24183818697929382, -0.0645224004983902, -0.12726151943206787, 0.19808802008628845, 0.06960641592741013, -0.12855258584022522, -0.16833695769309998, -0.16345366835594177, 0.5267650485038757, -0.38770025968551636, 0.7031177282333374, -0.3313407599925995, 0.15913145244121552, -0.10102095454931259, -0.17281298339366913, -0.32732826471328735, 0.28860729932785034, 0.41124042868614197, -0.20540554821491241, 0.19103890657424927, -0.24876518547534943, 0.015477243810892105, -0.06632788479328156, 0.32417839765548706, 0.39494404196739197, -0.12705060839653015, -0.12491845339536667, 0.058144330978393555, -0.3132097125053406, 0.009176541119813919, 0.13072119653224945, -0.2155926525592804, 0.05410657823085785, 0.20790942013263702, -0.10530975461006165, 0.028424888849258423, -0.05455748736858368, 0.1122860386967659, 0.5103116035461426, -0.056102439761161804, -0.07688291370868683, -0.15336160361766815, -0.46419358253479004, 0.19555121660232544, 0.1480264812707901, -0.29553085565567017, 0.18820905685424805, -0.008887369185686111, -0.0916220098733902, 0.1791578084230423, -0.16296164691448212, 0.22738617658615112, -0.37134993076324463, 0.33861732482910156, 0.12437038868665695, 0.11061816662549973, -0.15646833181381226, -0.0034201443195343018, -0.2882627248764038, -0.1226266473531723, -0.17246370017528534, -0.2685020864009857, -0.4840546250343323, -0.055313654243946075, -0.2976720333099365, 0.11594706773757935, -0.4657236337661743, 0.2845059931278229, 0.23764829337596893, -0.10014785826206207, 0.03081953525543213, 0.006419457495212555, -0.38083693385124207, 0.06800995767116547, 0.1406364142894745, 0.19741865992546082, -0.26207393407821655, 0.17947326600551605, -0.08413427323102951, -0.272799015045166, 0.5009785890579224, -0.10023920983076096, -0.17551136016845703, -0.38677865266799927, 0.19645996391773224, -0.13149720430374146, -0.10089340806007385, -0.06736677139997482, 0.12379734218120575, 0.23539267480373383, -0.16058430075645447, -0.036802250891923904, 0.047159116715192795, 0.15783050656318665, 0.12121565639972687, -0.21193447709083557, 0.09235861897468567, 0.07196284830570221, -0.1197153627872467, 0.13614772260189056, -0.09478165209293365 ]
https://github.com/huggingface/datasets/issues/6032
@mariosasko I fully understand that the logic for dataset is different. I see 2 issues with the current implementation of the env variables: - having the same https_proxy/http_prox/no_proxy env variables for all tools is not good in some case. For example I have 2 differents proxy server. In 2019 we had discussion with the Tensorflow teams and they recommended to do the following: TFDS_HTTP_PROXY, TFDS_HTTPS_PROXY ... - with recent version of requests, it is not possible to deactivate TLS interception (verify=false) by using env variable. This is useful to debug things and in some case TLS is not working and you need to ignore verifying the SSL certificate (probably not recommended) One of the best way is to able to pass our requests.Session() directly ``` import openai session = requests.Session() session.cert = CERT session.verify = False openai.requestssession = session ``` My 2 cents in this discussion
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info
### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4
146
DownloadConfig.proxies not work when load_dataset_builder calling HfApi.dataset_info ### Describe the bug ```python download_config = DownloadConfig(proxies={'https': '<my proxy>'}) builder = load_dataset_builder(..., download_config=download_config) ``` But, when getting the dataset_info from HfApi, the http requests not using the proxies. ### Steps to reproduce the bug 1. Setup proxies in DownloadConfig. 2. Call `load_dataset_build` with download_config. 3. Inspect the call stack in HfApi.dataset_info. ![image](https://github.com/huggingface/datasets/assets/138426806/33e538a8-2e22-4e63-b634-343febe5324b) ### Expected behavior DownloadConfig.proxies works for getting dataset_info. ### Environment info https://github.com/huggingface/datasets/commit/406b2212263c0d33f267e35b917f410ff6b3bc00 Python 3.11.4 @mariosasko I fully understand that the logic for dataset is different. I see 2 issues with the current implementation of the env variables: - having the same https_proxy/http_prox/no_proxy env variables for all tools is not good in some case. For example I have 2 differents proxy server. In 2019 we had discussion with the Tensorflow teams and they recommended to do the following: TFDS_HTTP_PROXY, TFDS_HTTPS_PROXY ... - with recent version of requests, it is not possible to deactivate TLS interception (verify=false) by using env variable. This is useful to debug things and in some case TLS is not working and you need to ignore verifying the SSL certificate (probably not recommended) One of the best way is to able to pass our requests.Session() directly ``` import openai session = requests.Session() session.cert = CERT session.verify = False openai.requestssession = session ``` My 2 cents in this discussion
[ -0.27245229482650757, -0.19546957314014435, 0.02785228192806244, 0.20180106163024902, 0.23760920763015747, -0.28152066469192505, 0.5187767744064331, 0.051726020872592926, -0.04137340188026428, 0.0696803405880928, -0.17300471663475037, 0.11520993709564209, 0.4824944734573364, 0.2368430197238922, 0.14011678099632263, -0.11716116219758987, 0.021192580461502075, -0.11532117426395416, -0.19701352715492249, -0.06042540445923805, -0.28614455461502075, -0.021801698952913284, -0.07357783615589142, 0.08364295959472656, 0.20439063012599945, 0.30180737376213074, -0.33726340532302856, 0.15250557661056519, 0.19398891925811768, 0.09012322872877121, 0.48313790559768677, 0.4099332094192505, 0.2846566438674927, 0.2030458003282547, -0.0001267338520847261, 0.5116857290267944, 0.30449214577674866, -0.13798049092292786, -0.2096988558769226, -0.22088491916656494, -0.7104844450950623, -0.20552918314933777, 0.026250705122947693, -0.25510966777801514, 0.09546758234500885, -0.2790077030658722, 0.03617493063211441, -0.4491976499557495, 0.16519683599472046, 0.32479357719421387, 0.04512343183159828, 0.42649075388908386, -0.05164545401930809, 0.12716138362884521, 0.19994735717773438, -0.13076414167881012, -0.0447714738547802, -0.22362235188484192, 0.16208279132843018, 0.22784492373466492, 0.12192709743976593, 0.15304875373840332, -0.1544209122657776, 0.1385214477777481, 0.4993647038936615, 0.09345243871212006, 0.249823659658432, -0.34550362825393677, 0.20286579430103302, 0.4929274320602417, 0.6590222120285034, -0.24837011098861694, -0.3935455083847046, -0.24130353331565857, -0.04351184144616127, -0.11851856112480164, 0.4041338562965393, 0.18402978777885437, -0.17667852342128754, 0.13615046441555023, -0.10920502245426178, -0.3139092028141022, -0.19698871672153473, 0.28206950426101685, 0.04927776753902435, 0.3451298177242279, 0.056300416588783264, 0.306779146194458, -0.23157942295074463, 0.10250610113143921, 0.33963608741760254, -0.5526624321937561, 0.221211776137352, -0.1055637001991272, -0.4304187595844269, 0.12470906227827072, 0.04139325022697449, -0.01672535389661789, 0.006076887249946594, 0.33310598134994507, -0.23296383023262024, 0.19552233815193176, -0.0689195990562439, 0.27760711312294006, 0.20776686072349548, -0.07787103950977325, 0.012941320426762104, 0.2154783308506012, 0.2968831956386566, 0.18492603302001953, 0.021030105650424957, 0.04369848221540451, 0.16751670837402344, -0.2129235863685608, -0.3320753574371338, -0.05729620158672333, 0.36890071630477905, -0.07479563355445862, -0.20938777923583984, 0.06286706030368805, -0.43366682529449463, -0.3025858402252197, 0.1921519935131073, 0.43816879391670227, -0.3929511308670044, 0.48182785511016846, 0.16324087977409363, 0.143858402967453, -0.2715943157672882, -0.02880091592669487, -0.1065514087677002, -0.09690110385417938, 0.09677273035049438, 0.19922612607479095, -0.037034403532743454, -0.21827508509159088, 0.38802197575569153, 0.0872424840927124, 0.22804278135299683, 0.07638487964868546, 0.22622951865196228, -0.13632383942604065, 0.17496317625045776, 0.2623944878578186, -0.007382594048976898, -0.17632082104682922, -0.09291855990886688, -0.2620662450790405, -0.049960508942604065, 0.10843056440353394, -0.302977055311203, -0.25811147689819336, 0.03649008274078369, 0.013225843198597431, -0.2068396806716919, -0.13434696197509766, -0.11609643697738647, 0.17975667119026184, 0.12228833138942719, 0.27665239572525024, -0.10584738850593567, -0.23960845172405243, -0.29227519035339355, -0.06953223049640656, 0.6279487013816833, 0.3424627482891083, -0.10914822667837143, -0.19937396049499512, 0.12997254729270935, -0.2613287568092346, 0.03869617357850075, -0.00849088653922081, -0.08504453301429749, 0.11778607219457626, -0.13190335035324097, -0.3422006368637085, 0.250468909740448, -0.7325261235237122, -0.4139191210269928, 0.3774857223033905, 0.37787699699401855, -0.00016901642084121704, 0.23789195716381073, -0.04418795555830002, 0.030122525990009308, -0.08656524121761322, -0.10451644659042358, 0.34886160492897034, -0.15051546692848206, 0.09588354825973511, -0.17907792329788208, -0.41071051359176636, 0.009837880730628967, 0.19750872254371643, 0.09761374443769455, 0.35212746262550354, -0.1759461760520935, -0.3390958905220032, 0.32746046781539917, -0.21778634190559387, 0.03593450039625168, 0.03259748965501785, 0.0384463332593441, 0.3517743945121765, 0.14247821271419525, 0.20198892056941986, -0.4765716791152954, 0.09240945428609848, -0.2435644567012787, -0.10373494029045105, 0.004421725869178772, -0.0854848325252533, 0.05507880449295044, -0.06598891317844391, -0.29384633898735046, -0.23394018411636353, -0.07435914129018784, 0.22004444897174835, -0.0861034169793129, -0.20260018110275269, -0.07770123332738876, 0.4080847203731537, -0.09585423767566681, 0.13183529675006866, -0.10875535011291504, 0.2905094027519226, 0.06170143932104111, 0.24660499393939972, 0.04815839231014252, 0.24113410711288452, 0.14518342912197113, -0.08305062353610992, -0.17149785161018372, 0.27671685814857483, -0.11501634120941162, 0.058568257838487625, -0.06948113441467285, -0.007029503583908081, 0.35743170976638794, -0.20849081873893738, 0.14607492089271545, -0.01619011163711548, 0.15911518037319183, 0.12682366371154785, -0.19538885354995728, 0.2786802649497986, 0.43435224890708923, 0.427292138338089, 0.31581199169158936, -0.1357644498348236, 0.1339080035686493, -0.029953449964523315, -0.2433779537677765, -0.07855565845966339, -0.14148537814617157, 0.09395963698625565, 0.45071175694465637, -0.04935175180435181, -0.4080725610256195, 0.16517901420593262, 0.36264386773109436, 0.29432839155197144, -0.07146555185317993, 0.1594463586807251, 0.024696815758943558, -0.019327927380800247, 0.4311600625514984, 0.1977316439151764, 0.3780706524848938, -0.0010197609663009644, -0.13333351910114288, 0.3271302580833435, -0.1318565458059311, -0.22928030788898468, 0.3211265802383423, 0.3069242537021637, -0.1025695726275444, -0.1299540251493454, -0.018365701660513878, 0.029797658324241638, -0.08738221228122711, -0.20623824000358582, -0.02605220302939415, -0.05545627325773239, -0.5837923884391785, 0.17219872772693634, -0.45248180627822876, -0.23028062283992767, 0.12570175528526306, 0.1365944743156433, 0.06916964054107666, -0.3097088932991028, -0.13465000689029694, 0.042805884033441544, -0.20188304781913757, 0.15034633874893188, -0.2555723190307617, 0.008522555232048035, 0.009152963757514954, -0.2478945553302765, -0.18912583589553833, 0.17611892521381378, -0.2527903914451599, -0.14014098048210144, 0.07654035091400146, -0.16505752503871918, 0.18637919425964355, -0.09487677365541458, -0.20813144743442535, -0.3596113920211792, -0.3685682415962219, 0.2881222367286682, 0.10802027583122253, 0.34217074513435364, 0.01599249802529812, -0.02775440737605095, 0.11910223960876465, -0.1596871316432953, 0.3036945164203644, 0.31370383501052856, 0.12527137994766235, -0.0803934633731842, 0.06266386806964874, -0.11927542090415955, -0.20227590203285217, -0.5532417297363281, -0.2434227168560028, -0.2084926962852478, -0.170166477560997, 0.04679008573293686, 0.1967807412147522, 0.15568867325782776, 0.16111429035663605, 0.09683360159397125, 0.03022564947605133, 0.156479611992836, -0.1415010541677475, -0.6714044213294983, 0.28175270557403564, -0.08405712246894836, -0.20880648493766785, -0.209549680352211, -0.10684354603290558, 0.22246530652046204, 0.417253315448761, -0.510482907295227, -0.35862112045288086, -0.16242356598377228, 0.3361651599407196, 0.1999855935573578, 0.19315554201602936, 0.060480616986751556, -0.13959692418575287, 0.0986621081829071, -0.2921231985092163, -0.09138601273298264, 0.21610063314437866, -0.11974619328975677, 0.2790547311306, 0.4241252541542053, 0.5622618198394775, 0.07932540774345398, 0.7194444537162781, 0.2354363203048706, -0.2125699371099472, 0.5997164249420166, -0.12320847809314728, 0.38499191403388977, 0.18649622797966003, -0.20200768113136292, 0.29730290174484253, 0.06814995408058167, 0.38485729694366455, 0.04767952859401703, 0.05346379056572914, -0.012343604117631912, -0.30798959732055664, 0.2990957498550415, -0.05382475629448891, -0.5087143182754517, -0.23806358873844147, -0.29624882340431213, 0.24936306476593018, 0.14817704260349274, 0.39984941482543945, -0.1963406354188919, -0.026755277067422867, 0.058368053287267685, 0.38609981536865234, 0.23466366529464722, -0.05289049074053764, -0.09074417501688004, -0.17112676799297333, -0.5317143201828003, 0.4787760376930237, -0.012668289244174957, 0.6536874771118164, -0.10245387256145477, 0.05126543343067169, 0.10596667230129242, -0.15247884392738342, 0.4345947802066803, -0.23687240481376648, -0.08782067149877548, 0.09187249839305878, -0.13628831505775452, -0.5145530104637146, -0.15144237875938416, 0.018045581877231598, 0.17770272493362427, 0.09782268106937408, 0.18644680082798004, -0.4418388605117798, -0.34177616238594055, 0.14518192410469055, -0.1681574434041977, -0.06684466451406479, -0.24039843678474426, -0.24847860634326935, -0.5245041847229004, -0.2505801320075989, -0.0059631578624248505, -0.27542200684547424, 0.0017828606069087982, -0.29490765929222107, -0.23866036534309387, -0.01869557425379753, 0.15459176898002625, 0.04512748867273331, 0.02947455644607544, -0.09221179783344269, 0.013832081109285355, 0.23747113347053528, 0.046335965394973755, 0.31062763929367065, 0.24639472365379333, 0.40849071741104126, -0.14112116396427155, -0.6639285087585449, 0.0020667053759098053, -0.11861822009086609, 0.13765192031860352, 0.1726943850517273, -0.2914571166038513, -0.07936706393957138, 0.3577694594860077, 0.25024449825286865, -0.034094326198101044, 0.17618556320667267, 0.28578925132751465, 0.1219123974442482, -0.016057655215263367, -0.7894509434700012, 0.3844600319862366, 0.12672753632068634, -0.03602556884288788, 0.35239195823669434, -0.12117882072925568, -0.1727011799812317, -0.050175171345472336, 0.0002297423779964447, 0.6600333452224731, 0.19042208790779114, 0.029116041958332062, 0.5542615652084351, -0.14246498048305511, 0.25306588411331177, -0.40533217787742615, 0.0210869163274765, -0.09575790911912918, -0.2497853934764862, -0.08975961804389954, -0.21113631129264832, 0.29132410883903503, 0.09204348921775818, -0.17590636014938354, 0.39028120040893555, 0.21728579699993134, -0.21109706163406372, 0.30570653080940247, 0.2817816138267517, -0.3644590377807617, -0.29799267649650574, -0.13707348704338074, 0.021863307803869247, 0.14153698086738586, 0.1451428234577179, 0.012134898453950882, -0.1455519199371338, -0.023574575781822205, -0.07071170210838318, -0.07332229614257812, 0.2165631800889969, -0.3411758244037628, 0.08695700764656067, 0.23422880470752716, -0.05740303546190262, 0.3095090389251709, 0.3661577105522156, 0.27439388632774353, -0.016301428899168968, -0.19945374131202698, 0.237996444106102, -0.2110436111688614, 0.45664289593696594, 0.15112358331680298, -0.26440364122390747, 0.3464355766773224, -0.07427575439214706, -0.5764073729515076, -0.056519147008657455, -0.09033448994159698, -0.3403877019882202, -0.1499961018562317, -0.12815748155117035, 0.35054391622543335, -0.054694343358278275, 0.2785198390483856, 0.01527378335595131, -0.13989569246768951, -0.09106940031051636, -0.012841570191085339, 0.05200233682990074, -0.032434262335300446, 0.39908289909362793, -0.18929915130138397, -0.3632791340351105, 0.0858408734202385, 0.41476166248321533, -0.09239788353443146, 0.42324191331863403, 0.4624119699001312, -0.033674485981464386, -0.053950197994709015, 0.02020401507616043, -0.1573803424835205, -0.5128939151763916, 0.10266231745481491, -0.06294804811477661, 0.02811932936310768, -0.0789501741528511, -0.42502930760383606, -0.24659118056297302, -0.4429110288619995, -0.22646014392375946, 0.07159626483917236, -0.331062376499176, -0.19211478531360626, -0.04144470393657684, -0.3171220123767853, -0.03729705512523651, 0.19589941203594208, 0.2453898787498474, 0.3009677827358246, -0.07200121879577637, -0.11692140251398087, -0.09809089452028275, 0.07110363245010376, 0.11153363436460495, 0.3116377592086792, 0.1209360733628273, 0.1522892713546753, -0.04694905877113342, -0.08307474851608276, -0.20656457543373108, -0.31337088346481323, -0.020401597023010254, -0.31113705039024353, 0.23698952794075012, 0.13756535947322845, -0.37455660104751587, -0.0014117024838924408, -0.17386256158351898, -0.2228085994720459, -0.2032104730606079, 0.4815475344657898, 0.05486885458230972, -0.22905820608139038, 0.09973039478063583, -0.2521544098854065, 0.14383564889431, -0.22613471746444702, 0.05651584640145302, 0.1012592613697052, 0.36659732460975647, 0.03367646411061287, 0.3596484065055847, -0.1593848615884781, -0.05831918865442276, -0.1925879418849945, -0.03919679671525955, 0.2312552034854889, 0.1902475506067276, 0.4676060080528259, -0.028024185448884964, 0.06502623856067657, 0.08765392750501633, -0.13342425227165222, 0.358951598405838, 0.02576945722103119, 0.11699247360229492, 0.18741458654403687, 0.051296256482601166, -0.08198313415050507, 0.06088585406541824, 0.4677402377128601, -0.031395040452480316, 0.06743411719799042, 0.01947500929236412, 0.22552023828029633, -0.018636450171470642, 0.2702867388725281, -0.03815872222185135, 0.275606244802475, -0.35104191303253174, 0.23036614060401917, 0.18840014934539795, -0.12286870181560516, 0.4574934244155884, 0.10829059779644012, -0.11176523566246033, -0.1082937940955162, 0.3956204652786255, 0.22131717205047607, 0.22909924387931824, 0.138274684548378, 0.14594919979572296, 0.07733575999736786, -0.5741907358169556, -0.022104904055595398, -0.08001966774463654, -0.27308323979377747, 0.1954846978187561, -0.035597119480371475, 0.372688889503479, 0.006074775010347366, 0.14213211834430695, -0.26954561471939087, 0.2674015760421753, 0.014619642868638039, -0.5388492941856384, -0.301096111536026, -0.0355948731303215, -0.046993695199489594, -0.005614712834358215, 0.10358880460262299, -0.28326135873794556, 0.14933259785175323, 0.1383248120546341, -0.18418514728546143, -0.42764317989349365, 0.20119115710258484, 0.02352343499660492, 0.09323267638683319, 0.015939265489578247, 0.3598331809043884, 0.045096613466739655, -0.18238523602485657, 0.1331668347120285, 0.13631291687488556, 0.19097955524921417, 0.20849867165088654, -0.040414080023765564, -0.11666887253522873, 0.3098433017730713, 0.10907105356454849, -0.35446199774742126, 0.05539499595761299, -0.10106752812862396, -0.15115192532539368, 0.2807210087776184, -0.025012267753481865, 0.011280223727226257, 0.022755149751901627, 0.07624873518943787, 0.35313576459884644, -0.47723788022994995, 0.4668019413948059, 0.08751431107521057, 0.08553767949342728, 0.24806581437587738, -0.1685403287410736, -0.3901148736476898, 0.1895999014377594, 0.628042995929718, -0.1581011414527893, 0.2700798809528351, -0.24490338563919067, -0.018966302275657654, -0.12816894054412842, 0.2047208547592163, 0.1627493053674698, -0.07339935749769211, -0.14932183921337128, 0.347146213054657, -0.43614745140075684, -0.08644793927669525, 0.34819164872169495, -0.26294761896133423, 0.02932128682732582, 0.3882408142089844, 0.041862521320581436, 0.014355411753058434, 0.11232788860797882, -0.1896982043981552, 0.6637829542160034, -0.01219826191663742, -0.25378504395484924, -0.08545602858066559, -0.40885767340660095, 0.4042656719684601, 0.22141779959201813, -0.5210460424423218, 0.09702320396900177, 0.05036264285445213, -0.13420575857162476, -0.04654669016599655, -0.1539941430091858, 0.3675728440284729, -0.31422531604766846, 0.5347768068313599, 0.12436956912279129, 0.3241029977798462, -0.11065632849931717, 0.0019967854022979736, -0.23991861939430237, -0.03880111500620842, -0.2147085964679718, -0.00387483648955822, -0.2818673849105835, -0.06604516506195068, -0.23708482086658478, -0.00852150283753872, -0.3261285424232483, 0.2553127706050873, 0.08997006714344025, -0.27140602469444275, 0.011230692267417908, 0.18325483798980713, -0.12045738101005554, 0.03272312879562378, -0.10485243797302246, 0.1878633350133896, -0.2217906415462494, 0.17287641763687134, -0.11919263005256653, -0.22197464108467102, 0.4252485930919647, -0.24812233448028564, -0.01699814572930336, -0.4982700049877167, 0.2434447705745697, -0.10776464641094208, 0.23243027925491333, -0.07080378383398056, 0.10607953369617462, 0.33719319105148315, -0.20290881395339966, -0.19927483797073364, 0.07470490038394928, 0.35402506589889526, 0.18083307147026062, -0.266920804977417, 0.08758407086133957, -0.05255754292011261, -0.35329192876815796, 0.06869900971651077, -0.1710582971572876 ]
https://github.com/huggingface/datasets/issues/6025
I've opened a PR with a fix. In the meantime, you can avoid the error by deleting `task_templates` with `dataset.info.task_templates = None` before the `interleave_datasets` call. `
Using a dataset for a use other than it was intended for.
### Describe the bug Hi, I want to use the rotten tomatoes dataset but for a task other than classification, but when I interleave the dataset, it throws ```'ValueError: Column label is not present in features.'```. It seems that the label_col must be there in the dataset for some reason? Here is the full stacktrace ``` File "/home/suryahari/Vornoi/tryage-handoff-other-datasets.py", line 276, in create_dataloaders dataset = interleave_datasets(dsfold, stopping_strategy="all_exhausted") File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/combine.py", line 134, in interleave_datasets return _interleave_iterable_datasets( File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1833, in _interleave_iterable_datasets info = DatasetInfo.from_merge([d.info for d in datasets]) File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 275, in from_merge dataset_infos = [dset_info.copy() for dset_info in dataset_infos if dset_info is not None] File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 275, in <listcomp> dataset_infos = [dset_info.copy() for dset_info in dataset_infos if dset_info is not None] File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 378, in copy return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()}) File "<string>", line 20, in __init__ File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 208, in __post_init__ self.task_templates = [ File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 209, in <listcomp> template.align_with_features(self.features) for template in (self.task_templates) File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/tasks/text_classification.py", line 20, in align_with_features raise ValueError(f"Column {self.label_column} is not present in features.") ValueError: Column label is not present in features. ``` ### Steps to reproduce the bug Delete the column `labels` from the `rotten_tomatoes` dataset. Try to interleave it with other datasets. ### Expected behavior Should let me use the dataset with just the `text` field ### Environment info latest datasets library? I don't think this was an issue in earlier versions.
27
Using a dataset for a use other than it was intended for. ### Describe the bug Hi, I want to use the rotten tomatoes dataset but for a task other than classification, but when I interleave the dataset, it throws ```'ValueError: Column label is not present in features.'```. It seems that the label_col must be there in the dataset for some reason? Here is the full stacktrace ``` File "/home/suryahari/Vornoi/tryage-handoff-other-datasets.py", line 276, in create_dataloaders dataset = interleave_datasets(dsfold, stopping_strategy="all_exhausted") File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/combine.py", line 134, in interleave_datasets return _interleave_iterable_datasets( File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 1833, in _interleave_iterable_datasets info = DatasetInfo.from_merge([d.info for d in datasets]) File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 275, in from_merge dataset_infos = [dset_info.copy() for dset_info in dataset_infos if dset_info is not None] File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 275, in <listcomp> dataset_infos = [dset_info.copy() for dset_info in dataset_infos if dset_info is not None] File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 378, in copy return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()}) File "<string>", line 20, in __init__ File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 208, in __post_init__ self.task_templates = [ File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/info.py", line 209, in <listcomp> template.align_with_features(self.features) for template in (self.task_templates) File "/home/suryahari/miniconda3/envs/vornoi/lib/python3.10/site-packages/datasets/tasks/text_classification.py", line 20, in align_with_features raise ValueError(f"Column {self.label_column} is not present in features.") ValueError: Column label is not present in features. ``` ### Steps to reproduce the bug Delete the column `labels` from the `rotten_tomatoes` dataset. Try to interleave it with other datasets. ### Expected behavior Should let me use the dataset with just the `text` field ### Environment info latest datasets library? I don't think this was an issue in earlier versions. I've opened a PR with a fix. In the meantime, you can avoid the error by deleting `task_templates` with `dataset.info.task_templates = None` before the `interleave_datasets` call. `
[ 0.04401043802499771, 0.10518953204154968, 0.042100902646780014, 0.2711704671382904, 0.41534680128097534, 0.40644603967666626, 0.6712472438812256, 0.12305937707424164, 0.37308967113494873, 0.13794034719467163, -0.25589993596076965, 0.2542686462402344, 0.011830978095531464, 0.3167995810508728, -0.3498857319355011, 0.020823609083890915, 0.016965191811323166, 0.14395540952682495, -0.06068915128707886, 0.04548212140798569, -0.2876318395137787, -0.123499296605587, -0.35584738850593567, 0.20018647611141205, -0.661788821220398, -0.100490041077137, -0.016378946602344513, 0.09171103686094284, 0.13154712319374084, -0.17407821118831635, 0.4844241440296173, -0.14224041998386383, 0.22268033027648926, 0.32104331254959106, -0.00012183876242488623, 0.032930053770542145, 0.24094343185424805, -0.04504917562007904, -0.28768420219421387, -0.2766338884830475, -0.503639817237854, -0.04418959468603134, -0.07436402142047882, -0.34067559242248535, -0.24817995727062225, -0.030698135495185852, -0.32722795009613037, -0.7566548585891724, -0.2404480278491974, 0.1526910811662674, 0.13557851314544678, 0.38393324613571167, 0.18011410534381866, 0.021200168877840042, 0.5015771985054016, -0.012613967061042786, -0.10238190740346909, 0.3241109549999237, 0.23889966309070587, -0.25997334718704224, 0.38316917419433594, 0.31916704773902893, 0.034860990941524506, -0.0991353839635849, 0.2731498181819916, 0.25397056341171265, 0.07990715652704239, -0.20858556032180786, -0.015952521935105324, 0.23780164122581482, 0.7662014365196228, -0.2495792806148529, -0.28045737743377686, 0.05408430099487305, 0.02884199097752571, -0.6597927808761597, -0.05866255983710289, 0.1752793788909912, 0.26465579867362976, 0.3557569980621338, 0.15843428671360016, 0.2564586102962494, -0.20144668221473694, 0.1304321140050888, 0.12718243896961212, 0.33619260787963867, -0.0645281970500946, 0.3016454577445984, 0.17348310351371765, -0.11086505651473999, 0.05997711420059204, 0.205101877450943, 0.04088950902223587, -0.09671030938625336, -0.6146910190582275, -0.28925055265426636, -0.28795498609542847, -0.11643728613853455, -0.1440121829509735, 0.3623347580432892, -0.18436507880687714, -0.27182647585868835, 0.16540642082691193, 0.23208333551883698, 0.653647780418396, 0.1366954892873764, 0.05267120152711868, 0.5237640142440796, 0.30053457617759705, -0.026276465505361557, -0.10655324161052704, -0.18314872682094574, -0.015016768127679825, 0.03138852119445801, 0.43389052152633667, -0.05339903011918068, 0.3382677435874939, -0.19974809885025024, -0.5414414405822754, -0.07040770351886749, -0.23420333862304688, -0.08410236984491348, 0.0713898092508316, 0.2518119513988495, 0.08889724314212799, 0.062219247221946716, -0.13345348834991455, 0.3533192574977875, 0.17706316709518433, -0.4673299193382263, -0.13975319266319275, 0.34265732765197754, -0.14757420122623444, -0.030711740255355835, -0.08433625847101212, 0.10339145362377167, 0.10778148472309113, -0.13288643956184387, 0.1662968397140503, -0.28917568922042847, 0.03505092114210129, -0.2898827791213989, -0.08011069893836975, 0.10466615855693817, 0.00789080560207367, -0.07101122289896011, 0.4569506347179413, -0.3044419586658478, -0.2329840213060379, 0.1600433588027954, -0.2848937511444092, -0.35782063007354736, -0.3092759847640991, 0.051296308636665344, 0.009021833539009094, -0.15174317359924316, 0.011268753558397293, -0.23701807856559753, 0.33037588000297546, -0.17147795855998993, 0.15936243534088135, -0.039960071444511414, 0.075422003865242, -0.21146276593208313, -0.07834134995937347, 0.34674984216690063, -0.6978252530097961, -0.05010928586125374, -0.07157619297504425, 0.1819557547569275, 0.3522033989429474, 0.44257503747940063, -0.0995270162820816, 0.10688155144453049, 0.0656086727976799, -0.1277562379837036, 0.18025025725364685, -0.4821668267250061, -0.3024865388870239, 0.19611956179141998, -0.12681853771209717, 0.16918569803237915, -0.015352077782154083, 0.6423233151435852, 0.003653537482023239, -0.10907014459371567, 0.08774721622467041, 0.3234444260597229, -0.10187452286481857, -0.1880023330450058, -0.0984279066324234, -0.025693580508232117, 0.517749547958374, 0.16467782855033875, -0.11487890779972076, 0.5107843279838562, 0.0405624583363533, -0.3274650275707245, -0.044260989874601364, -0.027749598026275635, 0.26483458280563354, -0.01598242297768593, 0.5597977638244629, 0.49324193596839905, -0.1982755959033966, -0.01032799482345581, -0.12293276190757751, 0.20499591529369354, 0.34300878643989563, 0.054382141679525375, 0.042876437306404114, -0.5026021599769592, -0.41421204805374146, 0.09237882494926453, -0.13874319195747375, -0.2860714793205261, -0.05436407029628754, -0.043166570365428925, 0.023414626717567444, -0.12956520915031433, -0.27661651372909546, 0.24028953909873962, -0.20993563532829285, 0.058780062943696976, -0.2590232491493225, 0.41837888956069946, -0.12292097508907318, 0.04940987005829811, -0.1336362063884735, 0.349962055683136, 0.15109887719154358, -0.005901459604501724, -0.034160636365413666, 0.5960913300514221, -0.01142306812107563, -0.08123984932899475, 0.20197919011116028, -0.0019852668046951294, 0.14132140576839447, -0.46262434124946594, 0.0032236631959676743, -0.09939375519752502, 0.2855195999145508, -0.014605402946472168, 0.12271860241889954, 0.3983133137226105, -0.0458538793027401, 0.38809651136398315, 0.015482783317565918, 0.20489372313022614, 0.08946748822927475, -0.23060528934001923, -0.1419025957584381, -0.1568860113620758, -0.09549549221992493, -0.714324414730072, 0.1375282108783722, 0.03403607755899429, -0.2558378577232361, 0.023991700261831284, 0.2837795317173004, 0.026783928275108337, 0.1553095281124115, -0.00147520552854985, 0.047474801540374756, 0.1129881963133812, -0.04689180850982666, -0.15556153655052185, 0.4867258369922638, 0.07142399996519089, -0.16630204021930695, -0.11998987942934036, 0.001778874546289444, -0.031040959060192108, 0.009351443499326706, 0.1576509028673172, 0.2840611934661865, -0.04939777031540871, 0.0023600533604621887, 0.024321872740983963, 0.3034091591835022, -0.3861406743526459, -0.1412539780139923, 0.15394183993339539, -0.26477187871932983, 0.27675750851631165, -0.44507449865341187, -0.12929221987724304, 0.02610088884830475, -0.4858854115009308, 0.036934494972229004, -0.32612234354019165, -0.15583232045173645, 0.13329613208770752, -0.10089542716741562, 0.23585765063762665, -0.4746624827384949, 0.2773187756538391, -0.023444272577762604, -0.04378434270620346, 0.029926948249340057, -0.560240626335144, -0.12996430695056915, 0.005948200821876526, -0.1673308163881302, -0.03215795010328293, 0.27835920453071594, 0.06494140625, -0.14357557892799377, -0.2678665816783905, -0.0902308002114296, 0.07828626036643982, -0.055550143122673035, 0.40073737502098083, -0.04279416799545288, -0.06756362318992615, 0.05591706931591034, -0.18760442733764648, 0.30627062916755676, -0.12860697507858276, 0.10834451764822006, 0.031028717756271362, -0.0355752594769001, -0.11221414059400558, 0.18832185864448547, -0.4446548819541931, -0.41180890798568726, -0.35566946864128113, -0.09572331607341766, -0.18850012123584747, -0.16308768093585968, -0.12817183136940002, -0.025917265564203262, -0.02909589558839798, 0.5508633255958557, 0.06375711411237717, -0.3401746153831482, -0.14845699071884155, 0.1314810961484909, -0.14197063446044922, -0.1443614512681961, 0.07048512995243073, -0.20753954350948334, 0.18826444447040558, -0.007417548447847366, -0.36864715814590454, 0.27647268772125244, -0.15541085600852966, 0.02214425802230835, 0.07254794239997864, 0.03795039653778076, 0.2246190309524536, -0.21230043470859528, 0.018214158713817596, -0.04120960086584091, -0.3212514817714691, 0.27002793550491333, 0.17193102836608887, 0.1958225965499878, 0.3606860935688019, 0.3412970304489136, -0.18323378264904022, 0.5946176052093506, -0.002985455095767975, -0.05180484801530838, 0.39276713132858276, -0.2788998782634735, 0.4324166178703308, -0.0564272440969944, -0.41013243794441223, -0.02237418107688427, -0.03952682018280029, -0.1768544316291809, -0.028584200888872147, -0.21576574444770813, -0.08627279102802277, -0.3393990993499756, 0.1327345073223114, -0.2601301074028015, -0.039210245013237, -0.10602554678916931, 0.1455312967300415, 0.21206603944301605, 0.16147547960281372, -0.14968448877334595, 0.113487608730793, -0.16911806166172028, -0.13483159244060516, 0.15330639481544495, 0.18045079708099365, 0.023663636296987534, -0.12545146048069, -0.32914817333221436, 0.0034790635108947754, 0.21904772520065308, 0.13721652328968048, 0.3767007887363434, -0.06215745210647583, -0.34186625480651855, -0.08981923758983612, 0.24476200342178345, 0.6368929743766785, -0.21192511916160583, -0.13368967175483704, 0.15053768455982208, 0.17754441499710083, -0.006968021392822266, -0.14644663035869598, -0.17515426874160767, -0.20341689884662628, 0.32910653948783875, 0.15747979283332825, -0.1066882461309433, 0.1893308162689209, 0.6644371747970581, -0.02921050414443016, -0.154260516166687, -0.24198725819587708, -0.3711628317832947, -0.06277495622634888, -0.35053613781929016, 0.0796690508723259, 0.136042058467865, 0.23515424132347107, -0.07794160395860672, 0.21388313174247742, -0.22495850920677185, -0.08895367383956909, 0.23750129342079163, 0.22241632640361786, 0.19806233048439026, -0.1795734167098999, 0.314362108707428, -0.05247359722852707, 0.08026756346225739, 0.43579810857772827, 0.88615483045578, -0.06783394515514374, -0.6140265464782715, 0.19874253869056702, -0.25425055623054504, 0.6224567890167236, 0.16529271006584167, -0.022883925586938858, 0.05998874455690384, -0.32513970136642456, -0.08989910781383514, -0.06066002696752548, -0.18320629000663757, 0.17978790402412415, -0.0051244087517261505, -0.4724995493888855, -0.2290758192539215, 0.26921749114990234, 0.10846760123968124, -0.0177023783326149, 0.1297268271446228, 0.4492909610271454, -0.080286905169487, 0.1867709457874298, 0.04448552802205086, 1.102872610092163, 0.14820997416973114, 0.18303829431533813, 0.010874200612306595, 0.11790664494037628, 0.5575271248817444, -0.07359346747398376, 0.12785673141479492, -0.3054770231246948, -0.6951586008071899, -0.10694968700408936, -0.10505616664886475, 0.25485581159591675, 0.1519823968410492, -0.1885683238506317, 0.5362848043441772, -0.4471225142478943, 0.3815136253833771, 0.10670171678066254, -0.25351911783218384, 0.34704136848449707, -0.17950662970542908, 0.10424527525901794, -0.016497857868671417, -0.053394947201013565, 0.28861895203590393, -0.09739089012145996, 0.2798989415168762, -0.22777396440505981, -0.030985470861196518, -0.29224640130996704, 0.16677220165729523, 0.2921343743801117, 0.2637442648410797, 0.21869277954101562, -0.030932821333408356, 0.20429211854934692, 0.04966101795434952, 0.4926132261753082, 0.12639230489730835, 0.1157199814915657, -0.0005623269826173782, 0.3454589247703552, 0.019751600921154022, 0.01703544706106186, 0.28449463844299316, 0.34699735045433044, 0.009749971330165863, -0.4670303463935852, 0.3913511335849762, 0.16225191950798035, -0.3622143268585205, -0.1690194308757782, 0.04121144115924835, 0.11526129394769669, -0.38520777225494385, -0.3996706008911133, 0.08469448983669281, 0.03690172731876373, -0.5198538303375244, 0.024296890944242477, -0.019783861935138702, -0.143584206700325, -0.023726075887680054, -0.14922553300857544, -0.4050736129283905, -0.23071792721748352, -0.0023803450167179108, 0.1560898870229721, 0.2131035327911377, 0.1841781735420227, -0.06302947551012039, -0.10093806684017181, -0.14811380207538605, 0.18790163099765778, 0.07369495928287506, -0.22133135795593262, 0.19747722148895264, 0.011341672390699387, 0.13985346257686615, -0.23311761021614075, 0.13546094298362732, 0.17860107123851776, 0.16222277283668518, -0.061368681490421295, -0.6186673641204834, -0.08032339066267014, 0.22995193302631378, 0.29322683811187744, 0.16081690788269043, -0.2238270342350006, 0.29688626527786255, -0.30188077688217163, 0.15832258760929108, -0.20315518975257874, -0.17174875736236572, -0.3435544967651367, 0.1294378638267517, 0.6164478659629822, 0.13897620141506195, 0.09569517523050308, -0.0354880690574646, 0.04650568217039108, 0.15898482501506805, 0.25544843077659607, -0.06333048641681671, -0.35704559087753296, 0.19367754459381104, -0.0692882239818573, -0.10350827872753143, -0.2464103400707245, -0.2805342972278595, -0.19626109302043915, -0.1292906105518341, 0.06381341814994812, 0.15009519457817078, 0.052280258387327194, 0.32885006070137024, -0.3382183313369751, -0.05566456541419029, -0.21753408014774323, 0.2487839311361313, -0.010340094566345215, 0.03529652580618858, 0.09483848512172699, 0.11366540193557739, 0.13883814215660095, -0.04012424498796463, -0.19841760396957397, -0.13606397807598114, -0.08870090544223785, 0.02777523174881935, 0.2256617248058319, -0.27631717920303345, 0.2579174339771271, 0.22518110275268555, 0.2325570285320282, 0.24777795374393463, 0.00328252837061882, 0.01438692957162857, 0.14632482826709747, 0.07575520128011703, -0.44529294967651367, -0.08059823513031006, 0.0326756127178669, -0.07795404642820358, 0.05449366569519043, 0.5507081747055054, 0.06692744046449661, 0.37928128242492676, -0.1078115850687027, -0.03358626365661621, 0.2572818696498871, -0.2698357403278351, 0.07392250001430511, 0.09019915014505386, -0.041400596499443054, 0.17399738729000092, 0.3011420965194702, 0.32042160630226135, 0.10260799527168274, 0.2610161304473877, -0.13378797471523285, 0.23033329844474792, 0.08206108957529068, 0.046980492770671844, -0.16432607173919678, -0.26175612211227417, 0.3236064016819, 0.28219589591026306, -0.3251340985298157, 0.06239189952611923, -0.1776520013809204, 0.11584917455911636, -0.4201521873474121, 0.04089698940515518, 0.05607367306947708, -0.12294138967990875, -0.053964558988809586, -0.07631239295005798, -0.001805141568183899, -0.17185690999031067, -0.20694813132286072, -0.09162776917219162, 0.12939484417438507, 0.013349128887057304, 0.031129617244005203, -0.21559759974479675, 0.04697254300117493, -0.4325760304927826, 0.09968822449445724, 0.20989859104156494, 0.26943373680114746, -0.18481233716011047, -0.02820366993546486, 0.09886052459478378, 0.03220745921134949, 0.43952271342277527, -0.04141414165496826, 0.37849298119544983, 0.2007092982530594, 0.11293993890285492, -0.08431930840015411, -0.1697196215391159, -0.37846601009368896, 0.10190770775079727, 0.38522326946258545, 0.1558806598186493, -0.21332979202270508, 0.22428558766841888, 0.052708953619003296, -0.08511722832918167, 0.2900669276714325, 0.13307082653045654, 0.6639923453330994, -0.5651229619979858, 0.20628784596920013, -0.07150918245315552, -0.37760841846466064, 0.08810584247112274, -0.03488803654909134, -0.15817755460739136, -0.16944000124931335, 0.13177570700645447, -0.12360550463199615, 0.11808989942073822, 0.0982016921043396, 0.032951489090919495, -0.1463862508535385, 0.23346742987632751, 0.48646655678749084, -0.21304330229759216, -0.3305496573448181, 0.10722622275352478, -0.48349982500076294, 0.23487862944602966, -0.29494619369506836, -0.5651180744171143, 0.013128634542226791, 0.14411544799804688, 0.14568495750427246, 0.2941480875015259, 0.12322112917900085, -0.14194083213806152, -0.09759722650051117, -0.1576184779405594, -0.26309365034103394, -0.42154648900032043, -0.14443501830101013, 0.07138614356517792, 0.10129016637802124, -0.27599623799324036, -0.10281552374362946, 0.2894892990589142, -0.12729036808013916, -0.11618245393037796, -0.2169494926929474, 0.15023335814476013, -0.019646845757961273, 0.09078742563724518, 0.04965214431285858, 0.7384722232818604, -0.022326882928609848, 0.06031881272792816, 0.06940507143735886, -0.38704848289489746, -0.2735752463340759, -0.009469268843531609, 0.2247496247291565, 0.23647120594978333, -0.22787290811538696, -0.023609071969985962, -0.26721638441085815, 0.4708016812801361, 0.18833881616592407, 0.02416393905878067, -0.22946450114250183, 0.12214897572994232, -0.030230723321437836, -0.09914443641901016, 0.14778628945350647, 0.10033300518989563, 0.027193894609808922, 0.28302085399627686, -0.014458850026130676, -0.300782710313797, 0.5963171124458313, 0.029269546270370483, -0.4251510798931122, -0.11749379336833954, 0.05348316207528114, 0.3938157260417938, -0.08028669655323029, -0.11950616538524628, 0.11026462912559509, 0.3152061104774475, 0.031075939536094666, -0.010120861232280731, 0.1614072322845459, -0.39913395047187805, 0.17303398251533508, 0.08592714369297028, 0.21521395444869995, -0.06493514776229858, -0.07357519865036011, 0.1911373734474182, -0.16094310581684113 ]
https://github.com/huggingface/datasets/issues/6020
This scenario currently requires explicitly passing the target features (to avoid the error): ```python import datasets ... features = dataset.features features["output"] = = [{"test": datasets.Value("int64")}] test2 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=32, features=features) ```
Inconsistent "The features can't be aligned" error when combining map, multiprocessing, and variable length outputs
### Describe the bug I'm using a dataset with map and multiprocessing to run a function that returned a variable length list of outputs. This output list may be empty. Normally this is handled fine, but there is an edge case that crops up when using multiprocessing. In some cases, an empty list result ends up in a dataset shard consisting of a single item. This results in a `The features can't be aligned` error that is difficult to debug because it depends on the number of processes/shards used. I've reproduced a minimal example below. My current workaround is to fill empty results with a dummy value that I filter after, but this was a weird error that took a while to track down. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_list([{'idx':i} for i in range(60)]) def test_func(row, idx): if idx==58: return {'output': []} else: return {'output' : [{'test':1}, {'test':2}]} # this works fine test1 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=4) # this fails test2 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=32) >ValueError: The features can't be aligned because the key output of features {'idx': Value(dtype='int64', id=None), 'output': Sequence(feature=Value(dtype='null', id=None), length=-1, id=None)} has unexpected type - Sequence(feature=Value(dtype='null', id=None), length=-1, id=None) (expected either [{'test': Value(dtype='int64', id=None)}] or Value("null"). ``` The error occurs during the check ```python _check_if_features_can_be_aligned([dset.features for dset in dsets]) ``` When the multiprocessing splitting lines up just right with the empty return value, one of the `dset` in `dsets` will have a single item with an empty list value, causing the error. ### Expected behavior Expected behavior is the result would be the same regardless of the `num_proc` value used. ### Environment info Datasets version 2.11.0 Python 3.9.16
36
Inconsistent "The features can't be aligned" error when combining map, multiprocessing, and variable length outputs ### Describe the bug I'm using a dataset with map and multiprocessing to run a function that returned a variable length list of outputs. This output list may be empty. Normally this is handled fine, but there is an edge case that crops up when using multiprocessing. In some cases, an empty list result ends up in a dataset shard consisting of a single item. This results in a `The features can't be aligned` error that is difficult to debug because it depends on the number of processes/shards used. I've reproduced a minimal example below. My current workaround is to fill empty results with a dummy value that I filter after, but this was a weird error that took a while to track down. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_list([{'idx':i} for i in range(60)]) def test_func(row, idx): if idx==58: return {'output': []} else: return {'output' : [{'test':1}, {'test':2}]} # this works fine test1 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=4) # this fails test2 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=32) >ValueError: The features can't be aligned because the key output of features {'idx': Value(dtype='int64', id=None), 'output': Sequence(feature=Value(dtype='null', id=None), length=-1, id=None)} has unexpected type - Sequence(feature=Value(dtype='null', id=None), length=-1, id=None) (expected either [{'test': Value(dtype='int64', id=None)}] or Value("null"). ``` The error occurs during the check ```python _check_if_features_can_be_aligned([dset.features for dset in dsets]) ``` When the multiprocessing splitting lines up just right with the empty return value, one of the `dset` in `dsets` will have a single item with an empty list value, causing the error. ### Expected behavior Expected behavior is the result would be the same regardless of the `num_proc` value used. ### Environment info Datasets version 2.11.0 Python 3.9.16 This scenario currently requires explicitly passing the target features (to avoid the error): ```python import datasets ... features = dataset.features features["output"] = = [{"test": datasets.Value("int64")}] test2 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=32, features=features) ```
[ -0.22299067676067352, -0.33570733666419983, -0.059271086007356644, 0.18832027912139893, 0.16204114258289337, -0.18797782063484192, 0.49852344393730164, 0.06349801272153854, -0.009108811616897583, 0.079771026968956, 0.35652121901512146, 0.23856398463249207, -0.0017629396170377731, 0.2790445387363434, -0.43523722887039185, -0.20278701186180115, 0.2810540199279785, 0.05386688560247421, 0.12135083973407745, 0.14021971821784973, -0.17497283220291138, 0.11300484091043472, -0.3761160969734192, -0.1721738874912262, -0.5670258402824402, -0.11216975748538971, -0.23887786269187927, -0.256031334400177, 0.2995084822177887, -0.06917333602905273, 0.06811819225549698, -0.15275967121124268, -0.5374452471733093, 0.6407015323638916, -0.00011376521433703601, 0.07682327926158905, 0.3734560012817383, -0.13790282607078552, 0.019297949969768524, -0.29468148946762085, -0.418294757604599, -0.26676878333091736, -0.20658674836158752, -0.13904957473278046, 0.19874517619609833, 0.12161609530448914, -0.07986012101173401, -0.4875124394893646, 0.08307997137308121, -0.008404884487390518, 0.12355820834636688, 0.34666502475738525, 0.022192224860191345, -0.0906796008348465, 0.07586421817541122, 0.17080503702163696, -0.08473308384418488, -0.5547665953636169, 0.24418604373931885, -0.05079101771116257, -0.06619253009557724, 0.23813223838806152, -0.22431506216526031, 0.12136787176132202, 0.0045209419913589954, 0.0963769406080246, 0.06903408467769623, -0.39643245935440063, 0.043795160949230194, 0.3107234239578247, -0.12854723632335663, 0.25727227330207825, -0.3534407615661621, -0.5165060758590698, -0.21679547429084778, -0.3907674252986908, 0.19331490993499756, 0.16102981567382812, 0.05901779606938362, 0.014156116172671318, -0.5104671120643616, 0.2494116574525833, 0.23792031407356262, 0.0721585750579834, -0.23978959023952484, 0.2105511724948883, 0.10950065404176712, 0.2537109851837158, -0.26253917813301086, -0.1311677098274231, -0.2244645059108734, -0.19224011898040771, -0.06528577208518982, 0.03294622153043747, -0.2883271872997284, 0.18409442901611328, 0.3330995440483093, -0.23001983761787415, 0.046819888055324554, -0.1408209204673767, -0.11975141614675522, -0.11533191800117493, -0.022935926914215088, 0.2444480061531067, 0.35569027066230774, -0.18856404721736908, 0.10692203789949417, 0.011736605316400528, -0.1619013249874115, -0.08393970131874084, -0.10531416535377502, 0.02951379120349884, 0.6747017502784729, -0.16818378865718842, 0.08893230557441711, 0.20808982849121094, 0.15993867814540863, 0.08845203369855881, -0.13685905933380127, 0.20656421780586243, -0.2584870457649231, 0.07313671708106995, -0.18921712040901184, -0.16082637012004852, 0.011982861906290054, 0.7013280391693115, -0.0019403770565986633, 0.31043627858161926, -0.10293281823396683, -0.20688311755657196, -0.06463303416967392, -0.20995722711086273, -0.2350088655948639, 0.01942380890250206, -0.028833400458097458, 0.27350687980651855, -0.08062456548213959, 0.2647637724876404, 0.1306747943162918, -0.20182867348194122, -0.310744047164917, -0.4364767074584961, 0.3431088924407959, 0.2545245289802551, 0.16337920725345612, 0.12272724509239197, -0.1259988248348236, -0.12585629522800446, -0.13999123871326447, 0.1527412384748459, -0.08251357078552246, -0.30006515979766846, 0.027473198249936104, 0.15905505418777466, -0.17073550820350647, 0.3777073323726654, -0.07928189635276794, 0.2464171051979065, 0.4465138018131256, 0.045063212513923645, -0.20587697625160217, -0.3635424077510834, -0.23451867699623108, -0.30466428399086, -0.04241255298256874, 0.34005993604660034, -0.037531573325395584, 0.20705586671829224, -0.11760357022285461, 0.2178577482700348, 0.026919307187199593, 0.24835669994354248, 0.1998291015625, 0.11536956578493118, -0.202060267329216, 0.4812271296977997, -0.13076411187648773, -0.049625419080257416, -0.11198224127292633, 0.45217764377593994, -0.10326547175645828, 0.4211059510707855, -0.07274051755666733, 0.07164997607469559, 0.30675095319747925, -0.013406101614236832, 0.4197026193141937, 0.29282042384147644, -0.3078550696372986, 0.11201149225234985, -0.32808876037597656, -0.04415199160575867, 0.09981101006269455, -0.13768157362937927, 0.02064381167292595, -0.0618930421769619, -0.06821928918361664, -0.3056448698043823, 0.2685619294643402, -0.05162140727043152, 0.19501793384552002, 0.12375406920909882, 0.15923210978507996, 0.2065795361995697, -0.19966235756874084, -0.19634519517421722, -0.8078374862670898, 0.2682742774486542, 0.05970489978790283, -0.09627139568328857, -0.1542108803987503, -0.19230365753173828, 0.1854955404996872, 0.2461569607257843, -0.1475830227136612, 0.08708395063877106, 0.09863574057817459, 0.028730832040309906, -0.16993746161460876, -0.23100370168685913, 0.10615071654319763, 0.24391016364097595, 0.27360042929649353, -0.2024354338645935, -0.13996927440166473, 0.3352665901184082, 0.00918499380350113, -0.11076218634843826, -0.10933776199817657, 0.07953693717718124, 0.26453736424446106, 0.17666679620742798, 0.0319313108921051, 0.39697206020355225, 0.20989151298999786, -0.016878698021173477, -0.22258293628692627, 0.13263635337352753, 0.1822023242712021, 0.11132965981960297, -0.13414503633975983, 0.2157527655363083, -0.0004536733031272888, -0.2651761770248413, -0.00842411071062088, 0.3510091006755829, 0.010937228798866272, 0.5071074962615967, -0.16946303844451904, 0.1556980311870575, 0.44107991456985474, -0.10814866423606873, -0.04721664637327194, -0.21608762443065643, 0.2678271234035492, -0.050574321299791336, -0.2905348241329193, 0.10274266451597214, -0.5407797694206238, 0.1964484602212906, 0.4119815528392792, 0.0978306233882904, 0.06248617172241211, -0.11702743172645569, 0.12196328490972519, 0.09859031438827515, 0.06763559579849243, 0.0555579736828804, 0.4281328320503235, 0.012576468288898468, -0.24079731106758118, 0.0015202462673187256, -0.12471272051334381, -0.06382350623607635, 0.0906413346529007, 0.1152070090174675, 0.10620759427547455, 0.3642045259475708, 0.3328859210014343, 0.23631083965301514, 0.27275198698043823, -0.2007923424243927, 0.06007126718759537, -0.27165818214416504, -0.3013076186180115, 0.10527583956718445, -0.4434701204299927, 0.3204633593559265, -0.07833671569824219, 0.01679905503988266, -0.47307923436164856, -0.704285740852356, -0.006240649614483118, 0.42287763953208923, -0.3494608998298645, 0.22512319684028625, 0.11441783607006073, -0.09967350959777832, 0.05893610417842865, -0.11238563060760498, 0.05230625718832016, -0.000122949481010437, -0.0894760712981224, -0.08365736156702042, 0.18813881278038025, -0.005681153386831284, 0.05539857596158981, 0.14455902576446533, -0.28218016028404236, -0.36540937423706055, -0.07215313613414764, 0.09368999302387238, -0.22537294030189514, 0.16753152012825012, 0.2359502613544464, -0.14278049767017365, 0.037112534046173096, -0.21015965938568115, 0.4282029867172241, 0.12106742709875107, -0.16110000014305115, 0.30864644050598145, 0.1410035789012909, -0.37987929582595825, -0.34614741802215576, -0.08975782990455627, 0.06672384589910507, -0.34040263295173645, 0.2853435277938843, -0.3672187924385071, 0.22836129367351532, -0.12423105537891388, 0.20253562927246094, -0.405253529548645, -0.23669850826263428, -0.3135280907154083, -0.23612384498119354, 0.2798999547958374, 0.28017479181289673, 0.031828753650188446, -0.211837500333786, -0.02158632129430771, -0.21980492770671844, -0.23973244428634644, 0.6537204384803772, -0.20200121402740479, 0.0190303772687912, 0.029462290927767754, 0.13516691327095032, 0.1841977834701538, 0.06977175921201706, 0.18439790606498718, 0.06713740527629852, 0.04042840003967285, -0.22890318930149078, -0.3440389633178711, 0.21569454669952393, 0.2611227333545685, 0.1027497947216034, 0.23388519883155823, -0.10863270610570908, 0.12345753610134125, 0.5089372992515564, 0.43825384974479675, -0.16329999268054962, 0.05269469693303108, -0.06365679949522018, -0.0903315469622612, -0.3507983684539795, -0.05964195355772972, -0.13490793108940125, -0.26410651206970215, -0.06410842388868332, -0.10628408193588257, -0.09655740857124329, -0.046175479888916016, 0.06432641297578812, 0.5109118819236755, -0.41118523478507996, -0.3737527132034302, 0.3225444257259369, -0.0833151638507843, 0.3558412790298462, 0.007459104061126709, 0.04239272326231003, -0.07500104606151581, 0.057531531900167465, -0.11857232451438904, 0.012462776154279709, 0.2065056562423706, -0.17068032920360565, -0.2683764398097992, 0.09306001663208008, -0.17495277523994446, 0.3552577495574951, 0.32178929448127747, 0.3083389401435852, 0.09338819980621338, -0.18543601036071777, -0.17580252885818481, 0.08796612173318863, 0.600425124168396, -0.29788920283317566, -0.11419998109340668, 0.24811619520187378, -0.2609943151473999, 0.1331983208656311, -0.23022261261940002, -0.13779422640800476, 0.6016179919242859, 0.2735936939716339, 0.41449999809265137, -0.36199983954429626, 0.19441506266593933, -0.17646324634552002, 0.06703245639801025, -0.11233218014240265, -0.053430382162332535, -0.016121573746204376, 0.1484246850013733, -0.1722763180732727, -0.15337620675563812, 0.4354585111141205, 0.3644472360610962, -0.022666318342089653, -0.08012133836746216, -0.2845115661621094, 0.002004951238632202, 0.017284829169511795, -0.050869256258010864, 0.5098167657852173, -0.38155102729797363, 0.311765193939209, -0.4028151035308838, 0.14384403824806213, 0.008092215284705162, 0.242463618516922, 0.07420181483030319, 0.0422956757247448, 0.08836588263511658, -0.6263484954833984, 0.1875200867652893, 0.3774130642414093, 0.17107588052749634, 0.1586572676897049, -0.010969841852784157, 0.2765611410140991, -0.24586506187915802, -0.16825737059116364, 0.358890563249588, 0.03946436941623688, -0.12301653623580933, 0.06277820467948914, 0.0525498166680336, -0.036537665873765945, 0.005278974771499634, 0.34189653396606445, -0.16259126365184784, -0.06482315063476562, 0.16157293319702148, 0.016537560150027275, 0.628338634967804, 0.11256854236125946, 0.03252454102039337, 0.21447190642356873, 0.12858806550502777, 0.032222624868154526, 0.21438828110694885, 0.5292061567306519, -0.19134971499443054, -0.13730622828006744, -0.0734700858592987, -0.10064283758401871, -0.13358640670776367, 0.21476037800312042, -0.11760169267654419, 0.35720008611679077, 0.025236591696739197, -0.03568103164434433, -0.11845914274454117, -0.19340845942497253, 0.22923554480075836, -0.2549996078014374, -0.18898548185825348, 0.007549218833446503, 0.13470053672790527, 0.07801267504692078, -0.08758525550365448, 0.009597275406122208, -0.04654219001531601, -0.19700570404529572, -0.5435236096382141, 0.1068325936794281, -0.1093858852982521, 0.12997648119926453, 0.33686789870262146, -0.11076625436544418, -0.16902664303779602, -0.02622467651963234, -0.5276882648468018, -0.026163477450609207, 0.1611306369304657, -0.03292907774448395, 0.3559493124485016, 0.09499145299196243, 0.021697402000427246, -0.3095080256462097, 0.11864886432886124, 0.04982882738113403, -0.21984097361564636, -0.18949070572853088, -0.18382471799850464, -0.28473713994026184, -0.16714957356452942, 0.21930202841758728, -0.16126011312007904, 0.02131054550409317, -0.26692476868629456, 0.18849432468414307, 0.23127035796642303, 0.011249832808971405, 0.007611006032675505, 0.19983796775341034, -0.14694499969482422, 0.3651816248893738, -0.33011594414711, -0.0539221316576004, -0.0750332698225975, -0.03192007541656494, -0.019566526636481285, 0.01537257432937622, 0.11718881130218506, 0.27291375398635864, 0.0007331445813179016, -0.09939064085483551, -0.11971829831600189, -0.16612303256988525, -0.26837509870529175, 0.26630619168281555, -0.42190152406692505, -0.3164326548576355, -0.03920876234769821, 0.15937530994415283, 0.24156981706619263, 0.49911633133888245, -0.06273466348648071, -0.4399207830429077, 0.1133061945438385, 0.12346687912940979, 0.05924480780959129, -0.0376669205725193, -0.12881451845169067, 0.1396699696779251, 0.14048773050308228, 0.2176579385995865, -0.22904610633850098, -0.0832427442073822, -0.0037859156727790833, 0.36642327904701233, 0.11928673088550568, -0.1493036150932312, 0.02971523255109787, -0.21066509187221527, 0.06615954637527466, -0.05594044551253319, -0.2243594527244568, -0.16177397966384888, -0.0809817984700203, 0.13210174441337585, 0.1784900575876236, 0.10039885342121124, -0.05427539348602295, -0.07087180763483047, 0.11490470170974731, -0.37438273429870605, 0.006172262132167816, 0.3936433792114258, -0.2861175835132599, -0.03764212504029274, 0.10613135993480682, 0.32146814465522766, -0.21201682090759277, 0.12325333803892136, 0.021795514971017838, -0.013894420117139816, -0.057667076587677, 0.19854235649108887, 0.12142843753099442, 0.09316781163215637, -0.08520133793354034, -0.08815312385559082, -0.33001697063446045, 0.36289581656455994, 0.4204156994819641, -0.06463706493377686, -0.008498333394527435, 0.1402290165424347, 0.3090234398841858, 0.2060975879430771, -0.2118971347808838, -0.05733919516205788, -0.04596966132521629, 0.20594638586044312, -0.07713805884122849, -0.14182591438293457, 0.5797913670539856, 0.329388827085495, 0.08519552648067474, 0.29621028900146484, 0.29427486658096313, -0.17029881477355957, -0.1135546863079071, 0.3188398480415344, 0.0638771802186966, -0.3559717535972595, 0.09357377886772156, 0.3028055429458618, 0.17035770416259766, 0.43759703636169434, 0.02299368940293789, -0.06756985932588577, 0.146360382437706, 0.3452790677547455, 0.0846119299530983, 0.35146427154541016, 0.18346372246742249, -0.2586461305618286, 0.1524173766374588, -0.3382093608379364, -0.04705755412578583, -0.04338429868221283, 0.09957296401262283, 0.49631789326667786, 0.22243255376815796, -0.17906887829303741, -0.3241589665412903, -0.4232809245586395, -0.19415690004825592, 0.09245894849300385, -0.2510490119457245, 0.08102712035179138, 0.14946413040161133, 0.007088169455528259, -0.3637962341308594, -0.18888163566589355, 0.14143595099449158, 0.2033718228340149, 1.1223899126052856, 0.09965803474187851, 0.01835472881793976, -0.07037774473428726, 0.08801648765802383, 0.0006208904087543488, 0.34046807885169983, -0.1651044487953186, 0.13833414018154144, 0.3348845839500427, -0.049098387360572815, 0.35026171803474426, 0.249947652220726, 0.46415942907333374, 0.5902643203735352, -0.3894343376159668, 0.14890803396701813, 0.05315851420164108, -0.004048295319080353, -0.11891813576221466, -0.009975667111575603, -0.3670005798339844, 0.11954617500305176, 0.23041264712810516, 0.11194814741611481, -0.15384793281555176, 0.35495316982269287, -0.03044818341732025, 0.2934347093105316, -0.22218897938728333, 0.35804060101509094, 0.01953050121665001, -0.05628379434347153, 0.10433092713356018, -0.015490300953388214, -0.11274658143520355, -0.3830847442150116, 0.49044308066368103, -0.08330808579921722, 0.19961577653884888, 0.12259908765554428, 0.04821379482746124, 0.003851449117064476, 0.11113198101520538, 0.4130880832672119, 0.05253927782177925, -0.18168359994888306, 0.2222876250743866, -0.6451486349105835, 0.2540085017681122, -0.504125714302063, 0.0648449957370758, 0.23707877099514008, 0.3587473928928375, 0.021665960550308228, 0.10031209886074066, 0.26876169443130493, -0.4789277911186218, -0.027863282710313797, 0.34379082918167114, -0.4608428180217743, -0.04254889488220215, 0.05039775371551514, -0.3166424334049225, 0.15860658884048462, -0.3456782400608063, 0.1612987220287323, 0.14683163166046143, 0.11947911977767944, 0.18325060606002808, -0.12972711026668549, 0.034841932356357574, 0.1572664976119995, -0.120846688747406, 0.4264359772205353, -0.019239656627178192, -0.17483101785182953, -0.2714163362979889, -0.3383845090866089, 0.2510741651058197, -0.18548069894313812, 0.24201110005378723, -0.02883954718708992, 0.4207508862018585, -0.43226802349090576, 0.34737351536750793, -0.03240204602479935, 0.014690123498439789, 0.00031520426273345947, 0.1061638817191124, -0.15114793181419373, 0.3642754554748535, -0.32713404297828674, 0.2872067987918854, 0.1758018136024475, 0.432134211063385, -0.025820080190896988, 0.1492186188697815, -0.07903482764959335, -0.28492701053619385, 0.058760084211826324, -0.4737946391105652, -0.3892626166343689, -0.348869651556015, -0.03248821198940277, -0.019874610006809235, 0.39867883920669556, -0.5148509740829468, -0.4925318956375122, 0.21790006756782532, -0.20598849654197693, -0.11055757105350494, -0.3600332736968994, -0.15599796175956726, -0.5394275784492493, -0.11173229664564133, -0.05484507605433464, -0.04917529597878456, -0.483975350856781, 0.3316684365272522, -0.11927855014801025 ]
https://github.com/huggingface/datasets/issues/6020
I just encountered the same error in the same situation (multiprocessing with variable length outputs). The funny (or dangerous?) thing is, that this error only showed up when testing with a small test dataset (16 examples, ValueError with `num_proc` >1) but the same code works fine for the full dataset (~70k examples). @mariosasko Any idea on how to do that with a nested feature with lists of variable lengths containing dicts? EDIT: Was able to narrow it down: >200 Examples: no error, <150 Examples: Error. Now idea what to make of this but pretty obvious that this is a bug....
Inconsistent "The features can't be aligned" error when combining map, multiprocessing, and variable length outputs
### Describe the bug I'm using a dataset with map and multiprocessing to run a function that returned a variable length list of outputs. This output list may be empty. Normally this is handled fine, but there is an edge case that crops up when using multiprocessing. In some cases, an empty list result ends up in a dataset shard consisting of a single item. This results in a `The features can't be aligned` error that is difficult to debug because it depends on the number of processes/shards used. I've reproduced a minimal example below. My current workaround is to fill empty results with a dummy value that I filter after, but this was a weird error that took a while to track down. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_list([{'idx':i} for i in range(60)]) def test_func(row, idx): if idx==58: return {'output': []} else: return {'output' : [{'test':1}, {'test':2}]} # this works fine test1 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=4) # this fails test2 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=32) >ValueError: The features can't be aligned because the key output of features {'idx': Value(dtype='int64', id=None), 'output': Sequence(feature=Value(dtype='null', id=None), length=-1, id=None)} has unexpected type - Sequence(feature=Value(dtype='null', id=None), length=-1, id=None) (expected either [{'test': Value(dtype='int64', id=None)}] or Value("null"). ``` The error occurs during the check ```python _check_if_features_can_be_aligned([dset.features for dset in dsets]) ``` When the multiprocessing splitting lines up just right with the empty return value, one of the `dset` in `dsets` will have a single item with an empty list value, causing the error. ### Expected behavior Expected behavior is the result would be the same regardless of the `num_proc` value used. ### Environment info Datasets version 2.11.0 Python 3.9.16
100
Inconsistent "The features can't be aligned" error when combining map, multiprocessing, and variable length outputs ### Describe the bug I'm using a dataset with map and multiprocessing to run a function that returned a variable length list of outputs. This output list may be empty. Normally this is handled fine, but there is an edge case that crops up when using multiprocessing. In some cases, an empty list result ends up in a dataset shard consisting of a single item. This results in a `The features can't be aligned` error that is difficult to debug because it depends on the number of processes/shards used. I've reproduced a minimal example below. My current workaround is to fill empty results with a dummy value that I filter after, but this was a weird error that took a while to track down. ### Steps to reproduce the bug ```python import datasets dataset = datasets.Dataset.from_list([{'idx':i} for i in range(60)]) def test_func(row, idx): if idx==58: return {'output': []} else: return {'output' : [{'test':1}, {'test':2}]} # this works fine test1 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=4) # this fails test2 = dataset.map(lambda row, idx: test_func(row, idx), with_indices=True, num_proc=32) >ValueError: The features can't be aligned because the key output of features {'idx': Value(dtype='int64', id=None), 'output': Sequence(feature=Value(dtype='null', id=None), length=-1, id=None)} has unexpected type - Sequence(feature=Value(dtype='null', id=None), length=-1, id=None) (expected either [{'test': Value(dtype='int64', id=None)}] or Value("null"). ``` The error occurs during the check ```python _check_if_features_can_be_aligned([dset.features for dset in dsets]) ``` When the multiprocessing splitting lines up just right with the empty return value, one of the `dset` in `dsets` will have a single item with an empty list value, causing the error. ### Expected behavior Expected behavior is the result would be the same regardless of the `num_proc` value used. ### Environment info Datasets version 2.11.0 Python 3.9.16 I just encountered the same error in the same situation (multiprocessing with variable length outputs). The funny (or dangerous?) thing is, that this error only showed up when testing with a small test dataset (16 examples, ValueError with `num_proc` >1) but the same code works fine for the full dataset (~70k examples). @mariosasko Any idea on how to do that with a nested feature with lists of variable lengths containing dicts? EDIT: Was able to narrow it down: >200 Examples: no error, <150 Examples: Error. Now idea what to make of this but pretty obvious that this is a bug....
[ -0.22299067676067352, -0.33570733666419983, -0.059271086007356644, 0.18832027912139893, 0.16204114258289337, -0.18797782063484192, 0.49852344393730164, 0.06349801272153854, -0.009108811616897583, 0.079771026968956, 0.35652121901512146, 0.23856398463249207, -0.0017629396170377731, 0.2790445387363434, -0.43523722887039185, -0.20278701186180115, 0.2810540199279785, 0.05386688560247421, 0.12135083973407745, 0.14021971821784973, -0.17497283220291138, 0.11300484091043472, -0.3761160969734192, -0.1721738874912262, -0.5670258402824402, -0.11216975748538971, -0.23887786269187927, -0.256031334400177, 0.2995084822177887, -0.06917333602905273, 0.06811819225549698, -0.15275967121124268, -0.5374452471733093, 0.6407015323638916, -0.00011376521433703601, 0.07682327926158905, 0.3734560012817383, -0.13790282607078552, 0.019297949969768524, -0.29468148946762085, -0.418294757604599, -0.26676878333091736, -0.20658674836158752, -0.13904957473278046, 0.19874517619609833, 0.12161609530448914, -0.07986012101173401, -0.4875124394893646, 0.08307997137308121, -0.008404884487390518, 0.12355820834636688, 0.34666502475738525, 0.022192224860191345, -0.0906796008348465, 0.07586421817541122, 0.17080503702163696, -0.08473308384418488, -0.5547665953636169, 0.24418604373931885, -0.05079101771116257, -0.06619253009557724, 0.23813223838806152, -0.22431506216526031, 0.12136787176132202, 0.0045209419913589954, 0.0963769406080246, 0.06903408467769623, -0.39643245935440063, 0.043795160949230194, 0.3107234239578247, -0.12854723632335663, 0.25727227330207825, -0.3534407615661621, -0.5165060758590698, -0.21679547429084778, -0.3907674252986908, 0.19331490993499756, 0.16102981567382812, 0.05901779606938362, 0.014156116172671318, -0.5104671120643616, 0.2494116574525833, 0.23792031407356262, 0.0721585750579834, -0.23978959023952484, 0.2105511724948883, 0.10950065404176712, 0.2537109851837158, -0.26253917813301086, -0.1311677098274231, -0.2244645059108734, -0.19224011898040771, -0.06528577208518982, 0.03294622153043747, -0.2883271872997284, 0.18409442901611328, 0.3330995440483093, -0.23001983761787415, 0.046819888055324554, -0.1408209204673767, -0.11975141614675522, -0.11533191800117493, -0.022935926914215088, 0.2444480061531067, 0.35569027066230774, -0.18856404721736908, 0.10692203789949417, 0.011736605316400528, -0.1619013249874115, -0.08393970131874084, -0.10531416535377502, 0.02951379120349884, 0.6747017502784729, -0.16818378865718842, 0.08893230557441711, 0.20808982849121094, 0.15993867814540863, 0.08845203369855881, -0.13685905933380127, 0.20656421780586243, -0.2584870457649231, 0.07313671708106995, -0.18921712040901184, -0.16082637012004852, 0.011982861906290054, 0.7013280391693115, -0.0019403770565986633, 0.31043627858161926, -0.10293281823396683, -0.20688311755657196, -0.06463303416967392, -0.20995722711086273, -0.2350088655948639, 0.01942380890250206, -0.028833400458097458, 0.27350687980651855, -0.08062456548213959, 0.2647637724876404, 0.1306747943162918, -0.20182867348194122, -0.310744047164917, -0.4364767074584961, 0.3431088924407959, 0.2545245289802551, 0.16337920725345612, 0.12272724509239197, -0.1259988248348236, -0.12585629522800446, -0.13999123871326447, 0.1527412384748459, -0.08251357078552246, -0.30006515979766846, 0.027473198249936104, 0.15905505418777466, -0.17073550820350647, 0.3777073323726654, -0.07928189635276794, 0.2464171051979065, 0.4465138018131256, 0.045063212513923645, -0.20587697625160217, -0.3635424077510834, -0.23451867699623108, -0.30466428399086, -0.04241255298256874, 0.34005993604660034, -0.037531573325395584, 0.20705586671829224, -0.11760357022285461, 0.2178577482700348, 0.026919307187199593, 0.24835669994354248, 0.1998291015625, 0.11536956578493118, -0.202060267329216, 0.4812271296977997, -0.13076411187648773, -0.049625419080257416, -0.11198224127292633, 0.45217764377593994, -0.10326547175645828, 0.4211059510707855, -0.07274051755666733, 0.07164997607469559, 0.30675095319747925, -0.013406101614236832, 0.4197026193141937, 0.29282042384147644, -0.3078550696372986, 0.11201149225234985, -0.32808876037597656, -0.04415199160575867, 0.09981101006269455, -0.13768157362937927, 0.02064381167292595, -0.0618930421769619, -0.06821928918361664, -0.3056448698043823, 0.2685619294643402, -0.05162140727043152, 0.19501793384552002, 0.12375406920909882, 0.15923210978507996, 0.2065795361995697, -0.19966235756874084, -0.19634519517421722, -0.8078374862670898, 0.2682742774486542, 0.05970489978790283, -0.09627139568328857, -0.1542108803987503, -0.19230365753173828, 0.1854955404996872, 0.2461569607257843, -0.1475830227136612, 0.08708395063877106, 0.09863574057817459, 0.028730832040309906, -0.16993746161460876, -0.23100370168685913, 0.10615071654319763, 0.24391016364097595, 0.27360042929649353, -0.2024354338645935, -0.13996927440166473, 0.3352665901184082, 0.00918499380350113, -0.11076218634843826, -0.10933776199817657, 0.07953693717718124, 0.26453736424446106, 0.17666679620742798, 0.0319313108921051, 0.39697206020355225, 0.20989151298999786, -0.016878698021173477, -0.22258293628692627, 0.13263635337352753, 0.1822023242712021, 0.11132965981960297, -0.13414503633975983, 0.2157527655363083, -0.0004536733031272888, -0.2651761770248413, -0.00842411071062088, 0.3510091006755829, 0.010937228798866272, 0.5071074962615967, -0.16946303844451904, 0.1556980311870575, 0.44107991456985474, -0.10814866423606873, -0.04721664637327194, -0.21608762443065643, 0.2678271234035492, -0.050574321299791336, -0.2905348241329193, 0.10274266451597214, -0.5407797694206238, 0.1964484602212906, 0.4119815528392792, 0.0978306233882904, 0.06248617172241211, -0.11702743172645569, 0.12196328490972519, 0.09859031438827515, 0.06763559579849243, 0.0555579736828804, 0.4281328320503235, 0.012576468288898468, -0.24079731106758118, 0.0015202462673187256, -0.12471272051334381, -0.06382350623607635, 0.0906413346529007, 0.1152070090174675, 0.10620759427547455, 0.3642045259475708, 0.3328859210014343, 0.23631083965301514, 0.27275198698043823, -0.2007923424243927, 0.06007126718759537, -0.27165818214416504, -0.3013076186180115, 0.10527583956718445, -0.4434701204299927, 0.3204633593559265, -0.07833671569824219, 0.01679905503988266, -0.47307923436164856, -0.704285740852356, -0.006240649614483118, 0.42287763953208923, -0.3494608998298645, 0.22512319684028625, 0.11441783607006073, -0.09967350959777832, 0.05893610417842865, -0.11238563060760498, 0.05230625718832016, -0.000122949481010437, -0.0894760712981224, -0.08365736156702042, 0.18813881278038025, -0.005681153386831284, 0.05539857596158981, 0.14455902576446533, -0.28218016028404236, -0.36540937423706055, -0.07215313613414764, 0.09368999302387238, -0.22537294030189514, 0.16753152012825012, 0.2359502613544464, -0.14278049767017365, 0.037112534046173096, -0.21015965938568115, 0.4282029867172241, 0.12106742709875107, -0.16110000014305115, 0.30864644050598145, 0.1410035789012909, -0.37987929582595825, -0.34614741802215576, -0.08975782990455627, 0.06672384589910507, -0.34040263295173645, 0.2853435277938843, -0.3672187924385071, 0.22836129367351532, -0.12423105537891388, 0.20253562927246094, -0.405253529548645, -0.23669850826263428, -0.3135280907154083, -0.23612384498119354, 0.2798999547958374, 0.28017479181289673, 0.031828753650188446, -0.211837500333786, -0.02158632129430771, -0.21980492770671844, -0.23973244428634644, 0.6537204384803772, -0.20200121402740479, 0.0190303772687912, 0.029462290927767754, 0.13516691327095032, 0.1841977834701538, 0.06977175921201706, 0.18439790606498718, 0.06713740527629852, 0.04042840003967285, -0.22890318930149078, -0.3440389633178711, 0.21569454669952393, 0.2611227333545685, 0.1027497947216034, 0.23388519883155823, -0.10863270610570908, 0.12345753610134125, 0.5089372992515564, 0.43825384974479675, -0.16329999268054962, 0.05269469693303108, -0.06365679949522018, -0.0903315469622612, -0.3507983684539795, -0.05964195355772972, -0.13490793108940125, -0.26410651206970215, -0.06410842388868332, -0.10628408193588257, -0.09655740857124329, -0.046175479888916016, 0.06432641297578812, 0.5109118819236755, -0.41118523478507996, -0.3737527132034302, 0.3225444257259369, -0.0833151638507843, 0.3558412790298462, 0.007459104061126709, 0.04239272326231003, -0.07500104606151581, 0.057531531900167465, -0.11857232451438904, 0.012462776154279709, 0.2065056562423706, -0.17068032920360565, -0.2683764398097992, 0.09306001663208008, -0.17495277523994446, 0.3552577495574951, 0.32178929448127747, 0.3083389401435852, 0.09338819980621338, -0.18543601036071777, -0.17580252885818481, 0.08796612173318863, 0.600425124168396, -0.29788920283317566, -0.11419998109340668, 0.24811619520187378, -0.2609943151473999, 0.1331983208656311, -0.23022261261940002, -0.13779422640800476, 0.6016179919242859, 0.2735936939716339, 0.41449999809265137, -0.36199983954429626, 0.19441506266593933, -0.17646324634552002, 0.06703245639801025, -0.11233218014240265, -0.053430382162332535, -0.016121573746204376, 0.1484246850013733, -0.1722763180732727, -0.15337620675563812, 0.4354585111141205, 0.3644472360610962, -0.022666318342089653, -0.08012133836746216, -0.2845115661621094, 0.002004951238632202, 0.017284829169511795, -0.050869256258010864, 0.5098167657852173, -0.38155102729797363, 0.311765193939209, -0.4028151035308838, 0.14384403824806213, 0.008092215284705162, 0.242463618516922, 0.07420181483030319, 0.0422956757247448, 0.08836588263511658, -0.6263484954833984, 0.1875200867652893, 0.3774130642414093, 0.17107588052749634, 0.1586572676897049, -0.010969841852784157, 0.2765611410140991, -0.24586506187915802, -0.16825737059116364, 0.358890563249588, 0.03946436941623688, -0.12301653623580933, 0.06277820467948914, 0.0525498166680336, -0.036537665873765945, 0.005278974771499634, 0.34189653396606445, -0.16259126365184784, -0.06482315063476562, 0.16157293319702148, 0.016537560150027275, 0.628338634967804, 0.11256854236125946, 0.03252454102039337, 0.21447190642356873, 0.12858806550502777, 0.032222624868154526, 0.21438828110694885, 0.5292061567306519, -0.19134971499443054, -0.13730622828006744, -0.0734700858592987, -0.10064283758401871, -0.13358640670776367, 0.21476037800312042, -0.11760169267654419, 0.35720008611679077, 0.025236591696739197, -0.03568103164434433, -0.11845914274454117, -0.19340845942497253, 0.22923554480075836, -0.2549996078014374, -0.18898548185825348, 0.007549218833446503, 0.13470053672790527, 0.07801267504692078, -0.08758525550365448, 0.009597275406122208, -0.04654219001531601, -0.19700570404529572, -0.5435236096382141, 0.1068325936794281, -0.1093858852982521, 0.12997648119926453, 0.33686789870262146, -0.11076625436544418, -0.16902664303779602, -0.02622467651963234, -0.5276882648468018, -0.026163477450609207, 0.1611306369304657, -0.03292907774448395, 0.3559493124485016, 0.09499145299196243, 0.021697402000427246, -0.3095080256462097, 0.11864886432886124, 0.04982882738113403, -0.21984097361564636, -0.18949070572853088, -0.18382471799850464, -0.28473713994026184, -0.16714957356452942, 0.21930202841758728, -0.16126011312007904, 0.02131054550409317, -0.26692476868629456, 0.18849432468414307, 0.23127035796642303, 0.011249832808971405, 0.007611006032675505, 0.19983796775341034, -0.14694499969482422, 0.3651816248893738, -0.33011594414711, -0.0539221316576004, -0.0750332698225975, -0.03192007541656494, -0.019566526636481285, 0.01537257432937622, 0.11718881130218506, 0.27291375398635864, 0.0007331445813179016, -0.09939064085483551, -0.11971829831600189, -0.16612303256988525, -0.26837509870529175, 0.26630619168281555, -0.42190152406692505, -0.3164326548576355, -0.03920876234769821, 0.15937530994415283, 0.24156981706619263, 0.49911633133888245, -0.06273466348648071, -0.4399207830429077, 0.1133061945438385, 0.12346687912940979, 0.05924480780959129, -0.0376669205725193, -0.12881451845169067, 0.1396699696779251, 0.14048773050308228, 0.2176579385995865, -0.22904610633850098, -0.0832427442073822, -0.0037859156727790833, 0.36642327904701233, 0.11928673088550568, -0.1493036150932312, 0.02971523255109787, -0.21066509187221527, 0.06615954637527466, -0.05594044551253319, -0.2243594527244568, -0.16177397966384888, -0.0809817984700203, 0.13210174441337585, 0.1784900575876236, 0.10039885342121124, -0.05427539348602295, -0.07087180763483047, 0.11490470170974731, -0.37438273429870605, 0.006172262132167816, 0.3936433792114258, -0.2861175835132599, -0.03764212504029274, 0.10613135993480682, 0.32146814465522766, -0.21201682090759277, 0.12325333803892136, 0.021795514971017838, -0.013894420117139816, -0.057667076587677, 0.19854235649108887, 0.12142843753099442, 0.09316781163215637, -0.08520133793354034, -0.08815312385559082, -0.33001697063446045, 0.36289581656455994, 0.4204156994819641, -0.06463706493377686, -0.008498333394527435, 0.1402290165424347, 0.3090234398841858, 0.2060975879430771, -0.2118971347808838, -0.05733919516205788, -0.04596966132521629, 0.20594638586044312, -0.07713805884122849, -0.14182591438293457, 0.5797913670539856, 0.329388827085495, 0.08519552648067474, 0.29621028900146484, 0.29427486658096313, -0.17029881477355957, -0.1135546863079071, 0.3188398480415344, 0.0638771802186966, -0.3559717535972595, 0.09357377886772156, 0.3028055429458618, 0.17035770416259766, 0.43759703636169434, 0.02299368940293789, -0.06756985932588577, 0.146360382437706, 0.3452790677547455, 0.0846119299530983, 0.35146427154541016, 0.18346372246742249, -0.2586461305618286, 0.1524173766374588, -0.3382093608379364, -0.04705755412578583, -0.04338429868221283, 0.09957296401262283, 0.49631789326667786, 0.22243255376815796, -0.17906887829303741, -0.3241589665412903, -0.4232809245586395, -0.19415690004825592, 0.09245894849300385, -0.2510490119457245, 0.08102712035179138, 0.14946413040161133, 0.007088169455528259, -0.3637962341308594, -0.18888163566589355, 0.14143595099449158, 0.2033718228340149, 1.1223899126052856, 0.09965803474187851, 0.01835472881793976, -0.07037774473428726, 0.08801648765802383, 0.0006208904087543488, 0.34046807885169983, -0.1651044487953186, 0.13833414018154144, 0.3348845839500427, -0.049098387360572815, 0.35026171803474426, 0.249947652220726, 0.46415942907333374, 0.5902643203735352, -0.3894343376159668, 0.14890803396701813, 0.05315851420164108, -0.004048295319080353, -0.11891813576221466, -0.009975667111575603, -0.3670005798339844, 0.11954617500305176, 0.23041264712810516, 0.11194814741611481, -0.15384793281555176, 0.35495316982269287, -0.03044818341732025, 0.2934347093105316, -0.22218897938728333, 0.35804060101509094, 0.01953050121665001, -0.05628379434347153, 0.10433092713356018, -0.015490300953388214, -0.11274658143520355, -0.3830847442150116, 0.49044308066368103, -0.08330808579921722, 0.19961577653884888, 0.12259908765554428, 0.04821379482746124, 0.003851449117064476, 0.11113198101520538, 0.4130880832672119, 0.05253927782177925, -0.18168359994888306, 0.2222876250743866, -0.6451486349105835, 0.2540085017681122, -0.504125714302063, 0.0648449957370758, 0.23707877099514008, 0.3587473928928375, 0.021665960550308228, 0.10031209886074066, 0.26876169443130493, -0.4789277911186218, -0.027863282710313797, 0.34379082918167114, -0.4608428180217743, -0.04254889488220215, 0.05039775371551514, -0.3166424334049225, 0.15860658884048462, -0.3456782400608063, 0.1612987220287323, 0.14683163166046143, 0.11947911977767944, 0.18325060606002808, -0.12972711026668549, 0.034841932356357574, 0.1572664976119995, -0.120846688747406, 0.4264359772205353, -0.019239656627178192, -0.17483101785182953, -0.2714163362979889, -0.3383845090866089, 0.2510741651058197, -0.18548069894313812, 0.24201110005378723, -0.02883954718708992, 0.4207508862018585, -0.43226802349090576, 0.34737351536750793, -0.03240204602479935, 0.014690123498439789, 0.00031520426273345947, 0.1061638817191124, -0.15114793181419373, 0.3642754554748535, -0.32713404297828674, 0.2872067987918854, 0.1758018136024475, 0.432134211063385, -0.025820080190896988, 0.1492186188697815, -0.07903482764959335, -0.28492701053619385, 0.058760084211826324, -0.4737946391105652, -0.3892626166343689, -0.348869651556015, -0.03248821198940277, -0.019874610006809235, 0.39867883920669556, -0.5148509740829468, -0.4925318956375122, 0.21790006756782532, -0.20598849654197693, -0.11055757105350494, -0.3600332736968994, -0.15599796175956726, -0.5394275784492493, -0.11173229664564133, -0.05484507605433464, -0.04917529597878456, -0.483975350856781, 0.3316684365272522, -0.11927855014801025 ]
https://github.com/huggingface/datasets/issues/6014
Hi ! The huggingface/dataset-viewer code was not maintained anymore because we switched to a new dataset viewer that is deployed available for each dataset the Hugging Face website. What are you using this old repository for ?
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
37
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. Hi ! The huggingface/dataset-viewer code was not maintained anymore because we switched to a new dataset viewer that is deployed available for each dataset the Hugging Face website. What are you using this old repository for ?
[ -0.1857638657093048, 0.04342028498649597, -0.05034692957997322, 0.3463643789291382, 0.06275570392608643, 0.13257735967636108, 0.10639771819114685, 0.3743211627006531, -0.0635615810751915, 0.173007071018219, -0.20122423768043518, 0.15556125342845917, -0.08831072598695755, 0.16802483797073364, 0.018161028623580933, -0.07017984986305237, -0.10250860452651978, 0.12706416845321655, -0.09926071763038635, 0.018310539424419403, 0.10186424851417542, 0.1564006805419922, -0.23712006211280823, -0.05866296961903572, -0.10348577797412872, 0.2037506103515625, -0.12844447791576385, 0.19171269237995148, -0.10519791394472122, -0.47683972120285034, 0.21174396574497223, 0.28793537616729736, 0.14829716086387634, 0.4842497706413269, -0.00011981176066910848, -0.028597049415111542, 0.356577605009079, -0.029142197221517563, -0.46923092007637024, -0.08496348559856415, 0.034545764327049255, -0.19125640392303467, 0.11451077461242676, -0.09615227580070496, -0.3189544677734375, -0.23535937070846558, -0.023214368149638176, -0.4184497892856598, 0.5440289378166199, 0.06857632100582123, 0.17733658850193024, 0.4283734858036041, 0.36420994997024536, -0.2772475481033325, -0.1346868872642517, 0.32660815119743347, 0.0019231587648391724, 0.3121621906757355, 0.37730520963668823, 0.18629896640777588, -0.09424848854541779, 0.39446449279785156, 0.10394873470067978, -0.2563830316066742, 0.3381047248840332, -0.1277467906475067, -0.023905936628580093, -0.2482902705669403, 0.13510224223136902, -0.12998926639556885, 0.8280373215675354, -0.3445342183113098, -0.25399988889694214, -0.25441625714302063, 0.008116498589515686, 0.1594931185245514, 0.056896716356277466, 0.030759289860725403, -0.1697876751422882, 0.3192543089389801, -0.38611844182014465, -0.5684492588043213, -0.19742149114608765, -0.21998542547225952, 0.035694241523742676, 0.04978207126259804, -0.3603833317756653, 0.007919065654277802, 0.12287899851799011, -0.235465407371521, 0.016032937914133072, -0.0531415119767189, 0.043987374752759933, 0.06563185155391693, 0.007633032742887735, -0.22830966114997864, 0.02110208570957184, 0.1541021168231964, -0.08761231601238251, 0.40791645646095276, -0.0023811478167772293, 0.07436563819646835, -0.0694873109459877, -0.012736069038510323, 0.42451420426368713, 0.1159188449382782, 0.3601073622703552, 0.11108484119176865, 0.12716460227966309, 0.28195062279701233, 0.24300450086593628, -0.057937849313020706, -0.29825615882873535, -0.00851057842373848, -0.17317646741867065, -0.17167390882968903, 0.3376113772392273, -0.16760127246379852, -0.059647999703884125, -0.1789916455745697, 0.21517980098724365, -0.18200433254241943, 0.1468522995710373, 0.3442612886428833, -0.1599549651145935, -0.008828756399452686, -0.005358181893825531, -0.31243887543678284, -0.06564446538686752, -0.8174999356269836, -0.13217638432979584, 0.02812432125210762, -0.30749961733818054, 0.10698090493679047, 0.06141375005245209, -0.580485463142395, 0.022164225578308105, -0.005202125757932663, 0.5541391968727112, 0.020828723907470703, -0.260450154542923, 0.22823476791381836, -0.06858821213245392, 0.13376253843307495, 0.0700119361281395, 0.09973463416099548, 0.16521842777729034, -0.21056780219078064, -0.08034662902355194, 0.09603504091501236, -0.37698012590408325, -0.32326191663742065, -0.1371786892414093, 0.07940438389778137, -0.173313707113266, 0.09961345046758652, -0.2989063560962677, 0.16612853109836578, -0.24121424555778503, -0.2223728895187378, 0.11661192774772644, 0.22840723395347595, 0.060532741248607635, -0.23951654136180878, 0.482215940952301, 0.8745834231376648, -0.30060210824012756, -0.17273299396038055, -0.1413297951221466, -0.24428588151931763, -0.17714160680770874, 0.17220957577228546, -0.13452807068824768, -0.19863182306289673, -0.2008415311574936, -0.15281912684440613, 0.48006248474121094, -0.5718721747398376, -0.40113353729248047, 0.16297349333763123, -0.15982317924499512, 0.048974163830280304, 0.04046459496021271, -0.0840897262096405, -0.07233346253633499, -0.269201397895813, -0.27620622515678406, 0.08900927007198334, -0.11257373541593552, -0.09859156608581543, -0.10915286839008331, -0.3199769854545593, 0.07773734629154205, 0.43418318033218384, -0.16685011982917786, 0.14069412648677826, 0.2900921106338501, -0.19620855152606964, 0.4613235592842102, 0.026642415672540665, 0.12827284634113312, -0.045227885246276855, 0.18238261342048645, 0.5466082692146301, -0.01965341530740261, -0.07405617833137512, -0.2049085944890976, 0.1440885066986084, 0.1546095907688141, -0.24211658537387848, -0.1466442495584488, -0.19190455973148346, -0.46572649478912354, 0.012790977954864502, -0.2426900714635849, -0.3995371460914612, 0.08194424957036972, -0.006482485681772232, 0.12425288558006287, 0.22572576999664307, -0.20804718136787415, 0.4186718165874481, -0.07275062054395676, 0.029051925987005234, -0.5963872075080872, 0.3392865061759949, -0.11843997240066528, 0.028881356120109558, 0.14236800372600555, 0.2344570904970169, 0.1151229590177536, 0.005748417228460312, 0.09445145726203918, 0.38282543420791626, -0.23648644983768463, 0.37770503759384155, 0.19634990394115448, 0.15196673572063446, 0.14393438398838043, -0.4777986705303192, 0.425137460231781, -0.23164428770542145, -0.05755385383963585, 0.17594288289546967, -0.16685710847377777, 0.08547944575548172, -0.15149344503879547, -0.06171203404664993, 0.11843353509902954, 0.12461226433515549, -0.2370513528585434, 0.2522376775741577, -0.19175997376441956, -0.21496513485908508, 0.029014337807893753, -0.025756236165761948, 0.3527633547782898, -0.1453493982553482, -0.18251778185367584, 0.0881139263510704, 0.20063355565071106, -0.18893510103225708, 0.0012394897639751434, 0.10891851782798767, -0.1597127914428711, -0.055845800787210464, 0.09849987179040909, -0.1493118852376938, 0.1302417367696762, 0.07923395931720734, -0.05507637932896614, 0.3373965919017792, 0.5245108008384705, -0.12150278687477112, 0.09736048430204391, 0.014183197170495987, 0.27567145228385925, -0.1771371215581894, -0.042377177625894547, 0.24691686034202576, -0.04336472228169441, -0.09667778015136719, -0.14981365203857422, 0.10356008261442184, -0.25121814012527466, 0.06338511407375336, -0.0588463731110096, -0.22624382376670837, -0.20330438017845154, 0.060477226972579956, -0.2805066704750061, -0.017946042120456696, -0.2549422085285187, 0.024331264197826385, 0.08848324418067932, 0.03934255242347717, -0.2904384136199951, 0.5090298652648926, -0.038899607956409454, 0.13599027693271637, -0.205556258559227, 0.0195905938744545, 0.0035499799996614456, 0.014524519443511963, 0.14697210490703583, -0.11397911608219147, 0.3487073481082916, -0.236713707447052, 0.45832639932632446, -0.3517812490463257, -0.29446345567703247, 0.020286478102207184, -0.034270986914634705, 0.11023254692554474, 0.28050661087036133, 0.07359863817691803, 0.007844150066375732, -0.04100825637578964, 0.21229135990142822, -0.2427154779434204, -0.2266426682472229, -0.2818908095359802, 0.24776478111743927, -0.04873418062925339, 0.007151424884796143, -0.07490412890911102, -0.33328157663345337, -0.3505958914756775, 0.41208675503730774, -0.2713736295700073, 0.07792124152183533, 0.204273521900177, 0.0644647553563118, 0.06433809548616409, -0.2861514091491699, 0.01963348686695099, -0.1074068695306778, -0.5194116830825806, 0.18145790696144104, -0.5379443764686584, -0.19319365918636322, -0.0005943775177001953, 0.40374505519866943, 0.1439223736524582, -0.10981349647045135, -0.37753617763519287, -0.05185239389538765, -0.007176403887569904, 0.05369880795478821, -0.000929275993257761, 0.07619043439626694, 0.21583551168441772, 0.18822252750396729, 0.022712111473083496, -0.0032838284969329834, -0.29246944189071655, -0.28848451375961304, -0.12042928487062454, -0.101831816136837, 0.2654627561569214, 0.15798282623291016, 0.01740363985300064, 0.6407170295715332, 0.5091354846954346, 0.13279306888580322, 0.11460183560848236, 0.07145663350820541, 0.6921260952949524, 0.03422471135854721, -0.4678962826728821, -0.017493724822998047, 0.14790169894695282, 0.1819624900817871, 0.06639114022254944, -0.012111961841583252, 0.17036792635917664, -0.3136384189128876, -0.5329540371894836, -0.26795798540115356, -0.2342061698436737, -0.16711081564426422, 0.015194641426205635, 0.5341070294380188, -0.12516935169696808, 0.06646141409873962, -0.15056806802749634, -0.016227710992097855, 0.34582653641700745, 0.49068400263786316, 0.23121705651283264, 0.03882758319377899, -0.26387819647789, 0.1923818290233612, -0.27331048250198364, 0.17455393075942993, -0.024765009060502052, 0.052325405180454254, -0.1635371893644333, -0.007930174469947815, 0.10831199586391449, 0.08470034599304199, 0.6689707040786743, -0.022395968437194824, 0.18922990560531616, -0.04224023222923279, -0.2870487570762634, -0.12298271805047989, 0.21665261685848236, 0.2094154953956604, 0.11566823720932007, -0.28017646074295044, 0.017779681831598282, -0.09553772211074829, -0.3791225552558899, 0.4850117266178131, -0.11201541125774384, -0.2514215409755707, -0.007855456322431564, 0.13645973801612854, -0.14129354059696198, -0.14241543412208557, -0.34524843096733093, -0.09675727784633636, 0.08787433803081512, -0.1401088535785675, 0.31748753786087036, -0.08242788910865784, 0.06435521692037582, 0.18496781587600708, 0.028650913387537003, 0.2639540731906891, 0.2522784471511841, 0.14946389198303223, 0.7605827450752258, -0.0533406063914299, 0.5006103515625, 0.4585094451904297, -0.03794432058930397, -0.38340523838996887, 0.0960606038570404, 0.11107843369245529, 0.32000449299812317, 0.4384816586971283, -0.0760730728507042, -0.17189563810825348, 0.06145714595913887, 0.06882494688034058, -0.5380593538284302, -0.21334339678287506, 0.2057221233844757, 0.006998047232627869, -0.3515072464942932, -0.71928870677948, 0.2796502411365509, -0.07709616422653198, 0.00759732723236084, -0.04427751898765564, 0.46313735842704773, -0.07860495150089264, -0.39603349566459656, -0.08577720820903778, 0.9546661376953125, 0.21805846691131592, 0.2534187138080597, 0.19451867043972015, -0.12221144884824753, 0.2555237412452698, -0.1260244995355606, -0.01108391024172306, -0.2910551428794861, -0.1609097719192505, 0.0124758780002594, -0.08608515560626984, 0.36278802156448364, -0.2509833574295044, -0.11747536063194275, 0.06495633721351624, -0.07296249270439148, -0.0602821484208107, -0.027966627851128578, 0.247825488448143, -0.00940355658531189, 0.051822103559970856, -0.30909085273742676, 0.10387502610683441, 0.13209962844848633, 0.23979440331459045, -0.0626978874206543, -0.3833563029766083, 0.021961867809295654, -0.023217052221298218, -0.36927762627601624, -0.0302451029419899, -0.05177928879857063, 0.31435707211494446, 0.15566538274288177, -0.2855728268623352, 0.9121887683868408, 0.4055987000465393, 0.21958541870117188, 0.21319958567619324, -0.26744189858436584, 0.09775504469871521, -0.2530035972595215, -0.15330757200717926, -0.16400764882564545, 0.22083523869514465, 0.14981195330619812, -0.141322523355484, -0.21843215823173523, 0.4085749685764313, -0.02818986214697361, -0.1076127141714096, -0.47344136238098145, 0.08406048268079758, 0.09922336041927338, -0.33069974184036255, 0.1155819445848465, -0.16019605100154877, 0.18020765483379364, -0.0416685976088047, 0.019057340919971466, 0.1588853895664215, 0.09827719628810883, -0.23557297885417938, 0.35542309284210205, -0.08851289749145508, 0.13873189687728882, 0.47698163986206055, -0.09358182549476624, -0.49279695749282837, 0.6168010830879211, 0.08440171182155609, -0.11832378059625626, -0.06074439734220505, 0.126668781042099, 0.3777231276035309, -0.5824741721153259, 0.04854758083820343, -0.1821306198835373, 0.3193769156932831, 0.17985141277313232, 0.17693795263767242, 0.09765863418579102, -0.15470854938030243, 0.01690080016851425, -0.18755267560482025, -0.15396824479103088, 0.1438630223274231, -0.1883872002363205, 0.009866500273346901, -0.04894237592816353, -0.03524233400821686, 0.09790325909852982, -0.051115140318870544, -0.2933346629142761, 0.23582130670547485, -0.11704322695732117, -0.07947582006454468, 0.4403740167617798, 0.003278220072388649, 0.07784777879714966, -0.23525811731815338, -0.052852436900138855, 0.048293087631464005, -0.38823726773262024, -0.03408107906579971, -0.021746516227722168, 0.21024002134799957, -0.20888613164424896, -0.10356836020946503, -0.004511546343564987, -0.13293211162090302, -0.19171929359436035, 0.004239022731781006, 0.07772326469421387, 0.09521600604057312, 0.19962994754314423, -0.045370616018772125, 0.07505259662866592, 0.06610794365406036, -0.10367568582296371, 0.30685943365097046, 0.3894774615764618, 0.4995192885398865, 0.14143848419189453, 0.020309407263994217, -0.2688715159893036, -0.0704989805817604, 0.28147760033607483, 0.4632892608642578, 0.40419232845306396, -0.07555318623781204, 0.33114540576934814, -0.05521148815751076, 0.13318845629692078, 0.18816238641738892, 0.2203066051006317, 0.24685600399971008, -0.35369253158569336, 0.02463746815919876, 0.149904265999794, 0.08223807066679001, -0.1651301085948944, 0.040610894560813904, 0.1880866140127182, 0.07465171813964844, -0.10174323618412018, 0.1706794649362564, 0.04254043102264404, 0.3218769133090973, 0.11473174393177032, 0.22445635497570038, 0.5657408833503723, 0.16529138386249542, 0.4225997030735016, 0.22259201109409332, -0.04289989173412323, -0.05183973163366318, 0.23789173364639282, 0.5549700856208801, 0.13828647136688232, 0.30613529682159424, -0.3939724266529083, 0.24732115864753723, -0.09527820348739624, 0.009741726331412792, 0.21672022342681885, -0.3687213063240051, 0.08232785761356354, 0.19041723012924194, 0.1309005618095398, 0.17314273118972778, -0.2609604001045227, 0.32135677337646484, 0.1301848143339157, -0.023891186341643333, 0.04174737632274628, 0.23315154016017914, 0.03131500259041786, -0.0048423148691654205, 0.43738943338394165, -0.34099090099334717, -0.4369592070579529, 0.013965047895908356, 0.035325780510902405, -0.37091442942619324, 0.17180658876895905, -0.2004426270723343, -0.1582166850566864, -0.40646862983703613, -0.06518800556659698, 0.22065381705760956, 0.35031819343566895, -0.16094918549060822, -0.17005404829978943, 0.2738528251647949, -0.0027901772409677505, 0.30879032611846924, 0.43490633368492126, 0.4460008442401886, 0.015217214822769165, 0.2067752480506897, 0.1586638242006302, -0.01039259321987629, -0.13434937596321106, 0.06804047524929047, -0.017499035224318504, 0.06563849747180939, -0.0678270012140274, 0.06672340631484985, 0.08283700793981552, -0.04419413581490517, -0.13127490878105164, 0.058655377477407455, 0.16045278310775757, -0.7561158537864685, 0.1685146689414978, -0.34711453318595886, -0.09917449951171875, -0.13705921173095703, 0.012509487569332123, -0.47799599170684814, 0.012021031230688095, 0.3037256598472595, 0.10960507392883301, -0.2028324007987976, -0.167839914560318, 0.031335361301898956, 0.273311972618103, 0.4629681706428528, 0.4718349575996399, 0.12855446338653564, -0.07585856318473816, -0.6442521214485168, -0.6195732951164246, -0.071868896484375, 0.40396031737327576, 0.07102031260728836, 0.07272033393383026, -0.04811973124742508, 0.19532008469104767, 0.06830140948295593, 0.21129177510738373, -0.07992039620876312, 0.10905499011278152, -0.09124892204999924, 0.0049517154693603516, -0.02893209084868431, 0.027672672644257545, 0.05963311344385147, 0.09979680180549622, 0.05788763612508774, 0.1682644486427307, -0.05244377627968788, -0.05986256152391434, -0.2253393530845642, 0.29971033334732056, -0.0349925234913826, -0.4176420569419861, 0.2935132682323456, -0.12167568504810333, 0.1586524397134781, 0.10921767354011536, -0.48611775040626526, -0.29715675115585327, -0.03938882425427437, 0.10171449184417725, 0.35998469591140747, 0.18628418445587158, 0.1825295239686966, -0.3397909104824066, -0.513927161693573, -0.4009588956832886, 0.20142795145511627, 0.16109253466129303, 0.11714042723178864, -0.23559057712554932, -0.011887628585100174, 0.02212868630886078, 0.08088278770446777, 0.3212544918060303, 0.052326738834381104, -0.09245861321687698, 0.19214493036270142, -0.4430866837501526, -0.11162693798542023, 0.6060925126075745, -0.4869227409362793, -0.14240893721580505, -0.31512314081192017, 0.18152400851249695, 0.09139062464237213, -0.39732491970062256, -0.6795108318328857, 0.24631056189537048, 0.2950150668621063, -0.009251672774553299, -0.007111608982086182, 0.28343576192855835, -0.22421754896640778, 0.057381272315979004, -0.05799585580825806, 0.6256875395774841, -0.029306475073099136, -0.19926658272743225, 0.2856755554676056, -0.14693385362625122 ]
https://github.com/huggingface/datasets/issues/6014
I think these parts are outdated: * https://github.com/huggingface/datasets-viewer/blob/8efad8eae313a891f713469983bf4c744786f26e/run.py#L126-L131 * https://github.com/huggingface/datasets-viewer/blob/8efad8eae313a891f713469983bf4c744786f26e/run.py#L145-L150 To make the viewer work, the first one should be replaced with the following: ```python dataset_module = datasets.load.dataset_module_factory(path) builder_cls = datasets.load.import_main_class(dataset_module.module_path) confs = builder_cls.BUILDER_CONFIGS ``` And the second one: ```python dataset_module = datasets.load.dataset_module_factory(path) builder_cls = datasets.load.import_main_class(dataset_module.module_path) if conf: builder_instance = builder_cls(name=conf, cache_dir=path if path_to_datasets is not None else None) else: builder_instance = builder_cls(cache_dir=path if path_to_datasets is not None else None) ``` But as @lhoestq suggested, it's better to use the `datasets-server` API nowadays to [fetch the rows](https://huggingface.co/docs/datasets-server/rows).
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
87
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. I think these parts are outdated: * https://github.com/huggingface/datasets-viewer/blob/8efad8eae313a891f713469983bf4c744786f26e/run.py#L126-L131 * https://github.com/huggingface/datasets-viewer/blob/8efad8eae313a891f713469983bf4c744786f26e/run.py#L145-L150 To make the viewer work, the first one should be replaced with the following: ```python dataset_module = datasets.load.dataset_module_factory(path) builder_cls = datasets.load.import_main_class(dataset_module.module_path) confs = builder_cls.BUILDER_CONFIGS ``` And the second one: ```python dataset_module = datasets.load.dataset_module_factory(path) builder_cls = datasets.load.import_main_class(dataset_module.module_path) if conf: builder_instance = builder_cls(name=conf, cache_dir=path if path_to_datasets is not None else None) else: builder_instance = builder_cls(cache_dir=path if path_to_datasets is not None else None) ``` But as @lhoestq suggested, it's better to use the `datasets-server` API nowadays to [fetch the rows](https://huggingface.co/docs/datasets-server/rows).
[ -0.25805866718292236, -0.015304967761039734, -0.02590104378759861, 0.3342154026031494, 0.14130829274654388, 0.1742892563343048, 0.17373070120811462, 0.4034424424171448, -0.04206851124763489, 0.14834603667259216, -0.16766893863677979, 0.22764688730239868, -0.14093910157680511, 0.20683681964874268, 0.07746215164661407, -0.0839606523513794, 0.002767939120531082, 0.18989892303943634, -0.09367015957832336, 0.026701882481575012, 0.07373195886611938, 0.2122097909450531, -0.2521927058696747, -0.06827812641859055, -0.07246962934732437, 0.21186767518520355, -0.10295017063617706, 0.12217041850090027, -0.140273779630661, -0.6109709143638611, 0.1996714472770691, 0.2596457004547119, 0.13656467199325562, 0.4695333242416382, -0.0001234439987456426, -0.009098373353481293, 0.3741534948348999, -0.09079861640930176, -0.4620968997478485, -0.10121779888868332, 0.055602267384529114, -0.2368983030319214, 0.25105422735214233, -0.09497225284576416, -0.31551840901374817, -0.3143484592437744, -0.09117543697357178, -0.32763200998306274, 0.5458074808120728, 0.09768489748239517, 0.15825188159942627, 0.42516028881073, 0.43103188276290894, -0.2432842254638672, -0.13789919018745422, 0.3362480700016022, -0.011363029479980469, 0.32865816354751587, 0.2543851137161255, 0.14386925101280212, -0.09834416210651398, 0.4029572010040283, 0.045887574553489685, -0.1884458363056183, 0.49212446808815, -0.12607735395431519, 0.06796461343765259, -0.31951549649238586, -0.04487241432070732, -0.08062337338924408, 0.6967698931694031, -0.3949950635433197, -0.3797834515571594, -0.4044531285762787, -0.046746496111154556, 0.07682886719703674, 0.06911766529083252, 0.01541101559996605, -0.14045165479183197, 0.23123899102210999, -0.36372727155685425, -0.5265492796897888, -0.17137518525123596, -0.17865142226219177, 0.04634647071361542, 0.029890932142734528, -0.38342225551605225, 0.04718500003218651, 0.11121983826160431, -0.20605133473873138, 0.06272643804550171, -0.11161437630653381, 0.10861879587173462, 0.15850335359573364, -0.055018629878759384, -0.1757625788450241, 0.06089635193347931, 0.16939185559749603, -0.0850326418876648, 0.35803502798080444, -0.03698621690273285, 0.023878540843725204, 0.048464175313711166, 0.06111513823270798, 0.3345409631729126, 0.1166495829820633, 0.3671785295009613, 0.1402236521244049, 0.0173251423984766, 0.29865580797195435, 0.25291985273361206, -0.06699030101299286, -0.3147332966327667, -0.16525982320308685, -0.19347457587718964, -0.0969294011592865, 0.2911628782749176, -0.13916030526161194, -0.1047104001045227, -0.07807186245918274, 0.18662187457084656, -0.1410023272037506, 0.1266956776380539, 0.34407347440719604, -0.22225412726402283, -0.024324677884578705, 0.10561800003051758, -0.15657582879066467, -0.1321881264448166, -0.692846417427063, -0.11002939939498901, 0.09712405502796173, -0.2675904333591461, 0.08779183775186539, 0.07976822555065155, -0.5483373403549194, 0.07059504091739655, -0.020254909992218018, 0.5228896141052246, -0.019786417484283447, -0.22907988727092743, 0.2448459416627884, -0.05241353437304497, 0.18524324893951416, 0.11108611524105072, 0.12100578844547272, 0.19408607482910156, -0.30349281430244446, -0.16730943322181702, 0.030392855405807495, -0.3065781593322754, -0.40381336212158203, -0.06808710098266602, 0.07548793405294418, -0.35017311573028564, 0.12257419526576996, -0.2935361862182617, 0.12046144157648087, -0.1432758867740631, -0.19811031222343445, 0.07778795808553696, 0.0985698401927948, 0.007796876132488251, -0.21388351917266846, 0.5601895451545715, 0.8168845176696777, -0.2807171940803528, -0.21012693643569946, -0.07978476583957672, -0.26053300499916077, -0.21489492058753967, 0.014002550393342972, -0.07115475833415985, -0.029534615576267242, -0.2142743170261383, -0.21045228838920593, 0.48995304107666016, -0.5807788968086243, -0.2523861229419708, 0.24798446893692017, -0.01562732458114624, 0.11130442470312119, 0.030806634575128555, -0.13809910416603088, -0.10827293992042542, -0.3255484700202942, -0.17862790822982788, 0.09319454431533813, -0.059950344264507294, -0.14126230776309967, -0.12985387444496155, -0.361858993768692, 0.07277812063694, 0.39008253812789917, -0.09802138805389404, 0.08826588094234467, 0.145175501704216, -0.1563444435596466, 0.468278706073761, 0.05144866183400154, 0.0932857021689415, 0.08738405257463455, 0.19080856442451477, 0.5021210312843323, -0.0627688318490982, -0.12045061588287354, -0.2448258250951767, 0.17558985948562622, 0.09169279038906097, -0.18637317419052124, -0.2095913290977478, -0.1688326895236969, -0.38236361742019653, 0.04156051576137543, -0.31985145807266235, -0.36997702717781067, 0.06651987135410309, -0.10358269512653351, 0.19698144495487213, 0.15972770750522614, -0.19536329805850983, 0.37131908535957336, -0.190644770860672, 0.06133358180522919, -0.5639128684997559, 0.32922351360321045, -0.1381160169839859, 0.007447805255651474, 0.144263356924057, 0.20861519873142242, 0.1532333493232727, -0.06403627246618271, 0.071143239736557, 0.4269998073577881, -0.1516370177268982, 0.3792469799518585, -0.02125747874379158, 0.1234883964061737, 0.13562169671058655, -0.3635731339454651, 0.29078933596611023, -0.24282173812389374, -0.07684630155563354, 0.13145416975021362, -0.1639738231897354, 0.12645670771598816, -0.17106497287750244, 0.06626054644584656, 0.22239558398723602, 0.11962300539016724, -0.1901950240135193, 0.3144926428794861, -0.2341027557849884, -0.24702005088329315, 0.030395515263080597, 0.010946262627840042, 0.27388814091682434, -0.15412494540214539, -0.1833299696445465, 0.049482155591249466, 0.19827598333358765, -0.13975894451141357, -0.01923919841647148, 0.10770784318447113, -0.19609366357326508, 0.01913072168827057, 0.09829632192850113, -0.04964522644877434, 0.16627885401248932, 0.08184061199426651, -0.07852555811405182, 0.4191873371601105, 0.3722560405731201, -0.0717804953455925, 0.20382235944271088, 0.14087677001953125, 0.23664645850658417, -0.07898183166980743, -0.17708194255828857, 0.24645879864692688, -0.03519975394010544, -0.13906177878379822, -0.18017928302288055, 0.15993553400039673, -0.41641977429389954, 0.08345673233270645, -0.0704987645149231, -0.15382301807403564, -0.1372624933719635, -0.08565638959407806, -0.2746850252151489, -0.10838893055915833, -0.24620099365711212, 0.0882529616355896, 0.06383556127548218, 0.08050192892551422, -0.3810519874095917, 0.32145148515701294, -0.024376805871725082, -0.003682594746351242, -0.16847267746925354, 0.003828607499599457, -0.005164113827049732, -0.011459119617938995, 0.1700802445411682, -0.14347977936267853, 0.3127728998661041, -0.2986370325088501, 0.35290175676345825, -0.23626524209976196, -0.3454754054546356, 0.06398425996303558, -0.13393904268741608, 0.2748176157474518, 0.2881143093109131, 0.03804686293005943, 0.060629040002822876, -0.0601319894194603, 0.30900534987449646, -0.26372382044792175, -0.18822041153907776, -0.23401856422424316, 0.23103676736354828, -0.09734277427196503, -0.04480203986167908, -0.05348212271928787, -0.28238385915756226, -0.4207279086112976, 0.3249117434024811, -0.07976263761520386, 0.14736203849315643, 0.3298102617263794, 0.15172326564788818, 0.08102405071258545, -0.2799002528190613, 0.16631120443344116, -0.05844096094369888, -0.5344447493553162, 0.2671884000301361, -0.5330650210380554, -0.2506089508533478, 0.040651991963386536, 0.33724576234817505, 0.235934779047966, -0.0586247444152832, -0.35991722345352173, -0.12496457993984222, -0.04144156724214554, -0.018785476684570312, -0.04008512943983078, 0.12652304768562317, 0.16818611323833466, 0.31534790992736816, 0.09175969660282135, -0.00018946081399917603, -0.22908584773540497, -0.24931395053863525, -0.195672869682312, -0.10350951552391052, 0.2111787050962448, 0.2728806436061859, -0.014264807105064392, 0.6474791169166565, 0.5301302671432495, 0.10298179090023041, 0.10480745136737823, 0.018679438158869743, 0.6793031096458435, 0.02421429194509983, -0.44942915439605713, -0.04893089458346367, 0.06905966997146606, 0.19398608803749084, 0.08070193231105804, -0.04829613119363785, 0.30928292870521545, -0.3878478407859802, -0.3007810413837433, -0.29386669397354126, -0.3071048855781555, -0.11808347702026367, -0.052518412470817566, 0.5230435132980347, -0.19881072640419006, 0.11496475338935852, -0.18919406831264496, 0.00507354736328125, 0.2672772705554962, 0.5544177293777466, 0.29324859380722046, 0.08906852453947067, -0.22846578061580658, 0.12848009169101715, -0.299621045589447, 0.1635538935661316, -0.048831164836883545, 0.05183640122413635, -0.11589213460683823, -0.03672172129154205, 0.04816477745771408, 0.06294502317905426, 0.5816049575805664, -0.03487963601946831, 0.15028107166290283, 0.0669335275888443, -0.25337302684783936, -0.33776161074638367, 0.09341183304786682, 0.1785271018743515, 0.1693505346775055, -0.33044224977493286, 0.03220192715525627, -0.08054813742637634, -0.46205994486808777, 0.46054211258888245, -0.007367324084043503, -0.2644241452217102, -0.12400857359170914, 0.05450145900249481, -0.1201155036687851, -0.23869851231575012, -0.35696548223495483, 0.010923966765403748, 0.11486959457397461, -0.10303649306297302, 0.3054429590702057, -0.15089654922485352, 0.050526879727840424, 0.2513423264026642, 0.0789915919303894, 0.31111210584640503, 0.09559598565101624, 0.22510437667369843, 0.660971999168396, -0.15264597535133362, 0.40398508310317993, 0.5309405326843262, -0.07172572612762451, -0.4247592091560364, 0.08829870820045471, 0.11300467699766159, 0.31725630164146423, 0.40829649567604065, -0.15844017267227173, -0.11894307285547256, 0.043307285755872726, 0.051687728613615036, -0.6127693057060242, -0.1396615207195282, 0.22297480702400208, -0.036986105144023895, -0.3108799457550049, -0.7720838785171509, 0.41601186990737915, -0.05430813878774643, 0.010406479239463806, -0.0014683918561786413, 0.5361983180046082, -0.1569717675447464, -0.3309755325317383, -0.04993245378136635, 0.9167616367340088, 0.2768363356590271, 0.19675177335739136, 0.26518747210502625, -0.10316605120897293, 0.2841747999191284, -0.14955180883407593, 0.006905317306518555, -0.2739526927471161, -0.19609113037586212, 0.01675701141357422, -0.11940418183803558, 0.35908272862434387, -0.19859857857227325, -0.14939641952514648, 0.1332002431154251, -0.1505712866783142, -0.052673328667879105, -0.018351104110479355, 0.30134105682373047, -0.035018160939216614, -0.012948544695973396, -0.3841473460197449, 0.08300325274467468, 0.13074909150600433, 0.2246563881635666, -0.06750397384166718, -0.25973033905029297, 0.033572107553482056, -0.035158637911081314, -0.34140151739120483, 0.018763422966003418, 0.017749980092048645, 0.2802361845970154, 0.12958616018295288, -0.2691848576068878, 0.8798472285270691, 0.35402873158454895, 0.16122601926326752, 0.17722925543785095, -0.2526487410068512, 0.12437323480844498, -0.3221926987171173, -0.1192595362663269, -0.17608126997947693, 0.27030321955680847, 0.21103806793689728, -0.1344429850578308, -0.10228659212589264, 0.35226744413375854, -0.06607898324728012, -0.042347054928541183, -0.3300236165523529, 0.030360087752342224, 0.12132041156291962, -0.3595442473888397, 0.06113871559500694, -0.16499924659729004, 0.13832925260066986, -0.0170523002743721, 0.012581106275320053, 0.18001805245876312, -0.03781700134277344, -0.10671120882034302, 0.22099058330059052, -0.047048285603523254, 0.1713426113128662, 0.453220397233963, -0.08690782636404037, -0.4411427676677704, 0.6150889992713928, 0.14946451783180237, -0.18439975380897522, -0.04410480707883835, 0.06646778434515, 0.3659716248512268, -0.554161787033081, 0.035378485918045044, -0.1464385986328125, 0.36024564504623413, 0.09600849449634552, 0.1813410222530365, 0.16912728548049927, -0.14806866645812988, 0.10139603912830353, -0.2189527451992035, -0.19683918356895447, 0.15257301926612854, -0.15791870653629303, 0.10271725058555603, -0.06350710988044739, -0.018105898052453995, 0.10708748549222946, -0.005370521917939186, -0.2669476270675659, 0.1569698303937912, -0.02859441563487053, -0.021154318004846573, 0.3773091435432434, -0.006332249380648136, 0.14282135665416718, -0.2786242365837097, -0.042927201837301254, -0.03850974142551422, -0.3881526589393616, -0.015794310718774796, -0.09875485301017761, 0.2203243225812912, -0.18796728551387787, -0.15395709872245789, 0.10726617276668549, -0.049974773079156876, -0.2291526049375534, -0.04904097691178322, 0.0917837917804718, 0.15156391263008118, 0.12299899756908417, 0.06792814284563065, 0.026414722204208374, 0.07027220726013184, -0.1472579389810562, 0.19847290217876434, 0.3564114570617676, 0.5176507830619812, 0.22130674123764038, 0.03589242324233055, -0.18312911689281464, -0.0541732981801033, 0.290343701839447, 0.47328779101371765, 0.254915714263916, -0.17759162187576294, 0.39092713594436646, -0.12393934279680252, 0.21343162655830383, 0.0910201296210289, 0.319905549287796, 0.38859251141548157, -0.2993616461753845, 0.04203183203935623, 0.16826079785823822, 0.05547995865345001, -0.19316646456718445, 0.06598107516765594, 0.1753503829240799, 0.11445407569408417, 0.003060273826122284, 0.1799584925174713, 0.05627566576004028, 0.27246206998825073, 0.09201160073280334, 0.33342763781547546, 0.5674101710319519, 0.10303816944360733, 0.5005624294281006, 0.28580641746520996, -0.02254725992679596, 0.002583637833595276, 0.24634334444999695, 0.555229127407074, 0.17179587483406067, 0.35908934473991394, -0.4281534254550934, 0.20478367805480957, -0.1762017160654068, -0.019672326743602753, 0.23654961585998535, -0.38962027430534363, 0.1611233949661255, 0.18359781801700592, 0.08099031448364258, 0.15890651941299438, -0.2658473551273346, 0.3507433831691742, 0.0367199182510376, 0.009958438575267792, 0.036497242748737335, 0.18925434350967407, 0.08885221183300018, -0.07909226417541504, 0.3476027250289917, -0.28416556119918823, -0.4586814045906067, -0.06962402909994125, 0.0547446683049202, -0.4937012195587158, 0.13858945667743683, -0.10163263231515884, -0.1111615002155304, -0.3873227834701538, -0.04428921639919281, 0.25923511385917664, 0.3849982023239136, -0.17057010531425476, -0.08864206820726395, 0.3578905165195465, -0.03895080089569092, 0.23981697857379913, 0.3992460370063782, 0.5815081596374512, 0.08199998736381531, 0.1548539698123932, 0.16342075169086456, 0.012223392724990845, -0.07734899967908859, 0.11239951848983765, -0.0011043380945920944, -0.02739083766937256, -0.06334143131971359, 0.144004225730896, 0.08165426552295685, -0.04439947009086609, -0.187808096408844, 0.005275567527860403, 0.0866832360625267, -0.6534528732299805, 0.3137683570384979, -0.2987960875034332, -0.12328176200389862, -0.11129052937030792, 0.018572786822915077, -0.5363253951072693, -0.01578354276716709, 0.41205286979675293, 0.1949291229248047, -0.16534152626991272, -0.13459840416908264, 0.017017588019371033, 0.3537878692150116, 0.499873548746109, 0.4350378215312958, 0.15365901589393616, -0.14070197939872742, -0.4971209168434143, -0.6417441368103027, -0.16613802313804626, 0.36223024129867554, 0.05051034688949585, 0.15578261017799377, -0.026848427951335907, 0.10258745402097702, 0.1664499193429947, 0.17567729949951172, -0.039878182113170624, 0.09677049517631531, -0.09287600964307785, -0.028403390198946, -0.10103174299001694, -0.015224713832139969, 0.02980872057378292, 0.10058629512786865, 0.05119924247264862, 0.04610976204276085, -0.15129603445529938, -0.055829279124736786, -0.19053596258163452, 0.2698235809803009, -0.014571737498044968, -0.3901330530643463, 0.30347520112991333, -0.05905468016862869, 0.2927260100841522, 0.09680773317813873, -0.4807264804840088, -0.29792237281799316, -0.04624103009700775, 0.007043212652206421, 0.4340694546699524, 0.08064232021570206, 0.15485849976539612, -0.33712249994277954, -0.5766650438308716, -0.5043289661407471, 0.18512259423732758, 0.13550519943237305, 0.005774635821580887, -0.2865557372570038, 0.09982505440711975, -0.009022191166877747, 0.24159418046474457, 0.3400357961654663, -0.0003605741076171398, -0.12535817921161652, 0.32049739360809326, -0.5169852375984192, -0.2301945686340332, 0.6401768922805786, -0.45509183406829834, -0.1335463672876358, -0.2652552127838135, 0.16367441415786743, 0.04361329227685928, -0.2836894094944, -0.7796626091003418, 0.22169719636440277, 0.3330390453338623, -0.07740224897861481, 0.046876586973667145, 0.30974265933036804, -0.2361573576927185, -0.003390006721019745, -0.11673010885715485, 0.5788275003433228, -0.07766929268836975, -0.13639363646507263, 0.1753232628107071, -0.19217127561569214 ]
https://github.com/huggingface/datasets/issues/6014
> The dataset viewer on the Hugging Face website is incredibly useful @mariosasko i think @lilyorlilypad wants to run the new dataset-viewer, not the old one
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
26
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. > The dataset viewer on the Hugging Face website is incredibly useful @mariosasko i think @lilyorlilypad wants to run the new dataset-viewer, not the old one
[ -0.2742135524749756, 0.07217845320701599, -0.06602172553539276, 0.331643283367157, 0.006425291299819946, 0.12299636006355286, 0.10355953127145767, 0.4018328785896301, -0.041862621903419495, 0.22050344944000244, -0.21187978982925415, 0.26414546370506287, -0.11946761608123779, 0.2302788496017456, 0.00559692457318306, -0.05807292088866234, -0.07654760777950287, 0.14816150069236755, -0.11701084673404694, 0.025996819138526917, 0.08600135892629623, 0.1328803151845932, -0.2574242353439331, -0.027071066200733185, -0.05049637705087662, 0.20470987260341644, -0.14819788932800293, 0.15406110882759094, -0.1247539296746254, -0.5209571123123169, 0.18547040224075317, 0.3354834318161011, 0.19925826787948608, 0.47931569814682007, -0.0001188883907161653, -0.04868236929178238, 0.34028035402297974, 0.0010333359241485596, -0.40153542160987854, -0.06362685561180115, 0.009834349155426025, -0.1853235363960266, 0.1738339066505432, -0.10909616202116013, -0.2894989848136902, -0.2607661485671997, -0.07427188009023666, -0.4359312057495117, 0.5555288791656494, 0.07260551303625107, 0.1766798198223114, 0.4230281710624695, 0.3248245120048523, -0.28546860814094543, -0.09301544725894928, 0.326627254486084, -0.03328142687678337, 0.25782257318496704, 0.32991671562194824, 0.1491164267063141, -0.07340936362743378, 0.3639446794986725, 0.057726360857486725, -0.22338837385177612, 0.34044456481933594, -0.1466486006975174, -0.049098554998636246, -0.29988425970077515, 0.0894910991191864, -0.08081802725791931, 0.8519566059112549, -0.3600987493991852, -0.26386281847953796, -0.22913125157356262, 0.033147137612104416, 0.17379997670650482, 0.05380478873848915, 0.005836009979248047, -0.1890532374382019, 0.28578779101371765, -0.3553718030452728, -0.5372400283813477, -0.21715259552001953, -0.22283244132995605, 0.07692039757966995, 0.06861796975135803, -0.32628142833709717, 0.0056415461003780365, 0.12744852900505066, -0.21833078563213348, 0.11617761850357056, -0.035732828080654144, 0.04888961464166641, 0.008203651756048203, -0.028704609721899033, -0.2214733064174652, -0.022164467722177505, 0.11373529583215714, -0.09708458185195923, 0.3665199279785156, 0.01813531666994095, 0.0754895806312561, -0.00306706503033638, -0.008437952026724815, 0.4090370535850525, 0.06726841628551483, 0.357363760471344, 0.11903892457485199, 0.13565601408481598, 0.23653492331504822, 0.24328963458538055, -0.014558834955096245, -0.31042999029159546, -0.07408159226179123, -0.20086440443992615, -0.13365426659584045, 0.285228431224823, -0.18116042017936707, -0.06859219074249268, -0.17120543122291565, 0.25955814123153687, -0.19814252853393555, 0.13389219343662262, 0.28452447056770325, -0.17390096187591553, -0.022183742374181747, 0.04538944363594055, -0.27266690135002136, -0.07598705589771271, -0.8182581663131714, -0.11622068285942078, 0.0010522045195102692, -0.323637455701828, 0.15340687334537506, 0.07078738510608673, -0.5319698452949524, 0.014234989881515503, -0.036962397396564484, 0.6073700785636902, 0.025925949215888977, -0.18400803208351135, 0.30751845240592957, -0.113752081990242, 0.15312039852142334, 0.11318523436784744, 0.08853630721569061, 0.15277576446533203, -0.1842462718486786, -0.07549293339252472, 0.1627209186553955, -0.32640132308006287, -0.31589797139167786, -0.15060633420944214, 0.08315028995275497, -0.1995532214641571, 0.08614212274551392, -0.2934744954109192, 0.15146690607070923, -0.2402614951133728, -0.24146050214767456, 0.09114570915699005, 0.18435436487197876, 0.07919041067361832, -0.25743964314460754, 0.48571914434432983, 0.8622174263000488, -0.32750415802001953, -0.12441051751375198, -0.16004249453544617, -0.19456899166107178, -0.2079101949930191, 0.08739384263753891, -0.13615334033966064, -0.1464415192604065, -0.16580629348754883, -0.09602807462215424, 0.521825909614563, -0.5836124420166016, -0.36681270599365234, 0.19923868775367737, -0.14816762506961823, -0.051203832030296326, 0.08332168310880661, -0.07964186370372772, -0.05324673652648926, -0.25497856736183167, -0.23682545125484467, 0.09069210290908813, -0.06956469267606735, -0.10458073019981384, -0.11771610379219055, -0.3816637098789215, 0.11324519664049149, 0.43284302949905396, -0.13266050815582275, 0.11888594925403595, 0.31450706720352173, -0.20897573232650757, 0.5073297619819641, -0.01447334699332714, 0.07513227313756943, -0.06365785747766495, 0.19530467689037323, 0.5001716613769531, -0.0404147133231163, -0.12351486086845398, -0.15851262211799622, 0.12346340715885162, 0.1550678014755249, -0.23754456639289856, -0.10325165092945099, -0.1809718757867813, -0.4561234414577484, 0.023196831345558167, -0.23767004907131195, -0.39100757241249084, 0.08706466853618622, 0.029218262061476707, 0.13119594752788544, 0.1578032374382019, -0.21082225441932678, 0.3631797134876251, -0.11745940148830414, 0.014480255544185638, -0.55194491147995, 0.3177785277366638, -0.11859433352947235, -0.007854973897337914, 0.16885806620121002, 0.18905919790267944, 0.12964797019958496, 0.03711371496319771, 0.062046490609645844, 0.4041142463684082, -0.2152825891971588, 0.3487413823604584, 0.16753694415092468, 0.11324305087327957, 0.10487344115972519, -0.4358842968940735, 0.45869797468185425, -0.21685990691184998, -0.10341036319732666, 0.1821388304233551, -0.17470869421958923, 0.10849086940288544, -0.2235795110464096, -0.06535662710666656, 0.13324423134326935, 0.13310512900352478, -0.27251309156417847, 0.28765246272087097, -0.21469509601593018, -0.15805447101593018, 0.03448742628097534, -0.03291508927941322, 0.30392295122146606, -0.1751657873392105, -0.21159060299396515, 0.09385517239570618, 0.20082032680511475, -0.1758849024772644, 0.03173277899622917, 0.061814166605472565, -0.1491338014602661, -0.0011898800730705261, 0.1346331387758255, -0.10862202197313309, 0.15673956274986267, 0.12123030424118042, -0.046931277960538864, 0.3619716763496399, 0.4680131673812866, -0.12975004315376282, 0.11989074945449829, 0.024064434692263603, 0.24453474581241608, -0.16119477152824402, -0.08166056871414185, 0.21216046810150146, -0.046535469591617584, -0.11490225046873093, -0.12476785480976105, 0.09418061375617981, -0.28014183044433594, 0.03232970088720322, -0.05526261031627655, -0.15953116118907928, -0.20902717113494873, 0.029847703874111176, -0.21221812069416046, -0.020232729613780975, -0.20277775824069977, 0.0784166157245636, 0.08144402503967285, 0.052599288523197174, -0.3462432622909546, 0.4769916534423828, -0.046824805438518524, 0.1166502982378006, -0.16278807818889618, 0.05300347879528999, -0.020853271707892418, 0.02856285870075226, 0.1806764304637909, -0.04997299984097481, 0.3623320162296295, -0.22644269466400146, 0.5005935430526733, -0.27274858951568604, -0.3065410554409027, 0.00008475827053189278, -0.0662916749715805, 0.13686154782772064, 0.2638172209262848, 0.07968629896640778, -0.005257643759250641, -0.07951337099075317, 0.21984952688217163, -0.24106736481189728, -0.22534579038619995, -0.2778710126876831, 0.27778205275535583, -0.0977785736322403, -0.004666745662689209, -0.1574849784374237, -0.3333897888660431, -0.37032434344291687, 0.4130611717700958, -0.24796754121780396, 0.09163772314786911, 0.21324588358402252, 0.14022937417030334, 0.10306607186794281, -0.23713281750679016, 0.01954152062535286, -0.07125628739595413, -0.5251641869544983, 0.20730620622634888, -0.5937285423278809, -0.20849694311618805, -0.0030381903052330017, 0.4605373442173004, 0.13890619575977325, -0.07253382354974747, -0.4047275185585022, -0.03991150110960007, 0.009519299492239952, 0.0909208208322525, -0.03025444969534874, 0.11007799953222275, 0.22304704785346985, 0.2587142586708069, 0.0360042005777359, -0.007626049220561981, -0.2829376459121704, -0.29000064730644226, -0.13912340998649597, -0.13320568203926086, 0.2570752501487732, 0.1591612547636032, -0.010483302175998688, 0.6424639225006104, 0.5002741813659668, 0.1546669453382492, 0.09642478823661804, 0.036982662975788116, 0.6634349822998047, 0.06455345451831818, -0.48750925064086914, -0.026313187554478645, 0.13883817195892334, 0.15411262214183807, 0.07935195416212082, -0.0533258393406868, 0.12599194049835205, -0.34129273891448975, -0.4926740527153015, -0.24011534452438354, -0.22014077007770538, -0.1572982370853424, 0.020316407084465027, 0.503086268901825, -0.12967707216739655, 0.08990108221769333, -0.2182064801454544, -0.025209279730916023, 0.3387141227722168, 0.4716830253601074, 0.22499841451644897, 0.015036415308713913, -0.24070219695568085, 0.1708703339099884, -0.26634344458580017, 0.22093942761421204, -0.04168587177991867, 0.050589028745889664, -0.18437093496322632, -0.04112544283270836, 0.1475953757762909, 0.09606143832206726, 0.6940125823020935, -0.09272352606058121, 0.12992531061172485, -0.049042709171772, -0.22449202835559845, -0.14230112731456757, 0.1779332160949707, 0.1970033198595047, 0.1729612648487091, -0.31557023525238037, -0.015949971973896027, -0.049382708966732025, -0.37692689895629883, 0.4902153015136719, -0.08357653766870499, -0.2602597773075104, -0.06876584142446518, 0.12721207737922668, -0.16404977440834045, -0.1663072407245636, -0.3672882318496704, -0.08954416215419769, 0.0720430538058281, -0.16489163041114807, 0.2845202684402466, -0.10936829447746277, 0.07599372416734695, 0.1876755803823471, 0.06675820052623749, 0.2497185617685318, 0.25302496552467346, 0.1689462661743164, 0.6931001543998718, -0.03824029490351677, 0.460163414478302, 0.4466164708137512, -0.045998647809028625, -0.38077807426452637, 0.11681998521089554, 0.045350659638643265, 0.323790580034256, 0.45173537731170654, -0.10873068869113922, -0.18046672642230988, 0.07374583184719086, 0.07400195300579071, -0.5282683968544006, -0.22046594321727753, 0.23640799522399902, -0.02667662315070629, -0.3371690511703491, -0.7802695035934448, 0.29884928464889526, -0.047324538230895996, -0.02598976343870163, 0.003924969118088484, 0.4395475685596466, -0.10636033117771149, -0.3476111888885498, -0.07852741330862045, 0.9839563965797424, 0.2045561820268631, 0.2150748372077942, 0.19043460488319397, -0.10243263840675354, 0.27560991048812866, -0.22966094315052032, 0.02630557492375374, -0.2890494763851166, -0.19976645708084106, 0.03340114653110504, -0.0869712308049202, 0.3718199133872986, -0.20427367091178894, -0.10574588179588318, 0.0625700131058693, -0.06518001854419708, -0.07159723341464996, -0.02870980277657509, 0.30927056074142456, 0.015126315876841545, 0.05221405252814293, -0.2808009386062622, 0.11039015650749207, 0.12709861993789673, 0.15072759985923767, -0.04338362067937851, -0.40577706694602966, 0.007019229233264923, -0.03784244507551193, -0.36538630723953247, -0.0062863826751708984, -0.01940210908651352, 0.31722375750541687, 0.07676975429058075, -0.25785672664642334, 0.9587450623512268, 0.444563090801239, 0.21275511384010315, 0.23529410362243652, -0.2566172778606415, 0.061999015510082245, -0.26919421553611755, -0.17038866877555847, -0.18699179589748383, 0.22471998631954193, 0.13647505640983582, -0.1480698436498642, -0.2572326064109802, 0.40513843297958374, 0.02375616878271103, -0.1656799018383026, -0.4479708671569824, 0.06335201859474182, 0.13405759632587433, -0.3843691945075989, 0.15199962258338928, -0.20325171947479248, 0.1725156456232071, -0.04022293910384178, 0.039879292249679565, 0.13364902138710022, 0.04598059877753258, -0.1205340176820755, 0.38690897822380066, -0.10172823071479797, 0.14159122109413147, 0.47580647468566895, -0.04511428624391556, -0.47713813185691833, 0.6174224019050598, 0.12859678268432617, -0.14022396504878998, -0.08349624276161194, 0.1546357274055481, 0.36152949929237366, -0.5737603306770325, 0.00915081799030304, -0.21167294681072235, 0.3040836453437805, 0.20731841027736664, 0.18112024664878845, 0.10322815179824829, -0.11547301709651947, 0.04604005813598633, -0.1833989918231964, -0.12171564996242523, 0.14549627900123596, -0.1564043015241623, 0.05828147381544113, -0.061324313282966614, -0.0688566043972969, 0.05552782863378525, -0.05603928864002228, -0.3035130798816681, 0.1980266124010086, -0.05112196132540703, -0.09422848373651505, 0.42653369903564453, 0.06212165206670761, 0.06672579050064087, -0.2136801779270172, -0.04686104878783226, 0.10471094399690628, -0.34979280829429626, -0.047194551676511765, 0.018371611833572388, 0.21961060166358948, -0.23683668673038483, -0.08335824310779572, -0.015313167124986649, -0.17216482758522034, -0.2318483144044876, 0.03337904065847397, 0.047916606068611145, 0.046539656817913055, 0.16288618743419647, -0.05906783789396286, 0.0457976795732975, 0.07771499454975128, -0.07622716575860977, 0.33196941018104553, 0.3892083466053009, 0.49441710114479065, 0.10637416690587997, 0.07205379009246826, -0.20416484773159027, -0.052327536046504974, 0.28073886036872864, 0.44556379318237305, 0.38368940353393555, -0.05300789326429367, 0.28227874636650085, -0.0897703617811203, 0.1135316789150238, 0.164009228348732, 0.272835373878479, 0.275391548871994, -0.3113774061203003, 0.04108886420726776, 0.17873403429985046, 0.0863102599978447, -0.16986986994743347, 0.025318369269371033, 0.18546639382839203, 0.05456237122416496, -0.09720736742019653, 0.19827087223529816, 0.03390929102897644, 0.3140147626399994, 0.12847058475017548, 0.24695764482021332, 0.4955645799636841, 0.16069674491882324, 0.4645443260669708, 0.25889158248901367, -0.08614569902420044, -0.05218971520662308, 0.24028778076171875, 0.5874274969100952, 0.09317423403263092, 0.39575186371803284, -0.39740023016929626, 0.2359449714422226, -0.07541759312152863, -0.040039680898189545, 0.19923076033592224, -0.3519713878631592, 0.1625116765499115, 0.12049973756074905, 0.14232417941093445, 0.16694208979606628, -0.2320852130651474, 0.3159714937210083, 0.05958874523639679, 0.016106117516756058, 0.004429936408996582, 0.19307111203670502, 0.06745147705078125, -0.013198405504226685, 0.3660585284233093, -0.3669137954711914, -0.43746891617774963, 0.020451806485652924, 0.031756240874528885, -0.38491180539131165, 0.21676693856716156, -0.19395984709262848, -0.13059009611606598, -0.37301063537597656, -0.07602526247501373, 0.22571760416030884, 0.32321932911872864, -0.1982516348361969, -0.1975841224193573, 0.23804156482219696, 0.0010270513594150543, 0.2920580208301544, 0.3995725214481354, 0.45852231979370117, 0.05980595573782921, 0.1341494470834732, 0.13510280847549438, 0.0006714165210723877, -0.12496345490217209, 0.08627806603908539, -0.0022094715386629105, 0.05215907841920853, -0.04366561770439148, 0.0860980972647667, 0.0895090252161026, -0.05698337405920029, -0.12569959461688995, 0.057414453476667404, 0.1403380185365677, -0.7623274922370911, 0.15712320804595947, -0.27667897939682007, -0.07627476006746292, -0.09841206669807434, -0.04290751367807388, -0.5144190788269043, 0.018239784985780716, 0.3636039197444916, 0.12583953142166138, -0.19948062300682068, -0.208513543009758, 0.033239658921957016, 0.2667763829231262, 0.4736042618751526, 0.4250332713127136, 0.14394742250442505, -0.0806184709072113, -0.5678180456161499, -0.635715901851654, -0.074337437748909, 0.4319968819618225, 0.10437130182981491, 0.059463050216436386, -0.0626845508813858, 0.22113780677318573, 0.13441228866577148, 0.20957937836647034, -0.0633537620306015, 0.11384556442499161, 0.009172692894935608, 0.0031534135341644287, -0.04218943417072296, 0.03239164501428604, 0.09532171487808228, 0.09536899626255035, 0.057256102561950684, 0.14062249660491943, -0.02924392931163311, -0.06123838201165199, -0.29538682103157043, 0.2801072597503662, 0.005659818649291992, -0.46730685234069824, 0.2945433557033539, -0.14574222266674042, 0.24243685603141785, 0.11470939218997955, -0.48607853055000305, -0.31724482774734497, -0.080348901450634, 0.06136688217520714, 0.4078592360019684, 0.17873305082321167, 0.1588989794254303, -0.33374646306037903, -0.5457341074943542, -0.47234705090522766, 0.1863224059343338, 0.1134074330329895, 0.16445502638816833, -0.18558204174041748, -0.04203781485557556, 0.03741574287414551, 0.11144296824932098, 0.3526695966720581, 0.022614503279328346, -0.0899139791727066, 0.23141935467720032, -0.4428885877132416, -0.15049035847187042, 0.563321053981781, -0.5615388751029968, -0.1497925966978073, -0.29733002185821533, 0.16800367832183838, 0.045680005103349686, -0.378846138715744, -0.723625123500824, 0.2574496269226074, 0.27556031942367554, -0.0648525059223175, 0.04875349998474121, 0.3362269401550293, -0.2153756022453308, 0.08019013702869415, -0.054331742227077484, 0.6143087148666382, -0.0783412829041481, -0.1771431565284729, 0.2264927178621292, -0.18259036540985107 ]
https://github.com/huggingface/datasets/issues/6014
> wants to run the new dataset-viewer, not the old one Thanks for the clarification for me. I do want to run the new dataset-viewer.
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
25
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. > wants to run the new dataset-viewer, not the old one Thanks for the clarification for me. I do want to run the new dataset-viewer.
[ -0.2614268362522125, 0.04871726036071777, -0.04760860279202461, 0.3212714195251465, -0.0047023119404911995, 0.13446806371212006, 0.09149372577667236, 0.36667561531066895, -0.02975161001086235, 0.21518786251544952, -0.2112337350845337, 0.23290081322193146, -0.12499379366636276, 0.22897718846797943, 0.03218405693769455, -0.023554716259241104, -0.06755269318819046, 0.17144204676151276, -0.07886660099029541, 0.02115809917449951, 0.08932911604642868, 0.14219656586647034, -0.23201632499694824, -0.017743036150932312, -0.039079420268535614, 0.18327398598194122, -0.14592784643173218, 0.17075176537036896, -0.12421678006649017, -0.5344423651695251, 0.18036507070064545, 0.34383895993232727, 0.18627934157848358, 0.5005994439125061, -0.00012127302761655301, -0.04966752976179123, 0.3446807861328125, -0.007007181644439697, -0.4003859758377075, -0.08285899460315704, 0.027803868055343628, -0.1891191303730011, 0.19071419537067413, -0.12315063923597336, -0.2819979786872864, -0.22633004188537598, -0.07042457163333893, -0.4171406924724579, 0.5824145078659058, 0.058025654405355453, 0.15561777353286743, 0.4301493167877197, 0.3286899924278259, -0.2867937684059143, -0.11990050226449966, 0.3483450412750244, -0.0069384947419166565, 0.2727546691894531, 0.34138917922973633, 0.15108714997768402, -0.08644893765449524, 0.3348180949687958, 0.061345286667346954, -0.2265813648700714, 0.359996497631073, -0.1572379618883133, -0.007682302966713905, -0.27217501401901245, 0.09944750368595123, -0.07516145706176758, 0.8571999073028564, -0.36792322993278503, -0.28474509716033936, -0.23671388626098633, 0.05131332203745842, 0.15180322527885437, 0.05566105991601944, 0.009799782186746597, -0.21232208609580994, 0.28529372811317444, -0.35448944568634033, -0.5489212870597839, -0.20490999519824982, -0.2373705804347992, 0.054637715220451355, 0.031032849103212357, -0.3264685273170471, 0.015196164138615131, 0.15330196917057037, -0.22884005308151245, 0.0729278028011322, -0.014300231821835041, 0.056751009076833725, 0.0029073134064674377, -0.02333732694387436, -0.22328931093215942, -0.007702535018324852, 0.12591977417469025, -0.08068179339170456, 0.3403032720088959, 0.014245912432670593, 0.06421441584825516, -0.015578273683786392, -0.01494770497083664, 0.41408997774124146, 0.03646869584918022, 0.3748789131641388, 0.11772273480892181, 0.13305793702602386, 0.25515300035476685, 0.2236858755350113, -0.03315116465091705, -0.3033486008644104, -0.06577261537313461, -0.2031121850013733, -0.13363592326641083, 0.2934333086013794, -0.17189982533454895, -0.04928835853934288, -0.1613001525402069, 0.2609747052192688, -0.1978815197944641, 0.13898532092571259, 0.3053963780403137, -0.1758337765932083, -0.05841541290283203, 0.05293922871351242, -0.2721138596534729, -0.08344605565071106, -0.8230458498001099, -0.11211538314819336, 0.00800061970949173, -0.32992297410964966, 0.16305556893348694, 0.05333992838859558, -0.5200127959251404, 0.017197944223880768, -0.03003491461277008, 0.6142529845237732, 0.017034322023391724, -0.21784046292304993, 0.29562321305274963, -0.133323535323143, 0.14912721514701843, 0.13325300812721252, 0.1024123802781105, 0.13621236383914948, -0.22879162430763245, -0.07254569232463837, 0.15221692621707916, -0.33275488018989563, -0.33948731422424316, -0.13200393319129944, 0.056743964552879333, -0.21324311196804047, 0.12160263955593109, -0.27508968114852905, 0.1347464919090271, -0.2555139362812042, -0.25099214911460876, 0.06636976450681686, 0.18324261903762817, 0.07238984107971191, -0.25805729627609253, 0.4729235768318176, 0.8818506002426147, -0.3338065445423126, -0.13343867659568787, -0.1528010368347168, -0.16868701577186584, -0.21998846530914307, 0.09898772835731506, -0.12544894218444824, -0.17644734680652618, -0.180566668510437, -0.11430494487285614, 0.5382038950920105, -0.6018004417419434, -0.37287139892578125, 0.1840532422065735, -0.13687054812908173, -0.060100533068180084, 0.09012159705162048, -0.08458772301673889, -0.043207261711359024, -0.269500195980072, -0.24256756901741028, 0.06580255925655365, -0.07350887358188629, -0.1299600452184677, -0.09746631979942322, -0.3707921504974365, 0.09755948185920715, 0.4277125597000122, -0.14984242618083954, 0.12810426950454712, 0.30492153763771057, -0.19537648558616638, 0.5369929075241089, -0.011725708842277527, 0.06556465476751328, -0.045769307762384415, 0.19881202280521393, 0.5187270641326904, -0.030461624264717102, -0.10486943274736404, -0.14550518989562988, 0.14629672467708588, 0.14826346933841705, -0.24213990569114685, -0.09456447511911392, -0.18682871758937836, -0.4599533975124359, 0.03861317038536072, -0.21244961023330688, -0.38056349754333496, 0.057167310267686844, 0.037124987691640854, 0.13347069919109344, 0.16541950404644012, -0.21891160309314728, 0.35445353388786316, -0.1512409746646881, 0.030338261276483536, -0.5491184592247009, 0.28944602608680725, -0.126974418759346, -0.016737420111894608, 0.17964717745780945, 0.19959406554698944, 0.12866462767124176, 0.05260259658098221, 0.07194053381681442, 0.371470183134079, -0.2377064824104309, 0.35383617877960205, 0.13560591638088226, 0.10849921405315399, 0.12293536216020584, -0.43028169870376587, 0.44801798462867737, -0.23051831126213074, -0.08501812815666199, 0.18492166697978973, -0.154744952917099, 0.09236440807580948, -0.1911923587322235, -0.04640718176960945, 0.16907507181167603, 0.13813111186027527, -0.2740139067173004, 0.2841307520866394, -0.21224817633628845, -0.14684446156024933, 0.04927439242601395, -0.01996002346277237, 0.3112325370311737, -0.21026328206062317, -0.19206367433071136, 0.08506889641284943, 0.22276775538921356, -0.18885189294815063, 0.046334199607372284, 0.07847621291875839, -0.15277880430221558, 0.013465389609336853, 0.11026064306497574, -0.11811838299036026, 0.14029181003570557, 0.10954953730106354, -0.052034758031368256, 0.37151360511779785, 0.4891514778137207, -0.12502777576446533, 0.0853838250041008, -0.0011153090745210648, 0.2739524245262146, -0.16495007276535034, -0.09541542828083038, 0.20864281058311462, -0.040650270879268646, -0.12043826282024384, -0.12919142842292786, 0.09419649839401245, -0.2700369656085968, 0.02728378027677536, -0.043857477605342865, -0.15834608674049377, -0.184555321931839, 0.06324118375778198, -0.23713216185569763, -0.0032505132257938385, -0.229692742228508, 0.10163571685552597, 0.0963129848241806, 0.04137015342712402, -0.3562435507774353, 0.46540918946266174, -0.04718080908060074, 0.1309000849723816, -0.15110161900520325, 0.0409780815243721, -0.039215587079524994, 0.0029277391731739044, 0.14693905413150787, -0.08912836015224457, 0.33178871870040894, -0.22812420129776, 0.48558858036994934, -0.28404733538627625, -0.2968851923942566, 0.014751231297850609, -0.06468439102172852, 0.12324284762144089, 0.27940666675567627, 0.09420797228813171, -0.017184928059577942, -0.054230958223342896, 0.2143758237361908, -0.2735178470611572, -0.23905061185359955, -0.2831609547138214, 0.28541165590286255, -0.07717161625623703, 0.03142049163579941, -0.11311489343643188, -0.3381497859954834, -0.37052807211875916, 0.41204386949539185, -0.23916880786418915, 0.08666784316301346, 0.21895378828048706, 0.12090902030467987, 0.09496784955263138, -0.23352177441120148, 0.03178057819604874, -0.07402639091014862, -0.5215363502502441, 0.18926960229873657, -0.5777572393417358, -0.217063769698143, 0.012330584228038788, 0.45455285906791687, 0.13556990027427673, -0.06770795583724976, -0.4049612879753113, -0.05698390677571297, 0.017983904108405113, 0.0884149968624115, -0.04482809454202652, 0.10916920006275177, 0.2323758602142334, 0.2516411244869232, 0.048269130289554596, -0.027085065841674805, -0.3196786046028137, -0.28021949529647827, -0.08996418863534927, -0.14810310304164886, 0.30030375719070435, 0.1938484162092209, -0.02228599786758423, 0.623166024684906, 0.489617258310318, 0.16764602065086365, 0.09587638825178146, 0.018468869850039482, 0.6503528952598572, 0.08272551000118256, -0.4828673303127289, -0.044054992496967316, 0.13717792928218842, 0.14886988699436188, 0.07899568974971771, -0.05295681580901146, 0.1481301486492157, -0.3359311819076538, -0.5061277151107788, -0.2458796352148056, -0.23417574167251587, -0.15768466889858246, 0.03661638870835304, 0.5193922519683838, -0.15014055371284485, 0.086357980966568, -0.20131275057792664, 0.0035866759717464447, 0.3463667929172516, 0.4928078353404999, 0.2530692517757416, 0.018637709319591522, -0.23439231514930725, 0.17592129111289978, -0.2806219160556793, 0.2043851613998413, -0.05270928889513016, 0.026540588587522507, -0.21464231610298157, -0.01122671365737915, 0.14334499835968018, 0.08588298410177231, 0.7173318266868591, -0.08873579651117325, 0.18087078630924225, -0.06366583704948425, -0.25451427698135376, -0.15505117177963257, 0.19831928610801697, 0.2050970196723938, 0.1758774071931839, -0.3475591838359833, -0.04983045160770416, -0.0683477371931076, -0.3759382367134094, 0.48283499479293823, -0.07793297618627548, -0.2699486017227173, -0.06259962916374207, 0.13123482465744019, -0.1925511509180069, -0.17454032599925995, -0.37267452478408813, -0.101673923432827, 0.0721651166677475, -0.1276085525751114, 0.29219722747802734, -0.11711623519659042, 0.04447145015001297, 0.18718892335891724, 0.06381449103355408, 0.25272440910339355, 0.24081751704216003, 0.1652466207742691, 0.7020712494850159, -0.06294050067663193, 0.44917845726013184, 0.4651523232460022, -0.03855166584253311, -0.4008997082710266, 0.12366238236427307, 0.05904308706521988, 0.31914326548576355, 0.48773327469825745, -0.10727636516094208, -0.15528476238250732, 0.0804261863231659, 0.055011920630931854, -0.5334831476211548, -0.22833925485610962, 0.25329598784446716, -0.01560947299003601, -0.3467453420162201, -0.7661544680595398, 0.2860463559627533, -0.031397026032209396, -0.02687031775712967, -0.0318307988345623, 0.48856163024902344, -0.10558211803436279, -0.351633220911026, -0.09428903460502625, 1.0215766429901123, 0.20844843983650208, 0.22013607621192932, 0.19828273355960846, -0.12895365059375763, 0.27634745836257935, -0.20642921328544617, 0.022444013506174088, -0.29403573274612427, -0.19688986241817474, 0.020824909210205078, -0.08223015815019608, 0.35629671812057495, -0.19902005791664124, -0.0798964574933052, 0.0606895349919796, -0.05528891086578369, -0.08969376981258392, -0.010564787313342094, 0.3120054304599762, 0.01512405090034008, 0.04587835818529129, -0.29893958568573, 0.08338553458452225, 0.1293422281742096, 0.1644923835992813, -0.039520956575870514, -0.39973515272140503, 0.0324396938085556, -0.05147485435009003, -0.3839420676231384, -0.014307145029306412, -0.014855392277240753, 0.286922812461853, 0.0832618772983551, -0.29050058126449585, 0.9687223434448242, 0.41448649764060974, 0.18872559070587158, 0.23326925933361053, -0.24564309418201447, 0.06121232360601425, -0.282158225774765, -0.16767518222332, -0.20693813264369965, 0.23823493719100952, 0.1302112638950348, -0.15481272339820862, -0.24137181043624878, 0.4177784025669098, 0.008649330586194992, -0.15912951529026031, -0.42873072624206543, 0.06667041778564453, 0.13812392950057983, -0.38929736614227295, 0.15521682798862457, -0.2009049952030182, 0.1541358083486557, -0.030828822404146194, 0.015591655857861042, 0.12861958146095276, 0.03496607020497322, -0.16121214628219604, 0.38157010078430176, -0.08386170119047165, 0.1592303216457367, 0.4634704291820526, -0.02964489720761776, -0.4624544382095337, 0.638529896736145, 0.10742560029029846, -0.13352295756340027, -0.06406126916408539, 0.1146322637796402, 0.4143838584423065, -0.5819214582443237, 0.02068289741873741, -0.20359325408935547, 0.30954229831695557, 0.2028777301311493, 0.1648123562335968, 0.11255987733602524, -0.11000978946685791, 0.0381331592798233, -0.21140559017658234, -0.11611656844615936, 0.15585634112358093, -0.16473405063152313, 0.04200363531708717, -0.02607617899775505, -0.06872536242008209, 0.053788937628269196, -0.04195656627416611, -0.2803565263748169, 0.19775190949440002, -0.03638540580868721, -0.09720376133918762, 0.43400704860687256, 0.05350222438573837, 0.06671135127544403, -0.2041667103767395, -0.06694508343935013, 0.10505441576242447, -0.3537147343158722, -0.020997831597924232, 0.02166852355003357, 0.2365764081478119, -0.2327733039855957, -0.06410910189151764, 0.007740110158920288, -0.15279841423034668, -0.2169855535030365, 0.04630789905786514, 0.048219747841358185, 0.029951833188533783, 0.1678459197282791, -0.0805780291557312, 0.044127654284238815, 0.0984356626868248, -0.12267623841762543, 0.33014315366744995, 0.38769498467445374, 0.49221014976501465, 0.09664668142795563, 0.07596835494041443, -0.20280654728412628, -0.04627548158168793, 0.2839355170726776, 0.4365052282810211, 0.3775734305381775, -0.06268778443336487, 0.3056223392486572, -0.0778055191040039, 0.1424904316663742, 0.14948336780071259, 0.27244579792022705, 0.27524539828300476, -0.2997322380542755, 0.03877020627260208, 0.18460673093795776, 0.05803683400154114, -0.17618772387504578, 0.02269899845123291, 0.19996707141399384, 0.03134961426258087, -0.09030164778232574, 0.21665912866592407, 0.01672092080116272, 0.3320392668247223, 0.11027081310749054, 0.24794605374336243, 0.5172939896583557, 0.14260339736938477, 0.4375990033149719, 0.2860890328884125, -0.08375918865203857, -0.034365247935056686, 0.24951869249343872, 0.589841365814209, 0.11175211519002914, 0.3993692100048065, -0.4093915820121765, 0.24312256276607513, -0.0738673061132431, -0.052781954407691956, 0.21647922694683075, -0.3631267547607422, 0.16718637943267822, 0.14714378118515015, 0.16773755848407745, 0.16781668365001678, -0.23241876065731049, 0.2895207405090332, 0.06362874805927277, 0.01426682248711586, 0.0014102533459663391, 0.18762749433517456, 0.06421878933906555, -0.003472529351711273, 0.35754790902137756, -0.3540363609790802, -0.4543147683143616, 0.040846556425094604, 0.021358167752623558, -0.37734508514404297, 0.20570646226406097, -0.19612012803554535, -0.10814185440540314, -0.3626827001571655, -0.11165733635425568, 0.2204732745885849, 0.3360515236854553, -0.18190312385559082, -0.1944078952074051, 0.2484017014503479, 0.017673270776867867, 0.2979443371295929, 0.417734831571579, 0.4651966691017151, 0.03207812085747719, 0.15243233740329742, 0.16757649183273315, 0.002063427120447159, -0.11270375549793243, 0.0925733894109726, -0.03182955086231232, 0.05580949783325195, -0.056843556463718414, 0.05998224765062332, 0.0676899403333664, -0.03660948574542999, -0.14098481833934784, 0.04360193386673927, 0.09069304913282394, -0.7558910846710205, 0.16112534701824188, -0.2601231634616852, -0.07385440170764923, -0.10103026032447815, -0.03991738334298134, -0.487901896238327, 0.0232015922665596, 0.36977091431617737, 0.12551136314868927, -0.21440820395946503, -0.1730428785085678, 0.01957603543996811, 0.24899092316627502, 0.4653908610343933, 0.4373261034488678, 0.14877815544605255, -0.0738440454006195, -0.548801064491272, -0.6187455058097839, -0.06065356358885765, 0.42389214038848877, 0.07114705443382263, 0.0579494908452034, -0.07104101777076721, 0.2210584431886673, 0.12083354592323303, 0.23683799803256989, -0.07120762020349503, 0.09584033489227295, -0.006737298332154751, 0.0226702019572258, -0.07326233386993408, 0.07940763235092163, 0.08359101414680481, 0.0789511650800705, 0.08634865283966064, 0.135685533285141, -0.03966943174600601, -0.08509735018014908, -0.26385781168937683, 0.26671671867370605, 0.003025852143764496, -0.4780474305152893, 0.28865474462509155, -0.14003810286521912, 0.25563663244247437, 0.12018115818500519, -0.4966983497142792, -0.2709200382232666, -0.052736811339855194, 0.055980127304792404, 0.4299434721469879, 0.1966593861579895, 0.14495527744293213, -0.3413935899734497, -0.5101132392883301, -0.47666701674461365, 0.1874081939458847, 0.1116468757390976, 0.15545135736465454, -0.1867993175983429, -0.032430022954940796, 0.04115511476993561, 0.12522044777870178, 0.3733408749103546, 0.023902416229248047, -0.0985795184969902, 0.22594749927520752, -0.4676761329174042, -0.1508510410785675, 0.5912033319473267, -0.5483287572860718, -0.13591954112052917, -0.2966637909412384, 0.18634413182735443, 0.049435459077358246, -0.3694940507411957, -0.721405565738678, 0.25180599093437195, 0.27583569288253784, -0.0575108528137207, 0.05012334883213043, 0.3164574205875397, -0.21009618043899536, 0.06927110254764557, -0.05047919601202011, 0.6136962175369263, -0.06417454779148102, -0.20934568345546722, 0.23566114902496338, -0.1697171926498413 ]
https://github.com/huggingface/datasets/issues/6014
It should be possible to run it locally using the HF datasets-server API (docs [here](https://huggingface.co/docs/datasets-server)) but the front end part is not open source (yet ?) The back-end is open source though if you're interested: https://github.com/huggingface/datasets-server It automatically converts datasets on HF to Parquet, which is the format we use to power the viewer.
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
54
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. It should be possible to run it locally using the HF datasets-server API (docs [here](https://huggingface.co/docs/datasets-server)) but the front end part is not open source (yet ?) The back-end is open source though if you're interested: https://github.com/huggingface/datasets-server It automatically converts datasets on HF to Parquet, which is the format we use to power the viewer.
[ -0.30234646797180176, -0.03900596499443054, -0.02046775445342064, 0.2967483699321747, 0.009397516027092934, 0.13059890270233154, 0.04538210481405258, 0.38922378420829773, -0.012390416115522385, 0.1952628195285797, -0.29669731855392456, 0.22623896598815918, -0.15911421179771423, 0.382734477519989, 0.09070362150669098, -0.09622974693775177, -0.0347982794046402, 0.1348208785057068, -0.20354923605918884, -0.044192828238010406, 0.08353005349636078, 0.16670449078083038, -0.22522562742233276, 0.06465691328048706, 0.038455456495285034, 0.18584421277046204, -0.22543248534202576, 0.184890016913414, -0.11050794273614883, -0.40824204683303833, 0.15992581844329834, 0.3568277060985565, 0.1919099986553192, 0.47684621810913086, -0.0001191885894513689, -0.053360261023044586, 0.23889796435832977, -0.0008907616138458252, -0.3572375178337097, -0.1646454781293869, 0.08656537532806396, -0.11957481503486633, 0.1559869349002838, -0.0802306979894638, -0.2878836393356323, -0.328465074300766, -0.06544055044651031, -0.44444477558135986, 0.530188262462616, 0.07165750861167908, 0.14495913684368134, 0.42970508337020874, 0.2581228017807007, -0.20913438498973846, -0.04063127562403679, 0.4415448009967804, -0.03730390593409538, 0.21835625171661377, 0.23664841055870056, 0.0376078262925148, -0.13427069783210754, 0.32507577538490295, 0.08565596491098404, -0.16984418034553528, 0.46710842847824097, -0.13735738396644592, -0.16026034951210022, -0.24003732204437256, 0.10097385942935944, 0.02678326517343521, 0.7223506569862366, -0.4432389438152313, -0.3079805076122284, -0.26528996229171753, 0.03481210395693779, 0.14679637551307678, 0.011345885694026947, 0.19603364169597626, -0.1264229416847229, 0.24600277841091156, -0.3531931936740875, -0.5556279420852661, -0.2265121042728424, -0.19730402529239655, 0.07818504422903061, 0.03292156010866165, -0.3342166244983673, 0.010728235356509686, 0.10275809466838837, -0.23674654960632324, 0.06331877410411835, -0.15046288073062897, 0.08642546832561493, 0.08591315150260925, -0.04595920816063881, -0.17447713017463684, -0.034428905695676804, 0.1395339071750641, 0.03725124150514603, 0.1859525740146637, -0.043387096375226974, 0.14148510992527008, -0.058187078684568405, 0.040553025901317596, 0.45153528451919556, -0.031653471291065216, 0.350426584482193, 0.15335868299007416, 0.049407072365283966, 0.26946619153022766, 0.2636348009109497, -0.018132280558347702, -0.29419976472854614, -0.020572394132614136, -0.3653806746006012, -0.24480479955673218, 0.21476447582244873, -0.2521666884422302, -0.08139713108539581, -0.09685268998146057, 0.2402891367673874, -0.1064513772726059, 0.10941478610038757, 0.34898683428764343, -0.21221739053726196, -0.033259160816669464, 0.04046151041984558, -0.22347867488861084, -0.16445302963256836, -0.7894435524940491, -0.08636941015720367, 0.035022053867578506, -0.25581294298171997, 0.1896166056394577, 0.05981893837451935, -0.5493648052215576, -0.011812496930360794, -0.026518285274505615, 0.6413710117340088, 0.1402909904718399, -0.17287921905517578, 0.2336265742778778, -0.11679577827453613, 0.10339543968439102, 0.12599113583564758, 0.0025131553411483765, 0.2374756932258606, -0.1650114357471466, -0.09840331971645355, 0.042795710265636444, -0.30967622995376587, -0.2635538578033447, -0.23572346568107605, 0.05265546217560768, -0.19569000601768494, 0.08844827860593796, -0.33952295780181885, 0.2046264410018921, -0.3047110140323639, -0.20351958274841309, 0.04355930909514427, 0.1373404711484909, -0.04451518505811691, -0.21594305336475372, 0.527262806892395, 0.8897863030433655, -0.33999159932136536, -0.13129054009914398, -0.05026447772979736, -0.19513311982154846, -0.19461235404014587, 0.11194705963134766, -0.14075212180614471, -0.11072875559329987, -0.20226961374282837, -0.11649750173091888, 0.4148842692375183, -0.5457676649093628, -0.22771409153938293, 0.29185575246810913, -0.011181987822055817, -0.06957753002643585, 0.025523899123072624, -0.2133415937423706, -0.023221135139465332, -0.2174946516752243, -0.2382262945175171, 0.12130001187324524, -0.06832768023014069, -0.10762827098369598, -0.13194654881954193, -0.3881431519985199, 0.008997822180390358, 0.46899059414863586, -0.05010584741830826, 0.12466087937355042, 0.32012835144996643, -0.21026727557182312, 0.5442495942115784, -0.09530141949653625, 0.1291998326778412, -0.022221917286515236, 0.18638700246810913, 0.5995831489562988, -0.04642225429415703, -0.1494099348783493, -0.1679248809814453, 0.06861847639083862, 0.018222957849502563, -0.2066756635904312, -0.14007297158241272, -0.2704821228981018, -0.3711029291152954, 0.08802273124456406, -0.20778565108776093, -0.3445919454097748, 0.07739639282226562, -0.014776159077882767, 0.08933860063552856, 0.15268369019031525, -0.25174832344055176, 0.4281478822231293, -0.18647459149360657, -0.015333395451307297, -0.48118719458580017, 0.40068477392196655, -0.03427371010184288, 0.038832783699035645, 0.25737959146499634, 0.15947364270687103, 0.11020644009113312, -0.020473526790738106, 0.04483797773718834, 0.4466302692890167, -0.19591405987739563, 0.34791016578674316, 0.2183396965265274, 0.13017237186431885, 0.11815032362937927, -0.4440730810165405, 0.4207579791545868, -0.28389766812324524, -0.0755443423986435, 0.17370963096618652, -0.25867536664009094, 0.15792524814605713, -0.22042179107666016, 0.0018250159919261932, 0.14098265767097473, 0.11831977963447571, -0.28135132789611816, 0.3273361921310425, -0.17814892530441284, -0.14993202686309814, 0.10110493749380112, -0.11623027175664902, 0.2797529995441437, -0.22086888551712036, -0.26210346817970276, 0.1075635701417923, 0.2720664143562317, -0.15574578940868378, -0.036730870604515076, 0.1574099361896515, -0.1493508368730545, 0.03292316198348999, 0.19786381721496582, -0.1782894730567932, 0.1005924642086029, 0.1193971037864685, -0.0703325867652893, 0.45402124524116516, 0.3585074841976166, 0.01086786761879921, 0.0659937858581543, 0.03565637394785881, 0.23264914751052856, -0.14970745146274567, -0.15707218647003174, 0.21990661323070526, -0.10273971408605576, -0.12288305908441544, -0.1575489491224289, 0.06718440353870392, -0.33102864027023315, 0.09355505555868149, -0.1760958880186081, -0.15229104459285736, -0.18238118290901184, 0.15095122158527374, -0.2321408987045288, -0.07060854882001877, -0.21776287257671356, 0.08037126064300537, 0.08175359666347504, 0.004504445940256119, -0.37355339527130127, 0.4129548668861389, -0.09097777307033539, 0.040886275470256805, -0.18866091966629028, 0.018366310745477676, -0.08808793127536774, -0.0002164691686630249, 0.2795584797859192, -0.00165465846657753, 0.3696090579032898, -0.2485143095254898, 0.41172927618026733, -0.32520627975463867, -0.298387348651886, 0.058343593031167984, -0.028586816042661667, 0.1470830887556076, 0.3100912868976593, 0.011928267776966095, -0.1989605873823166, -0.011817079037427902, 0.21736787259578705, -0.2818906605243683, -0.17636039853096008, -0.19434450566768646, 0.20424902439117432, -0.12129327654838562, -0.026264037936925888, -0.04022948816418648, -0.3107824921607971, -0.4034773111343384, 0.38997137546539307, -0.189386248588562, 0.1603805422782898, 0.09519876539707184, 0.0739603042602539, 0.19870585203170776, -0.2752114236354828, 0.02566733956336975, -0.10120314359664917, -0.5150471925735474, 0.23261845111846924, -0.6172346472740173, -0.314485102891922, 0.04564802348613739, 0.40603601932525635, 0.09013772010803223, -0.07387541234493256, -0.48298442363739014, -0.015601873397827148, 0.08768408745527267, 0.031867630779743195, -0.08245305716991425, 0.13018181920051575, 0.18307223916053772, 0.2205028533935547, 0.09404473751783371, -0.08339524269104004, -0.2612883448600769, -0.30565789341926575, -0.09829298406839371, -0.13735277950763702, 0.29987064003944397, 0.21689356863498688, 0.05749146640300751, 0.5985255241394043, 0.47424280643463135, 0.1674058735370636, 0.2012762427330017, 0.03916357457637787, 0.6739743947982788, 0.0018741749227046967, -0.3874594271183014, -0.02617020346224308, 0.08233833312988281, 0.20260362327098846, 0.18121860921382904, -0.029742959886789322, 0.1705811768770218, -0.3002401292324066, -0.46225160360336304, -0.22252294421195984, -0.21501752734184265, -0.1625518947839737, 0.007103085517883301, 0.48919373750686646, -0.10407546162605286, 0.11019110679626465, -0.19138795137405396, -0.059911128133535385, 0.42649751901626587, 0.5087251663208008, 0.3063163459300995, 0.13174088299274445, -0.16141392290592194, 0.14387674629688263, -0.253908634185791, 0.2052784413099289, -0.06299270689487457, 0.03222249075770378, -0.2879578471183777, -0.0064437538385391235, 0.14392638206481934, -0.02203289046883583, 0.6792671084403992, -0.03101995587348938, 0.0932459756731987, -0.040111128240823746, -0.22334295511245728, -0.20828905701637268, 0.1471032351255417, 0.18310031294822693, 0.09545466303825378, -0.36015817523002625, 0.09238989651203156, -0.1437169760465622, -0.5122082233428955, 0.4465700685977936, -0.13263480365276337, -0.23735632002353668, -0.06226435303688049, 0.13605532050132751, -0.12449155747890472, -0.1794508993625641, -0.36049145460128784, -0.09318046271800995, 0.10198411345481873, -0.04246706888079643, 0.33536726236343384, -0.10098721086978912, 0.1436937302350998, 0.20971262454986572, -0.019355811178684235, 0.23744454979896545, 0.2368355244398117, 0.16278313100337982, 0.6062849164009094, -0.003939224407076836, 0.3740515410900116, 0.5037326812744141, 0.016214899718761444, -0.3589268624782562, 0.20377786457538605, 0.1272592693567276, 0.30913349986076355, 0.3620120882987976, -0.05452926084399223, -0.15595272183418274, 0.12369948625564575, 0.22632096707820892, -0.5852647423744202, -0.12139424681663513, 0.2021980583667755, -0.09133942425251007, -0.34151893854141235, -0.659756064414978, 0.37820079922676086, -0.11046759784221649, 0.016494020819664, 0.0668320283293724, 0.6670675277709961, -0.036521442234516144, -0.22645309567451477, -0.00797339528799057, 0.9136325716972351, 0.10339472442865372, 0.19878387451171875, 0.19525301456451416, -0.32330843806266785, 0.2385653406381607, -0.298976868391037, -0.07503922283649445, -0.2472212165594101, -0.1804852932691574, -0.030207864940166473, -0.07775519788265228, 0.39480826258659363, -0.15059906244277954, -0.0631767064332962, 0.11513447761535645, 0.013850048184394836, -0.013942014425992966, -0.034293342381715775, 0.380548894405365, -0.026877885684370995, -0.10915438830852509, -0.35828685760498047, 0.1193336620926857, 0.11380571126937866, 0.1456167846918106, -0.0643145963549614, -0.4023817181587219, 0.07644663751125336, 0.0692145824432373, -0.3189595937728882, 0.015404835343360901, 0.027524873614311218, 0.20624208450317383, 0.09702059626579285, -0.14254556596279144, 0.9857884645462036, 0.3138192296028137, 0.15206530690193176, 0.23826825618743896, -0.3081566393375397, 0.029539283365011215, -0.31472691893577576, -0.13404744863510132, -0.20619820058345795, 0.2779708504676819, 0.16807720065116882, -0.1409485936164856, -0.22388795018196106, 0.32228755950927734, -0.0006065033376216888, -0.09461163729429245, -0.30142858624458313, -0.02588692680001259, 0.12891867756843567, -0.34475693106651306, 0.19618336856365204, -0.13550427556037903, 0.18293063342571259, 0.038634851574897766, 0.015657639130949974, 0.07907260954380035, 0.012474194169044495, -0.1393117606639862, 0.36901941895484924, -0.005219206213951111, 0.07878227531909943, 0.4496290683746338, -0.11501643061637878, -0.3690340518951416, 0.5258026719093323, 0.24877768754959106, -0.2039201557636261, -0.0454888716340065, 0.13563701510429382, 0.390949010848999, -0.4915330410003662, -0.10205522179603577, -0.16724492609500885, 0.31991109251976013, 0.14633247256278992, 0.12369808554649353, 0.12795796990394592, -0.229585662484169, 0.09115785360336304, -0.2233254611492157, -0.131879061460495, 0.15244638919830322, -0.17969414591789246, 0.05527082458138466, 0.10379146784543991, -0.013416053727269173, 0.06445733457803726, 0.0028090085834264755, -0.2784987986087799, 0.1469770073890686, -0.008902192115783691, -0.09700527042150497, 0.4458436071872711, 0.1168971061706543, 0.1167006641626358, -0.22383476793766022, -0.059116870164871216, 0.12228263914585114, -0.3905121684074402, -0.03162860870361328, -0.0774252638220787, 0.2249481976032257, -0.1466308832168579, -0.11289013177156448, 0.007411681115627289, -0.15672187507152557, -0.3254714012145996, -0.043365105986595154, 0.136220782995224, 0.07170921564102173, 0.10814686864614487, -0.03114432655274868, 0.120826855301857, -0.008980052545666695, -0.14600244164466858, 0.2231379747390747, 0.5686628818511963, 0.43029314279556274, 0.04203490912914276, 0.06759602576494217, -0.20483556389808655, -0.07999197393655777, 0.21316346526145935, 0.49048322439193726, 0.3895915150642395, -0.17983923852443695, 0.4111083447933197, -0.12442471086978912, 0.16969656944274902, 0.061110857874155045, 0.3919295072555542, 0.22285611927509308, -0.24893133342266083, 0.009371861815452576, 0.29821816086769104, 0.04739903658628464, -0.1669144630432129, -0.017579102888703346, 0.15732648968696594, 0.06441736221313477, -0.0725003182888031, 0.15794657170772552, 0.061457663774490356, 0.3381771147251129, 0.031965117901563644, 0.256130576133728, 0.4490232467651367, 0.15762382745742798, 0.3622244894504547, 0.2942357361316681, -0.11622828245162964, 0.04449847340583801, 0.16753889620304108, 0.5923236012458801, 0.08325034379959106, 0.3895185589790344, -0.34484732151031494, 0.17992369830608368, -0.1209191381931305, 0.05650369077920914, 0.28878429532051086, -0.45443427562713623, 0.14415140450000763, 0.17148876190185547, 0.26225775480270386, 0.1925426721572876, -0.3263653814792633, 0.34874895215034485, 0.14256443083286285, -0.1519126296043396, 0.011763833463191986, 0.29011332988739014, 0.09239451587200165, 0.03716874495148659, 0.3103891611099243, -0.30595582723617554, -0.4366954565048218, 0.03081928938627243, 0.09597678482532501, -0.4194754660129547, 0.18804199993610382, -0.1129872053861618, -0.01519518718123436, -0.2853662967681885, -0.04599194601178169, 0.23189124464988708, 0.36168786883354187, -0.17166045308113098, -0.17811833322048187, 0.18732616305351257, 0.026477104052901268, 0.19905273616313934, 0.3093055188655853, 0.36564362049102783, 0.04774492233991623, 0.11609309911727905, 0.15079118311405182, 0.005002874881029129, -0.037893928587436676, 0.2254408746957779, -0.03389154002070427, -0.05293736606836319, -0.0554109625518322, 0.18310581147670746, 0.03818919137120247, -0.01426440104842186, -0.2179448902606964, -0.0005448805168271065, 0.13880655169487, -0.7263166904449463, 0.15104487538337708, -0.26307016611099243, -0.03211124986410141, -0.01853088289499283, -0.05522824078798294, -0.4693393409252167, 0.026371873915195465, 0.3342316746711731, 0.16800981760025024, -0.13967318832874298, -0.14262007176876068, 0.02527271956205368, 0.2917681932449341, 0.4769456088542938, 0.38580501079559326, 0.1293567717075348, -0.07459098845720291, -0.559529185295105, -0.6267756223678589, -0.12865349650382996, 0.34377625584602356, 0.042434461414813995, 0.1898973137140274, -0.048521824181079865, 0.28004804253578186, 0.11197426170110703, 0.12422865629196167, -0.04791385680437088, 0.07246992737054825, 0.0782817006111145, 0.0939389318227768, -0.07613464444875717, -0.10804949700832367, 0.08409640938043594, 0.09796364605426788, -0.01548602432012558, 0.13625645637512207, -0.07230786234140396, -0.08979632705450058, -0.22688044607639313, 0.31430983543395996, -0.0026377663016319275, -0.6219637989997864, 0.179456889629364, -0.137851744890213, 0.1569260209798813, 0.08952245116233826, -0.40743374824523926, -0.19481487572193146, -0.043844882398843765, 0.008114594966173172, 0.3687884211540222, -0.0032184654846787453, 0.16060805320739746, -0.260999858379364, -0.6503850817680359, -0.4311739504337311, 0.20303398370742798, 0.1437550187110901, 0.14328527450561523, -0.18488949537277222, 0.07253550738096237, -0.05025661364197731, 0.11811945587396622, 0.34963303804397583, 0.023665910586714745, -0.08469826728105545, 0.2004820704460144, -0.39766308665275574, -0.11198730766773224, 0.5922971367835999, -0.6069191694259644, -0.12937384843826294, -0.24256868660449982, 0.1942693591117859, 0.106193408370018, -0.4855314791202545, -0.7772702574729919, 0.2643539309501648, 0.2410079538822174, -0.03682322800159454, 0.17587342858314514, 0.30880221724510193, -0.2648822069168091, 0.027575388550758362, -0.1336159110069275, 0.5399753451347351, -0.13602082431316376, -0.18783825635910034, 0.2692127227783203, -0.17223814129829407 ]
https://github.com/huggingface/datasets/issues/6014
the new frontend would probably be hard to open source, as is, as it's quite intertwined with the Hub's code. However, at some point it would be amazing to have a community-driven open source implementation of a frontend to datasets-server!
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
40
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. the new frontend would probably be hard to open source, as is, as it's quite intertwined with the Hub's code. However, at some point it would be amazing to have a community-driven open source implementation of a frontend to datasets-server!
[ -0.3248501121997833, -0.05922068655490875, -0.09017610549926758, 0.27208685874938965, -0.06077620014548302, 0.03568785637617111, 0.1505102664232254, 0.3401680290699005, 0.1280948519706726, 0.19909505546092987, -0.310796320438385, 0.23992449045181274, -0.18274036049842834, 0.4267308712005615, 0.06401161849498749, 0.08031360805034637, 0.06671691685914993, 0.18489326536655426, -0.2182925045490265, 0.008541986346244812, 0.05405139923095703, 0.1585908830165863, -0.22189316153526306, 0.050847724080085754, -0.08185024559497833, 0.2605118155479431, -0.23867261409759521, 0.14547090232372284, -0.24105167388916016, -0.33624258637428284, 0.0814552754163742, 0.347042441368103, 0.06091828644275665, 0.552401602268219, -0.00011931695189559832, -0.05553697049617767, 0.20292404294013977, 0.08673279732465744, -0.28981122374534607, -0.12601995468139648, -0.0051746368408203125, -0.16757310926914215, 0.07297350466251373, -0.060726456344127655, -0.11205707490444183, -0.29272782802581787, -0.0732269212603569, -0.3101580739021301, 0.4819793999195099, -0.008195187896490097, 0.11482095718383789, 0.44448328018188477, 0.2716057300567627, -0.18654319643974304, -0.17064936459064484, 0.41162940859794617, -0.15948469936847687, 0.019070342183113098, 0.3174601197242737, 0.057999469339847565, -0.18838125467300415, 0.27740418910980225, 0.07969152927398682, -0.27475878596305847, 0.4525682032108307, -0.10586680471897125, -0.21616409718990326, -0.17956507205963135, -0.005889398045837879, 0.002261962741613388, 0.7491025924682617, -0.4070843756198883, -0.38256222009658813, -0.29848283529281616, -0.0037381313741207123, 0.13157787919044495, -0.007282700389623642, 0.07467320561408997, -0.11410956084728241, 0.32823577523231506, -0.32887959480285645, -0.6647838950157166, -0.25507161021232605, -0.17042340338230133, 0.1687748283147812, 0.2931201159954071, -0.29523810744285583, 0.05801087245345116, 0.0570455938577652, -0.12998494505882263, 0.2655324935913086, -0.13478317856788635, 0.09916246682405472, -0.012532951310276985, -0.04557487741112709, -0.2980593740940094, 0.0674932450056076, 0.08077208697795868, 0.05521593242883682, 0.3966558873653412, -0.017506737262010574, 0.0635514035820961, -0.34950506687164307, -0.05129121616482735, 0.42348986864089966, -0.017860546708106995, 0.23472723364830017, 0.21374580264091492, 0.21066193282604218, 0.20988807082176208, 0.362769216299057, 0.10668060183525085, -0.2526015341281891, -0.0030011162161827087, -0.28626397252082825, -0.19732490181922913, 0.37125635147094727, -0.06500452011823654, 0.04263767600059509, -0.1920466423034668, 0.48108187317848206, -0.05973583459854126, 0.1719876378774643, 0.09825604408979416, -0.12106297165155411, 0.11667896807193756, 0.06755072623491287, -0.24245135486125946, -0.07012388855218887, -0.8517727255821228, -0.05084161460399628, -0.04232103377580643, -0.23864778876304626, 0.2933116555213928, 0.03947077691555023, -0.47782301902770996, 0.06298094242811203, 0.024426866322755814, 0.5611562132835388, 0.017126135528087616, -0.13221290707588196, 0.37660694122314453, -0.22618182003498077, 0.023373335599899292, 0.05290481448173523, 0.023047924041748047, 0.13303370773792267, -0.0714276134967804, -0.10877761244773865, 0.062443386763334274, -0.2717316746711731, -0.421012282371521, -0.32369518280029297, 0.03760113567113876, -0.20501944422721863, 0.12582506239414215, -0.3152467608451843, 0.22264620661735535, -0.40964969992637634, -0.2130981832742691, 0.09433795511722565, 0.3346801996231079, -0.005269564688205719, -0.21107013523578644, 0.4570581912994385, 0.8993592858314514, -0.30833080410957336, -0.043042197823524475, -0.14163321256637573, -0.13735081255435944, -0.3364163935184479, 0.05257771909236908, -0.09395377337932587, -0.15284475684165955, -0.13225457072257996, -0.13135609030723572, 0.3067885935306549, -0.6728349328041077, -0.30550673604011536, 0.22073349356651306, -0.11652479320764542, -0.13489912450313568, 0.02213211916387081, 0.0188385471701622, -0.06934569776058197, -0.19167141616344452, -0.23682045936584473, 0.1446436047554016, -0.10332944244146347, -0.08629043400287628, -0.10927839577198029, -0.42976483702659607, -0.09220664948225021, 0.4917093515396118, -0.09271953999996185, 0.10500374436378479, 0.22801518440246582, -0.25769710540771484, 0.46128058433532715, -0.12310648709535599, 0.16523101925849915, -0.18092018365859985, 0.18189367651939392, 0.4493054747581482, -0.03850128874182701, -0.27273908257484436, -0.2888556122779846, 0.05758602172136307, 0.207461416721344, -0.11222359538078308, -0.023727577179670334, -0.24001234769821167, -0.37511366605758667, 0.16871203482151031, -0.1830543428659439, -0.1271245777606964, 0.053948260843753815, -0.07860174775123596, -0.031115900725126266, 0.021799452602863312, -0.3419213891029358, 0.4154635965824127, -0.11432242393493652, 0.06424890458583832, -0.4968748986721039, 0.31095898151397705, -0.024203334003686905, 0.13845230638980865, 0.177232027053833, 0.18406614661216736, 0.1059519499540329, 0.04971029609441757, 0.11889669299125671, 0.45520398020744324, -0.21623753011226654, 0.4614831507205963, 0.4161953628063202, 0.143866166472435, 0.15154394507408142, -0.3405334949493408, 0.41319817304611206, -0.33866915106773376, -0.11306557059288025, 0.16255785524845123, -0.1971481889486313, 0.12107890099287033, -0.36528509855270386, -0.05295490846037865, -0.02786175161600113, 0.20928692817687988, -0.29232311248779297, 0.266299843788147, -0.26485109329223633, -0.1895022690296173, -0.021332785487174988, -0.045173972845077515, 0.11828476935625076, -0.17074640095233917, -0.1142861545085907, 0.12074555456638336, 0.12271083891391754, -0.1727190762758255, 0.09234410524368286, 0.07047224044799805, -0.12358589470386505, -0.03878364711999893, 0.2178921401500702, -0.1915908306837082, 0.1522689163684845, 0.061747048050165176, -0.15309932827949524, 0.42282524704933167, 0.46905893087387085, -0.008066285401582718, 0.11388496309518814, 0.18836283683776855, 0.33023396134376526, -0.14086921513080597, -0.15577584505081177, 0.25113335251808167, 0.05258283019065857, -0.23173315823078156, -0.10859882831573486, 0.004323543980717659, -0.235243022441864, -0.07280144840478897, -0.01539662480354309, 0.12228922545909882, 0.0030683614313602448, -0.1455458700656891, -0.23516404628753662, -0.044971562922000885, -0.11769663542509079, 0.07461394369602203, -0.04910845682024956, -0.015172408893704414, -0.356123149394989, 0.6014884114265442, -0.04124307259917259, 0.14647041261196136, -0.2607592046260834, 0.012749779969453812, 0.118250772356987, -0.03244047611951828, 0.2184547483921051, -0.12571465969085693, 0.39310988783836365, -0.17947381734848022, 0.597896933555603, -0.43006011843681335, -0.1876581609249115, 0.03392883390188217, -0.07160450518131256, 0.19793926179409027, 0.3155445456504822, -0.062308356165885925, -0.01777774840593338, -0.008324939757585526, 0.1297735869884491, -0.23179680109024048, -0.16612613201141357, -0.260956346988678, 0.2195361852645874, -0.132509246468544, 0.042055584490299225, -0.010805699974298477, -0.3031955659389496, -0.43578800559043884, 0.3426632583141327, -0.25865545868873596, 0.16115999221801758, 0.06182893365621567, 0.1393725723028183, 0.05130920931696892, -0.08159861713647842, -0.08252602070569992, -0.045673854649066925, -0.49413955211639404, 0.2072180211544037, -0.6696652173995972, -0.18936385214328766, 0.021495237946510315, 0.4444005489349365, 0.22273817658424377, -0.10424475371837616, -0.5097496509552002, -0.10540252923965454, 0.17175425589084625, 0.1371305137872696, -0.05115624889731407, 0.15446412563323975, 0.2474459558725357, 0.3671805262565613, 0.03704443573951721, -0.08989472687244415, -0.27598902583122253, -0.3857246935367584, -0.20601129531860352, -0.2135968655347824, 0.2336672991514206, 0.05511661246418953, 0.047305747866630554, 0.7308989763259888, 0.36125779151916504, 0.2354646474123001, 0.12197591364383698, 0.1331857591867447, 0.6800156235694885, -0.04056926816701889, -0.41030049324035645, -0.15991845726966858, 0.03818630054593086, 0.2241133749485016, 0.11121543496847153, 0.12346234917640686, 0.23654071986675262, -0.3805880546569824, -0.41896095871925354, -0.3077166974544525, -0.1677267849445343, -0.28323063254356384, 0.042439185082912445, 0.4332161843776703, -0.054694369435310364, 0.01693454384803772, -0.4050300717353821, -0.022550057619810104, 0.38631707429885864, 0.397772878408432, 0.32673436403274536, -0.04939879849553108, -0.2371158003807068, 0.1919141560792923, -0.2251945585012436, 0.1922132521867752, -0.13777180016040802, -0.11787991225719452, -0.08988582342863083, 0.08470369875431061, 0.06558822840452194, 0.0258755162358284, 0.7335115075111389, -0.09632802754640579, 0.030326664447784424, -0.19167938828468323, -0.1535947024822235, -0.2282692790031433, 0.22794684767723083, 0.31035900115966797, 0.10645192861557007, -0.2786262035369873, 0.16864755749702454, -0.09509342908859253, -0.4352869689464569, 0.44708365201950073, -0.16156703233718872, -0.23143301904201508, -0.09955283999443054, 0.2002689242362976, -0.07728278636932373, -0.11283242702484131, -0.46004506945610046, -0.09612912684679031, 0.07875217497348785, 0.022950194776058197, 0.23457473516464233, -0.07521025091409683, 0.13945403695106506, 0.18775880336761475, -0.0023235268890857697, 0.12943199276924133, 0.22158542275428772, 0.1706928014755249, 0.49525657296180725, 0.006435396149754524, 0.17679926753044128, 0.4024130702018738, 0.05568388104438782, -0.3775627911090851, 0.195525124669075, 0.08461260795593262, 0.18844252824783325, 0.47713518142700195, 0.03701740503311157, -0.20259135961532593, 0.033252693712711334, 0.1388755440711975, -0.5576024055480957, -0.10030607134103775, 0.14568907022476196, 0.06803610175848007, -0.44709312915802, -0.5960083603858948, 0.3913401961326599, -0.14227229356765747, -0.096682608127594, 0.2979578673839569, 0.7984707355499268, -0.029520010575652122, -0.12411642074584961, -0.10010691732168198, 0.9594638347625732, 0.18905822932720184, 0.18898694217205048, 0.24240347743034363, -0.29960960149765015, 0.40693068504333496, -0.3037457764148712, -0.06600306928157806, -0.21181902289390564, -0.17815782129764557, -0.032728344202041626, -0.024780742824077606, 0.21572142839431763, -0.14338257908821106, 0.03916862607002258, -0.018942940980196, 0.19957438111305237, -0.16226722300052643, 0.0029953569173812866, 0.46491891145706177, 0.004913879558444023, -0.14544154703617096, -0.18584688007831573, 0.09694116562604904, 0.12635058164596558, 0.11128517985343933, -0.07983017712831497, -0.3902623653411865, -0.08139923214912415, 0.14011991024017334, -0.4388180077075958, -0.0377994067966938, 0.18888172507286072, 0.23671333491802216, 0.11926665902137756, -0.08119593560695648, 0.8795959949493408, 0.2882857024669647, 0.32187530398368835, 0.21353694796562195, -0.34450310468673706, 0.042073894292116165, -0.3805209696292877, -0.1156889870762825, -0.13901197910308838, 0.15407989919185638, 0.18367470800876617, -0.18163198232650757, -0.30178576707839966, 0.3351435959339142, 0.07770660519599915, -0.24886174499988556, -0.4203164577484131, -0.09446004033088684, 0.2801319360733032, -0.49092942476272583, 0.1283625066280365, -0.07848423719406128, 0.20580635964870453, -0.038191501051187515, -0.0028132637962698936, 0.12524189054965973, 0.02287086471915245, -0.12255404889583588, 0.3635132610797882, 0.003084152936935425, 0.13046057522296906, 0.21576914191246033, -0.03612380474805832, -0.40079206228256226, 0.3986220061779022, 0.15260152518749237, -0.12072842568159103, -0.046127013862133026, 0.22046977281570435, 0.4078105092048645, -0.5378923416137695, -0.0399053618311882, -0.17515641450881958, 0.06346635520458221, 0.21453124284744263, 0.11598996818065643, 0.24918808043003082, -0.03663455694913864, 0.08028717339038849, -0.11032041162252426, -0.0905831828713417, 0.18816658854484558, -0.17573139071464539, 0.13180099427700043, 0.10360566526651382, -0.13626712560653687, -0.016923878341913223, -0.011004023253917694, -0.2546059191226959, 0.13023307919502258, 0.04275260120630264, -0.1876002997159958, 0.29391175508499146, 0.015380811877548695, -0.005479671061038971, -0.2391350120306015, -0.09019479155540466, -0.006801477633416653, -0.3649129569530487, 0.010281797498464584, -0.06572375446557999, 0.2504581809043884, -0.13856810331344604, -0.1299818456172943, -0.00447496771812439, -0.14810653030872345, -0.28518539667129517, -0.044382788240909576, 0.1295551359653473, 0.1455584168434143, 0.12640336155891418, -0.13806483149528503, 0.09454129636287689, 0.06476766616106033, -0.19137337803840637, 0.3699740171432495, 0.6327964067459106, 0.5084875226020813, 0.07604028284549713, 0.21342837810516357, -0.12910465896129608, -0.1105656698346138, 0.1318379044532776, 0.46773266792297363, 0.37714436650276184, -0.03142630681395531, 0.49855583906173706, -0.03247750923037529, 0.14627599716186523, 0.2505589723587036, 0.3835868537425995, 0.17558534443378448, -0.2201211303472519, 0.07500233501195908, 0.12503832578659058, 0.054992448538541794, -0.23048055171966553, -0.005548916757106781, 0.15743589401245117, 0.053306661546230316, -0.013725422322750092, 0.15177686512470245, 0.0019466429948806763, 0.27095216512680054, 0.08284743130207062, 0.24322621524333954, 0.405924916267395, 0.19690865278244019, 0.4273521900177002, 0.19223901629447937, -0.1750645637512207, 0.08661668002605438, 0.25858914852142334, 0.49731817841529846, 0.026694592088460922, 0.44677624106407166, -0.37129950523376465, 0.2514553964138031, -0.10632295161485672, -0.008742624893784523, 0.3747837543487549, -0.26086390018463135, 0.18293219804763794, 0.0013320446014404297, 0.25044646859169006, 0.14987510442733765, -0.2157260626554489, 0.19653524458408356, -0.05967651307582855, -0.07390441745519638, -0.04190588369965553, 0.26013490557670593, 0.14786195755004883, 0.021184388548135757, 0.22425052523612976, -0.2854647934436798, -0.2630847692489624, 0.04229453206062317, 0.029740767553448677, -0.4202982485294342, 0.05896808207035065, -0.14592602849006653, -0.1005084291100502, -0.1456931084394455, -0.049083162099123, 0.2383481115102768, 0.3638911545276642, -0.12697052955627441, -0.3018823564052582, 0.15172427892684937, 0.04937410354614258, 0.16814373433589935, 0.40294182300567627, 0.24357159435749054, 0.06820196658372879, 0.11757158488035202, 0.21825866401195526, -0.0030165649950504303, -0.03156035393476486, 0.1512116938829422, -0.06525295972824097, 0.052559155970811844, 0.10308386385440826, 0.09315967559814453, 0.03523397445678711, -0.011967506259679794, -0.18420493602752686, 0.04896209016442299, 0.023798789829015732, -0.7351257801055908, 0.13723205029964447, -0.24941015243530273, -0.18985730409622192, -0.061244964599609375, 0.053412169218063354, -0.36301344633102417, 0.034021299332380295, 0.31770792603492737, 0.006662413477897644, -0.21150138974189758, -0.2290441244840622, 0.02952905371785164, 0.2539803981781006, 0.2793334722518921, 0.4602711498737335, 0.11555749177932739, -0.004678456112742424, -0.5266992449760437, -0.5350391864776611, 0.014051932841539383, 0.4964570105075836, 0.00025428831577301025, 0.03446993604302406, -0.05282551050186157, 0.2597189247608185, 0.11994375288486481, 0.1336202323436737, -0.05045623332262039, 0.01821066439151764, 0.14894868433475494, 0.04175162315368652, 0.033254604786634445, -0.06926673650741577, 0.14162473380565643, 0.13299646973609924, 0.005971826612949371, 0.1652030348777771, 0.1235826388001442, -0.14034691452980042, -0.15891394019126892, 0.3353515565395355, 0.04654129594564438, -0.3949331045150757, 0.3117870092391968, -0.12013379484415054, 0.09583882242441177, 0.03670481592416763, -0.4458381235599518, -0.47529733180999756, -0.16060680150985718, -0.034967996180057526, 0.3277391195297241, 0.15022027492523193, 0.019560471177101135, -0.3215685486793518, -0.5439914464950562, -0.31496283411979675, 0.15481872856616974, 0.09965348243713379, 0.1501937210559845, -0.16429302096366882, -0.025964953005313873, -0.08785392343997955, 0.004613280296325684, 0.38200467824935913, 0.014730486087501049, -0.1602851003408432, 0.169242262840271, -0.3256005644798279, -0.10542029142379761, 0.4804736375808716, -0.477130651473999, -0.11753958463668823, -0.2564274072647095, 0.2089587152004242, 0.1689082682132721, -0.4668320119380951, -0.7197747230529785, 0.14014843106269836, 0.21136566996574402, 0.03490081802010536, 0.1857622116804123, 0.2987429201602936, -0.23198239505290985, -0.022352181375026703, -0.14227019250392914, 0.643743097782135, -0.09150129556655884, -0.2821102738380432, 0.38151219487190247, -0.15457960963249207 ]
https://github.com/huggingface/datasets/issues/6014
For the frontend viewer, see https://github.com/huggingface/datasets/issues/6139. Also mentioned in https://github.com/huggingface/datasets-server/issues/213 and https://github.com/huggingface/datasets-server/issues/441 Closing as a duplicate of https://github.com/huggingface/datasets/issues/6139
Request to Share/Update Dataset Viewer Code
Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response.
18
Request to Share/Update Dataset Viewer Code Overview: The repository (huggingface/datasets-viewer) was recently archived and when I tried to run the code, there was the error message "AttributeError: module 'datasets.load' has no attribute 'prepare_module'". I could not resolve the issue myself due to lack of documentation of that attribute. Request: I kindly request the sharing of the code responsible for the dataset preview functionality or help with resolving the error. The dataset viewer on the Hugging Face website is incredibly useful since it is compatible with different types of inputs. It allows users to find datasets that meet their needs more efficiently. If needed, I am willing to contribute to the project by testing, documenting, and providing feedback on the dataset viewer code. Thank you for considering this request, and I look forward to your response. For the frontend viewer, see https://github.com/huggingface/datasets/issues/6139. Also mentioned in https://github.com/huggingface/datasets-server/issues/213 and https://github.com/huggingface/datasets-server/issues/441 Closing as a duplicate of https://github.com/huggingface/datasets/issues/6139
[ -0.23733460903167725, -0.07210084050893784, -0.057132452726364136, 0.3593696653842926, 0.11453050374984741, 0.13318656384944916, 0.10088930279016495, 0.3478478193283081, -0.07706047594547272, 0.18915918469429016, -0.18325158953666687, 0.21624279022216797, -0.1487388163805008, 0.3128073513507843, 0.09004905819892883, -0.09984474629163742, -0.08274434506893158, 0.1462341994047165, -0.1372179090976715, 0.032869189977645874, 0.14720343053340912, 0.21018491685390472, -0.23938512802124023, -0.030873771756887436, -0.10189106315374374, 0.19371110200881958, -0.13041244447231293, 0.17860214412212372, -0.1227753758430481, -0.48776987195014954, 0.17711764574050903, 0.28333330154418945, 0.12767393887043, 0.443031907081604, -0.00012048590724589303, -0.03549611568450928, 0.33578744530677795, -0.06150054186582565, -0.44227296113967896, -0.10581357032060623, 0.037756338715553284, -0.15859588980674744, 0.17598918080329895, -0.05084088444709778, -0.2994028925895691, -0.26667696237564087, -0.05788273364305496, -0.3876746594905853, 0.5753039717674255, 0.05617000162601471, 0.16475729644298553, 0.4655119776725769, 0.39220482110977173, -0.23313720524311066, -0.14269982278347015, 0.39024659991264343, -0.02892560511827469, 0.31038203835487366, 0.2914748191833496, 0.14046892523765564, -0.10484389215707779, 0.3580918312072754, 0.1098899394273758, -0.2113310545682907, 0.4214554727077484, -0.13826996088027954, -0.08165322244167328, -0.2865242660045624, 0.06674781441688538, -0.0647616758942604, 0.7631062865257263, -0.39293017983436584, -0.34434694051742554, -0.3252996802330017, 0.06928299367427826, 0.12597152590751648, 0.09808072447776794, 0.06513666361570358, -0.15013328194618225, 0.25611940026283264, -0.4175198972225189, -0.5067600607872009, -0.1921260952949524, -0.2395610809326172, 0.07485570013523102, -0.04755360260605812, -0.3754247725009918, 0.004795342683792114, 0.12793748080730438, -0.2736563980579376, 0.007370077073574066, -0.08163201808929443, 0.06527739763259888, 0.07756601274013519, -0.050464365631341934, -0.21851852536201477, -0.0007362868636846542, 0.10216622054576874, -0.0727778822183609, 0.3498707711696625, 0.05961550772190094, 0.07431955635547638, -0.04108474403619766, 0.00556565448641777, 0.42584946751594543, 0.10922634601593018, 0.35302045941352844, 0.0972624123096466, 0.07504400610923767, 0.2284179925918579, 0.2832415699958801, -0.033244118094444275, -0.2869166135787964, -0.028740866109728813, -0.23721501231193542, -0.1539459526538849, 0.20673750340938568, -0.1466425061225891, -0.10549063980579376, -0.14032921195030212, 0.24125225841999054, -0.1614016890525818, 0.1377214640378952, 0.33444467186927795, -0.14467762410640717, -0.008056397549808025, 0.056432828307151794, -0.23829394578933716, -0.08653318881988525, -0.7695367932319641, -0.11154818534851074, 0.05698128789663315, -0.2935401201248169, 0.14140582084655762, 0.09642860293388367, -0.5924225449562073, 0.05174265056848526, -0.03688933327794075, 0.5807820558547974, -0.03117571771144867, -0.18705058097839355, 0.30751797556877136, -0.09371677041053772, 0.1542140692472458, 0.11581950634717941, 0.07091060280799866, 0.1760905683040619, -0.16854563355445862, -0.08949786424636841, 0.032075434923172, -0.3550156056880951, -0.3359648883342743, -0.09402485936880112, 0.06672105938196182, -0.28136730194091797, 0.14015457034111023, -0.2951827049255371, 0.14940261840820312, -0.2348518669605255, -0.1841680109500885, 0.10098718106746674, 0.1868249624967575, -0.002283908426761627, -0.22340622544288635, 0.514964759349823, 0.835395336151123, -0.2813429534435272, -0.19527684152126312, -0.0788101777434349, -0.27117860317230225, -0.21895799040794373, 0.07019001245498657, -0.08850082755088806, -0.11045713722705841, -0.20202647149562836, -0.12036372721195221, 0.4547238349914551, -0.5530495643615723, -0.29687777161598206, 0.20700053870677948, -0.10458552837371826, -0.02149496227502823, 0.05093231797218323, -0.12174306809902191, -0.10901457071304321, -0.23747171461582184, -0.1939658671617508, 0.10379192233085632, -0.06710819900035858, -0.08388257771730423, -0.11506401747465134, -0.3890538811683655, 0.031954921782016754, 0.4567405581474304, -0.15977266430854797, 0.06700783222913742, 0.28271523118019104, -0.20913025736808777, 0.43455713987350464, -0.010059934109449387, 0.09448127448558807, 0.013659035786986351, 0.13085201382637024, 0.4942835569381714, -0.03961453214287758, -0.10610995441675186, -0.1865299642086029, 0.11681815981864929, 0.09089148044586182, -0.28239643573760986, -0.15552344918251038, -0.19905883073806763, -0.4114420711994171, 0.014970444142818451, -0.2068423628807068, -0.3650183379650116, 0.07887622714042664, -0.04130483791232109, 0.13666996359825134, 0.19431400299072266, -0.23793083429336548, 0.3954598009586334, -0.12735241651535034, 0.013382285833358765, -0.588300883769989, 0.3303382694721222, -0.08182419836521149, -0.002467326819896698, 0.25646981596946716, 0.22480429708957672, 0.10342001914978027, -0.03403109684586525, 0.0582098625600338, 0.4275624752044678, -0.2038045972585678, 0.41534000635147095, 0.13807152211666107, 0.11845642328262329, 0.13457296788692474, -0.4108331501483917, 0.3453519344329834, -0.26446333527565, -0.08879707753658295, 0.14573827385902405, -0.21931758522987366, 0.1324736475944519, -0.28018712997436523, -0.043701667338609695, 0.18183138966560364, 0.16499510407447815, -0.24759119749069214, 0.3013899624347687, -0.2224203646183014, -0.2181529998779297, 0.0759386271238327, -0.09554896503686905, 0.3143264055252075, -0.17207011580467224, -0.1989445984363556, 0.055638208985328674, 0.19460679590702057, -0.13682883977890015, 0.01819615438580513, 0.09348233789205551, -0.18907758593559265, 0.032116301357746124, 0.11838815361261368, -0.12679395079612732, 0.1426662802696228, 0.0939328521490097, -0.08231280744075775, 0.3524824380874634, 0.4792056083679199, -0.08132662624120712, 0.11883598566055298, 0.061110179871320724, 0.22113487124443054, -0.11938335001468658, -0.1431981921195984, 0.21828773617744446, -0.04372243210673332, -0.08787968754768372, -0.14712275564670563, 0.09246793389320374, -0.3461554944515228, 0.028196021914482117, -0.07366436719894409, -0.1678919643163681, -0.18235531449317932, 0.004721108824014664, -0.2621476650238037, -0.02559705078601837, -0.21766136586666107, 0.06164448708295822, 0.021198593080043793, 0.0138336680829525, -0.3232509195804596, 0.44845789670944214, -0.03832221031188965, 0.1149541363120079, -0.1828758418560028, 0.06986060738563538, 0.02124527096748352, 0.008785095065832138, 0.20702049136161804, -0.06673737615346909, 0.3779318928718567, -0.2893863916397095, 0.44778972864151, -0.2460905760526657, -0.3007839024066925, 0.05246654152870178, -0.06834016740322113, 0.15121005475521088, 0.3177565336227417, 0.0512583963572979, -0.02087772637605667, -0.0775749459862709, 0.25629428029060364, -0.24636179208755493, -0.245560884475708, -0.2146271914243698, 0.288329154253006, -0.09505658596754074, -0.0633673220872879, -0.09857182204723358, -0.2784084677696228, -0.39565563201904297, 0.4289664626121521, -0.24581903219223022, 0.1261533498764038, 0.19308435916900635, 0.1286773979663849, 0.16612552106380463, -0.31891748309135437, 0.07912721484899521, -0.08038952201604843, -0.5488019585609436, 0.19586960971355438, -0.5720621347427368, -0.2533949911594391, 0.037230342626571655, 0.40480467677116394, 0.1933787316083908, -0.07099342346191406, -0.3704982399940491, -0.09174934774637222, 0.018087247386574745, 0.008489608764648438, -0.07907222956418991, 0.11891879886388779, 0.19135023653507233, 0.24732184410095215, 0.049824170768260956, -0.03515715152025223, -0.27674365043640137, -0.29385703802108765, -0.1751188039779663, -0.09493423998355865, 0.2013055384159088, 0.16055601835250854, 0.01214919239282608, 0.645950198173523, 0.5238977670669556, 0.11939724534749985, 0.08560579270124435, 0.03927880525588989, 0.6709175705909729, 0.05787839740514755, -0.44065937399864197, -0.037502776831388474, 0.1151360347867012, 0.25258690118789673, 0.09259076416492462, -0.01619551330804825, 0.23543831706047058, -0.32225120067596436, -0.4526069760322571, -0.2724143862724304, -0.23758994042873383, -0.15243864059448242, 0.016960106790065765, 0.5282990336418152, -0.17082896828651428, 0.08644981682300568, -0.1442396491765976, -0.02454846352338791, 0.3030383884906769, 0.49901503324508667, 0.28038498759269714, 0.04920902103185654, -0.23278726637363434, 0.0985395759344101, -0.26170486211776733, 0.17476752400398254, -0.026434477418661118, 0.08513542264699936, -0.21179810166358948, -0.028447147458791733, 0.1081252247095108, 0.061025459319353104, 0.6832208633422852, -0.0471520721912384, 0.159223273396492, -0.05519184097647667, -0.2896231710910797, -0.2046080082654953, 0.19476160407066345, 0.19257593154907227, 0.14628152549266815, -0.26002374291419983, 0.044041574001312256, -0.06865591555833817, -0.4286116063594818, 0.4219878315925598, -0.10007932782173157, -0.2426472157239914, -0.12232908606529236, 0.12698975205421448, -0.06617958098649979, -0.20294617116451263, -0.34560447931289673, -0.07665359973907471, 0.09454427659511566, -0.10455936193466187, 0.27817586064338684, -0.12286769598722458, 0.05048517882823944, 0.22080056369304657, 0.022157784551382065, 0.2894956171512604, 0.21658599376678467, 0.21325094997882843, 0.736545205116272, -0.06269023567438126, 0.418372243642807, 0.48801252245903015, 0.011612977832555771, -0.34603527188301086, 0.15041807293891907, 0.07481242716312408, 0.3089836835861206, 0.389651894569397, -0.13310405611991882, -0.15510310232639313, 0.0657675638794899, 0.07629549503326416, -0.5920420289039612, -0.1670667678117752, 0.19866465032100677, -0.02859215997159481, -0.31553009152412415, -0.6708970069885254, 0.3223954141139984, -0.0667567178606987, 0.021452754735946655, 0.03569601848721504, 0.5321536064147949, -0.09340719878673553, -0.3765500485897064, -0.05887293070554733, 0.9264995455741882, 0.19388334453105927, 0.21836884319782257, 0.1579376608133316, -0.12590797245502472, 0.2817060947418213, -0.16267594695091248, 0.006823554635047913, -0.2610369920730591, -0.22392643988132477, 0.018135562539100647, -0.09844396263360977, 0.3420194983482361, -0.19973604381084442, -0.10866700857877731, 0.062234070152044296, -0.01840299367904663, -0.06610977649688721, -0.05695527791976929, 0.3123355507850647, -0.042266227304935455, 0.0004620179533958435, -0.3483055531978607, 0.08891233801841736, 0.15424200892448425, 0.19629403948783875, -0.008811622858047485, -0.3731839060783386, 0.04225713014602661, -0.026408348232507706, -0.35339272022247314, -0.02418825402855873, -0.0020125769078731537, 0.2693440914154053, 0.13828091323375702, -0.23411127924919128, 0.9839864373207092, 0.36509397625923157, 0.1474042534828186, 0.22690586745738983, -0.3121475577354431, 0.05630309134721756, -0.33662211894989014, -0.14476026594638824, -0.221029594540596, 0.2904745042324066, 0.18070240318775177, -0.15442490577697754, -0.14716152846813202, 0.37214571237564087, 0.002514876425266266, -0.049734894186258316, -0.3677178621292114, 0.05317911133170128, 0.056839462369680405, -0.3759039342403412, 0.14260151982307434, -0.19001463055610657, 0.1515263020992279, -0.0009300112724304199, 0.024477504193782806, 0.1736859679222107, 0.01694684475660324, -0.13780102133750916, 0.3810282051563263, -0.0636458471417427, 0.1495589166879654, 0.5190582871437073, -0.09317212551832199, -0.4481958746910095, 0.5887035727500916, 0.11886399984359741, -0.1316012293100357, -0.07485021650791168, 0.104795441031456, 0.35907790064811707, -0.5698172450065613, 0.018478624522686005, -0.14143303036689758, 0.3395129144191742, 0.13397076725959778, 0.15011414885520935, 0.1258007287979126, -0.17237156629562378, 0.08537445962429047, -0.2093888372182846, -0.18507108092308044, 0.14169099926948547, -0.14397989213466644, 0.09644873440265656, -0.05252019315958023, -0.010518932715058327, 0.10234162211418152, 0.020013878121972084, -0.27989792823791504, 0.1740296483039856, -0.0540451854467392, -0.10538890957832336, 0.4501339793205261, 0.05628010258078575, 0.11659133434295654, -0.2510078549385071, -0.0601191483438015, 0.0691385269165039, -0.3929058611392975, -0.026476843282580376, -0.037335120141506195, 0.22247830033302307, -0.20537787675857544, -0.10199737548828125, 0.06210527569055557, -0.09275586903095245, -0.23279888927936554, -0.011226633563637733, 0.07052949070930481, 0.062499918043613434, 0.152676060795784, -0.016630083322525024, 0.018660515546798706, 0.0827295184135437, -0.12625358998775482, 0.24623960256576538, 0.4183773100376129, 0.4536627531051636, 0.13870982825756073, 0.028344739228487015, -0.2416965663433075, -0.0569082573056221, 0.2635500133037567, 0.4401387572288513, 0.35288047790527344, -0.17039421200752258, 0.3141246736049652, -0.07182450592517853, 0.1070932149887085, 0.11551392078399658, 0.2948662042617798, 0.25934284925460815, -0.33928707242012024, 0.07656779885292053, 0.17920279502868652, 0.07600214332342148, -0.14994622766971588, 0.046304404735565186, 0.1221030056476593, 0.1258065402507782, -0.07957424223423004, 0.1371777355670929, 0.0649147480726242, 0.2926906645298004, 0.14358565211296082, 0.2462255209684372, 0.49873149394989014, 0.15955686569213867, 0.44213977456092834, 0.2312925159931183, -0.1085648462176323, -0.020733725279569626, 0.218431755900383, 0.558664858341217, 0.11109520494937897, 0.3050597608089447, -0.40176624059677124, 0.20395921170711517, -0.1944081336259842, -0.00556391105055809, 0.22576561570167542, -0.38324636220932007, 0.1214672103524208, 0.14702236652374268, 0.17369776964187622, 0.1847224086523056, -0.2655438482761383, 0.3986506760120392, 0.07169701159000397, -0.010552678257226944, 0.013031162321567535, 0.21459025144577026, 0.08872289955615997, 0.009363621473312378, 0.3676477074623108, -0.33165442943573, -0.4291952848434448, 0.011126488447189331, 0.0562482513487339, -0.39672228693962097, 0.22682449221611023, -0.13166211545467377, -0.1027824729681015, -0.405862033367157, -0.05548807978630066, 0.30393579602241516, 0.37517958879470825, -0.17525199055671692, -0.14970391988754272, 0.2991594076156616, 0.03553146868944168, 0.28385284543037415, 0.39782512187957764, 0.4682180881500244, 0.0401078537106514, 0.24385465681552887, 0.14045341312885284, -0.01833547092974186, -0.07761935144662857, 0.09206640720367432, 0.06556575745344162, 0.020331688225269318, -0.06162372976541519, 0.11372731626033783, 0.07519564777612686, -0.04723219573497772, -0.2167174220085144, 0.02757537178695202, 0.16577468812465668, -0.7443850636482239, 0.20539306104183197, -0.33652225136756897, -0.07554145157337189, -0.13339747488498688, -0.014371346682310104, -0.5008097290992737, 0.0512431301176548, 0.3263735771179199, 0.17311587929725647, -0.21707940101623535, -0.17897562682628632, 0.027812782675027847, 0.3047166168689728, 0.49918949604034424, 0.4423148036003113, 0.17265206575393677, -0.08934895694255829, -0.5622699856758118, -0.6154500842094421, -0.13062165677547455, 0.4336732029914856, 0.11794692277908325, 0.09665433317422867, -0.04152902960777283, 0.18175163865089417, 0.10894329845905304, 0.1821303814649582, -0.04046019911766052, 0.11842243373394012, -0.05746954679489136, 0.011798731982707977, -0.07618323713541031, -0.04941130802035332, 0.056743696331977844, 0.11310280859470367, 0.08133901655673981, 0.10954050719738007, -0.061281852424144745, -0.07801896333694458, -0.2510579526424408, 0.3276277482509613, -0.09158246964216232, -0.40949761867523193, 0.2706516683101654, -0.11181056499481201, 0.25402480363845825, 0.0912388414144516, -0.46706336736679077, -0.28986600041389465, -0.06922637671232224, 0.0645972490310669, 0.3652760684490204, 0.1892545372247696, 0.16934791207313538, -0.32235971093177795, -0.6269419193267822, -0.4405505657196045, 0.2145751565694809, 0.12113666534423828, 0.1038665771484375, -0.20634543895721436, 0.019925519824028015, -0.006131507456302643, 0.12739115953445435, 0.34565645456314087, 0.06545595079660416, -0.11858305335044861, 0.1994263082742691, -0.45424091815948486, -0.15974125266075134, 0.5754098892211914, -0.5373483896255493, -0.11694340407848358, -0.24486835300922394, 0.20680028200149536, 0.10218708217144012, -0.38841599225997925, -0.7726697325706482, 0.24688489735126495, 0.2809351682662964, -0.0547003298997879, 0.09208472073078156, 0.3445712924003601, -0.25359243154525757, 0.040904268622398376, -0.09260544180870056, 0.6460895538330078, -0.01884898543357849, -0.18211209774017334, 0.2757989764213562, -0.1855425089597702 ]
https://github.com/huggingface/datasets/issues/6013
You can use the `remove_columns` parameter in `map` to avoid duplicating the columns (and save disk space) and then concatenate the original dataset with the map result: ```python from datasets import concatenate_datasets # dummy example ds_new = ds.map(lambda x: {"new_col": x["col"] + 2}, remove_columns=ds.column_names) ds_combined = concatenate_datasets([ds, ds_new], axis=1) ``` Doing this automatically is hard to implement efficiently unless we know ahead of time which existing columns will be modified by a `map` transform. We have this info when `input_columns` are specified, so I think this is the only case we can optimize.
[FR] `map` should reuse unchanged columns from the previous dataset to avoid disk usage
### Feature request Currently adding a new column with `map` will cause all the data in the dataset to be duplicated and stored/cached on the disk again. It should reuse unchanged columns. ### Motivation This allows having datasets with different columns but sharing some basic columns. Currently, these datasets would become too expensive to store and one would need some kind of on-the-fly join; which also doesn't seem implemented. ### Your contribution _
93
[FR] `map` should reuse unchanged columns from the previous dataset to avoid disk usage ### Feature request Currently adding a new column with `map` will cause all the data in the dataset to be duplicated and stored/cached on the disk again. It should reuse unchanged columns. ### Motivation This allows having datasets with different columns but sharing some basic columns. Currently, these datasets would become too expensive to store and one would need some kind of on-the-fly join; which also doesn't seem implemented. ### Your contribution _ You can use the `remove_columns` parameter in `map` to avoid duplicating the columns (and save disk space) and then concatenate the original dataset with the map result: ```python from datasets import concatenate_datasets # dummy example ds_new = ds.map(lambda x: {"new_col": x["col"] + 2}, remove_columns=ds.column_names) ds_combined = concatenate_datasets([ds, ds_new], axis=1) ``` Doing this automatically is hard to implement efficiently unless we know ahead of time which existing columns will be modified by a `map` transform. We have this info when `input_columns` are specified, so I think this is the only case we can optimize.
[ -0.23237107694149017, -0.2284434735774994, -0.17978745698928833, 0.044314831495285034, 0.08519665896892548, 0.35239219665527344, 0.17297399044036865, 0.5289419293403625, 0.36176013946533203, 0.08009135723114014, -0.216575026512146, 0.5258405804634094, 0.004911448806524277, 0.15665900707244873, -0.10771793127059937, -0.11825565993785858, 0.07873348146677017, 0.32194751501083374, -0.4633845388889313, 0.023537032306194305, -0.465354323387146, -0.01038940716534853, -0.15567299723625183, -0.37368419766426086, 0.027425512671470642, 0.07813478261232376, -0.3813101351261139, -0.03737236186861992, -0.05932089686393738, -0.022863060235977173, 0.0904843732714653, 0.1460496187210083, 0.11426161974668503, 0.2188435196876526, -0.00009570617112331092, -0.08501862734556198, -0.22586862742900848, -0.03662770986557007, -0.10269369184970856, -0.04844875633716583, -0.13522237539291382, -0.4433571398258209, -0.2131759226322174, -0.4868107736110687, -0.021064378321170807, -0.19646573066711426, -0.224472776055336, -0.35272216796875, 0.360749214887619, -0.20456498861312866, 0.33848685026168823, -0.003756936639547348, -0.10886409133672714, -0.10581603646278381, -0.010810773819684982, -0.03516535088419914, -0.05280168727040291, -0.07981917262077332, 0.10970935225486755, -0.10392432659864426, 0.11922146379947662, 0.49996939301490784, -0.251020610332489, -0.0002860166132450104, 0.1415952444076538, 0.148948073387146, 0.3677750527858734, -0.121590256690979, 0.19960133731365204, 0.22078166902065277, 0.2920660972595215, -0.3477421998977661, -0.13793718814849854, -0.15808895230293274, 0.07305464893579483, -0.1887052059173584, -0.07186658680438995, -0.07959765195846558, 0.25081682205200195, 0.021442212164402008, -0.20998357236385345, -0.13331496715545654, 0.038188494741916656, 0.05604182928800583, -0.12959802150726318, 0.09827481210231781, 0.07981398701667786, 0.06495292484760284, 0.20036271214485168, -0.08184968680143356, -0.060931600630283356, -0.31875303387641907, 0.07109308242797852, 0.2511999011039734, -0.34738612174987793, -0.3894202411174774, -0.0055074021220207214, -0.2344009280204773, 0.13692450523376465, -0.0740920901298523, 0.11395148187875748, -0.07139991223812103, 0.07503031939268112, 0.16726143658161163, 0.17199747264385223, 0.1255018264055252, -0.22704219818115234, 0.06101284176111221, 0.01626921258866787, -0.0795741155743599, -0.061045631766319275, -0.06259766221046448, 0.06039559096097946, -0.02201666682958603, 0.21013370156288147, -0.23295563459396362, 0.21518239378929138, 0.20980769395828247, -0.08109022676944733, -0.08474184572696686, 0.09980490058660507, -0.04412192851305008, -0.11349934339523315, 0.09283652901649475, 0.06604153662919998, 0.2519485354423523, -0.012300781905651093, 0.022053204476833344, 0.13268786668777466, 0.0749344453215599, -0.22915661334991455, 0.045597728341817856, -0.09129925817251205, 0.0008538197726011276, -0.04821392893791199, 0.053933028131723404, -0.01918203756213188, 0.1454245150089264, -0.13489024341106415, 0.1529403179883957, 0.07896116375923157, -0.06560637801885605, 0.381511390209198, 0.17486277222633362, 0.1322849988937378, -0.08163952082395554, 0.028059277683496475, 0.003565184772014618, -0.41432318091392517, 0.2536645531654358, -0.19654400646686554, -0.23986776173114777, -0.22286897897720337, 0.33663564920425415, 0.17444026470184326, 0.0473833791911602, -0.19159020483493805, 0.2767397463321686, 0.058544546365737915, -0.22715884447097778, -0.014092996716499329, 0.022102903574705124, -0.1864060014486313, -0.3995261490345001, 0.07202822715044022, 0.10746729373931885, -0.25613299012184143, 0.021113157272338867, -0.0007561296224594116, 0.09069165587425232, -0.021598536521196365, 0.30859243869781494, -0.1988123059272766, -0.051776912063360214, -0.07858489453792572, -0.0174083411693573, 0.3907959759235382, -0.00526437908411026, -0.24708878993988037, 0.09917367994785309, -0.07204961776733398, 0.08747083693742752, 0.06981091946363449, 0.24364475905895233, 0.26944708824157715, -0.051975350826978683, 0.10521811246871948, 0.1699090152978897, -0.14126306772232056, 0.07265454530715942, -0.19851626455783844, -0.29764071106910706, 0.2841983437538147, -0.10094398260116577, -0.13551022112369537, 0.164940744638443, 0.04444894939661026, -0.08715835213661194, 0.20285899937152863, -0.16562090814113617, 0.11231253296136856, 0.1236145868897438, 0.18428122997283936, -0.22587721049785614, -0.07636341452598572, -0.04997207224369049, -0.5777251720428467, 0.06719469279050827, 0.33565452694892883, -0.21822801232337952, 0.18991874158382416, -0.3243982493877411, -0.09083478152751923, -0.11852407455444336, 0.06794361770153046, 0.213433638215065, 0.3155817687511444, 0.012178141623735428, 0.1809595823287964, -0.3957652151584625, -0.16451187431812286, 0.1423245072364807, -0.12175735086202621, -0.1116071417927742, -0.27248838543891907, 0.2251807153224945, -0.035310111939907074, 0.19408026337623596, -0.04896591603755951, 0.19085083901882172, 0.16419318318367004, -0.019277673214673996, 0.2580679655075073, 0.12813355028629303, -0.2551942765712738, 0.3394801914691925, 0.020387636497616768, 0.26774972677230835, 0.123447947204113, 0.26569700241088867, 0.2146165519952774, -0.1997910439968109, 0.1514136791229248, -0.05243122950196266, -0.20271793007850647, 0.14127524197101593, 0.05212847515940666, 0.10412372648715973, 0.11736118793487549, 0.05734652280807495, 0.05843275785446167, -0.15635180473327637, 0.027888640761375427, -0.3783693015575409, -0.204290509223938, 0.21598586440086365, -0.055643338710069656, 0.303069531917572, -0.18597650527954102, 0.24594345688819885, 0.5025931596755981, -0.06358274072408676, 0.01654670014977455, 0.08210095763206482, -0.2077483981847763, -0.061738573014736176, -0.03780081868171692, 0.42771148681640625, 0.4218257665634155, 0.3945094347000122, 0.16585847735404968, 0.09665818512439728, -0.0744427740573883, 0.05355292186141014, 0.2324652522802353, 0.05576317757368088, 0.21927908062934875, 0.18788404762744904, 0.16769835352897644, 0.17016443610191345, -0.10997598618268967, 0.020016543567180634, 0.09201888740062714, 0.14918971061706543, 0.07598084211349487, -0.2938871383666992, -0.10128675401210785, 0.037594400346279144, -0.03736846148967743, -0.03546324744820595, 0.12958675622940063, -0.31950411200523376, -0.03802608326077461, 0.16226044297218323, -0.27079689502716064, 0.22178488969802856, 0.0893021672964096, 0.2309386134147644, 0.038554996252059937, -0.27862823009490967, -0.06921187043190002, -0.13946862518787384, 0.21637418866157532, 0.3002032935619354, 0.01203235611319542, -0.18957968056201935, 0.2698126435279846, -0.0038387104868888855, 0.12819093465805054, -0.2998441159725189, -0.31433260440826416, 0.0058266231790184975, -0.25828614830970764, -0.2388862520456314, 0.048144299536943436, 0.24920743703842163, -0.16916438937187195, -0.1643677055835724, 0.05597362667322159, -0.15136131644248962, -0.1454920470714569, -0.0050045885145664215, 0.10927112400531769, -0.14209865033626556, -0.11169251799583435, -0.38393133878707886, -0.17529618740081787, -0.33122631907463074, 0.15814660489559174, 0.0009984225034713745, 0.14155733585357666, -0.31740087270736694, 0.18788838386535645, -0.09506792575120926, 0.060567084699869156, 0.03193623572587967, -0.42698100209236145, -0.2606964707374573, 0.4076884388923645, -0.07307851314544678, -0.10474198311567307, -0.002096526324748993, -0.2678819000720978, 0.17748065292835236, 0.13290199637413025, -0.23575672507286072, -0.3540157973766327, -0.1515444666147232, 0.235657200217247, -0.12509775161743164, 0.2840198874473572, 0.44394734501838684, 0.3162935674190521, -0.2154034972190857, 0.08054165542125702, -0.027727779000997543, -0.08779561519622803, 0.4631974697113037, -0.0383920893073082, -0.0610671266913414, 0.22006291151046753, 0.05361035466194153, 0.15618392825126648, 0.2981276512145996, 0.05950034037232399, 0.14424140751361847, 0.02327595464885235, 0.3999958634376526, -0.15562717616558075, -0.185102641582489, -0.24767030775547028, -0.2115795910358429, 0.14397946000099182, 0.09970507025718689, 0.04311234503984451, -0.22308586537837982, -0.004445858299732208, 0.02808724343776703, -0.14590765535831451, -0.11636511236429214, 0.20937484502792358, -0.013897396624088287, 0.2118588536977768, 0.0733170211315155, -0.1343715339899063, -0.3284590542316437, 0.022928379476070404, 0.06584785878658295, -0.06849153339862823, 0.16225264966487885, -0.25916212797164917, -0.2865644097328186, -0.029265819117426872, -0.5898310542106628, 0.2726667523384094, 0.06894652545452118, -0.15933841466903687, 0.24085454642772675, -0.38772517442703247, -0.34843334555625916, 0.013963267207145691, 0.4244360327720642, -0.24449950456619263, -0.4658506512641907, 0.1649867445230484, -0.051331013441085815, -0.30732500553131104, 0.14908456802368164, -0.04548356682062149, -0.15159833431243896, 0.13446205854415894, 0.7064841389656067, -0.09810241311788559, -0.1200154647231102, 0.38478970527648926, 0.44145500659942627, -0.04123295471072197, 0.02860185131430626, -0.08636679500341415, -0.13332372903823853, -0.37067726254463196, -0.19097530841827393, -0.004552755504846573, 0.08357588946819305, 0.11358202248811722, -0.03529588133096695, -0.0255131796002388, -0.11819340288639069, 0.273946613073349, 0.19218075275421143, 0.34254077076911926, 0.21297672390937805, 0.27194488048553467, 0.13541097939014435, 0.05223755165934563, -0.06773456186056137, 0.3999033570289612, -0.32694658637046814, -0.0045952871441841125, -0.0569678358733654, -0.07130090892314911, 0.22092516720294952, 0.0908166840672493, 0.08370283246040344, 0.11255963146686554, -0.5618675351142883, 0.17672087252140045, -0.473766565322876, -0.26989659667015076, 0.17554904520511627, 0.06628316640853882, -0.24525423347949982, -0.3666696548461914, 0.3699367344379425, 0.2107614129781723, -0.18953900039196014, 0.3818657696247101, -0.04691975936293602, -0.15649758279323578, 0.3288652300834656, 0.21360459923744202, 0.8158727288246155, -0.13534289598464966, 0.15840420126914978, 0.1075080931186676, -0.17916995286941528, 0.1179821789264679, -0.18957552313804626, 0.1821208894252777, -0.09912853688001633, -0.2674221396446228, -0.05419405922293663, -0.00277651846408844, 0.1855868399143219, 0.18259978294372559, -0.3896504044532776, 0.041266631335020065, -0.01308954507112503, 0.3536714017391205, -0.14155563712120056, 0.09559270739555359, 0.014360198751091957, -0.4035574197769165, -0.13754837214946747, 0.23364034295082092, 0.15840312838554382, -0.3231944441795349, 0.03385166451334953, 0.08223588764667511, 0.060665689408779144, -0.1327138990163803, 0.08063971996307373, -0.1301560401916504, 0.09474408626556396, 0.343298077583313, -0.13231146335601807, -0.14373168349266052, -0.0915616974234581, 0.15584975481033325, 0.03818183392286301, 0.05373503640294075, 0.1378687173128128, -0.13075213134288788, 0.20976927876472473, 0.30331355333328247, -0.016176743432879448, -0.16468346118927002, 0.05558445304632187, 0.22592808306217194, 0.04924394190311432, 0.17851895093917847, 0.11878010630607605, -0.16213218867778778, -0.4057101607322693, 0.1627717912197113, 0.2156354933977127, -0.3708290457725525, -0.18832185864448547, 0.27284950017929077, -0.20948413014411926, -0.2358471006155014, 0.2573489546775818, -0.07376093417406082, -0.16851121187210083, 0.4690841734409332, 0.036714259535074234, -0.3202907145023346, -0.1528031975030899, 0.276771605014801, 0.44333651661872864, 0.15254716575145721, 0.16688677668571472, -0.30756115913391113, -0.17994967103004456, -0.31970226764678955, 0.14908698201179504, -0.01850936934351921, -0.039359211921691895, 0.1161615401506424, -0.1671764850616455, -0.08208392560482025, 0.05802914872765541, 0.03757648915052414, 0.04453027993440628, 0.2842281460762024, 0.009462200105190277, -0.0689830332994461, -0.37381190061569214, 0.37758904695510864, 0.3931945860385895, 0.40546315908432007, 0.16286949813365936, 0.055244337767362595, -0.27464741468429565, 0.3542221486568451, -0.5368196368217468, 0.061064720153808594, 0.12944257259368896, 0.12453098595142365, 0.2902820408344269, -0.052015893161296844, -0.05409250408411026, -0.2505309283733368, 0.3436540961265564, 0.22134849429130554, -0.061786945909261703, -0.4380205273628235, -0.12349826097488403, 0.01857687532901764, -0.1199205070734024, 0.044862352311611176, -0.10254286974668503, -0.12755827605724335, -0.11089661717414856, -0.3257507085800171, 0.11974351108074188, 0.057452231645584106, -0.07910169661045074, -0.11666359007358551, 0.02195560559630394, -0.3570922017097473, 0.032360173761844635, 0.05987999215722084, 0.02747996896505356, -0.049206361174583435, -0.03250756114721298, 0.1941252052783966, -0.15896856784820557, -0.04105653613805771, -0.021976303309202194, 0.08195985853672028, 0.17559801042079926, -0.1298113912343979, 0.36450308561325073, 0.17929509282112122, -0.15291744470596313, 0.22467902302742004, 0.3813062012195587, -0.14458119869232178, -0.12327307462692261, -0.06527295708656311, 0.02644582837820053, 0.41878119111061096, -0.5710077285766602, -0.23931030929088593, 0.3246634602546692, 0.12566103041172028, 0.38738036155700684, 0.24622628092765808, 0.15587547421455383, 0.13745534420013428, -0.02479568123817444, 0.017666414380073547, 0.1620064675807953, -0.2410404235124588, 0.30229517817497253, 0.5416372418403625, 0.1829594075679779, -0.13510996103286743, 0.14031577110290527, 0.3261195123195648, 0.22796191275119781, 0.17929339408874512, -0.10044118762016296, 0.2426559180021286, 0.06499728560447693, 0.01210566982626915, -0.05978772044181824, -0.21575918793678284, 0.45459213852882385, 0.19164817035198212, -0.16740213334560394, 0.2188151329755783, 0.2984347343444824, -0.0925905853509903, -0.03703175485134125, -0.2117825746536255, -0.08901058882474899, 0.38652902841567993, -0.2726801633834839, -0.11543790996074677, 0.2659681439399719, -0.16531923413276672, 0.01121889054775238, -0.011215843260288239, 0.03446783125400543, -0.33541592955589294, 0.5989682674407959, -0.11798602342605591, 0.34449338912963867, 0.10974481701850891, 0.128402978181839, -0.011392079293727875, 0.2595476508140564, -0.2587164640426636, -0.11500904709100723, 0.17195095121860504, -0.024128787219524384, -0.1442190557718277, 0.16933074593544006, 0.244573712348938, -0.025003580376505852, 0.04052801430225372, 0.36021578311920166, 0.032849859446287155, -0.1868288815021515, -0.104826420545578, -0.16792145371437073, 0.048443570733070374, -0.10481344163417816, 0.18936286866664886, 0.32417359948158264, -0.28037428855895996, 0.06163695827126503, 0.0657629743218422, 0.12096358835697174, -0.31226009130477905, 0.12567353248596191, 0.36635100841522217, -0.4503668546676636, 0.1505752056837082, -0.01101171225309372, -0.09671623259782791, -0.34346312284469604, 0.3234366774559021, -0.19886569678783417, 0.08579535037279129, 0.0010341145098209381, 0.20826563239097595, 0.25455591082572937, 0.2409893274307251, 0.11456120014190674, -0.36599522829055786, -0.3515930771827698, -0.2869178056716919, -0.5305483341217041, -0.1951558142900467, -0.09798410534858704, -0.12133480608463287, 0.04062916338443756, 0.26973915100097656, 0.2883736491203308, 0.19292637705802917, 0.07656703889369965, -0.15846358239650726, -0.1398915946483612, -0.03954361751675606, -0.15802499651908875, -0.15467695891857147, 0.07509240508079529, -0.1392797976732254, 0.10337015986442566, -0.3931456208229065, 0.22117966413497925, 0.19824635982513428, 0.23146703839302063, -0.2528824210166931, 0.25863975286483765, -0.019626114517450333, 0.15502801537513733, 0.2588694095611572, -0.00581586267799139, -0.09993468970060349, -0.3343372941017151, -0.016088973730802536, 0.16023913025856018, -0.05405084416270256, -0.11604238301515579, 0.10102898627519608, 0.1265125870704651, 0.07649730145931244, -0.339883029460907, -0.1000562459230423, 0.009812526404857635, -0.1877441555261612, 0.17637185752391815, -0.0886932909488678, -0.21591907739639282, 0.16641199588775635, 0.09911598265171051, 0.12929022312164307, -0.07430491596460342, 0.47186771035194397, 0.033195339143276215, 0.21365641057491302, 0.0589190274477005, -0.2559768557548523, 0.31871604919433594, -0.05534026771783829, -0.2916067838668823, -0.07911716401576996, -0.04091476649045944, -0.009886790066957474, 0.11952749639749527, -0.32436680793762207, -0.058090247213840485, 0.2842549979686737, -0.26656848192214966, 0.009212188422679901, 0.4032023549079895, -0.11666233837604523, -0.03996556997299194, -0.126327782869339, 0.18760454654693604, -0.07539956271648407, -0.38162729144096375, -0.09060400724411011, -0.4267737567424774 ]
https://github.com/huggingface/datasets/issues/6012
You can use `with_transform` to get a new dataset object. Support for lazy `map` has already been discussed [here](https://github.com/huggingface/datasets/issues/3385) a little bit. Personally, I'm not a fan, as this would make `map` even more complex.
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
35
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ You can use `with_transform` to get a new dataset object. Support for lazy `map` has already been discussed [here](https://github.com/huggingface/datasets/issues/3385) a little bit. Personally, I'm not a fan, as this would make `map` even more complex.
[ -0.2477826476097107, -0.4162158966064453, -0.1703816056251526, -0.06715787947177887, -0.0025982828810811043, -0.03832286596298218, -0.03812398388981819, 0.406848281621933, 0.29438120126724243, 0.1818750500679016, -0.06886430084705353, 0.42894840240478516, -0.2255830466747284, 0.35840633511543274, 0.12850823998451233, -0.13405029475688934, 0.1262088418006897, 0.18901903927326202, -0.3754942715167999, -0.0104951411485672, -0.4055739641189575, 0.10751685500144958, 0.008576929569244385, -0.05086732283234596, -0.021795926615595818, -0.06624844670295715, -0.28515440225601196, -0.13263894617557526, -0.05333227291703224, 0.021432574838399887, 0.2067689597606659, 0.2997106611728668, -0.13591080904006958, 0.14917217195034027, -0.00009640333882998675, -0.017173290252685547, 0.054611559957265854, 0.015919841825962067, -0.03776833415031433, -0.254835844039917, -0.205265611410141, -0.30012810230255127, -0.09884442389011383, -0.34357473254203796, -0.22085291147232056, -0.2081359624862671, 0.20584896206855774, -0.37029391527175903, 0.48446571826934814, -0.23892974853515625, 0.32957151532173157, 0.05875679850578308, -0.2670712471008301, -0.22261108458042145, 0.1753132939338684, 0.27559202909469604, 0.007213376462459564, -0.126056969165802, 0.16497905552387238, 0.0776711255311966, -0.15716148912906647, 0.3442964553833008, -0.16259083151817322, -0.055999405682086945, 0.46537667512893677, -0.047657184302806854, -0.10260774195194244, -0.17696958780288696, 0.03426336869597435, 0.17483298480510712, 0.17987677454948425, -0.2305137813091278, -0.2530698776245117, -0.3588925898075104, -0.2749766707420349, -0.1496366262435913, -0.16870734095573425, 0.038068413734436035, 0.023016218096017838, 0.19450387358665466, -0.35655251145362854, -0.199612095952034, 0.07932597398757935, 0.09601019322872162, 0.02016228437423706, -0.03994015231728554, -0.1304665207862854, -0.008544176816940308, 0.23964658379554749, -0.060886017978191376, -0.025811847299337387, -0.14426377415657043, 0.03672183305025101, 0.1931189000606537, -0.2032642811536789, -0.3326205611228943, 0.2206254005432129, 0.08668296039104462, 0.3657931089401245, 0.2642894983291626, -0.035445671528577805, 0.16813117265701294, -0.33879607915878296, 0.16427510976791382, 0.21354609727859497, 0.1337454915046692, -0.06232944503426552, -0.23500974476337433, 0.17223504185676575, -0.23044952750205994, 0.05570998042821884, 0.029525384306907654, 0.16333167254924774, 0.06724242120981216, -0.08532200753688812, -0.06598736345767975, 0.167729914188385, 0.0889546349644661, -0.009935304522514343, -0.26817116141319275, 0.16022372245788574, 0.09977269172668457, 0.0004969127476215363, 0.3722706139087677, 0.02611180767416954, 0.2075638473033905, 0.18984472751617432, 0.01597420684993267, 0.029608793556690216, 0.03390214219689369, -0.24732744693756104, -0.18127286434173584, -0.17834576964378357, 0.16329458355903625, -0.014225699007511139, 0.01795239746570587, 0.15799322724342346, 0.04289042204618454, -0.07540655881166458, 0.15754812955856323, 0.3088221549987793, 0.04479756951332092, 0.20568333566188812, 0.012453289702534676, -0.06931868940591812, -0.008878972381353378, 0.13256442546844482, 0.08315072953701019, -0.42918622493743896, 0.12878265976905823, -0.294095903635025, -0.28123950958251953, 0.06559111922979355, 0.30230292677879333, -0.03182610124349594, -0.08397497236728668, -0.2426605373620987, 0.5922927260398865, -0.08993453532457352, -0.21384473145008087, 0.10436639189720154, 0.08552566915750504, -0.33437931537628174, -0.1955808401107788, -0.05815090611577034, 0.14480170607566833, 0.11777836084365845, -0.3537644147872925, -0.040522053837776184, -0.003003600984811783, -0.14613884687423706, 0.3200751543045044, -0.25214725732803345, 0.009288271889090538, -0.19720406830310822, 0.12284749746322632, 0.309929221868515, 0.029188193380832672, -0.20239314436912537, 0.10256846994161606, -0.22506769001483917, -0.10994962602853775, -0.023371867835521698, 0.38267791271209717, 0.29791659116744995, -0.16720539331436157, -0.007514026015996933, 0.37979957461357117, -0.10335983335971832, 0.17827364802360535, -0.0035448074340820312, -0.29935649037361145, -0.08718183636665344, -0.055977243930101395, -0.012180285528302193, 0.1139059066772461, 0.03600122779607773, 0.13961157202720642, 0.2250732034444809, -0.25245335698127747, 0.21432027220726013, 0.15145322680473328, 0.13473014533519745, -0.13520431518554688, -0.06085151061415672, -0.35996100306510925, -0.47841572761535645, -0.04653336480259895, 0.09195047616958618, -0.15721495449543, 0.18566125631332397, -0.3340039849281311, 0.0061957500874996185, 0.0132988840341568, 0.06433290243148804, 0.19712617993354797, 0.24242912232875824, 0.15450824797153473, -0.06316305696964264, -0.17556394636631012, -0.3770586848258972, -0.016965165734291077, 0.030464455485343933, -0.005885113030672073, -0.41459906101226807, 0.24152496457099915, 0.23364123702049255, 0.09802582859992981, -0.019479304552078247, -0.0010282974690198898, -0.05776907131075859, -0.15650556981563568, 0.2779555022716522, 0.05525752902030945, 0.05908319354057312, 0.24529480934143066, -0.06466861069202423, 0.6146386861801147, 0.21206682920455933, -0.03244497627019882, 0.2786575257778168, 0.028119735419750214, 0.09161806851625443, -0.12985993921756744, -0.43683621287345886, 0.40540811419487, -0.2528408467769623, 0.13608749210834503, 0.017096124589443207, 0.05762422829866409, 0.16103065013885498, -0.15458300709724426, -0.22822946310043335, -0.17104625701904297, 0.05384260416030884, 0.06502614915370941, 0.22835426032543182, 0.09676109999418259, -0.2266947627067566, 0.2831166088581085, 0.5104617476463318, -0.18781901895999908, 0.20125241577625275, 0.23041905462741852, -0.057974811643362045, -0.13003113865852356, 0.015770038589835167, 0.2283707559108734, 0.267473042011261, 0.318315714597702, 0.13051602244377136, 0.07569985836744308, 0.25572633743286133, 0.01847543567419052, 0.3663818836212158, 0.004825334995985031, 0.24098780751228333, -0.07217103242874146, 0.2047843188047409, -0.03864129260182381, -0.3278348445892334, -0.3263356685638428, 0.13856804370880127, -0.07640784978866577, 0.11525969207286835, -0.03565725311636925, -0.16251680254936218, -0.012206189334392548, -0.2573773264884949, -0.3306734561920166, 0.007709823548793793, -0.30400797724723816, 0.011647425591945648, 0.25458717346191406, -0.413019597530365, 0.25801753997802734, 0.06768742203712463, 0.4639798402786255, 0.0041745007038116455, -0.24515396356582642, -0.277936190366745, -0.2001243233680725, 0.2156524807214737, 0.18760833144187927, 0.0423860065639019, -0.2598862648010254, 0.4283160865306854, -0.22954264283180237, 0.19814461469650269, -0.3100801408290863, -0.40991342067718506, 0.3046864867210388, -0.07086537778377533, -0.04795033857226372, 0.2129994034767151, 0.20220695436000824, 0.1622542142868042, -0.07507637143135071, 0.049201902002096176, -0.3780399560928345, -0.29871881008148193, -0.15730510652065277, 0.09910780936479568, 0.09692516922950745, -0.22213146090507507, -0.0922229140996933, -0.10734447836875916, -0.43672725558280945, 0.5739480257034302, -0.049518074840307236, 0.1656530201435089, 0.05573614314198494, 0.010468337684869766, 0.08173906058073044, 0.06535957753658295, -0.04783299192786217, -0.23906470835208893, -0.3973595201969147, 0.11097168922424316, -0.23720300197601318, -0.07035861164331436, -0.25602197647094727, -0.12513934075832367, 0.0008570626378059387, 0.04758410155773163, -0.2809469401836395, -0.43108537793159485, -0.2581523656845093, 0.5016736388206482, 0.13788588345050812, 0.16871529817581177, 0.45089560747146606, 0.28238144516944885, -0.24953864514827728, -0.05930066481232643, -0.28527185320854187, -0.05327090620994568, 0.22914031147956848, -0.09003011882305145, 0.2374161034822464, 0.29110318422317505, 0.21653565764427185, 0.6903384327888489, 0.1606210470199585, -0.020374519750475883, 0.1871681958436966, 0.04850276559591293, 0.19791477918624878, -0.30552196502685547, -0.2908155918121338, -0.2060968577861786, -0.22629906237125397, -0.08028177171945572, 0.25755125284194946, 0.006245754659175873, -0.3831693232059479, 0.060490041971206665, -0.3724548816680908, -0.07720897346735, -0.21298228204250336, 0.2177019715309143, 0.015449786558747292, -0.009060673415660858, 0.197972372174263, -0.0013954266905784607, -0.41508716344833374, 0.06115309149026871, 0.2264569252729416, -0.04265565425157547, 0.2884507477283478, -0.1462935507297516, -0.20944248139858246, 0.00504399836063385, -0.5810481905937195, 0.44261717796325684, 0.05341915041208267, -0.332467257976532, -0.022670388221740723, -0.3069242835044861, -0.1605140119791031, -0.03938018158078194, 0.5701736211776733, 0.006825042888522148, -0.2964039742946625, -0.05804964527487755, -0.49157875776290894, -0.13227707147598267, 0.28260451555252075, -0.02381577342748642, 0.01606648787856102, 0.23492422699928284, 0.6012458205223083, -0.3529564142227173, -0.20757979154586792, 0.17671611905097961, 0.16343733668327332, -0.2576843500137329, 0.06360328197479248, 0.04955404996871948, -0.33303672075271606, -0.3078351616859436, 0.025372536852955818, 0.007697112858295441, -0.07851780951023102, 0.3153405487537384, -0.05486704036593437, -0.22747917473316193, 0.008869461715221405, 0.10707291215658188, 0.047537826001644135, 0.11114766448736191, 0.12866400182247162, 0.09900397062301636, 0.13536661863327026, 0.12159968912601471, -0.1684643179178238, 0.42996683716773987, -0.20942437648773193, -0.23408019542694092, 0.07687001675367355, 0.19266286492347717, 0.18039047718048096, 0.18556851148605347, 0.3474510908126831, 0.17609237134456635, 0.26065969467163086, 0.17173364758491516, -0.6235682368278503, -0.08421441912651062, 0.14550428092479706, 0.12089724093675613, -0.2717144191265106, -0.47369587421417236, 0.5301856398582458, 0.14987778663635254, -0.2616908550262451, 0.3083559572696686, -0.03978389501571655, -0.2309577763080597, 0.47547417879104614, 0.286885142326355, 0.9568652510643005, 0.003575480543076992, 0.25495460629463196, 0.08548566699028015, -0.18791411817073822, 0.52472984790802, -0.2987671494483948, 0.159758523106575, -0.30496901273727417, -0.5421876907348633, -0.10754546523094177, -0.050256796181201935, -0.17836613953113556, 0.04695769026875496, -0.36575496196746826, 0.2550516128540039, 0.24084702134132385, 0.12142014503479004, -0.14931660890579224, -0.023186810314655304, -0.05842068791389465, -0.32550162076950073, -0.21943838894367218, 0.28572359681129456, 0.09113091230392456, 0.14588752388954163, -0.11275912821292877, -0.23624885082244873, 0.10440622270107269, -0.0638807937502861, -0.015561595559120178, -0.09878242760896683, -0.0763518363237381, 0.27143025398254395, -0.12796860933303833, 0.14813557267189026, -0.1855076253414154, 0.03652817755937576, 0.05807081237435341, 0.05412427335977554, -0.11697084456682205, -0.023600762709975243, -0.10412992537021637, 0.3646869361400604, -0.09155119955539703, -0.22103257477283478, 0.370713472366333, 0.0879775658249855, 0.087090402841568, -0.054535310715436935, 0.16815677285194397, -0.22633835673332214, -0.35277920961380005, 0.07750063389539719, -0.2244560569524765, -0.19802860915660858, -0.0792163535952568, 0.3866443634033203, -0.007078379392623901, -0.21279314160346985, 0.20431029796600342, 0.03822491690516472, -0.04999042674899101, 0.3352471590042114, 0.060754768550395966, -0.1551656872034073, -0.03626374527812004, 0.2815139591693878, 0.2970835864543915, 0.025956735014915466, 0.23570571839809418, -0.11874565482139587, -0.2304731160402298, -0.30430150032043457, 0.1985601782798767, 0.19879862666130066, -0.4199412167072296, 0.43486467003822327, -0.3434664011001587, -0.3250550627708435, -0.05624204874038696, 0.212315171957016, 0.16012908518314362, 0.13858872652053833, -0.15607784688472748, -0.06312242895364761, -0.28190216422080994, 0.42703551054000854, 0.06739510595798492, 0.507773220539093, 0.06168461591005325, 0.05078698694705963, -0.10202157497406006, 0.24768376350402832, -0.5048602819442749, 0.008274693042039871, -0.08808209747076035, 0.05185782164335251, 0.045739926397800446, -0.21671892702579498, 0.05452854186296463, 0.022780098021030426, 0.14149977266788483, 0.1565258502960205, -0.23915860056877136, -0.3096855580806732, -0.21721182763576508, 0.10410937666893005, -0.1923498511314392, 0.21074450016021729, 0.09074850380420685, -0.02535007894039154, -0.036301176995038986, -0.4169228971004486, 0.1957186907529831, 0.0874011293053627, 0.08216865360736847, -0.09228545427322388, 0.14631491899490356, -0.27221211791038513, 0.03281911462545395, 0.03760332986712456, 0.3961530327796936, -0.048053134232759476, -0.20644435286521912, 0.2255578190088272, -0.17325718700885773, -0.20346757769584656, 0.1424138993024826, 0.2884276509284973, 0.5714288353919983, -0.22056002914905548, 0.3795429766178131, 0.138351708650589, -0.19603395462036133, 0.3424384593963623, 0.5556604862213135, -0.09799034148454666, 0.010944295674562454, 0.15019530057907104, 0.0881250873208046, 0.3699761927127838, -0.39001303911209106, -0.13533255457878113, 0.36219361424446106, 0.11042101681232452, 0.2269526571035385, 0.18177174031734467, -0.02529411017894745, 0.15854324400424957, 0.10808411240577698, -0.12338858097791672, 0.1938629150390625, -0.29909950494766235, 0.16237394511699677, 0.1473063826560974, 0.08583123981952667, -0.12476503103971481, 0.4091026484966278, 0.30291107296943665, 0.5008546113967896, 0.21561767160892487, -0.13284428417682648, 0.2543301582336426, 0.036794111132621765, 0.06806442886590958, 0.21775688230991364, -0.17112313210964203, 0.16921472549438477, 0.17911292612552643, -0.010867848992347717, 0.30371910333633423, 0.1739160567522049, 0.04867353290319443, -0.01821994222700596, -0.12974677979946136, -0.3321116268634796, 0.6950963735580444, -0.19601225852966309, -0.2751832604408264, 0.08516355603933334, -0.18858948349952698, -0.10377763211727142, 0.037642285227775574, -0.03981524705886841, -0.2883267402648926, 0.5481197834014893, 0.04394055902957916, 0.47681713104248047, 0.040012091398239136, -0.042934417724609375, 0.016075637191534042, 0.328816294670105, -0.3051219582557678, -0.04020097851753235, 0.23514413833618164, -0.22964328527450562, -0.046416256576776505, 0.5561140179634094, 0.15166236460208893, -0.061462316662073135, -0.21290314197540283, 0.40065163373947144, -0.24040450155735016, -0.11549606919288635, -0.2490513175725937, 0.14722436666488647, -0.046472933143377304, 0.07521598041057587, 0.349197655916214, 0.2573244273662567, -0.21638469398021698, 0.12354503571987152, -0.015215117484331131, -0.0038456041365861893, -0.260856568813324, 0.3626102805137634, 0.12820452451705933, -0.08626742660999298, -0.0395427830517292, -0.04614958539605141, -0.19189324975013733, -0.08493220806121826, 0.14929255843162537, -0.4486534297466278, 0.17672060430049896, 0.06185785308480263, 0.16422411799430847, 0.04301907494664192, 0.30455124378204346, 0.13586458563804626, 0.028390532359480858, -0.040272194892168045, -0.09656138718128204, -0.23067235946655273, 0.0815201997756958, 0.17868220806121826, 0.13818639516830444, 0.04821835830807686, 0.04035615175962448, 0.25107821822166443, 0.1294865608215332, -0.178537517786026, -0.3557664752006531, -0.07072977721691132, 0.19482602179050446, -0.05971421301364899, -0.0019648438319563866, -0.1265685111284256, -0.07832998782396317, 0.2620534896850586, -0.4035395383834839, -0.06096704304218292, -0.01526622474193573, 0.12557892501354218, -0.1781063675880432, 0.29709064960479736, -0.11950871348381042, -0.27399882674217224, 0.3870699107646942, 0.3002571165561676, -0.16946639120578766, -0.2541561424732208, -0.10646615922451019, 0.08076360076665878, -0.2790892422199249, -0.3228738009929657, 0.06190378963947296, 0.041685059666633606, 0.16880583763122559, -0.19525861740112305, -0.18763881921768188, -0.09275563061237335, -0.14130684733390808, 0.19556502997875214, 0.16090504825115204, -0.2999129891395569, 0.16743311285972595, -0.423179030418396, -0.08972671627998352, 0.020260993391275406, 0.6125141382217407, 0.060952331870794296, 0.20755983889102936, 0.0014107972383499146, -0.26688531041145325, 0.44237980246543884, -0.39053860306739807, -0.33436715602874756, 0.059912823140621185, 0.07436569780111313, 0.08718825876712799, -0.20129376649856567, -0.17644698917865753, -0.006121352314949036, 0.2373550832271576, -0.08760391175746918, -0.09740422666072845, 0.3040584921836853, -0.015128878876566887, -0.26702311635017395, -0.2385328859090805, 0.5089589357376099, 0.19786381721496582, -0.4159248173236847, 0.17365601658821106, -0.3546178936958313 ]
https://github.com/huggingface/datasets/issues/6012
> You can use `with_transform` to get a new dataset object. > > Support for lazy `map` has already been discussed [here](https://github.com/huggingface/datasets/issues/3385) a little bit. Personally, I'm not a fan, as this would make `map` even more complex. I read about IterableDataset, and it seems to have lazy mapping. But I can't figure out how to convert an IterableDataset into a normal one when needed. `with_transform` still does not chain AFAIU.
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
71
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ > You can use `with_transform` to get a new dataset object. > > Support for lazy `map` has already been discussed [here](https://github.com/huggingface/datasets/issues/3385) a little bit. Personally, I'm not a fan, as this would make `map` even more complex. I read about IterableDataset, and it seems to have lazy mapping. But I can't figure out how to convert an IterableDataset into a normal one when needed. `with_transform` still does not chain AFAIU.
[ -0.2746129035949707, -0.40563780069351196, -0.1270229071378708, -0.08347396552562714, 0.027343671768903732, 0.07320760190486908, -0.0010271789506077766, 0.3469206690788269, 0.15508490800857544, 0.04703827202320099, -0.1103539690375328, 0.33956676721572876, -0.29174119234085083, 0.27537283301353455, 0.03291916474699974, -0.03924693539738655, 0.15350982546806335, 0.07826094329357147, -0.3640493154525757, 0.021864496171474457, -0.3769230842590332, 0.18362484872341156, -0.03131408989429474, -0.10852354019880295, 0.002789519727230072, -0.12865424156188965, -0.27437424659729004, -0.18551471829414368, 0.03170992434024811, -0.020137503743171692, 0.3665735423564911, 0.364124596118927, -0.09525442123413086, 0.08781879395246506, -0.00010313657548977062, -0.022052474319934845, 0.013899024575948715, -0.0002260059118270874, -0.03580012917518616, -0.21773827075958252, -0.2675068974494934, -0.25512421131134033, -0.12138357013463974, -0.2853529453277588, -0.21585069596767426, -0.3208827078342438, 0.23530414700508118, -0.40361326932907104, 0.49567922949790955, -0.21770304441452026, 0.2482626736164093, -0.14613491296768188, -0.2747196555137634, -0.24372687935829163, 0.003006158396601677, 0.25633472204208374, -0.07936747372150421, 0.0016039833426475525, 0.27749398350715637, 0.10724561661481857, -0.10207641124725342, 0.20116063952445984, -0.09023083746433258, -0.08987461030483246, 0.48563840985298157, -0.04598022624850273, -0.05031786486506462, -0.21500977873802185, 0.0809364914894104, 0.2045896351337433, 0.1396121084690094, -0.2151792198419571, -0.20764055848121643, -0.5087723135948181, -0.18392646312713623, -0.07613416016101837, -0.22182410955429077, -0.054521121084690094, 0.08303819596767426, 0.2247992604970932, -0.3799188435077667, -0.1980137825012207, 0.041107840836048126, 0.0969763994216919, 0.1561022400856018, -0.14846113324165344, -0.14775259792804718, 0.021413035690784454, 0.21220582723617554, -0.11600393056869507, 0.20719793438911438, -0.20897379517555237, 0.08465006202459335, 0.2815482020378113, -0.14096638560295105, -0.33397775888442993, 0.1647671014070511, 0.11159748584032059, 0.4160551428794861, 0.256700724363327, -0.12140533328056335, 0.07740926742553711, -0.5029069781303406, 0.022710228338837624, 0.31780707836151123, 0.05561825633049011, -0.1263360232114792, -0.06729761511087418, 0.09427453577518463, -0.12827861309051514, 0.0744224488735199, 0.06022224575281143, 0.15693743526935577, 0.07438246160745621, 0.08845455944538116, 0.01610482856631279, 0.2146729975938797, 0.04922349750995636, -0.050247758626937866, -0.36695030331611633, -0.02239128202199936, 0.013656772673130035, 0.003407645970582962, 0.20167340338230133, 0.03669462725520134, 0.16781085729599, 0.1066354513168335, 0.06463561952114105, 0.15762615203857422, 0.11578475683927536, -0.19472305476665497, -0.32150399684906006, -0.13790062069892883, 0.22569531202316284, -0.0035854950547218323, -0.02515539526939392, 0.1535184234380722, 0.047771286219358444, -0.1849515736103058, 0.14671742916107178, 0.3462517261505127, -0.07589086890220642, 0.28498750925064087, -0.06389997899532318, -0.08824136108160019, 0.09793996810913086, 0.1326267421245575, -0.07061659544706345, -0.42339712381362915, 0.09400150924921036, -0.2814047634601593, -0.28481030464172363, 0.13496264815330505, 0.2068427950143814, -0.1548907458782196, -0.13339942693710327, -0.2146005928516388, 0.6047580242156982, 0.012976069003343582, -0.23512892425060272, 0.10642600059509277, -0.02464325912296772, -0.2831576466560364, -0.17510555684566498, -0.07039859145879745, 0.1765626072883606, 0.12158612906932831, -0.35444924235343933, -0.06504326313734055, -0.01720106601715088, -0.0932788997888565, 0.40582215785980225, -0.19320343434810638, 0.2024705708026886, -0.2917402386665344, 0.06865194439888, 0.13432782888412476, 0.19177234172821045, -0.23401561379432678, 0.12543131411075592, -0.09558048099279404, 0.14080792665481567, -0.13388247787952423, 0.35499536991119385, 0.2942016124725342, -0.33987343311309814, 0.05502176284790039, 0.37781447172164917, -0.24214375019073486, 0.03705485910177231, 0.057403601706027985, -0.22692781686782837, -0.06426156312227249, -0.1298651546239853, 0.021116018295288086, 0.275344580411911, -0.016394037753343582, 0.2342684417963028, 0.28865084052085876, -0.278901606798172, 0.2310725897550583, 0.17866401374340057, 0.13541439175605774, -0.1235884428024292, 0.0064164623618125916, -0.339079886674881, -0.5651983022689819, -0.0715593472123146, 0.16389110684394836, -0.14745093882083893, 0.12300067394971848, -0.3468920588493347, -0.023952104151248932, -0.035843025892972946, -0.016555840149521828, 0.21031919121742249, 0.1741415411233902, 0.21273434162139893, -0.07237358391284943, -0.16709589958190918, -0.4318503141403198, 0.02056303806602955, 0.0057592689990997314, -0.1077333390712738, -0.49191489815711975, 0.21654805541038513, 0.3431910276412964, 0.11724033951759338, 0.02286667376756668, 0.1315353810787201, -0.046190045773983, -0.27385398745536804, 0.275867760181427, 0.028781909495592117, 0.003298044204711914, 0.1559182107448578, -0.08757300674915314, 0.7862424850463867, 0.2462257295846939, -0.007627084851264954, 0.12331777065992355, 0.0290418341755867, 0.05674610659480095, -0.21902692317962646, -0.4257288873195648, 0.3116593360900879, -0.5682328343391418, 0.28288131952285767, 0.013616293668746948, 0.07657316327095032, 0.26366233825683594, -0.11694324016571045, -0.3892403841018677, -0.12584592401981354, 0.013428919948637486, -0.008719822391867638, 0.22616255283355713, 0.00948103703558445, -0.12069929391145706, 0.3636513948440552, 0.5208198428153992, -0.20975017547607422, 0.14142639935016632, 0.143662691116333, -0.04705473408102989, -0.03970062732696533, 0.030293671414256096, 0.2792268991470337, 0.3082696795463562, 0.20364272594451904, 0.16249042749404907, 0.1254739910364151, 0.22412578761577606, 0.08466830849647522, 0.36549320816993713, 0.007890397682785988, 0.3650107681751251, -0.045464083552360535, 0.1379307359457016, -0.01532365195453167, -0.30188706517219543, -0.49462196230888367, 0.1028309091925621, 0.020081667229533195, 0.1269918829202652, -0.04231955111026764, -0.12850049138069153, -0.02406679093837738, -0.2679465413093567, -0.39556121826171875, 0.09315282106399536, -0.36432957649230957, -0.08665578067302704, 0.3737795352935791, -0.24774585664272308, 0.2891847491264343, 0.020673803985118866, 0.4484526515007019, 0.015081055462360382, -0.3169642686843872, -0.3359506130218506, -0.20630550384521484, 0.20394501090049744, 0.1343555748462677, 0.1594851315021515, -0.4608244299888611, 0.301849901676178, -0.259854793548584, 0.07772397249937057, -0.30168360471725464, -0.31451094150543213, 0.3077530562877655, -0.10393296182155609, -0.0812068060040474, 0.261894553899765, 0.24362348020076752, 0.21381604671478271, -0.11348991096019745, 0.033340420573949814, -0.27159586548805237, -0.16178244352340698, -0.1194322407245636, 0.005360513925552368, 0.09727714955806732, -0.09933874011039734, -0.0906713604927063, -0.009660322219133377, -0.3128366768360138, 0.5718645453453064, -0.08091098070144653, 0.12630213797092438, 0.2607493996620178, -0.015426591038703918, 0.08966200798749924, 0.16096770763397217, -0.10922221094369888, -0.18573321402072906, -0.3304816782474518, 0.2099255919456482, -0.15341439843177795, -0.09222543984651566, -0.2314981073141098, -0.21144285798072815, 0.02684299275279045, 0.01668817177414894, -0.2740778923034668, -0.28040310740470886, -0.23765267431735992, 0.4578234553337097, 0.09610138088464737, 0.08793508261442184, 0.43676722049713135, 0.3270527720451355, -0.14219632744789124, -0.03327783942222595, -0.2676316797733307, 0.054173197597265244, 0.17856189608573914, -0.022223718464374542, 0.37533044815063477, 0.3191658556461334, 0.30239659547805786, 0.7648844122886658, 0.3693024516105652, 0.06661680340766907, 0.13671031594276428, -0.0060585374012589455, 0.08498045802116394, -0.31485652923583984, -0.3932522237300873, -0.27886760234832764, -0.2368275374174118, -0.16725048422813416, 0.19267868995666504, -0.028536109253764153, -0.4098186790943146, 0.13124005496501923, -0.3077661991119385, -0.0006992369890213013, -0.26847267150878906, 0.21687255799770355, -0.08718102425336838, 0.02818302810192108, 0.15703241527080536, -0.001585550606250763, -0.29042595624923706, -0.029055140912532806, 0.29828307032585144, -0.1272733509540558, 0.3361037075519562, -0.1283879429101944, -0.2145521491765976, 0.005328651517629623, -0.5823999643325806, 0.3928252160549164, -0.017066363245248795, -0.18917249143123627, -0.04068081080913544, -0.28959935903549194, -0.14638760685920715, -0.040229856967926025, 0.6998798847198486, -0.05385782942175865, -0.2810962200164795, 0.02610129863023758, -0.42119455337524414, -0.08333619683980942, 0.2214140146970749, -0.07653255760669708, 0.1861533224582672, 0.34001776576042175, 0.6964142322540283, -0.39573413133621216, -0.17698973417282104, 0.20151276886463165, 0.15888679027557373, -0.2530735731124878, 0.0909334272146225, 0.08473929762840271, -0.3614983856678009, -0.19409334659576416, -0.017630912363529205, 0.02861148864030838, 0.009820260107517242, 0.33628860116004944, -0.057861924171447754, -0.36027249693870544, -0.07869165390729904, 0.027245834469795227, -0.007130522280931473, 0.05958031490445137, 0.23301225900650024, 0.24402867257595062, 0.24996010959148407, 0.04582563787698746, -0.24073675274848938, 0.47608545422554016, -0.1484537124633789, -0.23421230912208557, 0.09190252423286438, 0.14138469099998474, 0.18634313344955444, 0.17939303815364838, 0.28582704067230225, 0.032001666724681854, 0.4104166030883789, 0.1359184980392456, -0.6202147603034973, -0.16235050559043884, 0.10891969501972198, 0.09194730967283249, -0.3573840856552124, -0.5204820036888123, 0.4709823727607727, 0.19632413983345032, -0.2704300284385681, 0.3480917811393738, -0.0387294702231884, -0.24924466013908386, 0.5029734969139099, 0.2635383903980255, 0.8977885246276855, -0.11377260088920593, 0.17540931701660156, 0.028992943465709686, -0.057600654661655426, 0.46846088767051697, -0.3715762197971344, 0.17132103443145752, -0.28552186489105225, -0.7100877165794373, -0.12925103306770325, -0.07053296267986298, -0.1697341352701187, 0.09804210811853409, -0.3231737017631531, 0.33649420738220215, 0.30223575234413147, 0.11094056069850922, -0.06723842769861221, -0.07757733762264252, -0.13042515516281128, -0.2559050917625427, -0.1737021803855896, 0.22112414240837097, 0.10075511038303375, 0.1525612622499466, -0.07473728060722351, -0.22834736108779907, 0.20724347233772278, 0.07361723482608795, -0.06367771327495575, -0.05187537521123886, -0.10375690460205078, 0.13150019943714142, -0.035257380455732346, 0.12767677009105682, -0.15845325589179993, 0.07238148152828217, 0.1468110829591751, -0.05250462144613266, -0.17726382613182068, -0.07318247109651566, -0.09049418568611145, 0.31778964400291443, -0.08596843481063843, -0.24831970036029816, 0.401804655790329, 0.12494175136089325, 0.2373284101486206, -0.017963971942663193, 0.20885002613067627, -0.22424471378326416, -0.3732956051826477, 0.014594058506190777, -0.1456986963748932, -0.2872392535209656, -0.14246231317520142, 0.5391584038734436, 0.08248765021562576, -0.13236239552497864, 0.14440342783927917, 0.08633184432983398, -0.00039596110582351685, 0.39649978280067444, -0.09013374149799347, -0.14267781376838684, 0.014433901757001877, 0.26353469491004944, 0.2869856655597687, 0.009219542145729065, 0.3124709129333496, -0.09472360461950302, -0.1305023580789566, -0.20238885283470154, 0.18265241384506226, 0.23584868013858795, -0.4801795482635498, 0.36204373836517334, -0.43746134638786316, -0.1604876071214676, -0.16204015910625458, 0.23311005532741547, 0.11047829687595367, 0.14643968641757965, -0.20666095614433289, -0.14708691835403442, -0.25404658913612366, 0.37901660799980164, 0.18526706099510193, 0.47856903076171875, -0.01002480834722519, -0.07001389563083649, -0.07235227525234222, 0.19852565228939056, -0.4238232374191284, -0.026362573727965355, -0.08166821300983429, 0.06743355095386505, -0.13089461624622345, -0.1823505312204361, 0.11618269979953766, -0.02679823711514473, 0.08920588344335556, 0.1397310197353363, -0.13608503341674805, -0.23155702650547028, -0.17616009712219238, 0.11847847700119019, -0.06592471152544022, 0.15136107802391052, 0.017851661890745163, -0.08624470233917236, -0.07748880982398987, -0.4663020372390747, 0.19155356287956238, 0.027689091861248016, 0.13715007901191711, -0.07869672775268555, 0.0840560719370842, -0.30356311798095703, -0.09003091603517532, -0.11763792484998703, 0.3980814218521118, -0.09536859393119812, -0.18182185292243958, 0.2607778310775757, -0.15111151337623596, -0.22406423091888428, 0.08394540101289749, 0.32006382942199707, 0.6599319577217102, -0.21646904945373535, 0.459242045879364, 0.07190874218940735, -0.2048960030078888, 0.3838551342487335, 0.5525261163711548, -0.0027505159378051758, -0.07353800535202026, 0.22351065278053284, 0.0561058484017849, 0.2665466368198395, -0.35147106647491455, -0.10513022541999817, 0.2896224558353424, 0.2380993366241455, 0.14992229640483856, 0.22090524435043335, -0.11106055229902267, 0.026172101497650146, 0.26040977239608765, -0.1394680142402649, 0.20631928741931915, -0.37081918120384216, 0.1491735577583313, 0.18175363540649414, 0.11641824245452881, -0.13615109026432037, 0.4013930857181549, 0.2119525969028473, 0.4597702920436859, 0.21551816165447235, -0.10010424256324768, 0.17131835222244263, 0.10234696418046951, 0.04336990788578987, 0.30255410075187683, -0.14468511939048767, 0.10161582380533218, 0.17729026079177856, 0.05382370203733444, 0.232446551322937, 0.23110754787921906, -0.1504155695438385, 0.10230496525764465, -0.14341609179973602, -0.24047747254371643, 0.5439659953117371, -0.13722695410251617, -0.23994845151901245, 0.11520373076200485, -0.16882169246673584, -0.15409612655639648, 0.0006443560123443604, -0.13344033062458038, -0.3833923041820526, 0.5979059934616089, -0.004132673144340515, 0.5209759473800659, -0.0734294056892395, 0.108220674097538, 0.048474449664354324, 0.43759316205978394, -0.2520613372325897, 0.04760125279426575, 0.14726552367210388, -0.23502019047737122, -0.15744416415691376, 0.6878332495689392, 0.1010170429944992, 0.04848051816225052, -0.19986847043037415, 0.4567171037197113, -0.2659666836261749, -0.16283158957958221, -0.09746100753545761, 0.2882322371006012, -0.16499248147010803, 0.038203950971364975, 0.3247297704219818, 0.16126930713653564, -0.10419715940952301, 0.25457626581192017, -0.025661546736955643, -0.033570509403944016, -0.2852458953857422, 0.42631641030311584, 0.10601823776960373, -0.07401242852210999, 0.10146461427211761, -0.07345948368310928, -0.04956173524260521, -0.1976545751094818, 0.15599873661994934, -0.5503624081611633, 0.2016754001379013, 0.04148150607943535, 0.1340339183807373, -0.006559891626238823, 0.17656126618385315, 0.18624940514564514, 0.04514308646321297, -0.11361944675445557, -0.03699949383735657, -0.1457996517419815, -0.0494169220328331, 0.16383831202983856, 0.19616393744945526, 0.11302350461483002, 0.10738836228847504, 0.21407344937324524, 0.2787424325942993, -0.18636149168014526, -0.3723704218864441, -0.15844590961933136, 0.3669688403606415, 0.11375755816698074, -0.14914056658744812, -0.06296674907207489, -0.009628470987081528, 0.17353259027004242, -0.4181317090988159, 0.006632767152041197, -0.1440131962299347, 0.052471183240413666, -0.005797006189823151, 0.19667556881904602, -0.02726878970861435, -0.3311153054237366, 0.3058348000049591, 0.36154043674468994, -0.29219910502433777, -0.18831223249435425, -0.03308100253343582, 0.006593780126422644, -0.24932336807250977, -0.2614612579345703, 0.2645600736141205, 0.07867708802223206, 0.09662847965955734, -0.2666257917881012, -0.16419923305511475, -0.13058586418628693, -0.2463998794555664, 0.2149442583322525, 0.2580604553222656, -0.41153383255004883, 0.24995839595794678, -0.49023425579071045, 0.04746286943554878, -0.0159616619348526, 0.6414691209793091, 0.023347463458776474, 0.3148071765899658, -0.019609034061431885, -0.17429347336292267, 0.4138288199901581, -0.5008535385131836, -0.3383464217185974, 0.2324984073638916, 0.057324811816215515, 0.18344375491142273, -0.29017263650894165, -0.07613015174865723, -0.03127007931470871, 0.31549036502838135, -0.1591721624135971, -0.12380003929138184, 0.2298559695482254, 0.11937238276004791, -0.21090413630008698, -0.21740573644638062, 0.6522453427314758, 0.25600990653038025, -0.4689396023750305, 0.20000602304935455, -0.3748972713947296 ]
https://github.com/huggingface/datasets/issues/6012
> I read about IterableDataset, and it seems to have lazy mapping. But I can't figure out how to convert an IterableDataset into a normal one when needed. You must cache an `IterableDataset` to disk to load it as a `Dataset`. One way to do this is with `Dataset.from_generator`: ```python from functools import partial from datasets import Dataset def gen_from_iterable_dataset(iterable_ds) yield from iterable_ds ds = Dataset.from_generator(partial(gen_from_iterable_dataset, iterable_ds), features=iterable_ds.features}) ``` > with_transform still does not chain AFAIU. Yes, not supported yet - the solution is to combine the transforms into a single one.
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
92
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ > I read about IterableDataset, and it seems to have lazy mapping. But I can't figure out how to convert an IterableDataset into a normal one when needed. You must cache an `IterableDataset` to disk to load it as a `Dataset`. One way to do this is with `Dataset.from_generator`: ```python from functools import partial from datasets import Dataset def gen_from_iterable_dataset(iterable_ds) yield from iterable_ds ds = Dataset.from_generator(partial(gen_from_iterable_dataset, iterable_ds), features=iterable_ds.features}) ``` > with_transform still does not chain AFAIU. Yes, not supported yet - the solution is to combine the transforms into a single one.
[ -0.23495686054229736, -0.32557356357574463, -0.16109181940555573, -0.18144211173057556, 0.10616925358772278, 0.13453617691993713, 0.055798061192035675, 0.4533080458641052, 0.008160553872585297, -0.046478718519210815, 0.010550286620855331, 0.4062656760215759, -0.3834393322467804, 0.17144931852817535, -0.008139999583363533, -0.006094319745898247, 0.16904973983764648, 0.13566836714744568, -0.29485902190208435, 0.0002900362014770508, -0.3701968789100647, 0.09793150424957275, -0.02412758767604828, -0.18691112101078033, -0.02394881099462509, -0.12674689292907715, -0.1812736839056015, -0.20656557381153107, 0.02700958028435707, -0.10256801545619965, 0.27624979615211487, 0.3333825170993805, -0.013881105929613113, 0.04932333528995514, -0.00010174432827625424, -0.04101921617984772, -0.029253970831632614, -0.04174915701150894, -0.09292012453079224, -0.18211138248443604, -0.2244160920381546, -0.24538373947143555, -0.05466219410300255, -0.3073463439941406, -0.21282432973384857, -0.3659905195236206, 0.18974930047988892, -0.5085781812667847, 0.43978387117385864, -0.12036781758069992, 0.25286173820495605, -0.18352967500686646, -0.2730344533920288, -0.17947222292423248, 0.0022583678364753723, 0.15287195146083832, -0.17226290702819824, -0.0036187954246997833, 0.3102766275405884, 0.054716579616069794, -0.05096849054098129, 0.23971368372440338, -0.1584230363368988, -0.07849595695734024, 0.5851933360099792, -0.07213374227285385, 0.1460566520690918, -0.3335689902305603, 0.07847513258457184, 0.06821604073047638, 0.16327548027038574, -0.22731715440750122, -0.17312899231910706, -0.4906957745552063, -0.24747996032238007, -0.12775132060050964, -0.21727782487869263, -0.05377153307199478, 0.01592707261443138, 0.18844178318977356, -0.3272954523563385, -0.24567747116088867, 0.02536967396736145, 0.05357088893651962, 0.1511610448360443, -0.04972245544195175, -0.09404753893613815, -0.02847551554441452, 0.1211824119091034, -0.12049244344234467, 0.5339966416358948, -0.22558432817459106, 0.23194366693496704, 0.2881900370121002, -0.1301303505897522, -0.3240048885345459, 0.18462227284908295, -0.023832250386476517, 0.31747862696647644, 0.31822338700294495, -0.16459254920482635, 0.042108722031116486, -0.4109336733818054, 0.010779487900435925, 0.27516165375709534, 0.1519135683774948, -0.16640499234199524, -0.008973877876996994, -0.004078198224306107, -0.19552215933799744, -0.04138420894742012, 0.0008283066563308239, 0.0778028815984726, -0.012564882636070251, 0.2722669541835785, 0.04332442581653595, 0.19962140917778015, 0.10477885603904724, -0.04095909744501114, -0.3522127568721771, 0.019349291920661926, 0.06126519292593002, 0.03484625369310379, 0.1781015694141388, 0.06263993680477142, 0.26879018545150757, 0.02547842264175415, 0.10426011681556702, 0.2375129759311676, 0.13933122158050537, -0.17858541011810303, -0.254153311252594, -0.07986751943826675, 0.15271034836769104, 0.020204588770866394, 0.011117201298475266, 0.13370120525360107, 0.05339086428284645, -0.19900080561637878, 0.13947221636772156, 0.4576881229877472, -0.079949751496315, 0.36581480503082275, -0.05700692534446716, -0.08225410431623459, 0.1395721584558487, 0.2001991868019104, -0.08052296936511993, -0.4193034768104553, 0.18489889800548553, -0.25192782282829285, -0.30909332633018494, 0.12068557739257812, 0.2302308976650238, -0.20059192180633545, -0.1075824573636055, -0.10265915095806122, 0.45137882232666016, 0.17168325185775757, -0.2033964991569519, 0.07263873517513275, -0.1505938470363617, -0.20956426858901978, -0.263129860162735, -0.019938644021749496, 0.12084148824214935, 0.1190473735332489, -0.26477617025375366, -0.12322971969842911, 0.10640141367912292, 0.015840299427509308, 0.3769042491912842, -0.17855383455753326, 0.23253582417964935, -0.24989688396453857, -0.04397562891244888, 0.25776341557502747, 0.16234345734119415, -0.2655157446861267, 0.23696407675743103, -0.03336910158395767, 0.23694555461406708, -0.0798439085483551, 0.3393925428390503, 0.3111051619052887, -0.34544306993484497, 0.17689305543899536, 0.39981088042259216, -0.2887307405471802, 0.014438897371292114, -0.11464515328407288, -0.21662577986717224, 0.09412778913974762, -0.13409864902496338, 0.12811802327632904, 0.2979218661785126, -0.1592452973127365, 0.20109789073467255, 0.32724639773368835, -0.29927438497543335, 0.2218552827835083, 0.12772737443447113, 0.1368975043296814, -0.07647363841533661, 0.044505525380373, -0.34258541464805603, -0.42814916372299194, 0.030590258538722992, 0.14713865518569946, -0.14494208991527557, 0.050581563264131546, -0.31621649861335754, -0.058601535856723785, -0.027390845119953156, -0.12752120196819305, 0.15832066535949707, 0.23021581768989563, 0.17739522457122803, -0.08737701177597046, -0.14176586270332336, -0.4482361078262329, 0.005967410281300545, 0.06174860894680023, -0.21373480558395386, -0.3994689881801605, 0.2020418494939804, 0.3028259575366974, 0.08328027278184891, -0.026127807796001434, 0.15758785605430603, -0.027904104441404343, -0.2156434804201126, 0.14716938138008118, -0.033678751438856125, -0.002568073570728302, 0.09057506918907166, -0.12812544405460358, 0.8224422931671143, 0.19263993203639984, -0.06907321512699127, 0.1525093913078308, 0.15098696947097778, 0.07505695521831512, -0.187254399061203, -0.30106034874916077, 0.2911343574523926, -0.5515789985656738, 0.28649741411209106, 0.035437196493148804, 0.13290902972221375, 0.2699669301509857, -0.08343742787837982, -0.31211185455322266, -0.18419881165027618, -0.06747487187385559, 0.04801465570926666, 0.19637779891490936, -0.022411074489355087, -0.041897326707839966, 0.4540739059448242, 0.39458268880844116, -0.12281154096126556, 0.11434374749660492, 0.020145243033766747, -0.10373514890670776, -0.0805426836013794, 0.06144193559885025, 0.31718626618385315, 0.3028889298439026, 0.17900873720645905, 0.19898107647895813, 0.10181155800819397, 0.19980978965759277, 0.1405288428068161, 0.36911720037460327, 0.010828178375959396, 0.3939632773399353, 0.038998059928417206, 0.060129910707473755, 0.03551444783806801, -0.23488262295722961, -0.5078789591789246, 0.1361834704875946, 0.033404022455215454, 0.17370611429214478, -0.021392982453107834, -0.11567052453756332, 0.03899513930082321, -0.14471040666103363, -0.3623862862586975, 0.13163773715496063, -0.36546045541763306, -0.06360882520675659, 0.3888736367225647, -0.1598833203315735, 0.30180197954177856, -0.07020998001098633, 0.30634987354278564, 0.08056327700614929, -0.409155011177063, -0.2195909172296524, -0.23965276777744293, 0.21062520146369934, 0.17214351892471313, 0.18051600456237793, -0.3986363410949707, 0.3060982823371887, -0.22779783606529236, 0.04215524345636368, -0.2529447078704834, -0.20803231000900269, 0.17016258835792542, -0.10833849757909775, -0.0932040587067604, 0.18333032727241516, 0.16842326521873474, 0.2568451762199402, -0.1278056800365448, 0.016765791922807693, -0.2076735496520996, 0.01306159794330597, -0.1378900706768036, -0.017244670540094376, 0.033597588539123535, -0.0387607179582119, -0.07607616484165192, -0.13750894367694855, -0.3240436017513275, 0.40812936425209045, 0.05472683906555176, 0.1422901749610901, 0.2208750694990158, 0.01714392751455307, -0.07679757475852966, 0.3664485216140747, -0.08856697380542755, -0.1279582530260086, -0.20855894684791565, 0.3068515658378601, -0.20508788526058197, -0.046993326395750046, -0.16398699581623077, -0.31670111417770386, 0.07904297113418579, 0.0817079171538353, -0.19148214161396027, -0.10836640745401382, -0.2756767272949219, 0.48612940311431885, 0.0238331351429224, -0.02578422799706459, 0.38519924879074097, 0.44305720925331116, -0.11347277462482452, -0.047214340418577194, -0.07295781373977661, -0.01586010679602623, 0.09361374378204346, 0.026660136878490448, 0.41634172201156616, 0.23341089487075806, 0.3253149092197418, 0.7197089791297913, 0.3416134715080261, 0.08166022598743439, 0.16551971435546875, 0.009582001715898514, -0.024504955857992172, -0.26870331168174744, -0.46373993158340454, -0.3178963363170624, -0.315890908241272, -0.2657477557659149, 0.12732841074466705, -0.06760051846504211, -0.4737483859062195, 0.09069527685642242, -0.2897448241710663, 0.039035916328430176, -0.25550001859664917, 0.2796703279018402, -0.29057759046554565, 0.16095954179763794, 0.14952662587165833, 0.00022608041763305664, -0.4020098149776459, 0.012324489653110504, 0.24015912413597107, -0.16137270629405975, 0.3014565110206604, -0.18874143064022064, -0.12542778253555298, 0.018727891147136688, -0.5409846901893616, 0.2663308382034302, 0.026821840554475784, -0.17722675204277039, 0.049610838294029236, -0.34282386302948, -0.16908949613571167, -0.039382267743349075, 0.5930206775665283, -0.09771540015935898, -0.22253869473934174, 0.147487074136734, -0.3926126956939697, -0.01848103106021881, 0.15250945091247559, -0.038254618644714355, 0.19366835057735443, 0.2891950309276581, 0.6319044828414917, -0.2656937837600708, -0.13101699948310852, 0.06299763917922974, 0.18180561065673828, -0.25381866097450256, 0.11291106045246124, 0.11975404620170593, -0.31246238946914673, -0.20209312438964844, -0.13948263227939606, 0.12528035044670105, 0.05504077300429344, 0.1992798000574112, -0.06400074064731598, -0.4474323093891144, -0.04367863014340401, 0.13036702573299408, 0.06021782383322716, 0.0680873841047287, 0.08147041499614716, 0.24734924733638763, 0.13901729881763458, 0.009419999085366726, -0.2791953682899475, 0.37258318066596985, -0.07693319022655487, -0.21953317523002625, 0.011092506349086761, 0.16047297418117523, 0.12061695754528046, 0.1376921683549881, 0.20344796776771545, -0.07598033547401428, 0.18054136633872986, 0.17120790481567383, -0.5334357023239136, -0.16954156756401062, 0.07814846932888031, -0.06821388751268387, -0.26340559124946594, -0.6623317003250122, 0.47483131289482117, 0.13299454748630524, -0.2357654571533203, 0.2626333236694336, -0.21056276559829712, -0.2118837833404541, 0.6038506627082825, 0.3431243896484375, 0.8547743558883667, -0.08271810412406921, 0.12843962013721466, 0.018127206712961197, 0.10211856663227081, 0.42203399538993835, -0.44803619384765625, 0.24660784006118774, -0.26254040002822876, -0.8626656532287598, -0.10942193865776062, -0.03773564100265503, -0.21126937866210938, 0.10475201904773712, -0.3278297483921051, 0.29528453946113586, 0.19615274667739868, 0.02459104359149933, 0.03187321871519089, -0.09716244786977768, -0.09290820360183716, -0.22508662939071655, -0.11004826426506042, 0.23310232162475586, 0.16176027059555054, 0.11869613826274872, -0.044338613748550415, -0.26875045895576477, 0.1822814643383026, 0.1309351623058319, -0.05100734531879425, 0.023424826562404633, -0.10165587067604065, 0.26070278882980347, -0.12469122558832169, 0.04296708106994629, -0.15105141699314117, 0.11096727848052979, 0.1655580699443817, -0.07453577220439911, -0.15063053369522095, -0.0397769957780838, 0.11151769012212753, 0.252205491065979, -0.13301242887973785, -0.12068826705217361, 0.3826632797718048, 0.031211204826831818, 0.21923959255218506, 0.037197940051555634, 0.1338185966014862, -0.19696803390979767, -0.3992385268211365, -0.0359550416469574, -0.018240515142679214, -0.3160754442214966, -0.1658444106578827, 0.5308968424797058, -0.025927256792783737, -0.08798327296972275, 0.18865592777729034, 0.06076951324939728, -0.06210530176758766, 0.45967233180999756, -0.2636116147041321, -0.09505019336938858, 0.040434010326862335, 0.1792919784784317, 0.32204461097717285, -0.0025321468710899353, 0.3140111267566681, -0.19023318588733673, -0.17499695718288422, -0.21660585701465607, 0.14010369777679443, 0.09449782967567444, -0.3919200301170349, 0.35059529542922974, -0.43665534257888794, -0.1203957051038742, -0.20863261818885803, 0.1661686897277832, 0.17662560939788818, 0.24194934964179993, -0.2480139434337616, -0.06195240467786789, -0.24845950305461884, 0.2800379991531372, 0.18316951394081116, 0.43734076619148254, -0.1271911859512329, -0.07100437581539154, -0.08861489593982697, 0.201647087931633, -0.4452349543571472, -0.01929713971912861, -0.003941670060157776, 0.0970759317278862, -0.23682186007499695, -0.285199373960495, 0.007498439401388168, 0.07910796254873276, 0.1744692623615265, 0.09086915105581284, -0.08201275020837784, -0.2824353873729706, -0.09141481667757034, 0.09282593429088593, 0.0024528391659259796, 0.05707523971796036, -0.04872822389006615, -0.10123807191848755, -0.15997155010700226, -0.42262858152389526, 0.21957944333553314, -0.0015767142176628113, 0.07407479733228683, -0.004246462136507034, 0.03352915123105049, -0.282626211643219, -0.19703452289104462, -0.11596478521823883, 0.36788153648376465, -0.034967534244060516, -0.20217406749725342, 0.2908383011817932, -0.1220361590385437, -0.22389082610607147, -0.105581134557724, 0.3032180070877075, 0.4519515037536621, -0.1956380307674408, 0.5510222315788269, 0.03860051929950714, -0.10493203997612, 0.33702418208122253, 0.415908545255661, 0.1451486051082611, -0.09686978906393051, 0.21840594708919525, 0.049331869930028915, 0.29392436146736145, -0.33483877778053284, -0.11757013201713562, 0.14010611176490784, 0.21802586317062378, 0.15474393963813782, 0.25035348534584045, -0.053653497248888016, -0.09725207090377808, 0.3256767988204956, -0.1318964660167694, 0.28692299127578735, -0.4095863401889801, 0.16122354567050934, 0.28239279985427856, 0.2316824346780777, -0.16744010150432587, 0.267516165971756, 0.1783493608236313, 0.44472774863243103, 0.32825034856796265, -0.1186421662569046, 0.1255015879869461, 0.1574321836233139, -0.1310429573059082, 0.2519017457962036, -0.03616662696003914, 0.0024129855446517467, 0.19322672486305237, 0.06381157040596008, 0.28510868549346924, 0.2268848717212677, -0.2962157726287842, 0.11288828402757645, -0.1488795280456543, -0.19749310612678528, 0.5247462391853333, -0.08395995199680328, -0.19737383723258972, 0.1804361343383789, -0.17087528109550476, -0.2807241678237915, -0.08883590251207352, -0.13376456499099731, -0.2867133617401123, 0.5062412619590759, 0.07101647555828094, 0.4959462881088257, 0.03754616528749466, 0.30915331840515137, 0.06322060525417328, 0.47093087434768677, -0.31353530287742615, -0.00949614867568016, 0.16955256462097168, -0.23568785190582275, -0.2676195502281189, 0.561953067779541, 0.1940256953239441, 0.2828820049762726, -0.34642016887664795, 0.4162501394748688, -0.20895463228225708, -0.24354586005210876, -0.10425329208374023, 0.21203383803367615, -0.2009197622537613, 0.12348195910453796, 0.26522085070610046, 0.1744292825460434, -0.12150990962982178, 0.30656346678733826, -0.0024007223546504974, -0.028749048709869385, -0.2611629366874695, 0.45497408509254456, 0.19060279428958893, -0.13044589757919312, 0.19325405359268188, -0.030606921762228012, -0.1332809329032898, -0.3156585395336151, 0.2212473452091217, -0.5098286867141724, 0.21271350979804993, 0.06233920529484749, 0.13983851671218872, -0.13094666600227356, 0.14796128869056702, 0.07550229132175446, 0.09160906076431274, -0.15813860297203064, -0.08480840921401978, -0.09484755992889404, -0.040645748376846313, 0.18308115005493164, 0.07833537459373474, 0.1755993366241455, 0.16300594806671143, 0.10674180090427399, 0.3146462142467499, -0.2834417521953583, -0.3621383011341095, -0.2804775536060333, 0.47479337453842163, 0.14417769014835358, -0.12519507110118866, -0.07486817240715027, 0.09191589802503586, 0.1540299952030182, -0.48358190059661865, 0.001771911047399044, -0.28703126311302185, 0.14075225591659546, 0.04230227321386337, 0.07955630868673325, 0.18597759306430817, -0.15343639254570007, 0.3368868827819824, 0.3390098214149475, -0.18992716073989868, -0.159071147441864, -0.04017360880970955, 0.026577405631542206, -0.18489181995391846, -0.20524322986602783, 0.2489737570285797, 0.18932650983333588, 0.08197498321533203, -0.2673248052597046, -0.03477507084608078, -0.1641523391008377, -0.15065361559391022, 0.23302984237670898, 0.22401580214500427, -0.3638795018196106, 0.2012818306684494, -0.44334620237350464, 0.194520965218544, -0.003912296146154404, 0.5423677563667297, -0.06972160190343857, 0.3475305438041687, -0.11040879040956497, -0.25509798526763916, 0.2821007966995239, -0.4280312955379486, -0.43819940090179443, 0.1793884038925171, 0.08381399512290955, 0.20434018969535828, -0.11215388774871826, 0.023639559745788574, -0.04952222853899002, 0.3574731945991516, -0.13150034844875336, -0.13598932325839996, 0.1687939614057541, 0.1751514971256256, -0.25343674421310425, -0.21599580347537994, 0.618802011013031, 0.07267147302627563, -0.3496227264404297, 0.04014404118061066, -0.4111832082271576 ]
https://github.com/huggingface/datasets/issues/6012
I wonder if it would be beneficial to have a dedicated method to do that ? Maybe a `.save_to_disk()` so that the user can reload the resulting dataset later ?
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
30
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ I wonder if it would be beneficial to have a dedicated method to do that ? Maybe a `.save_to_disk()` so that the user can reload the resulting dataset later ?
[ -0.13788457214832306, -0.2570563852787018, -0.1635575145483017, -0.29137471318244934, 0.0028412677347660065, 0.06371314823627472, -0.05337013304233551, 0.3641147315502167, 0.09568798542022705, 0.0788969174027443, 0.044697947800159454, 0.5188761949539185, -0.36936914920806885, 0.1335517168045044, 0.10490119457244873, -0.007591567933559418, 0.18340179324150085, 0.2566030025482178, -0.26676011085510254, -0.04112118482589722, -0.4068528711795807, 0.10360777378082275, 0.04370465874671936, -0.20536883175373077, -0.0337027832865715, -0.12195704877376556, -0.2617635130882263, -0.3155909776687622, 0.04178091883659363, 0.016829095780849457, 0.26566243171691895, 0.35882049798965454, -0.029107052832841873, 0.044880110770463943, -0.00010774568363558501, -0.016343645751476288, -0.06844362616539001, -0.07997532188892365, -0.037393853068351746, -0.19757676124572754, -0.41755831241607666, -0.2746681869029999, -0.023899801075458527, -0.36571750044822693, -0.0018339082598686218, -0.21693550050258636, 0.29186707735061646, -0.5428397059440613, 0.479890376329422, -0.2977864146232605, 0.23909024894237518, -0.2051278054714203, -0.44616881012916565, -0.134927898645401, 0.08347627520561218, 0.2881172299385071, -0.055817145854234695, -0.10946226119995117, 0.11887609958648682, 0.09174796938896179, -0.11404900252819061, 0.265290766954422, -0.08381909132003784, -0.2815512418746948, 0.5761289596557617, -0.11033011972904205, 0.07959569245576859, -0.38181594014167786, 0.0442621149122715, 0.005267498083412647, 0.15364307165145874, -0.19591601192951202, -0.19784390926361084, -0.39950084686279297, -0.27554959058761597, -0.04295913875102997, -0.2942621409893036, -0.002331111580133438, 0.08325614780187607, 0.1800612509250641, -0.4008505344390869, -0.4273298978805542, 0.046196095645427704, 0.062329210340976715, 0.20720365643501282, -0.10736212134361267, -0.005481081083416939, -0.08627483248710632, 0.2225978523492813, 0.016067009419202805, 0.4143323600292206, -0.2876679003238678, 0.11755688488483429, 0.2208443135023117, -0.09267139434814453, -0.3495616614818573, 0.12442435324192047, 0.058792728930711746, 0.13554897904396057, 0.35128024220466614, 0.01196899265050888, 0.11856243014335632, -0.2887139320373535, 0.046457499265670776, 0.11614837497472763, 0.20711147785186768, -0.10460290312767029, -0.05086858570575714, 0.17305076122283936, -0.3332083821296692, 0.06683391332626343, 0.08801648020744324, 0.17539788782596588, 0.12321199476718903, 0.1534055918455124, 0.009519483894109726, 0.11724576354026794, 0.12908269464969635, 0.012689955532550812, -0.2807995676994324, 0.08983216434717178, 0.05164949595928192, -0.08587342500686646, 0.3886185586452484, 0.051338084042072296, 0.3094940185546875, 0.24435104429721832, 0.05242188274860382, 0.11164567619562149, 0.21109852194786072, -0.12094010412693024, -0.22597801685333252, -0.06624022871255875, 0.16953590512275696, 0.05008164793252945, 0.0822581797838211, 0.07067219913005829, 0.06508838385343552, -0.19854886829853058, -0.0007713809609413147, 0.4335714280605316, 0.057912830263376236, 0.3365684747695923, -0.03635236993432045, -0.05378790572285652, 0.09406288713216782, 0.16801631450653076, 0.02974005788564682, -0.4073690176010132, 0.35702499747276306, -0.4233739972114563, -0.29992830753326416, 0.13046295940876007, 0.19658562541007996, -0.0762459859251976, -0.15250861644744873, -0.1824500858783722, 0.4972788095474243, 0.07483886182308197, -0.25163161754608154, 0.16212540864944458, 0.03657824546098709, -0.3227391242980957, -0.2623615860939026, -0.11446226388216019, 0.01772862672805786, 0.12008887529373169, -0.28758588433265686, -0.18844297528266907, 0.18065468966960907, -0.10401156544685364, 0.2533663511276245, -0.1849333792924881, 0.15565572679042816, -0.1408771425485611, 0.16060103476047516, 0.4291306436061859, 0.1474044919013977, -0.15746033191680908, 0.12385758757591248, -0.15664251148700714, -0.06273889541625977, -0.04690442979335785, 0.4526766240596771, 0.5610388517379761, -0.2792278528213501, 0.10544911026954651, 0.3628067374229431, -0.0797596424818039, 0.19999787211418152, -0.09456268697977066, -0.2755807042121887, -0.0650736391544342, -0.13470394909381866, 0.06256355345249176, 0.24256396293640137, -0.005846492946147919, 0.3552772104740143, 0.3489549160003662, -0.27336108684539795, 0.265018105506897, 0.1864425092935562, 0.09238425642251968, -0.17812591791152954, -0.15148650109767914, -0.11473926901817322, -0.47109195590019226, -0.06784115731716156, 0.095587819814682, -0.2967880368232727, 0.19008708000183105, -0.30658799409866333, 0.15909653902053833, -0.08719108998775482, -0.04056509956717491, 0.20036356151103973, 0.14824360609054565, 0.1495729237794876, -0.1846855878829956, -0.04132143035531044, -0.3052603304386139, -0.062454044818878174, 0.16103777289390564, -0.14691323041915894, -0.3125104606151581, 0.30630576610565186, 0.25825297832489014, 0.0839112251996994, -0.10277377814054489, -0.03712441027164459, -0.06882025301456451, -0.17897911369800568, 0.1637907326221466, 0.001990419114008546, 0.08736875653266907, 0.21218398213386536, -0.07993695139884949, 0.7097307443618774, 0.1817847192287445, -0.0866565927863121, 0.327661395072937, 0.12366633862257004, 0.0605146549642086, -0.17836856842041016, -0.4128033518791199, 0.34379154443740845, -0.45187801122665405, 0.19078056514263153, -0.11734263598918915, 0.026861734688282013, 0.12088426947593689, -0.1180688887834549, -0.17385512590408325, -0.23590010404586792, 0.045349184423685074, 0.11640911549329758, 0.2054089456796646, 0.007588805630803108, -0.029339179396629333, 0.36234697699546814, 0.2610185146331787, -0.16338327527046204, 0.16829723119735718, 0.1372838318347931, 0.11041527986526489, -0.13516253232955933, -0.021423475816845894, 0.37037432193756104, 0.37519052624702454, 0.1834830790758133, 0.10157439112663269, 0.05136105418205261, 0.31132566928863525, 0.019833605736494064, 0.37299373745918274, 0.015979977324604988, 0.46362656354904175, 0.02349046617746353, 0.145309180021286, -0.008851690217852592, -0.27790385484695435, -0.38044553995132446, 0.20717988908290863, -0.1120026707649231, 0.1772225797176361, -0.15319225192070007, -0.08765294402837753, 0.05516672879457474, -0.15745288133621216, -0.4819030463695526, 0.04098546877503395, -0.3561180531978607, 0.01891200616955757, 0.15642213821411133, -0.28221189975738525, 0.3388901650905609, -0.05449964851140976, 0.5393372774124146, -0.08611246943473816, -0.37878578901290894, -0.32382702827453613, -0.22338226437568665, 0.302641361951828, 0.07593431323766708, -0.033476781100034714, -0.37409165501594543, 0.29173946380615234, -0.21893680095672607, 0.15336042642593384, -0.1909048855304718, -0.30067750811576843, 0.14509104192256927, -0.02626458927989006, -0.18991664052009583, 0.11901503056287766, 0.24264079332351685, 0.23888972401618958, -0.09653287380933762, -0.18167483806610107, -0.29749685525894165, -0.06691533327102661, -0.28311097621917725, 0.21573932468891144, 0.11642187833786011, -0.16847705841064453, 0.021037597209215164, -0.16497044265270233, -0.3678942918777466, 0.46409839391708374, -0.03960028290748596, 0.0689968466758728, -0.11321063339710236, 0.0133107490837574, -0.1048021912574768, 0.22000063955783844, -0.14303991198539734, -0.1131608709692955, -0.30085545778274536, 0.24781517684459686, -0.30256175994873047, 0.011900713667273521, -0.1653415560722351, -0.1492397040128708, -0.022002091631293297, 0.03614557906985283, -0.37847983837127686, -0.11451978981494904, -0.21533933281898499, 0.49576523900032043, -0.011519946157932281, 0.10063014924526215, 0.441148579120636, 0.39576268196105957, -0.08631160855293274, -0.06987446546554565, -0.28072986006736755, -0.05276494473218918, 0.26912856101989746, 0.036713503301143646, 0.18307170271873474, 0.22067323327064514, 0.3152135908603668, 0.6942399740219116, 0.18848006427288055, 0.024689029902219772, 0.15774978697299957, 0.17861826717853546, 0.17441514134407043, -0.20024427771568298, -0.2543860971927643, -0.40828242897987366, -0.34884169697761536, -0.28313732147216797, 0.09979446232318878, -0.05003154277801514, -0.529270350933075, 0.16503718495368958, -0.45054715871810913, 0.009160369634628296, -0.19095084071159363, 0.26006701588630676, -0.2841545641422272, 0.08395666629076004, 0.19333365559577942, 0.06228239834308624, -0.4403914213180542, -0.016453996300697327, 0.26487839221954346, -0.07050268352031708, 0.4624941945075989, -0.18003863096237183, 0.03700654208660126, 0.005232088267803192, -0.6164010763168335, 0.3602294921875, 0.007946997880935669, -0.28287678956985474, 0.006098046898841858, -0.2231501340866089, -0.18870311975479126, 0.07377764582633972, 0.479832261800766, -0.08266821503639221, -0.2399163544178009, -0.019828476011753082, -0.5475894808769226, -0.021338552236557007, 0.14421811699867249, 0.11312977969646454, -0.1170613169670105, 0.25561344623565674, 0.6806007027626038, -0.1965327262878418, -0.08068573474884033, 0.03653569146990776, 0.15293392539024353, -0.39470767974853516, 0.06301885843276978, 0.161574587225914, -0.31881850957870483, -0.27726227045059204, -0.029460251331329346, 0.051183223724365234, -0.14801861345767975, 0.2973662316799164, 0.036173149943351746, -0.2665424346923828, 0.09723681211471558, -0.003026861697435379, -0.08985826373100281, 0.08157093822956085, 0.24547553062438965, 0.09436511248350143, 0.01166578009724617, -0.027464870363473892, -0.24934567511081696, 0.27694210410118103, -0.29751187562942505, -0.05286194756627083, 0.1436871886253357, 0.14274796843528748, 0.17462870478630066, 0.24151524901390076, 0.32033365964889526, 0.024808408692479134, 0.29599103331565857, 0.19434478878974915, -0.61924809217453, -0.16403113305568695, 0.013572636991739273, -0.03703782707452774, -0.32221677899360657, -0.5543054938316345, 0.5445979833602905, 0.13977494835853577, -0.20554012060165405, 0.16915279626846313, -0.2239675521850586, -0.25318196415901184, 0.7534162998199463, 0.49423253536224365, 0.9249058961868286, -0.034501492977142334, 0.3696793019771576, -0.16611862182617188, -0.10288853198289871, 0.5102329850196838, -0.46369391679763794, 0.2257460653781891, -0.30619141459465027, -0.6893765926361084, -0.1834850162267685, -0.05967431887984276, -0.23677217960357666, -0.021439407020807266, -0.4043516516685486, 0.1875852793455124, 0.3196909725666046, -0.05821668729186058, -0.017167367041110992, -0.14359690248966217, 0.01632787473499775, -0.32789677381515503, 0.05695316940546036, 0.18695631623268127, 0.16892680525779724, 0.14384743571281433, -0.18915659189224243, -0.2280787080526352, 0.01805022358894348, 0.05118982493877411, 0.015854686498641968, -0.013504289090633392, 0.01688792183995247, 0.49210619926452637, -0.3884320855140686, 0.14639806747436523, -0.1620716005563736, 0.11845418810844421, 0.006533624604344368, 0.061979733407497406, -0.10883878916501999, -0.0198432095348835, 0.031410008668899536, 0.30741456151008606, -0.06635779142379761, -0.22502465546131134, 0.42738255858421326, 0.033953920006752014, 0.2188684344291687, -0.06516842544078827, 0.010271236300468445, -0.2352118045091629, -0.6658640503883362, 0.08588071167469025, -0.28396928310394287, -0.12870647013187408, -0.2062133550643921, 0.5395956039428711, -0.054314352571964264, -0.13706062734127045, 0.1164361983537674, 0.10933759063482285, 0.0049311257898807526, 0.5606016516685486, -0.13669057190418243, -0.20199526846408844, 0.03972269967198372, 0.35954180359840393, 0.26360994577407837, -0.04120665788650513, 0.20154422521591187, -0.26897162199020386, -0.26818913221359253, -0.23080001771450043, 0.3116101026535034, -0.0382050946354866, -0.36872678995132446, 0.3293933868408203, -0.6216776967048645, -0.1920585334300995, -0.19672885537147522, 0.14318594336509705, 0.22520792484283447, 0.21605432033538818, -0.18512648344039917, -0.02198009192943573, -0.27616268396377563, 0.26978662610054016, 0.1203254833817482, 0.4486374258995056, -0.03296542540192604, 0.0054517947137355804, -0.02916799485683441, 0.22056844830513, -0.3693750500679016, 0.0042374953627586365, 0.05457965284585953, 0.04713049530982971, -0.2774960398674011, -0.15057484805583954, 0.021625589579343796, 0.028746962547302246, 0.027643032371997833, 0.10546142607927322, -0.14865806698799133, -0.16228428483009338, -0.15617889165878296, 0.13929766416549683, -0.07754494249820709, 0.3085255026817322, -0.06640742719173431, -0.1353079229593277, -0.005668312311172485, -0.31141912937164307, 0.03053269535303116, 0.08610975742340088, -0.028188753873109818, -0.16127657890319824, 0.07639457285404205, -0.33229541778564453, -0.09224390983581543, 0.07672443985939026, 0.4090126156806946, 0.010788794606924057, -0.30910560488700867, 0.34336206316947937, -0.207281231880188, -0.2030937820672989, -0.03456665575504303, 0.24887141585350037, 0.4931168258190155, -0.10161682963371277, 0.40142372250556946, 0.04209054261445999, -0.09192604571580887, 0.23763024806976318, 0.4645017087459564, 0.0413341298699379, -0.030433760955929756, 0.1273011565208435, 0.006869625300168991, 0.23184145987033844, -0.18572503328323364, -0.10987216979265213, 0.3644484281539917, 0.2033948451280594, 0.04924476146697998, 0.20420344173908234, -0.020879335701465607, 0.028997182846069336, 0.05594107136130333, -0.05895720049738884, 0.20139166712760925, -0.48389357328414917, 0.17536069452762604, 0.22553479671478271, 0.03642342984676361, -0.025781825184822083, 0.3713589906692505, 0.2832127511501312, 0.43870192766189575, 0.20796531438827515, -0.06625425815582275, 0.24755388498306274, 0.23241081833839417, -0.07719036936759949, 0.05001066252589226, -0.04240145534276962, 0.08205083012580872, 0.09103973954916, 0.036742910742759705, 0.3529300093650818, 0.3354581892490387, -0.2918422520160675, 0.11390700936317444, -0.1328052431344986, -0.28797370195388794, 0.7678231000900269, -0.14989441633224487, -0.23181909322738647, 0.2339012622833252, -0.16240468621253967, -0.09108966588973999, 0.061774566769599915, -0.08508674800395966, -0.18499347567558289, 0.5679845213890076, 0.2958097755908966, 0.5288450717926025, 0.33353206515312195, 0.017797721549868584, -0.05724317580461502, 0.4099787771701813, -0.33846020698547363, -0.21803921461105347, 0.06362759321928024, -0.22784721851348877, -0.24534794688224792, 0.4253394901752472, 0.12006939202547073, 0.09758628904819489, -0.1892721801996231, 0.45550537109375, -0.13891424238681793, -0.05778524652123451, -0.13804757595062256, 0.227915421128273, 0.010098671540617943, 0.15872925519943237, 0.3446938991546631, 0.1521090269088745, -0.08668947964906693, 0.32174769043922424, 0.09392382204532623, 0.04718158394098282, -0.11663151532411575, 0.480138897895813, 0.3063772916793823, -0.12556618452072144, 0.1703108847141266, 0.06494711339473724, -0.10905823111534119, -0.010467488318681717, 0.2166825532913208, -0.5680664777755737, 0.09768956899642944, 0.1080096960067749, 0.10024160891771317, -0.04773125424981117, 0.2265978455543518, 0.08393175899982452, -0.05059787258505821, -0.17387166619300842, -0.11322485655546188, -0.09310494363307953, -0.02864278480410576, 0.21390701830387115, 0.17328420281410217, 0.0927969217300415, 0.044279709458351135, 0.19484002888202667, 0.1900111436843872, -0.26897627115249634, -0.46816420555114746, -0.21580708026885986, 0.4961352050304413, 0.022723592817783356, 0.08114192634820938, -0.04784229397773743, 0.08943973481655121, 0.21492940187454224, -0.3746849298477173, 0.006683222949504852, 0.0205545611679554, 0.10699997842311859, -0.0874607264995575, 0.19239673018455505, -0.01410648226737976, -0.1342536062002182, 0.484535813331604, 0.24328385293483734, -0.2294076830148697, -0.27382028102874756, -0.08206713944673538, 0.18448880314826965, -0.16710101068019867, -0.1274498850107193, 0.08700408041477203, 0.1646108478307724, 0.10322120785713196, -0.2903878390789032, -0.03821055218577385, -0.22158560156822205, -0.32097724080085754, 0.10663395375013351, 0.40118688344955444, -0.3501715064048767, 0.11664959788322449, -0.41553938388824463, 0.11376143991947174, 0.09356752783060074, 0.5771230459213257, 0.0628126710653305, 0.3921186923980713, -0.13751620054244995, -0.16211703419685364, 0.34160327911376953, -0.394830584526062, -0.41467520594596863, 0.1126476377248764, 0.11613481491804123, 0.049814969301223755, -0.11093553155660629, -0.04288017749786377, -0.05941091477870941, 0.28161102533340454, -0.2058526575565338, -0.14074984192848206, 0.2790810167789459, 0.018070075660943985, -0.2699914574623108, -0.15754881501197815, 0.6834230422973633, 0.1272759884595871, -0.3088299036026001, 0.09461022913455963, -0.4918438196182251 ]
https://github.com/huggingface/datasets/issues/6012
> ```python > from functools import partial > from datasets import Dataset > > def gen_from_iterable_dataset(iterable_ds) > yield from iterable_ds > > ds = Dataset.from_generator(partial(gen_from_iterable_dataset, iterable_ds), features=iterable_ds.features}) > ``` @mariosasko With these complex mapping functions, what hash will be used to cache this dataset?
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
44
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ > ```python > from functools import partial > from datasets import Dataset > > def gen_from_iterable_dataset(iterable_ds) > yield from iterable_ds > > ds = Dataset.from_generator(partial(gen_from_iterable_dataset, iterable_ds), features=iterable_ds.features}) > ``` @mariosasko With these complex mapping functions, what hash will be used to cache this dataset?
[ -0.006098143756389618, -0.4207122325897217, -0.15540720522403717, -0.06829299032688141, 0.06173661723732948, 0.19080397486686707, 0.02012314274907112, 0.40103286504745483, 0.13905248045921326, -0.034752048552036285, 0.12666434049606323, 0.2140544354915619, -0.35841625928878784, 0.16181352734565735, 0.15363341569900513, -0.04624441638588905, 0.18389102816581726, 0.12005186825990677, -0.2854900062084198, -0.20765730738639832, -0.5244958400726318, 0.05155336856842041, 0.06710980832576752, -0.2874792218208313, -0.18531063199043274, 0.009396757930517197, -0.2064402997493744, -0.12844125926494598, 0.0030851513147354126, -0.14619842171669006, 0.18234668672084808, 0.2639879584312439, -0.014489196240901947, -0.0014836154878139496, -0.00010380809544585645, 0.029831662774086, -0.005414854735136032, -0.17578847706317902, 0.14023509621620178, -0.21134760975837708, -0.5405324697494507, -0.4248068332672119, -0.18164664506912231, -0.3016824424266815, -0.06113649904727936, -0.14860661327838898, 0.24579907953739166, -0.5571876168251038, 0.4125857949256897, -0.09084488451480865, 0.2822128236293793, -0.21103954315185547, -0.270587295293808, -0.013683393597602844, 0.28504177927970886, -0.06743767857551575, -0.050930920988321304, -0.16569319367408752, -0.06376062333583832, 0.08217616379261017, -0.0495227687060833, 0.3851880729198456, -0.08900561928749084, -0.12626706063747406, 0.5562272071838379, 0.05415035039186478, 0.23025411367416382, -0.39747413992881775, 0.18957111239433289, -0.061502326279878616, 0.19614291191101074, -0.15796390175819397, -0.13191072642803192, -0.1613728404045105, -0.4929881691932678, -0.0608384907245636, 0.02252708002924919, -0.03463500738143921, 0.1362251192331314, 0.01643192395567894, -0.43578940629959106, -0.15994621813297272, 0.0974779725074768, 0.04880546033382416, 0.23200851678848267, -0.1582193523645401, -0.0033401455730199814, -0.03626340627670288, 0.13659071922302246, -0.07832485437393188, 0.25230515003204346, -0.25585734844207764, 0.2747022211551666, 0.3123202323913574, -0.03736604005098343, -0.18162080645561218, 0.23412828147411346, 0.08900374174118042, 0.16056734323501587, 0.31513017416000366, -0.21827983856201172, 0.11972740292549133, -0.0690595805644989, 0.14648814499378204, -0.03672194853425026, 0.08068390190601349, -0.007745586335659027, -0.10604145377874374, -0.04141770675778389, -0.37238407135009766, -0.2706637978553772, -0.024791842326521873, 0.1406077891588211, 0.04342794045805931, 0.3049870729446411, -0.02027020789682865, 0.10833616554737091, 0.11137360334396362, 0.1618926227092743, -0.0786486268043518, -0.027795732021331787, -0.044584549963474274, 0.06108194217085838, 0.23596253991127014, 0.01255558431148529, 0.2249646931886673, -0.005133435130119324, -0.09076374769210815, 0.15120267868041992, 0.21570169925689697, -0.33789002895355225, -0.09788777679204941, -0.089267797768116, 0.16580446064472198, 0.12091471254825592, -0.06991850584745407, 0.19586175680160522, 0.09782111644744873, -0.15780505537986755, -0.0028939396142959595, 0.506101131439209, -0.01784539967775345, 0.43076789379119873, 0.09801587462425232, -0.12861689925193787, 0.07678885757923126, 0.17288029193878174, 0.18207775056362152, -0.4502973258495331, 0.06899648159742355, -0.38500791788101196, -0.43022578954696655, 0.2517963945865631, 0.25795799493789673, -0.21287409961223602, 0.08832518756389618, 0.022875843569636345, 0.3507957458496094, 0.24264279007911682, -0.07227808982133865, 0.17344003915786743, 0.06045912206172943, -0.24214082956314087, -0.44214147329330444, -0.04881264641880989, 0.2002156525850296, 0.25493407249450684, -0.25459882616996765, 0.03783068805932999, 0.20549961924552917, 0.006471332162618637, 0.28681620955467224, -0.1804974526166916, -0.07959423959255219, -0.1046314388513565, 0.05654683709144592, 0.406241774559021, -0.10700368136167526, -0.3988679051399231, 0.09517160058021545, 0.06787531077861786, -0.0168774351477623, 0.10298324376344681, 0.3484225571155548, 0.2497144490480423, -0.4479549527168274, 0.19010047614574432, 0.3399466276168823, -0.23554791510105133, -0.03523702546954155, -0.1661798059940338, -0.20213258266448975, -0.00034566596150398254, -0.14446833729743958, 0.43318793177604675, 0.028808752074837685, -0.08161436766386032, 0.25317880511283875, 0.026392977684736252, -0.08760379999876022, 0.2413409948348999, 0.14045560359954834, 0.07935062050819397, -0.09829850494861603, 0.1217474490404129, -0.2195214182138443, -0.2741323411464691, 0.09804946184158325, 0.04826456308364868, -0.1934831142425537, -0.07219907641410828, -0.15325573086738586, 0.09435000270605087, -0.025349698960781097, -0.14437535405158997, 0.1331150084733963, 0.2245645970106125, 0.07152336835861206, 0.027007274329662323, -0.16004988551139832, -0.36392030119895935, 0.15280389785766602, 0.1725310981273651, -0.15975184738636017, -0.4002971351146698, 0.16198943555355072, 0.18741559982299805, 0.042668044567108154, -0.07698797434568405, 0.13008466362953186, 0.21279938519001007, -0.12987929582595825, 0.15370483696460724, -0.050055257976055145, 0.02127772569656372, -0.056429579854011536, -0.01976482756435871, 0.8647521734237671, 0.03859756886959076, -0.28615057468414307, 0.3857935667037964, 0.03307166323065758, 0.0990174412727356, -0.1822395920753479, -0.1804114580154419, 0.24362260103225708, -0.45719945430755615, 0.009571075439453125, -0.05769537761807442, 0.0358232706785202, 0.010995835065841675, -0.042176514863967896, -0.17549467086791992, -0.3424510359764099, 0.037663575261831284, -0.022338932380080223, 0.2335735708475113, 0.22394801676273346, 0.08175826072692871, 0.3404909372329712, 0.6746517419815063, -0.18892329931259155, 0.04842419922351837, 0.04405943304300308, -0.07520514726638794, -0.3690139055252075, -0.051455579698085785, 0.20619997382164001, 0.16283854842185974, 0.1592443734407425, 0.28634747862815857, 0.095185786485672, 0.24378874897956848, 0.061833664774894714, 0.38450783491134644, -0.14643830060958862, 0.17792874574661255, -0.17902635037899017, 0.03171246871352196, -0.0498104989528656, -0.15818049013614655, -0.19235065579414368, 0.26325422525405884, 0.08301330357789993, 0.15890631079673767, 0.07562736421823502, -0.07383295893669128, 0.26495057344436646, -0.08510632067918777, -0.37720829248428345, -0.10396046191453934, -0.3558676838874817, 0.05461961030960083, 0.22879400849342346, -0.09753023833036423, 0.21270659565925598, -0.2690306007862091, 0.18923939764499664, 0.0777563750743866, -0.5141381621360779, -0.23265382647514343, -0.23813539743423462, 0.171401709318161, 0.12788398563861847, 0.037259541451931, -0.3817157447338104, 0.26035594940185547, -0.3847557008266449, 0.03151828050613403, -0.08208641409873962, -0.21495451033115387, 0.07411849498748779, -0.21842096745967865, -0.18050752580165863, 0.20171290636062622, 0.1415328085422516, 0.0752418264746666, -0.11215992271900177, 0.09641292691230774, -0.28317052125930786, -0.06375826150178909, -0.04998818039894104, 0.023261699825525284, 0.06753554940223694, 0.10076211392879486, -0.03362962231040001, -0.17944569885730743, -0.18952716886997223, 0.3570023775100708, 0.08931732177734375, 0.12375761568546295, 0.1306517869234085, -0.091682568192482, -0.2303183525800705, 0.21069705486297607, -0.07737687975168228, -0.41425371170043945, -0.5082845687866211, 0.39582228660583496, -0.11853012442588806, 0.07038149237632751, -0.07052542269229889, -0.16902506351470947, 0.03225479647517204, 0.29084312915802, -0.25445622205734253, -0.043219588696956635, -0.253460168838501, 0.60654616355896, 0.16647730767726898, 0.08825207501649857, 0.445591002702713, 0.411330908536911, -0.17285296320915222, -0.24845680594444275, -0.15195022523403168, 0.09183207154273987, 0.17642271518707275, 0.13880708813667297, 0.3169809877872467, 0.24503138661384583, 0.34872373938560486, 0.8906875252723694, 0.28722184896469116, 0.023548956960439682, 0.1558365523815155, 0.24777378141880035, 0.07128512859344482, -0.18948404490947723, -0.3361300230026245, -0.23338192701339722, -0.14990411698818207, -0.2068670392036438, 0.07586798071861267, -0.01914917305111885, -0.4193812608718872, -0.012024596333503723, -0.4287511706352234, -0.21822258830070496, -0.2576804757118225, 0.4085197448730469, -0.512036919593811, 0.20817112922668457, 0.219572514295578, 0.016545183956623077, -0.6663787364959717, -0.07889042049646378, 0.22099757194519043, -0.19646315276622772, 0.24301865696907043, 0.001195654273033142, 0.041069820523262024, 0.15305478870868683, -0.450571209192276, 0.3327091336250305, 0.11832145601511002, -0.10515862703323364, -0.103343665599823, -0.34780165553092957, -0.16400662064552307, -0.06061480939388275, 0.5252105593681335, -0.21808966994285583, -0.06696751713752747, -0.020643290132284164, -0.5077697038650513, 0.08911079913377762, 0.16182714700698853, 0.07449493557214737, 0.21453261375427246, 0.24103319644927979, 0.34287625551223755, -0.24457374215126038, -0.08942140638828278, 0.020721707493066788, 0.0406748428940773, -0.19052451848983765, 0.039815496653318405, 0.15122930705547333, -0.25007811188697815, -0.03606153279542923, -0.13031914830207825, 0.05332203954458237, -0.10835419595241547, 0.2349914312362671, 0.14502903819084167, -0.3066599667072296, -0.00841880589723587, 0.2703380584716797, 0.0391838513314724, 0.03724142536520958, 0.11318930983543396, 0.17557524144649506, 0.1776149868965149, -0.058021754026412964, -0.3245198428630829, 0.2536178231239319, -0.11582377552986145, -0.20923225581645966, -0.08388638496398926, 0.15718258917331696, 0.026046350598335266, 0.22007718682289124, 0.07856889814138412, -0.1427103877067566, 0.27482926845550537, 0.11802650988101959, -0.39664894342422485, -0.24504125118255615, 0.07578571885824203, 0.05635089799761772, -0.44073671102523804, -0.6332181692123413, 0.5218573212623596, 0.18762053549289703, -0.2604849934577942, 0.09132660180330276, -0.20957060158252716, -0.25944051146507263, 0.5334932208061218, 0.42790091037750244, 1.0234061479568481, -0.1109999567270279, 0.2555936574935913, -0.09054738283157349, 0.2460317760705948, 0.49506011605262756, -0.49245747923851013, 0.17556944489479065, -0.2577893137931824, -0.726348340511322, -0.18696632981300354, -0.11784113198518753, -0.2511715590953827, 0.034343965351581573, -0.17658072710037231, 0.36548087000846863, 0.13819964230060577, 0.22242166101932526, -0.0029286853969097137, -0.30802077054977417, -0.08541769534349442, -0.1227426528930664, -0.19372691214084625, 0.2695419192314148, 0.26083335280418396, 0.19580432772636414, -0.12600524723529816, -0.26989489793777466, 0.06574981659650803, -0.12454799562692642, -0.046066269278526306, -0.026442233473062515, -0.04893697425723076, 0.39492639899253845, -0.12851077318191528, 0.005349650979042053, -0.3654981255531311, -0.020276252180337906, 0.276729017496109, -0.11052945256233215, -0.10133982449769974, -0.07447507977485657, 0.255935937166214, 0.12518280744552612, -0.05093692988157272, -0.10280591249465942, 0.48473525047302246, -0.05462956428527832, 0.1107664406299591, -0.014064602553844452, 0.08391080796718597, -0.25128239393234253, -0.32928189635276794, 0.10279203951358795, -0.2767173647880554, -0.1661388874053955, -0.18170171976089478, 0.33369457721710205, -0.1604032814502716, 0.03451312333345413, 0.2066352665424347, 0.05986716225743294, -0.17524272203445435, 0.4559732973575592, -0.28154894709587097, -0.08676160871982574, 0.0807783454656601, 0.21105483174324036, 0.3844044804573059, -0.06740504503250122, 0.19484424591064453, -0.21263164281845093, -0.31679198145866394, -0.18245667219161987, 0.02416527271270752, 0.06588847190141678, -0.2953396439552307, 0.29935789108276367, -0.42502352595329285, -0.14904001355171204, -0.20057179033756256, 0.1715203821659088, 0.17093396186828613, 0.18328145146369934, -0.09929897636175156, -0.08558113873004913, -0.392194002866745, 0.3212496042251587, 0.07496261596679688, 0.35618603229522705, -0.14213627576828003, -0.012133469805121422, -0.024055879563093185, 0.35886186361312866, -0.44314661622047424, 0.10951057821512222, -0.14606408774852753, 0.10399462282657623, -0.18643422424793243, -0.2993919551372528, 0.1653422713279724, 0.1549522429704666, 0.16085010766983032, 0.054967522621154785, -0.41561421751976013, -0.2574954628944397, -0.042051762342453, 0.10038281977176666, -0.10552933812141418, -0.012762902304530144, -0.10764741152524948, -0.053009554743766785, -0.07638872414827347, -0.24612751603126526, 0.08772677183151245, 0.26293322443962097, 0.124026820063591, 0.01277448982000351, -0.03463728725910187, -0.19358855485916138, -0.09668669104576111, 0.011488286778330803, 0.21879234910011292, 0.16186144948005676, -0.17601002752780914, 0.24866656959056854, -0.2243470549583435, -0.13080887496471405, -0.09292753040790558, 0.33228617906570435, 0.25879380106925964, -0.30266112089157104, 0.5378760099411011, -0.018969792872667313, -0.14770781993865967, 0.3111669421195984, 0.22168198227882385, 0.04014616087079048, -0.07741974294185638, 0.04209417104721069, -0.08931183815002441, 0.285749226808548, -0.2876397967338562, -0.1252867430448532, 0.30170580744743347, 0.24215885996818542, 0.09614571928977966, 0.2112891525030136, 0.12864390015602112, -0.05592060834169388, 0.2142484486103058, -0.035804808139801025, 0.333138644695282, -0.5263225436210632, 0.22370411455631256, 0.08316797018051147, 0.22744019329547882, 0.0035814866423606873, 0.34908804297447205, 0.3984605669975281, 0.3714398145675659, 0.34138113260269165, -0.04282126575708389, 0.12574103474617004, 0.1296253204345703, -0.18898619711399078, 0.0025686360895633698, -0.1398012936115265, -0.013487535528838634, 0.3684242069721222, -0.018184538930654526, 0.37597787380218506, 0.1033485010266304, -0.12468154728412628, 0.20871612429618835, -0.016261333599686623, -0.2908898591995239, 0.5840550661087036, -0.10414211452007294, -0.3147052824497223, 0.2874789237976074, -0.2216167002916336, -0.3385530114173889, 0.009113609790802002, 0.03462211787700653, -0.23052352666854858, 0.7233474254608154, 0.24082329869270325, 0.543928325176239, 0.13038261234760284, 0.1946685016155243, 0.07751521468162537, 0.4163287878036499, -0.34091365337371826, 0.05267321318387985, 0.2005292922258377, -0.3794707655906677, -0.05310789868235588, 0.12089113891124725, 0.24683935940265656, 0.0014422554522752762, -0.34318768978118896, 0.4870820939540863, -0.08435669541358948, -0.24780873954296112, -0.2479628324508667, 0.3379969298839569, 0.024452846497297287, 0.1585346907377243, 0.08397060632705688, 0.21410542726516724, -0.09246481955051422, 0.23509430885314941, -0.06855864822864532, 0.037250760942697525, 0.03296802192926407, 0.48920515179634094, 0.18119794130325317, -0.02378057688474655, 0.1165056824684143, 0.14483334124088287, -0.16215431690216064, -0.3805566132068634, 0.24095876514911652, -0.15889962017536163, 0.2536569833755493, 0.17049816250801086, 0.11846103519201279, -0.1078358143568039, 0.23757591843605042, 0.005779167637228966, 0.17686425149440765, -0.21254581212997437, 0.031076371669769287, 0.08417945355176926, -0.03112756460905075, 0.10557161271572113, 0.11997886002063751, 0.0087294802069664, 0.23134241998195648, 0.3243332505226135, 0.10950018465518951, -0.3181479573249817, -0.16758647561073303, -0.1981673240661621, 0.47130072116851807, 0.17958644032478333, 0.05528685450553894, -0.14940936863422394, 0.2031760811805725, 0.17631030082702637, -0.3233191668987274, -0.09684434533119202, -0.16706997156143188, 0.22006061673164368, -0.2620874345302582, -0.02436789870262146, 0.18320459127426147, -0.20964550971984863, 0.35787907242774963, 0.3832952678203583, -0.10771921277046204, -0.19637280702590942, -0.13883446156978607, 0.006873965263366699, -0.044906891882419586, -0.10074140131473541, 0.10516051948070526, 0.09961646795272827, 0.12303762137889862, -0.310986191034317, 0.10759350657463074, -0.13339687883853912, -0.04868428036570549, 0.05289468914270401, 0.21306100487709045, -0.19772738218307495, 0.05002925544977188, -0.44676050543785095, 0.09383788704872131, 0.0823063850402832, 0.6097868084907532, -0.081231988966465, 0.21183067560195923, -0.15569838881492615, -0.2206636369228363, 0.36184707283973694, -0.49270644783973694, -0.43501174449920654, -0.025474822148680687, 0.109053835272789, 0.2090788185596466, -0.07275266200304031, -0.10693845897912979, -0.017678454518318176, 0.2685277760028839, -0.09303504228591919, -0.29704558849334717, 0.0872415155172348, 0.12332867085933685, -0.11941923201084137, -0.18971729278564453, 0.36874082684516907, -0.09544496238231659, -0.2131068855524063, -0.08509394526481628, -0.3592325448989868 ]
https://github.com/huggingface/datasets/issues/6012
The params passed to `Dataset.from_generator` will be used to compute the hash (`partial` encapsulates the `iterable_ds` value, so changing it will also change the hash)
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
25
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ The params passed to `Dataset.from_generator` will be used to compute the hash (`partial` encapsulates the `iterable_ds` value, so changing it will also change the hash)
[ -0.2502351701259613, -0.28470587730407715, -0.19874492287635803, -0.03752261772751808, 0.0846019983291626, -0.019080407917499542, 0.06320175528526306, 0.4058738350868225, 0.1536235213279724, 0.2261349856853485, 0.16613797843456268, 0.4546946883201599, -0.3608607351779938, 0.22598934173583984, 0.19368211925029755, 0.052076347172260284, 0.12128981202840805, 0.23741582036018372, -0.4160343408584595, -0.17932838201522827, -0.3923090696334839, 0.0810178816318512, -0.002773597836494446, -0.20891985297203064, 0.042636483907699585, -0.039496056735515594, -0.10877123475074768, -0.11736761033535004, -0.031007586047053337, -0.12447527050971985, 0.06200767308473587, 0.35461971163749695, -0.10153105854988098, -0.016970016062259674, -0.00009784785652300343, 0.09474441409111023, 0.02432514727115631, -0.08675531297922134, -0.009369153529405594, -0.23663394153118134, -0.5164352059364319, -0.1873379945755005, -0.2939300239086151, -0.3295290172100067, -0.04022542014718056, -0.2207334041595459, 0.17584194242954254, -0.5148215293884277, 0.367109477519989, -0.10925015807151794, 0.3262866139411926, -0.15703719854354858, -0.2648782730102539, -0.1434316635131836, 0.28868573904037476, 0.07484767585992813, -0.0349038690328598, -0.09581774473190308, -0.0790184736251831, 0.04554472118616104, -0.19725652039051056, 0.35677802562713623, -0.07563576847314835, -0.12584662437438965, 0.4577828347682953, -0.05597708374261856, 0.19276835024356842, -0.25100940465927124, 0.17236581444740295, 0.0911058783531189, 0.1709533929824829, -0.2545016407966614, -0.2093435823917389, -0.05501149967312813, -0.46217742562294006, -0.10566942393779755, -0.02929704263806343, -0.02476627752184868, 0.0763142928481102, 0.17722298204898834, -0.3693867325782776, -0.11840954422950745, 0.03848309814929962, -0.04431290179491043, 0.14646054804325104, -0.07327748090028763, 0.031982626765966415, -0.014530356973409653, 0.2916383445262909, -0.042066674679517746, 0.2403770089149475, -0.07306987047195435, 0.07166528701782227, 0.18765634298324585, -0.1367429792881012, -0.27377450466156006, 0.18352243304252625, -0.014873180538415909, 0.23903876543045044, 0.33356502652168274, -0.02708417922258377, 0.1675751805305481, -0.12268640100955963, 0.12814980745315552, -0.04088456928730011, 0.03990662470459938, 0.037398237735033035, -0.09350492060184479, 0.04915674775838852, -0.4116581678390503, -0.06196819990873337, 0.021525397896766663, 0.12209506332874298, -0.1282099038362503, 0.1616184264421463, -0.012328371405601501, -0.05070141330361366, 0.18722191452980042, 0.1062842383980751, -0.23781488835811615, 0.03794803470373154, -0.011857416480779648, 0.050289977341890335, 0.3435591459274292, 0.10291530191898346, 0.151528000831604, 0.029524654150009155, -0.04198002070188522, 0.10558559000492096, 0.18413043022155762, -0.28156015276908875, -0.06454107165336609, -0.10373890399932861, 0.11000971496105194, -0.018174290657043457, 0.015611700713634491, 0.08635304868221283, 0.014609463512897491, -0.07933708280324936, 0.12505067884922028, 0.4206797480583191, 0.08430837839841843, 0.45847153663635254, 0.052224528044462204, -0.029957037419080734, 0.022335603833198547, 0.053848978132009506, 0.05266430974006653, -0.4644775986671448, 0.1953977346420288, -0.269542932510376, -0.31537097692489624, 0.17514516413211823, 0.32756999135017395, -0.10186164081096649, 0.03930055350065231, 0.07645891606807709, 0.4044545888900757, 0.12103423476219177, -0.18551671504974365, 0.19720450043678284, 0.05816183611750603, -0.24845775961875916, -0.32404476404190063, -0.03526468575000763, 0.10663365572690964, 0.04730500280857086, -0.1813429594039917, -0.023164400830864906, 0.017085622996091843, -0.009180855005979538, 0.13034802675247192, -0.21363680064678192, -0.07047061622142792, -0.2046469897031784, 0.10312187671661377, 0.48995518684387207, 0.002218693494796753, -0.3202471137046814, 0.22656476497650146, -0.10675189644098282, -0.201386496424675, 0.16015227138996124, 0.3531467616558075, 0.25896453857421875, -0.2770227789878845, 0.04460353031754494, 0.25660619139671326, -0.15798157453536987, 0.0368882492184639, -0.15752658247947693, -0.10661865770816803, -0.002343646716326475, -0.13214300572872162, 0.2934522032737732, 0.075316421687603, 0.03202100098133087, 0.25790348649024963, 0.2650337219238281, -0.2292913794517517, 0.2605481743812561, 0.12085284292697906, 0.15806104242801666, -0.3714140057563782, 0.10053315758705139, -0.256852388381958, -0.20935383439064026, 0.05352327972650528, -0.048353128135204315, -0.05113827809691429, 0.02248965948820114, -0.180963933467865, 0.025866996496915817, 0.04031673073768616, -0.06802413612604141, 0.193873330950737, 0.25556814670562744, 0.1323414295911789, -0.10026726126670837, -0.19627615809440613, -0.40003395080566406, -0.04815952479839325, -0.02408425137400627, -0.2771061658859253, -0.4051644504070282, 0.21362432837486267, 0.133491650223732, 0.11887025833129883, -0.09718625247478485, -0.008024588227272034, 0.04166853800415993, -0.15886817872524261, 0.19989362359046936, 0.019106747582554817, 0.06943243741989136, 0.08485487848520279, -0.04144220054149628, 0.7669129967689514, 0.12329351902008057, -0.21822983026504517, 0.33333829045295715, 0.007399525493383408, 0.00288604199886322, -0.15219895541667938, -0.20829293131828308, 0.36620771884918213, -0.5378220081329346, 0.1098543182015419, 0.022165291011333466, 0.05211372673511505, 0.23029273748397827, -0.09587585180997849, -0.2866119146347046, -0.34900349378585815, -0.03667942434549332, 0.13295984268188477, 0.161823570728302, 0.17696399986743927, 0.09990891814231873, 0.2855207324028015, 0.612689733505249, -0.23320810496807098, -0.006979379802942276, 0.09168112277984619, 0.0169144906103611, -0.2707976698875427, -0.09494622051715851, 0.3252582550048828, 0.16304031014442444, 0.22708947956562042, 0.330520898103714, -0.0058251721784472466, 0.20747320353984833, -0.021363411098718643, 0.45396310091018677, -0.1086922138929367, 0.3307666480541229, 0.009491500444710255, 0.0820164829492569, -0.1430961936712265, -0.2889775037765503, -0.29614636301994324, 0.32792386412620544, 0.07327887415885925, 0.07040315866470337, 0.028034724295139313, -0.17824846506118774, 0.1900688260793686, -0.13283511996269226, -0.3107573390007019, -0.05167999863624573, -0.2851523160934448, 0.1086377203464508, 0.20535323023796082, -0.3228170573711395, 0.26084551215171814, -0.01643514260649681, 0.2760752737522125, 0.17152053117752075, -0.38178369402885437, -0.354328989982605, -0.31896787881851196, 0.1849946677684784, 0.183493509888649, 0.05567428842186928, -0.3798149824142456, 0.336366206407547, -0.3269810080528259, 0.024984203279018402, -0.1280294507741928, -0.3301849067211151, 0.19482211768627167, -0.07808558642864227, -0.08905811607837677, 0.26380202174186707, 0.05483397841453552, 0.11532918363809586, -0.03967338427901268, -0.022982124239206314, -0.39668402075767517, -0.2346607744693756, -0.08426715433597565, 0.03877454251050949, 0.11726900935173035, -0.19033795595169067, -0.14809545874595642, -0.08911179006099701, -0.3218713402748108, 0.4090740382671356, 0.032375745475292206, 0.3174273669719696, 0.07575035095214844, 0.003241661936044693, -0.09920568764209747, 0.17586931586265564, -0.13839799165725708, -0.34552884101867676, -0.4704071283340454, 0.30140283703804016, -0.3018268346786499, -0.035942837595939636, -0.10389826446771622, -0.2711714506149292, 0.17031148076057434, 0.2697412967681885, -0.21601156890392303, -0.20511232316493988, -0.11965750902891159, 0.5024559497833252, 0.07892342656850815, 0.03589306026697159, 0.33348172903060913, 0.421146422624588, -0.24345366656780243, -0.1962321251630783, -0.09723839163780212, 0.07113669067621231, 0.15156491100788116, 0.10392629355192184, 0.3564477562904358, 0.32880693674087524, 0.35345518589019775, 0.7433777451515198, 0.050047650933265686, -0.031924694776535034, 0.13397978246212006, -0.004222413524985313, 0.05489739030599594, -0.0913255363702774, -0.284309446811676, -0.21202915906906128, -0.0252951979637146, -0.23271095752716064, 0.12344282865524292, -0.10167302191257477, -0.3955872356891632, 0.043967992067337036, -0.32284608483314514, -0.11249091476202011, -0.1941903680562973, 0.34055495262145996, -0.3139655888080597, 0.08232928812503815, 0.17328862845897675, 0.09968455880880356, -0.4387568235397339, 0.03638533875346184, 0.33066824078559875, -0.16127756237983704, 0.32172447443008423, -0.2217315435409546, 0.06205904483795166, 0.09946246445178986, -0.45331475138664246, 0.29264402389526367, 0.12652821838855743, -0.17023125290870667, -0.02888161689043045, -0.37274885177612305, -0.17146949470043182, -0.1530834436416626, 0.6278863549232483, -0.1496262401342392, -0.09201568365097046, 0.04626411199569702, -0.51705002784729, 0.08101852983236313, 0.2380213737487793, 0.046704210340976715, 0.001927018165588379, 0.2323254644870758, 0.4222892224788666, -0.2986465096473694, -0.16090446710586548, 0.11848212778568268, -0.02505848929286003, -0.3068980574607849, -0.008353620767593384, 0.08759412914514542, -0.3693070411682129, -0.19494980573654175, -0.07492032647132874, 0.011042341589927673, 0.016829345375299454, 0.1680326759815216, -0.01944233477115631, -0.20145577192306519, 0.022667236626148224, 0.18319517374038696, 0.03290245682001114, 0.07580606639385223, 0.08480079472064972, 0.08368432521820068, -0.009034744463860989, 0.04542183130979538, -0.19146433472633362, 0.1615934669971466, -0.11981077492237091, 0.02080916240811348, 0.010655384510755539, 0.08448610454797745, 0.06916645169258118, 0.194959819316864, 0.07339607179164886, 0.011724717915058136, 0.2456069439649582, 0.14282269775867462, -0.49115172028541565, -0.13115480542182922, 0.06460254639387131, -0.11835871636867523, -0.3072107434272766, -0.5629440546035767, 0.5829666256904602, 0.16482636332511902, -0.28738874197006226, 0.1720881313085556, -0.173250213265419, -0.3163072466850281, 0.5441630482673645, 0.48378944396972656, 1.000062108039856, -0.042203061282634735, 0.1518581509590149, 0.05863708257675171, 0.04525180906057358, 0.4217565655708313, -0.46754828095436096, 0.1901523917913437, -0.3607708513736725, -0.6681634187698364, -0.1463640034198761, -0.09443911164999008, -0.2152838110923767, 0.24365079402923584, -0.18092387914657593, 0.17514446377754211, 0.26132896542549133, 0.13979479670524597, -0.07484801113605499, -0.1007840484380722, -0.11134698241949081, -0.16961795091629028, -0.06713861227035522, 0.2582084536552429, 0.26766467094421387, 0.0357670895755291, -0.15622277557849884, -0.406523197889328, 0.17372159659862518, -0.1467316448688507, -0.006860390305519104, 0.015448249876499176, 0.017811838537454605, 0.2792447805404663, -0.1631108969449997, 0.08368487656116486, -0.19585636258125305, -0.08386312425136566, 0.161556214094162, -0.010136311873793602, -0.057536616921424866, 0.07625865936279297, 0.09276154637336731, 0.37437471747398376, -0.04810429736971855, -0.07553685456514359, 0.46742677688598633, -0.030723389238119125, 0.11946195363998413, -0.10490050911903381, 0.13089996576309204, -0.2553434669971466, -0.37673085927963257, 0.023269038647413254, -0.28026044368743896, -0.05890798196196556, 0.08112309873104095, 0.3535134792327881, -0.2082270234823227, -0.10874678194522858, 0.23323526978492737, -0.017661258578300476, -0.2361079752445221, 0.5648044943809509, -0.11504388600587845, -0.12390223890542984, 0.0834522470831871, 0.33113396167755127, 0.30797767639160156, -0.030030537396669388, 0.16005709767341614, -0.2446943074464798, -0.3440224230289459, -0.29318997263908386, -0.0017087459564208984, 0.08423466235399246, -0.30205607414245605, 0.43599849939346313, -0.40494340658187866, -0.2110811024904251, -0.0015754476189613342, 0.12565845251083374, 0.13358883559703827, 0.3899765610694885, -0.08582735806703568, 0.01641879975795746, -0.3135717511177063, 0.2766587734222412, 0.08733213692903519, 0.5164566040039062, -0.1160043478012085, -0.020529113709926605, -0.1597716212272644, 0.3449998199939728, -0.5093927979469299, -0.025777412578463554, -0.041981786489486694, 0.09868047386407852, -0.18369421362876892, -0.2436058223247528, 0.02295558527112007, 0.0883265808224678, 0.213704913854599, 0.2030799239873886, -0.2748384475708008, -0.27690383791923523, -0.11304643005132675, 0.11901131272315979, -0.09976635873317719, 0.022418312728405, -0.03625519946217537, -0.08896035701036453, -0.17748896777629852, -0.23579595983028412, 0.15790021419525146, 0.10129962861537933, -0.00875614583492279, 0.038689032196998596, 0.07945409417152405, -0.19881857931613922, 0.009577266871929169, -0.05676192790269852, 0.2661018669605255, 0.1500958651304245, -0.19128604233264923, 0.32904621958732605, -0.22484678030014038, -0.2023516148328781, 0.06492463499307632, 0.2908937633037567, 0.4154062867164612, -0.2804528772830963, 0.5764786601066589, 0.06106448918581009, -0.2228240966796875, 0.2858740985393524, 0.5775526762008667, 0.006963718682527542, -0.024657372385263443, -0.0013722404837608337, 0.0033366158604621887, 0.33617427945137024, -0.3601534366607666, -0.0624224990606308, 0.16149480640888214, 0.15123048424720764, 0.1648210734128952, 0.1453952193260193, 0.060249269008636475, -0.10743582248687744, 0.09967514872550964, -0.08101211488246918, 0.1676628589630127, -0.5353279113769531, 0.07676602900028229, 0.16845864057540894, -0.017448902130126953, -0.01252518780529499, 0.4523634612560272, 0.22328051924705505, 0.428936630487442, 0.4118610918521881, -0.17452475428581238, 0.3323521614074707, 0.11014460027217865, -0.08195917308330536, -0.00564492866396904, -0.05166161432862282, 0.06740636378526688, 0.304577112197876, 0.08432763814926147, 0.3127085566520691, 0.27331027388572693, -0.18123021721839905, 0.2734960913658142, 0.052969545125961304, -0.33217793703079224, 0.6293624043464661, -0.10995550453662872, -0.29160305857658386, 0.013230547308921814, -0.3131420612335205, -0.2830197215080261, 0.058384254574775696, 0.0277701523154974, -0.1919792890548706, 0.6304165124893188, 0.3053603172302246, 0.4990982115268707, 0.19308705627918243, 0.12946678698062897, -0.028326071798801422, 0.3076893389225006, -0.4314000606536865, -0.09289237856864929, 0.3527282178401947, -0.3024595379829407, -0.12067359685897827, 0.2753846049308777, 0.1057797223329544, 0.03380309417843819, -0.22600898146629333, 0.31100523471832275, -0.0752112865447998, -0.13393442332744598, -0.2861117720603943, 0.3711605370044708, -0.03445390984416008, 0.19168011844158173, 0.2742617130279541, 0.21627363562583923, -0.17250928282737732, 0.18641245365142822, 0.07148026674985886, 0.07954991608858109, -0.01591898500919342, 0.449030339717865, 0.27610090374946594, -0.020344093441963196, 0.08279441297054291, 0.017591288313269615, -0.08468282967805862, -0.38038507103919983, 0.22280582785606384, -0.37886348366737366, 0.273125022649765, 0.040463630110025406, 0.1463371068239212, -0.000817449763417244, 0.33807259798049927, 0.015464038588106632, -0.0072744861245155334, -0.13842472434043884, -0.045384831726551056, -0.01170327514410019, 0.08209864795207977, 0.24479803442955017, 0.29347461462020874, -0.05171772837638855, 0.23172743618488312, 0.31049200892448425, -0.009194247424602509, -0.27848148345947266, -0.3143131136894226, -0.1979357749223709, 0.5181605815887451, 0.15114915370941162, 0.04965567588806152, -0.2355090230703354, -0.0025125332176685333, 0.13896483182907104, -0.4212070107460022, -0.0727631002664566, -0.21466755867004395, 0.23719288408756256, -0.21147821843624115, 0.1449594497680664, 0.15224334597587585, -0.248679518699646, 0.40598732233047485, 0.32941779494285583, -0.1364535391330719, -0.35396456718444824, -0.015450265258550644, 0.12652350962162018, -0.14973247051239014, -0.24074971675872803, 0.10977828502655029, 0.0927252471446991, 0.04879986494779587, 0.01203346997499466, -0.02642996422946453, -0.1493249237537384, -0.14200939238071442, -0.0094776451587677, 0.19198979437351227, -0.31174325942993164, 0.1166309043765068, -0.4204261898994446, -0.09249288588762283, -0.006069798022508621, 0.43126729130744934, 0.07486240565776825, 0.21098002791404724, -0.14318329095840454, -0.35631564259529114, 0.3087362051010132, -0.45201796293258667, -0.3963167071342468, 0.056790657341480255, 0.10231778025627136, 0.04781243950128555, -0.0759788230061531, -0.04233717918395996, -0.01879853755235672, 0.271372526884079, -0.13315227627754211, -0.07334082573652267, 0.21018177270889282, 0.10160616040229797, -0.1441400945186615, -0.26284289360046387, 0.27213940024375916, 0.10458686947822571, -0.25496700406074524, -0.09400684386491776, -0.4037274718284607 ]
https://github.com/huggingface/datasets/issues/6012
Hi, I think this feature would be very useful. I want to concatenate large datasets with heterogeneous columns. I dislike `map` since I don't want multiple copy of that datasets locally. I tried to use "set_transform" on each dataset to convert it to a standard features format, but `datasets.concatenate_datasets` ignores the updated format of the datasets.  A work around is to use `torch.utils.data.ConcatDataset`. Is there a neat way to do it using HF datasets?
[FR] Transform Chaining, Lazy Mapping
### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _
74
[FR] Transform Chaining, Lazy Mapping ### Feature request Currently using a `map` call processes and duplicates the whole dataset, which takes both time and disk space. The solution is to allow lazy mapping, which is essentially a saved chain of transforms that are applied on the fly whenever a slice of the dataset is requested. The API should look like `map`, as `set_transform` changes the current dataset while `map` returns another dataset. ### Motivation Lazy processing allows lower disk usage and faster experimentation. ### Your contribution _ Hi, I think this feature would be very useful. I want to concatenate large datasets with heterogeneous columns. I dislike `map` since I don't want multiple copy of that datasets locally. I tried to use "set_transform" on each dataset to convert it to a standard features format, but `datasets.concatenate_datasets` ignores the updated format of the datasets.  A work around is to use `torch.utils.data.ConcatDataset`. Is there a neat way to do it using HF datasets?
[ -0.4485601782798767, -0.21093867719173431, 0.009916141629219055, -0.20319369435310364, -0.004091721028089523, 0.23192815482616425, 0.18682898581027985, 0.456773579120636, -0.055248141288757324, -0.09726309776306152, -0.2656952440738678, 0.2790479362010956, -0.03515258803963661, 0.08542145788669586, -0.1913859248161316, -0.20907089114189148, 0.2270401269197464, 0.14976602792739868, -0.5164502263069153, -0.17218632996082306, -0.3986901044845581, -0.048444174230098724, -0.016214825212955475, -0.0839308500289917, -0.14702554047107697, 0.10288568586111069, -0.3621239960193634, -0.10854020714759827, 0.2061835378408432, 0.20585376024246216, 0.30905503034591675, 0.6185876131057739, 0.15791332721710205, 0.10039570927619934, -0.00011570985952857882, -0.05100187659263611, -0.06102875620126724, -0.05122791975736618, -0.08926860988140106, -0.17888663709163666, -0.332283616065979, -0.41481682658195496, -0.10591700673103333, -0.12385401129722595, 0.05813506990671158, -0.24987156689167023, 0.03618653863668442, -0.5723528265953064, 0.21816998720169067, -0.15995590388774872, 0.10792316496372223, -0.1426030993461609, -0.3154746890068054, -0.20830444991588593, 0.17033323645591736, 0.36606335639953613, 0.0034528374671936035, -0.14633695781230927, 0.13265153765678406, -0.2645813226699829, -0.15481042861938477, 0.17406460642814636, -0.10666729509830475, -0.3685075342655182, 0.3231382668018341, -0.023982908576726913, -0.20326891541481018, -0.2815524935722351, 0.1277931183576584, 0.2988983690738678, 0.19100478291511536, -0.17112842202186584, -0.15994258224964142, -0.3097323477268219, -0.2135034203529358, -0.0023600831627845764, -0.3475072383880615, 0.21486538648605347, 0.028320424258708954, 0.10943961143493652, -0.24836620688438416, -0.2644563317298889, 0.009523376822471619, 0.11930454522371292, 0.11881035566329956, -0.015956126153469086, 0.21985545754432678, 0.007215678691864014, 0.15463560819625854, -0.18795977532863617, 0.3733538091182709, -0.4251646399497986, 0.07134498655796051, 0.33946096897125244, -0.45691603422164917, -0.15090633928775787, 0.024362711235880852, -0.10909883677959442, 0.48162734508514404, 0.052651215344667435, -0.25379613041877747, 0.19758687913417816, -0.3294413983821869, -0.002932429313659668, 0.013042490929365158, 0.08823759853839874, -0.051922932267189026, 0.17105045914649963, -0.024906229227781296, -0.3197239637374878, 0.004111751914024353, 0.0984371155500412, 0.11822271347045898, -0.1176476925611496, -0.22117915749549866, 0.11165881156921387, -0.10087735950946808, 0.059563249349594116, 0.04494365304708481, -0.13329540193080902, 0.021277256309986115, -0.06322692334651947, -0.10675964504480362, 0.23913359642028809, -0.027223240584135056, 0.3420707583427429, 0.14480334520339966, 0.19534872472286224, 0.06806796044111252, 0.07310004532337189, -0.025973090901970863, -0.2734222412109375, -0.07312381267547607, 0.13570769131183624, 0.02512431889772415, -0.1358819603919983, -0.2276548445224762, 0.18585899472236633, 0.03849270939826965, 0.4516391158103943, 0.18399512767791748, -0.09367430955171585, 0.3664621412754059, -0.19082731008529663, -0.07051463425159454, -0.022694073617458344, 0.3094479441642761, 0.1675998866558075, -0.40549159049987793, 0.2148335725069046, -0.3774884343147278, -0.2425411343574524, -0.3185049593448639, 0.05160175636410713, 0.12242309749126434, -0.09943976998329163, -0.031496334820985794, 0.530022382736206, 0.20602765679359436, -0.098018579185009, 0.08623053878545761, -0.10693921148777008, -0.15423154830932617, -0.17170387506484985, -0.07408622652292252, 0.3632548451423645, 0.14711618423461914, -0.23028622567653656, 0.19957058131694794, 0.22167551517486572, 0.11197705566883087, 0.33326831459999084, -0.18067525327205658, 0.029652610421180725, -0.26060885190963745, -0.08096711337566376, 0.5031456351280212, 0.11954696476459503, 0.05854535847902298, 0.40023407340049744, -0.10411609709262848, -0.001849941909313202, 0.1697818636894226, 0.09285442531108856, 0.3565530478954315, -0.15705710649490356, 0.28054073452949524, 0.4910050332546234, -0.08273091912269592, -0.032438091933727264, 0.02108592540025711, -0.291059672832489, 0.14852342009544373, -0.21487608551979065, 0.04234936088323593, 0.34459394216537476, 0.03612038120627403, 0.08009450137615204, 0.4941408336162567, -0.3952627182006836, 0.31980302929878235, 0.3336135745048523, -0.1483112871646881, 0.10560590028762817, -0.08559659123420715, 0.08289014548063278, -0.4903731942176819, -0.14911316335201263, 0.19587458670139313, -0.13463518023490906, 0.21053500473499298, -0.3704322576522827, 0.3215269148349762, -0.06473679095506668, -0.0699310153722763, 0.31643038988113403, -0.003825142979621887, 0.22950774431228638, -0.130031019449234, -0.14897820353507996, -0.20563197135925293, 0.4231244921684265, 0.21710088849067688, -0.09739059954881668, -0.31137222051620483, 0.4005228281021118, 0.24531500041484833, 0.2281779944896698, -0.08962395042181015, 0.2055705487728119, 0.0403178445994854, -0.14064252376556396, 0.04118586331605911, 0.041146405041217804, -0.29372963309288025, -0.025907382369041443, 0.05862729996442795, 0.5423993468284607, 0.10617617517709732, -0.06732457131147385, 0.21985021233558655, -0.20605584979057312, -0.08849279582500458, -0.3070250153541565, -0.41547173261642456, 0.32679158449172974, -0.41136276721954346, 0.3202579617500305, -0.1364956796169281, 0.004350394010543823, 0.06055904179811478, -0.14959219098091125, -0.14839905500411987, -0.19772998988628387, 0.2597903907299042, 0.04999275505542755, 0.17285479605197906, 0.04871336370706558, -0.34536510705947876, 0.3735697865486145, 0.341314435005188, -0.012876339256763458, -0.031881969422101974, 0.24772557616233826, 0.052461184561252594, 0.08549776673316956, 0.1106383353471756, -0.1561673879623413, 0.3894925117492676, 0.20820508897304535, 0.07693874835968018, 0.11823409795761108, 0.08318302035331726, 0.17052102088928223, 0.22317367792129517, -0.16259124875068665, 0.2769944369792938, 0.23430660367012024, 0.38136523962020874, 0.08800481259822845, -0.31822332739830017, -0.3357064127922058, 0.20872049033641815, -0.3023819327354431, -0.024933986365795135, 0.08448125422000885, -0.32287049293518066, -0.05039019510149956, -0.3399237394332886, -0.5656282305717468, -0.026370231062173843, -0.3547401428222656, -0.07215937227010727, 0.20001381635665894, -0.08770739287137985, 0.4134400188922882, -0.182353213429451, 0.35720834136009216, 0.13442477583885193, -0.5958702564239502, -0.2370707094669342, -0.09170505404472351, 0.12817132472991943, -0.055017441511154175, 0.021440915763378143, -0.39399585127830505, 0.05121702700853348, -0.18242338299751282, 0.04970545321702957, -0.37769874930381775, -0.23939070105552673, 0.280096173286438, -0.059722986072301865, -0.5112127661705017, 0.29747024178504944, -0.06730411946773529, 0.11808682233095169, -0.2891607880592346, -0.022886408492922783, 0.1279105544090271, 0.004904717206954956, 0.10745561122894287, 0.04343413934111595, 0.042256180197000504, -0.03215591236948967, 0.0055454447865486145, -0.1401219367980957, -0.37532949447631836, 0.28259485960006714, -0.2111116647720337, 0.09682877361774445, 0.0017059706151485443, 0.007920600473880768, -0.3226809501647949, 0.025182869285345078, -0.11676104366779327, -0.12811970710754395, -0.18783535063266754, 0.381133109331131, -0.19201353192329407, -0.22813570499420166, -0.3161291480064392, -0.26887598633766174, -0.22233442962169647, 0.35163629055023193, -0.2711827754974365, 0.14521950483322144, -0.09052935987710953, 0.6184327006340027, -0.13955336809158325, 0.24053481221199036, 0.2667313814163208, 0.4082086682319641, 0.0628850981593132, -0.00949735939502716, -0.0066747963428497314, 0.04752441123127937, 0.10936547815799713, 0.28147900104522705, 0.17321638762950897, 0.3310232162475586, 0.22599424421787262, 0.46250396966934204, 0.364113450050354, -0.061131685972213745, 0.34418582916259766, 0.010699441656470299, 0.2466934621334076, -0.1473001092672348, -0.48602110147476196, -0.3042854368686676, -0.3317263424396515, 0.07560408115386963, 0.05947951227426529, -0.12936235964298248, -0.3011655807495117, 0.1454218626022339, -0.24370333552360535, 0.34856992959976196, -0.2513982653617859, 0.3779650330543518, -0.5767931938171387, 0.23085099458694458, 0.19129306077957153, -0.012243837118148804, -0.5407940149307251, -0.16155663132667542, 0.4425896406173706, 0.107193224132061, 0.2541902959346771, -0.020085759460926056, 0.06738936901092529, -0.07229511439800262, -0.4896354377269745, 0.5179301500320435, 0.18239690363407135, 0.07481855899095535, -0.08019185811281204, -0.19255515933036804, -0.31736066937446594, 0.0172494538128376, 0.7108888626098633, 0.027153057977557182, -0.4118424654006958, 0.20785608887672424, -0.29382455348968506, 0.005294136703014374, -0.09018800407648087, 0.21544557809829712, 0.0267791710793972, 0.05037185922265053, 0.5635956525802612, -0.399848073720932, -0.2912738621234894, 0.17818482220172882, 0.2553666830062866, -0.17208066582679749, 0.114925816655159, 0.1616635024547577, 0.010920092463493347, -0.22880756855010986, -0.3330622911453247, -0.08243139088153839, 0.09427879005670547, -0.04605014622211456, 0.0711262971162796, -0.3025099039077759, 0.05974598228931427, 0.16930755972862244, -0.24029463529586792, 0.03670688718557358, 0.4338735342025757, 0.15182222425937653, -0.030045688152313232, 0.218257874250412, -0.05994894355535507, 0.40581101179122925, -0.11674389243125916, -0.32283729314804077, 0.024183686822652817, 0.043249767273664474, 0.4094119071960449, 0.08445645868778229, 0.26177045702934265, 0.09673057496547699, 0.15992555022239685, 0.31495776772499084, -0.44258204102516174, 0.060374416410923004, 0.06689855456352234, 0.043025750666856766, -0.6757221221923828, -0.4661007821559906, 0.5324414968490601, 0.17968526482582092, -0.16567417979240417, 0.2176867127418518, -0.2880655527114868, -0.2558612525463104, 0.5443891286849976, 0.2604905962944031, 0.8386489152908325, 0.0571637898683548, 0.34009817242622375, -0.20734088122844696, -0.12134258449077606, 0.3601749539375305, -0.5043061971664429, 0.14504525065422058, -0.335615336894989, -0.7188387513160706, -0.1967136710882187, -0.1434057652950287, -0.09988567233085632, -0.01062522642314434, -0.3106042146682739, 0.3495285212993622, 0.010995090007781982, 0.12490113079547882, -0.08214424550533295, -0.26677125692367554, -0.004162203520536423, -0.517998456954956, 0.14827370643615723, 0.04688630253076553, 0.16209539771080017, 0.21832165122032166, -0.15258532762527466, -0.3234889507293701, 0.02505640685558319, -0.036654986441135406, -0.08045651763677597, 0.11175747215747833, 0.02564740926027298, 0.4098978638648987, -0.08852590620517731, -0.0469202995300293, 0.025291450321674347, -0.10550358146429062, 0.24812756478786469, -0.06997255980968475, 0.1184345930814743, -0.2970044016838074, 0.22605031728744507, 0.2225397527217865, -0.1675497591495514, -0.2469867616891861, 0.5273659229278564, 0.2786896824836731, 0.15752679109573364, 0.08446815609931946, 0.1464586853981018, -0.20161056518554688, -0.5056284666061401, -0.0033904947340488434, -0.03875367343425751, -0.2279565930366516, 0.002892635762691498, 0.5076987743377686, 0.03781186044216156, 0.12558497488498688, 0.00564288254827261, -0.028166990727186203, -0.04749099537730217, 0.4110301733016968, -0.23661431670188904, -0.06078975647687912, -0.10732917487621307, 0.35797619819641113, 0.18481947481632233, -0.03591228649020195, 0.183343306183815, 0.12490518391132355, -0.2733301818370819, -0.018862057477235794, 0.1555604189634323, 0.17119035124778748, -0.40648800134658813, -0.0173816978931427, -0.5067504048347473, -0.280706524848938, -0.20169854164123535, 0.2609788477420807, 0.0010358341969549656, 0.06617499142885208, -0.1126040518283844, -0.04787665605545044, -0.33961987495422363, 0.1887996792793274, -0.037042517215013504, 0.21589836478233337, 0.06457477807998657, 0.27721336483955383, -0.08913454413414001, 0.2159939855337143, -0.23241348564624786, -0.13027220964431763, 0.15633007884025574, 0.03713406249880791, -0.18726252019405365, -0.04727230966091156, -0.16613414883613586, -0.13542649149894714, -0.02362261526286602, 0.14092621207237244, 0.00984172523021698, -0.11312597990036011, -0.18443776667118073, 0.14003635942935944, 0.09240636229515076, 0.3042222857475281, -0.08496684581041336, -0.1444893181324005, -0.116157665848732, -0.4182358980178833, 0.122962586581707, 0.07603849470615387, -0.09813599288463593, -0.053782206028699875, 0.0426081158220768, -0.42644795775413513, -0.10961848497390747, 0.08790776878595352, 0.6888731718063354, 0.053303346037864685, -0.36505067348480225, 0.2945389151573181, -0.3263879120349884, -0.1363801509141922, -0.2509542405605316, 0.3452160060405731, 0.6231551766395569, -0.20791520178318024, 0.3518356382846832, 0.0120304636657238, -0.15734218060970306, 0.09726542234420776, 0.38727858662605286, 0.0542682483792305, -0.01236056163907051, 0.03785758465528488, 0.17771998047828674, 0.0843416303396225, -0.2731168270111084, -0.44747933745384216, 0.05813300237059593, 0.05493839830160141, 0.05728533864021301, 0.2582988440990448, 0.08197642862796783, -0.06981285661458969, 0.08537916094064713, -0.07283047586679459, 0.06635606288909912, -0.13183191418647766, 0.13802781701087952, 0.39968541264533997, 0.22977425158023834, 0.20087110996246338, 0.376882940530777, 0.4172241687774658, 0.3115159273147583, -0.036129798740148544, 0.18822243809700012, 0.05786918103694916, 0.39546167850494385, -0.1267920583486557, 0.12724608182907104, -0.3976641893386841, 0.09648693352937698, 0.020568683743476868, 0.3644395172595978, 0.43474364280700684, 0.1359993815422058, -0.16895714402198792, 0.2145918607711792, -0.41586044430732727, -0.09864074736833572, 0.8256581425666809, -0.05751824751496315, -0.1439565271139145, 0.3561304807662964, 0.06755807995796204, -0.20297861099243164, -0.040061648935079575, 0.009982574731111526, -0.204474538564682, 0.7597413063049316, 0.10077740252017975, 0.7158739566802979, 0.1515958160161972, 0.3305615782737732, 0.16480669379234314, 0.3082069754600525, -0.265506386756897, -0.1385875791311264, 0.0283995158970356, -0.16859404742717743, -0.10842058062553406, 0.3109193444252014, 0.1606220304965973, 0.28818583488464355, -0.1078246459364891, 0.25237560272216797, -0.22336304187774658, -0.00023782998323440552, 0.09575746208429337, 0.037914346903562546, -0.19486750662326813, -0.292557954788208, 0.4600309431552887, 0.013582322746515274, -0.009897381067276001, 0.37897852063179016, -0.09805165231227875, -0.032624389976263046, -0.20568814873695374, 0.3408792316913605, 0.3921303153038025, -0.08738958090543747, 0.3344179689884186, -0.12278002500534058, -0.06549485772848129, 0.0973077118396759, 0.46360471844673157, -0.28381291031837463, 0.15358580648899078, 0.14024490118026733, 0.051890794187784195, 0.13093595206737518, 0.1898716390132904, 0.15130135416984558, 0.0717020258307457, -0.18179580569267273, -0.1387357860803604, -0.02908201515674591, -0.07356655597686768, 0.16414013504981995, 0.027336999773979187, 0.21830788254737854, 0.006071008741855621, 0.38122114539146423, 0.05997918173670769, -0.2737409472465515, -0.5071183443069458, -0.07448621839284897, 0.5874332785606384, -0.10256344079971313, -0.19005373120307922, -0.0700736716389656, 0.18055860698223114, -0.024922866374254227, -0.410546213388443, 0.31823915243148804, 0.2641924321651459, -0.014894302934408188, -0.10080260783433914, 0.15500575304031372, 0.17284807562828064, -0.33254194259643555, 0.12909051775932312, 0.19639715552330017, -0.13736167550086975, -0.2754909098148346, 0.13460317254066467, 0.1428251415491104, -0.2471139132976532, -0.11201080679893494, 0.2904251217842102, 0.008238295093178749, -0.09294582903385162, -0.28327643871307373, -0.1326279193162918, -0.13520248234272003, -0.20424912869930267, 0.3326684236526489, 0.32123756408691406, -0.381473571062088, 0.3646320104598999, -0.408561110496521, 0.04621155187487602, 0.09093895554542542, 0.7041282653808594, 0.07645998895168304, 0.4057948887348175, 0.0691196471452713, -0.30044490098953247, 0.3494170308113098, -0.3970228135585785, -0.5351535677909851, -0.002952631562948227, -0.06998196989297867, 0.27178722620010376, -0.029018815606832504, -0.04775511473417282, -0.08069857209920883, 0.2208108752965927, -0.2740267515182495, -0.025839686393737793, 0.17142806947231293, 0.22111700475215912, -0.21238607168197632, -0.28014928102493286, 0.3494003117084503, 0.05371343716979027, -0.3490886390209198, -0.007692605257034302, -0.2808716893196106 ]
https://github.com/huggingface/datasets/issues/6011
Hi! You can do `ds.get_index("embeddings").faiss_index.metric_type` to get the metric type and then match the result with the FAISS metric [enum](https://github.com/facebookresearch/faiss/blob/43d86e30736ede853c384b24667fc3ab897d6ba9/faiss/MetricType.h#L22-L36) (should be L2).
Documentation: wiki_dpr Dataset has no metric_type for Faiss Index
### Describe the bug After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ### Steps to reproduce the bug System: Python 3.9.16, Transformers 4.30.2, WSL After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ```py from transformers import DPRQuestionEncoder, DPRContextEncoder, DPRQuestionEncoderTokenizer, DPRContextEncoderTokenizer tokenizer = DPRQuestionEncoderTokenizer.from_pretrained("facebook/dpr-question_encoder-multiset-base") encoder = DPRQuestionEncoder.from_pretrained("facebook/dpr-question_encoder-multiset-base") def encode_question(query, tokenizer=tokenizer, encoder=encoder): inputs = tokenizer(query, return_tensors='pt') question_embedding = encoder(**inputs)[0].detach().numpy() return question_embedding def get_knn(query, k=5, tokenizer=tokenizer, encoder=encoder, verbose=False): enc_question = encode_question(query, tokenizer, encoder) topk_results = ds.get_nearest_examples(index_name='embeddings', query=enc_question, k=k) a = torch.tensor(enc_question[0]).reshape(768) b = torch.tensor(topk_results.examples['embeddings'][0]) print(a.shape, b.shape) print(torch.dot(a, b)) print((a-b).pow(2).sum()) return topk_results ``` The [FAISS documentation](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances) suggests the metric is usually L2 distance (without the square root) or the inner product. I compute both for the sample query: ```py query = """ it catapulted into popular culture along with a line of action figures and other toys by Bandai.[2] By 2001, the media franchise had generated over $6 billion in toy sales. Despite initial criticism that its action violence targeted child audiences, the franchise has been commercially successful.""" get_knn(query,k=5) ``` Here, I get dot product of 80.6020 and L2 distance of 77.6616 and ```py NearestExamplesResults(scores=array([76.20431 , 75.312416, 74.945404, 74.866394, 74.68506 ], dtype=float32), examples={'id': ['3081096', '2004811', '8908258', '9594124', '286575'], 'text': ['actors, resulting in the "Power Rangers" franchise which has continued since then into sequel TV series (with "Power Rangers Beast Morphers" set to premiere in 2019), comic books, video games, and three feature films, with a further cinematic universe planned. Following from the success of "Power Rangers", Saban acquired the rights to more of Toei\'s library, creating "VR Troopers" and "Big Bad Beetleborgs" from several Metal Hero Series shows and "Masked Rider" from Kamen Rider Series footage. DIC Entertainment joined this boom by acquiring the rights to "Gridman the Hyper Agent" and turning it into "Superhuman Samurai Syber-Squad". In 2002,', ``` Doing `k=1` indicates the higher the outputted number, the better the match, so the metric should not be L2 distance. However, my manually computed inner product (80.6) has a discrepancy with the reported (76.2). Perhaps, this has to do with me using the `compressed` embeddings? ### Expected behavior ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # METRIC_INNER_PRODUCT ``` ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-477.13.1.el8_8.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
23
Documentation: wiki_dpr Dataset has no metric_type for Faiss Index ### Describe the bug After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ### Steps to reproduce the bug System: Python 3.9.16, Transformers 4.30.2, WSL After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ```py from transformers import DPRQuestionEncoder, DPRContextEncoder, DPRQuestionEncoderTokenizer, DPRContextEncoderTokenizer tokenizer = DPRQuestionEncoderTokenizer.from_pretrained("facebook/dpr-question_encoder-multiset-base") encoder = DPRQuestionEncoder.from_pretrained("facebook/dpr-question_encoder-multiset-base") def encode_question(query, tokenizer=tokenizer, encoder=encoder): inputs = tokenizer(query, return_tensors='pt') question_embedding = encoder(**inputs)[0].detach().numpy() return question_embedding def get_knn(query, k=5, tokenizer=tokenizer, encoder=encoder, verbose=False): enc_question = encode_question(query, tokenizer, encoder) topk_results = ds.get_nearest_examples(index_name='embeddings', query=enc_question, k=k) a = torch.tensor(enc_question[0]).reshape(768) b = torch.tensor(topk_results.examples['embeddings'][0]) print(a.shape, b.shape) print(torch.dot(a, b)) print((a-b).pow(2).sum()) return topk_results ``` The [FAISS documentation](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances) suggests the metric is usually L2 distance (without the square root) or the inner product. I compute both for the sample query: ```py query = """ it catapulted into popular culture along with a line of action figures and other toys by Bandai.[2] By 2001, the media franchise had generated over $6 billion in toy sales. Despite initial criticism that its action violence targeted child audiences, the franchise has been commercially successful.""" get_knn(query,k=5) ``` Here, I get dot product of 80.6020 and L2 distance of 77.6616 and ```py NearestExamplesResults(scores=array([76.20431 , 75.312416, 74.945404, 74.866394, 74.68506 ], dtype=float32), examples={'id': ['3081096', '2004811', '8908258', '9594124', '286575'], 'text': ['actors, resulting in the "Power Rangers" franchise which has continued since then into sequel TV series (with "Power Rangers Beast Morphers" set to premiere in 2019), comic books, video games, and three feature films, with a further cinematic universe planned. Following from the success of "Power Rangers", Saban acquired the rights to more of Toei\'s library, creating "VR Troopers" and "Big Bad Beetleborgs" from several Metal Hero Series shows and "Masked Rider" from Kamen Rider Series footage. DIC Entertainment joined this boom by acquiring the rights to "Gridman the Hyper Agent" and turning it into "Superhuman Samurai Syber-Squad". In 2002,', ``` Doing `k=1` indicates the higher the outputted number, the better the match, so the metric should not be L2 distance. However, my manually computed inner product (80.6) has a discrepancy with the reported (76.2). Perhaps, this has to do with me using the `compressed` embeddings? ### Expected behavior ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # METRIC_INNER_PRODUCT ``` ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-477.13.1.el8_8.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Hi! You can do `ds.get_index("embeddings").faiss_index.metric_type` to get the metric type and then match the result with the FAISS metric [enum](https://github.com/facebookresearch/faiss/blob/43d86e30736ede853c384b24667fc3ab897d6ba9/faiss/MetricType.h#L22-L36) (should be L2).
[ -0.3627319037914276, -0.5373347997665405, 0.06526761502027512, 0.3944721817970276, 0.33478012681007385, 0.139950230717659, 0.33886921405792236, 0.3349672555923462, 0.38180649280548096, 0.33025017380714417, 0.13445734977722168, 0.23283353447914124, 0.18522217869758606, -0.14470714330673218, -0.029888417571783066, -0.35495635867118835, 0.05146298557519913, 0.072262242436409, 0.14561975002288818, -0.2550848126411438, -0.3635517954826355, 0.1195937842130661, -0.4809117317199707, -0.14540058374404907, -0.3482491672039032, 0.10831751674413681, -0.05393989756703377, -0.13415221869945526, -0.11504776030778885, -0.6324169635772705, 0.5448925495147705, -0.19124144315719604, 0.4148246645927429, 0.37153443694114685, -0.00011936265218537301, 0.06424103677272797, 0.5459181070327759, -0.06515848636627197, -0.06828392297029495, 0.03330482169985771, -0.32037657499313354, -0.2035902440547943, 0.16180510818958282, -0.45351365208625793, -0.22441366314888, -0.33410078287124634, -0.11903125047683716, -0.19030863046646118, 0.23532941937446594, 0.37752464413642883, 0.11184459179639816, 0.09138922393321991, -0.006412521004676819, -0.23228545486927032, -0.08828124403953552, -0.0945289358496666, -0.14435264468193054, 0.16852858662605286, -0.1965939700603485, 0.14209243655204773, 0.17313188314437866, 0.24463115632534027, 0.06396784633398056, 0.07574184238910675, 0.1677570939064026, 0.2691023051738739, 0.5262347459793091, -0.045427221804857254, 0.11601480841636658, 0.35904479026794434, 0.44730696082115173, -0.03713221848011017, -0.1772046685218811, 0.026111409068107605, -0.012932464480400085, -0.325013130903244, 0.07395793497562408, -0.2228125035762787, -0.10999014973640442, 0.06575220823287964, -0.26244741678237915, 0.3647008240222931, -0.23453795909881592, 0.33281180262565613, -0.3320567011833191, 0.6909911632537842, -0.023878153413534164, 0.09009850025177002, -0.20534220337867737, -0.020626261830329895, -0.11236821860074997, -0.22736632823944092, 0.002746627666056156, 0.20848344266414642, -0.22785063087940216, -0.2579267621040344, 0.23472514748573303, -0.39360862970352173, 0.08056291937828064, -0.19241905212402344, -0.3221389353275299, 0.12095421552658081, 0.560074508190155, -0.09038465470075607, 0.23954026401042938, 0.49105510115623474, -0.004356026649475098, 0.3218015432357788, 0.04243730381131172, 0.3899444043636322, 0.021312348544597626, 0.0009311176836490631, -0.0171210840344429, 0.03918430209159851, 0.06904573738574982, 0.05818159878253937, 0.04186052829027176, -0.06971827149391174, -0.2607977092266083, 0.2460741400718689, -0.057447321712970734, -0.06334096938371658, -0.0015652328729629517, 0.49836936593055725, -0.08289352804422379, 0.49629056453704834, 0.10873369872570038, 0.1728435456752777, -0.21151518821716309, 0.3316091001033783, -0.19371530413627625, -0.12367790937423706, -0.0028631985187530518, 0.17015378177165985, 0.23587319254875183, 0.02475026249885559, 0.17568840086460114, -0.10891158878803253, 0.11241339147090912, -0.19458699226379395, -0.04780124872922897, 0.1275091916322708, 0.373946875333786, 0.19864171743392944, -0.01992424577474594, 0.2708972096443176, 0.19514092803001404, -0.4425991475582123, -0.2527163624763489, 0.04693944752216339, -0.3891976475715637, -0.20734483003616333, -0.06586717069149017, 0.18242639303207397, -0.0647566094994545, -0.06925606727600098, -0.14445140957832336, 0.33146610856056213, 0.17328289151191711, -0.020032934844493866, 0.1145518347620964, -0.06909752637147903, -0.17618539929389954, -0.10004477202892303, 0.4231719970703125, 0.1149945855140686, -0.13905677199363708, -0.31628063321113586, 0.03926863148808479, 0.09014423191547394, 0.2398766428232193, -0.013668257743120193, -0.006925657391548157, 0.16154995560646057, -0.004497487097978592, 0.21410994231700897, 0.530326247215271, -0.7963207960128784, -0.3819698095321655, 0.10407111048698425, 0.10231901705265045, 0.08385509252548218, 0.14739179611206055, -0.035271111875772476, 0.20893912017345428, 0.31899183988571167, 0.3188844919204712, 0.36219459772109985, 0.08659786731004715, -0.03893635421991348, -0.3946651816368103, -0.3349798023700714, 0.23951098322868347, 0.21263360977172852, 0.2790404260158539, -0.08854840695858002, 0.054143261164426804, 0.30256325006484985, 0.26032766699790955, -0.030880045145750046, -0.08162035793066025, 0.14831100404262543, 0.08815573155879974, -0.38451018929481506, 0.4469735622406006, -0.44909822940826416, -0.12497689574956894, 0.26207709312438965, -0.24678434431552887, 0.14305385947227478, 0.19012297689914703, -0.21158970892429352, -0.5357016921043396, -0.06854227185249329, -0.2574714422225952, -0.292927622795105, 0.1065358966588974, -0.10110102593898773, -0.0752999410033226, 0.10313169658184052, -0.22473958134651184, -0.4532231390476227, -0.01956912875175476, -0.24088548123836517, -0.11878138780593872, 0.1513802409172058, -0.17197902500629425, -0.004895344376564026, -0.09042907506227493, 0.5494769811630249, 0.3549342453479767, 0.10410301387310028, -0.18883207440376282, 0.15889713168144226, 0.1774716079235077, -0.1692018210887909, 0.07050368189811707, 0.005109749734401703, 0.1755654215812683, -0.48998528718948364, -0.21205854415893555, 0.35284680128097534, 0.07011362910270691, 0.08396562933921814, -0.34327447414398193, 0.49366748332977295, 0.49721160531044006, 0.21871918439865112, -0.06710998713970184, -0.009209226816892624, 0.06866006553173065, -0.07733821123838425, 0.17879995703697205, -0.6360124349594116, -0.11584021151065826, 0.002712210640311241, -0.3520045578479767, -0.06085296720266342, 0.3221627473831177, 0.007851187139749527, 0.5351020693778992, -0.3102358281612396, 0.21174584329128265, 0.16689682006835938, -0.23717492818832397, -0.2241245061159134, -0.060740359127521515, -0.3223336338996887, 0.26395097374916077, 0.1426147073507309, 0.09127718955278397, -0.18130625784397125, -0.12623539566993713, -0.18861714005470276, 0.22720161080360413, 0.08733043074607849, -0.20680855214595795, 0.33567672967910767, 0.14402468502521515, -0.0007149651646614075, -0.026139236986637115, 0.24972641468048096, -0.11087975651025772, 0.14134439826011658, -0.3804962635040283, 0.06163769215345383, -0.3431946039199829, 0.091471828520298, 0.03942505270242691, -0.04448577016592026, -0.058157846331596375, -0.239507257938385, 0.3174019753932953, -0.3953227698802948, 0.0009894222021102905, 0.38439100980758667, 0.03686732053756714, 0.20746159553527832, 0.18020814657211304, -0.21620504558086395, -0.10617735236883163, -0.4253188371658325, -0.5265461206436157, -0.013806991279125214, -0.05498863011598587, 0.2112901359796524, 0.13157181441783905, -0.200798898935318, -0.09603952616453171, -0.20328938961029053, -0.33118510246276855, 0.10668094456195831, 0.005158551037311554, 0.5423403382301331, 0.08162209391593933, 0.06436524540185928, -0.23058809340000153, -0.07863029837608337, 0.1916847974061966, -0.14610493183135986, -0.018807988613843918, 0.18672707676887512, -0.2653248608112335, 0.013072356581687927, -0.06597797572612762, -0.5332697629928589, -0.03577923774719238, -0.1628330647945404, -0.07364553213119507, 0.1272086799144745, 0.028871463611721992, 0.014616291970014572, 0.13940966129302979, 0.10030072927474976, 0.0106474868953228, 0.11864323914051056, -0.37579911947250366, 0.1430666744709015, 0.4438846707344055, -0.1163061186671257, -0.6027717590332031, -0.1899777054786682, -0.3372933268547058, 0.15618076920509338, -0.034950293600559235, -0.29979944229125977, -0.38387906551361084, -0.04220420867204666, 0.28292834758758545, 0.13741442561149597, 0.27888065576553345, 0.3808440566062927, -0.19911453127861023, -0.04133927822113037, -0.26700717210769653, 0.17263607680797577, 0.15676096081733704, -0.1671481877565384, 0.18759943544864655, -0.11221465468406677, 0.18939293920993805, -0.16150659322738647, 0.7556715607643127, 0.3029806911945343, -0.23276421427726746, 0.24845056235790253, -0.1737375557422638, 0.1601209193468094, -0.041581444442272186, 0.025339223444461823, 0.3213287889957428, 0.06859464198350906, 0.1566201001405716, 0.3667297959327698, 0.04195787385106087, -0.3852424621582031, -0.06662546098232269, 0.1649581640958786, -0.3789331018924713, -0.2051967978477478, -0.020063558593392372, 0.2579375207424164, 0.1608867347240448, 0.02400660514831543, 0.39175909757614136, -0.44681915640830994, -0.2155815064907074, 0.2543105483055115, 0.33715417981147766, -0.17323637008666992, -0.03429587557911873, 0.08918095380067825, -0.21204008162021637, -0.30835944414138794, 0.40165185928344727, 0.32759833335876465, 0.43532657623291016, -0.10750852525234222, 0.024959921836853027, 0.13235005736351013, 0.026771672070026398, 0.3477502167224884, -0.38117292523384094, 0.08894667029380798, 0.364040344953537, 0.2865222096443176, -0.5273367166519165, -0.16313979029655457, -0.32165080308914185, -0.34932175278663635, -0.1171485036611557, 0.6443755030632019, -0.42019763588905334, -0.2167714685201645, 0.18223387002944946, 0.10806390643119812, -0.2598586976528168, -0.13392344117164612, -0.45775797963142395, -0.40013739466667175, -0.029574327170848846, 0.1637541949748993, 0.12593001127243042, 0.6089532971382141, -0.19505617022514343, -0.08806759119033813, -0.5045982003211975, 0.14990022778511047, -0.2555246353149414, 0.2705609202384949, 0.31055259704589844, 0.15236182510852814, 0.020475417375564575, 0.08353196084499359, 0.15605883300304413, 0.028730230405926704, 0.04723019897937775, 0.21979567408561707, -0.0743231326341629, 0.27071937918663025, 0.032430507242679596, -0.1292944848537445, 0.1766873598098755, -0.3299225866794586, 0.0465921089053154, 0.13722798228263855, 0.35324934124946594, -0.38751256465911865, 0.037554509937763214, 0.4753808379173279, 0.003957938402891159, -0.21726951003074646, -0.19400301575660706, 0.8071783185005188, 0.07335126399993896, -0.07286498695611954, 0.15014708042144775, 0.3299150764942169, -0.15949369966983795, 0.4889228940010071, 0.5268920063972473, 0.7543565034866333, 0.0040694791823625565, 0.025908660143613815, 0.4947259724140167, 0.0888633131980896, 0.35636720061302185, -0.4767024517059326, 0.2482067197561264, -0.2657148241996765, -0.16924487054347992, -0.042521487921476364, 0.02877875417470932, -0.012996498495340347, -0.038770951330661774, -0.34535712003707886, 0.16665083169937134, -0.04913085699081421, -0.0010448875837028027, 0.06921075284481049, 0.21545623242855072, -0.02816927619278431, -0.1255878210067749, -0.16539305448532104, 0.016713786870241165, 0.13181021809577942, 0.12081355601549149, 0.03208703547716141, -0.05945616215467453, -0.2082023173570633, -0.3268352746963501, -0.31699228286743164, -0.10628943890333176, -0.009776834398508072, 0.22355613112449646, 0.09122641384601593, -0.23116546869277954, 0.02499939501285553, 0.2835477292537689, 0.2906751334667206, -0.028806431218981743, -0.5874632000923157, 0.46530282497406006, -0.4874243140220642, 0.18235377967357635, 0.022325776517391205, -0.1253894716501236, 0.2450558841228485, -0.11260425299406052, -0.3584791421890259, 0.040102578699588776, -0.01544811949133873, 0.03608463704586029, -0.08336099982261658, -0.050165560096502304, -0.24105463922023773, -0.1805286407470703, 0.12163349241018295, -0.2518969178199768, 0.17754998803138733, -0.2014111876487732, 0.1027233824133873, -0.158596009016037, -0.20169900357723236, 0.2623477280139923, 0.12140439450740814, -0.273826539516449, 0.08552402257919312, 0.6880028247833252, 0.2266675978899002, -0.40132778882980347, 0.3392312526702881, -0.0740518718957901, -0.21095603704452515, -0.20992818474769592, -0.12838783860206604, 0.4196529686450958, -0.2005559504032135, 0.04786323383450508, 0.14382804930210114, -0.21717709302902222, 0.009051263332366943, 0.4494774043560028, 0.1269841492176056, -0.07994484156370163, -0.2821950912475586, -0.24881204962730408, -0.19518721103668213, 0.20374751091003418, -0.10594233870506287, 0.24159935116767883, -0.17117488384246826, -0.03269995376467705, -0.03652619943022728, 0.17692025005817413, -0.2305728793144226, -0.034799039363861084, -0.5351478457450867, 0.1775321215391159, -0.3105655908584595, -0.15886621177196503, 0.14510518312454224, 0.09188129007816315, 0.03395804017782211, -0.15948089957237244, -0.1297023892402649, -0.19534505903720856, -0.21739238500595093, 0.19098280370235443, 0.12355726212263107, -0.013979615643620491, -0.04384264349937439, 0.04200465977191925, -0.25134027004241943, -0.2898198366165161, 0.22906477749347687, -0.07495837658643723, -0.21265153586864471, 0.27005088329315186, 0.013273268938064575, 0.24299529194831848, -0.10100118815898895, -0.07002371549606323, 0.1757921278476715, 0.4275139272212982, 0.01390063762664795, 0.00333075737580657, 0.03268316388130188, 0.10225974023342133, -0.1402449607849121, 0.08724655210971832, 0.21841758489608765, 0.01746537536382675, 0.2843278646469116, -0.1987106204032898, -0.23059937357902527, 0.18798620998859406, 0.16020730137825012, 0.1070251315832138, -0.20773771405220032, -0.1036570742726326, -0.0892912745475769, 0.10776053369045258, -0.149265319108963, -0.08481161296367645, 0.3550737500190735, 0.029911883175373077, 0.05600651353597641, 0.07062648236751556, 0.15304771065711975, -0.0699116513133049, -0.08167718350887299, -0.010544754564762115, 0.023319486528635025, -0.08081647753715515, 0.18102477490901947, 0.4042758345603943, 0.19509008526802063, 0.15047746896743774, -0.0714266374707222, -0.1528446078300476, 0.24661904573440552, 0.3342994153499603, -0.14973829686641693, 0.6204262971878052, -0.20885063707828522, 0.17186586558818817, -0.07492774724960327, -0.04977396875619888, 0.36163145303726196, -0.22380585968494415, -0.04892093688249588, 0.040604859590530396, -0.0881054550409317, 0.16202634572982788, -0.1130116805434227, -0.048309341073036194, -0.4860081970691681, -0.1284455806016922, -0.13851985335350037, -0.287920206785202, -0.1082630455493927, -0.023952506482601166, -0.20036840438842773, -0.1449144184589386, 0.13264581561088562, 0.12900567054748535, -0.19142593443393707, 0.06148428097367287, -0.27196204662323, 0.047143757343292236, -0.008832527324557304, 0.3554242253303528, 0.5550036430358887, -0.010190069675445557, 0.18988262116909027, 0.37547633051872253, 0.02573137730360031, -0.01403956487774849, 0.34489306807518005, 0.17167890071868896, 0.2499094307422638, -0.3992231786251068, -0.04275752976536751, 0.4151097536087036, -0.13599860668182373, 0.02231963723897934, 0.2705293893814087, 0.1347285360097885, -0.046369172632694244, 0.11902544647455215, 0.1065935343503952, -0.17237208783626556, -0.1236778050661087, -0.11152343451976776, 0.266384482383728, -0.12252695858478546, 0.1391526162624359, -0.4007030427455902, 0.09779195487499237, -0.016217026859521866, -0.023076742887496948, -0.35879063606262207, 0.3732084035873413, 0.10808256268501282, 0.33301734924316406, 0.32581332325935364, -0.16194820404052734, 0.050240397453308105, -0.07631346583366394, 0.5051534175872803, 0.027082039043307304, 0.17093782126903534, -0.34731289744377136, 0.11947977542877197, -0.4343653917312622, 0.351284921169281, 0.14222578704357147, -0.14711548388004303, 0.404725581407547, 0.1730346530675888, -0.3356096148490906, 0.13240492343902588, 0.11003220081329346, 0.22781500220298767, 0.448452889919281, 0.46703678369522095, -0.2754208743572235, -0.27726227045059204, -0.12302292883396149, -0.1665825992822647, -0.09395803511142731, -0.33834290504455566, 0.0783194750547409, -0.1796264499425888, -0.047783806920051575, -0.040222663432359695, -0.12410350143909454, 0.09840131551027298, 0.2750330865383148, 0.2324194312095642, 0.29732662439346313, 0.46878737211227417, -0.21464481949806213, 0.16356593370437622, -0.18925026059150696, -0.10736677050590515, -0.032661158591508865, -0.03795319423079491, -0.2876109480857849, 0.1999247670173645, -0.08265139907598495, -0.2079460173845291, -0.10995692014694214, 0.1716710329055786, 0.16537679731845856, -0.05610718950629234, -0.176441490650177, 0.030883513391017914, -0.22960737347602844, -0.06670860946178436, 0.19110286235809326, 0.10321348905563354, 0.011771230958402157, 0.2576737403869629, 0.10850927233695984, -0.43216943740844727, 0.4834272861480713, -0.6419909596443176, -0.2284313291311264, -0.22336064279079437, 0.23645693063735962, 0.2204904854297638, 0.1384013444185257, -0.5475014448165894, 0.013679936528205872, 0.44653409719467163, 0.19552132487297058, -0.20056265592575073, -0.08841042220592499, -0.0015550516545772552, 0.048635244369506836, -0.21299666166305542, -0.002783864736557007, 0.08010442554950714, 0.13539716601371765, -0.15412425994873047, -0.2767115831375122 ]
https://github.com/huggingface/datasets/issues/6011
Ah! Thank you for pointing this out. FYI: the enum indicates it's using the inner product. Using `torch.inner` or `torch.dot` still produces a discrepancy compared to the built-in score. I think this is because of the compression/quantization that occurs with the FAISS index.
Documentation: wiki_dpr Dataset has no metric_type for Faiss Index
### Describe the bug After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ### Steps to reproduce the bug System: Python 3.9.16, Transformers 4.30.2, WSL After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ```py from transformers import DPRQuestionEncoder, DPRContextEncoder, DPRQuestionEncoderTokenizer, DPRContextEncoderTokenizer tokenizer = DPRQuestionEncoderTokenizer.from_pretrained("facebook/dpr-question_encoder-multiset-base") encoder = DPRQuestionEncoder.from_pretrained("facebook/dpr-question_encoder-multiset-base") def encode_question(query, tokenizer=tokenizer, encoder=encoder): inputs = tokenizer(query, return_tensors='pt') question_embedding = encoder(**inputs)[0].detach().numpy() return question_embedding def get_knn(query, k=5, tokenizer=tokenizer, encoder=encoder, verbose=False): enc_question = encode_question(query, tokenizer, encoder) topk_results = ds.get_nearest_examples(index_name='embeddings', query=enc_question, k=k) a = torch.tensor(enc_question[0]).reshape(768) b = torch.tensor(topk_results.examples['embeddings'][0]) print(a.shape, b.shape) print(torch.dot(a, b)) print((a-b).pow(2).sum()) return topk_results ``` The [FAISS documentation](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances) suggests the metric is usually L2 distance (without the square root) or the inner product. I compute both for the sample query: ```py query = """ it catapulted into popular culture along with a line of action figures and other toys by Bandai.[2] By 2001, the media franchise had generated over $6 billion in toy sales. Despite initial criticism that its action violence targeted child audiences, the franchise has been commercially successful.""" get_knn(query,k=5) ``` Here, I get dot product of 80.6020 and L2 distance of 77.6616 and ```py NearestExamplesResults(scores=array([76.20431 , 75.312416, 74.945404, 74.866394, 74.68506 ], dtype=float32), examples={'id': ['3081096', '2004811', '8908258', '9594124', '286575'], 'text': ['actors, resulting in the "Power Rangers" franchise which has continued since then into sequel TV series (with "Power Rangers Beast Morphers" set to premiere in 2019), comic books, video games, and three feature films, with a further cinematic universe planned. Following from the success of "Power Rangers", Saban acquired the rights to more of Toei\'s library, creating "VR Troopers" and "Big Bad Beetleborgs" from several Metal Hero Series shows and "Masked Rider" from Kamen Rider Series footage. DIC Entertainment joined this boom by acquiring the rights to "Gridman the Hyper Agent" and turning it into "Superhuman Samurai Syber-Squad". In 2002,', ``` Doing `k=1` indicates the higher the outputted number, the better the match, so the metric should not be L2 distance. However, my manually computed inner product (80.6) has a discrepancy with the reported (76.2). Perhaps, this has to do with me using the `compressed` embeddings? ### Expected behavior ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # METRIC_INNER_PRODUCT ``` ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-477.13.1.el8_8.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
43
Documentation: wiki_dpr Dataset has no metric_type for Faiss Index ### Describe the bug After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ### Steps to reproduce the bug System: Python 3.9.16, Transformers 4.30.2, WSL After loading `wiki_dpr` using: ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # prints nothing because the value is None ``` the index does not have a defined `metric_type`. This is an issue because I do not know how the `scores` are being computed for `get_nearest_examples()`. ```py from transformers import DPRQuestionEncoder, DPRContextEncoder, DPRQuestionEncoderTokenizer, DPRContextEncoderTokenizer tokenizer = DPRQuestionEncoderTokenizer.from_pretrained("facebook/dpr-question_encoder-multiset-base") encoder = DPRQuestionEncoder.from_pretrained("facebook/dpr-question_encoder-multiset-base") def encode_question(query, tokenizer=tokenizer, encoder=encoder): inputs = tokenizer(query, return_tensors='pt') question_embedding = encoder(**inputs)[0].detach().numpy() return question_embedding def get_knn(query, k=5, tokenizer=tokenizer, encoder=encoder, verbose=False): enc_question = encode_question(query, tokenizer, encoder) topk_results = ds.get_nearest_examples(index_name='embeddings', query=enc_question, k=k) a = torch.tensor(enc_question[0]).reshape(768) b = torch.tensor(topk_results.examples['embeddings'][0]) print(a.shape, b.shape) print(torch.dot(a, b)) print((a-b).pow(2).sum()) return topk_results ``` The [FAISS documentation](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances) suggests the metric is usually L2 distance (without the square root) or the inner product. I compute both for the sample query: ```py query = """ it catapulted into popular culture along with a line of action figures and other toys by Bandai.[2] By 2001, the media franchise had generated over $6 billion in toy sales. Despite initial criticism that its action violence targeted child audiences, the franchise has been commercially successful.""" get_knn(query,k=5) ``` Here, I get dot product of 80.6020 and L2 distance of 77.6616 and ```py NearestExamplesResults(scores=array([76.20431 , 75.312416, 74.945404, 74.866394, 74.68506 ], dtype=float32), examples={'id': ['3081096', '2004811', '8908258', '9594124', '286575'], 'text': ['actors, resulting in the "Power Rangers" franchise which has continued since then into sequel TV series (with "Power Rangers Beast Morphers" set to premiere in 2019), comic books, video games, and three feature films, with a further cinematic universe planned. Following from the success of "Power Rangers", Saban acquired the rights to more of Toei\'s library, creating "VR Troopers" and "Big Bad Beetleborgs" from several Metal Hero Series shows and "Masked Rider" from Kamen Rider Series footage. DIC Entertainment joined this boom by acquiring the rights to "Gridman the Hyper Agent" and turning it into "Superhuman Samurai Syber-Squad". In 2002,', ``` Doing `k=1` indicates the higher the outputted number, the better the match, so the metric should not be L2 distance. However, my manually computed inner product (80.6) has a discrepancy with the reported (76.2). Perhaps, this has to do with me using the `compressed` embeddings? ### Expected behavior ```py ds = load_dataset(path='wiki_dpr', name='psgs_w100.multiset.compressed', split='train') print(ds.get_index("embeddings").metric_type) # METRIC_INNER_PRODUCT ``` ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-477.13.1.el8_8.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Ah! Thank you for pointing this out. FYI: the enum indicates it's using the inner product. Using `torch.inner` or `torch.dot` still produces a discrepancy compared to the built-in score. I think this is because of the compression/quantization that occurs with the FAISS index.
[ -0.3627319037914276, -0.5373347997665405, 0.06526761502027512, 0.3944721817970276, 0.33478012681007385, 0.139950230717659, 0.33886921405792236, 0.3349672555923462, 0.38180649280548096, 0.33025017380714417, 0.13445734977722168, 0.23283353447914124, 0.18522217869758606, -0.14470714330673218, -0.029888417571783066, -0.35495635867118835, 0.05146298557519913, 0.072262242436409, 0.14561975002288818, -0.2550848126411438, -0.3635517954826355, 0.1195937842130661, -0.4809117317199707, -0.14540058374404907, -0.3482491672039032, 0.10831751674413681, -0.05393989756703377, -0.13415221869945526, -0.11504776030778885, -0.6324169635772705, 0.5448925495147705, -0.19124144315719604, 0.4148246645927429, 0.37153443694114685, -0.00011936265218537301, 0.06424103677272797, 0.5459181070327759, -0.06515848636627197, -0.06828392297029495, 0.03330482169985771, -0.32037657499313354, -0.2035902440547943, 0.16180510818958282, -0.45351365208625793, -0.22441366314888, -0.33410078287124634, -0.11903125047683716, -0.19030863046646118, 0.23532941937446594, 0.37752464413642883, 0.11184459179639816, 0.09138922393321991, -0.006412521004676819, -0.23228545486927032, -0.08828124403953552, -0.0945289358496666, -0.14435264468193054, 0.16852858662605286, -0.1965939700603485, 0.14209243655204773, 0.17313188314437866, 0.24463115632534027, 0.06396784633398056, 0.07574184238910675, 0.1677570939064026, 0.2691023051738739, 0.5262347459793091, -0.045427221804857254, 0.11601480841636658, 0.35904479026794434, 0.44730696082115173, -0.03713221848011017, -0.1772046685218811, 0.026111409068107605, -0.012932464480400085, -0.325013130903244, 0.07395793497562408, -0.2228125035762787, -0.10999014973640442, 0.06575220823287964, -0.26244741678237915, 0.3647008240222931, -0.23453795909881592, 0.33281180262565613, -0.3320567011833191, 0.6909911632537842, -0.023878153413534164, 0.09009850025177002, -0.20534220337867737, -0.020626261830329895, -0.11236821860074997, -0.22736632823944092, 0.002746627666056156, 0.20848344266414642, -0.22785063087940216, -0.2579267621040344, 0.23472514748573303, -0.39360862970352173, 0.08056291937828064, -0.19241905212402344, -0.3221389353275299, 0.12095421552658081, 0.560074508190155, -0.09038465470075607, 0.23954026401042938, 0.49105510115623474, -0.004356026649475098, 0.3218015432357788, 0.04243730381131172, 0.3899444043636322, 0.021312348544597626, 0.0009311176836490631, -0.0171210840344429, 0.03918430209159851, 0.06904573738574982, 0.05818159878253937, 0.04186052829027176, -0.06971827149391174, -0.2607977092266083, 0.2460741400718689, -0.057447321712970734, -0.06334096938371658, -0.0015652328729629517, 0.49836936593055725, -0.08289352804422379, 0.49629056453704834, 0.10873369872570038, 0.1728435456752777, -0.21151518821716309, 0.3316091001033783, -0.19371530413627625, -0.12367790937423706, -0.0028631985187530518, 0.17015378177165985, 0.23587319254875183, 0.02475026249885559, 0.17568840086460114, -0.10891158878803253, 0.11241339147090912, -0.19458699226379395, -0.04780124872922897, 0.1275091916322708, 0.373946875333786, 0.19864171743392944, -0.01992424577474594, 0.2708972096443176, 0.19514092803001404, -0.4425991475582123, -0.2527163624763489, 0.04693944752216339, -0.3891976475715637, -0.20734483003616333, -0.06586717069149017, 0.18242639303207397, -0.0647566094994545, -0.06925606727600098, -0.14445140957832336, 0.33146610856056213, 0.17328289151191711, -0.020032934844493866, 0.1145518347620964, -0.06909752637147903, -0.17618539929389954, -0.10004477202892303, 0.4231719970703125, 0.1149945855140686, -0.13905677199363708, -0.31628063321113586, 0.03926863148808479, 0.09014423191547394, 0.2398766428232193, -0.013668257743120193, -0.006925657391548157, 0.16154995560646057, -0.004497487097978592, 0.21410994231700897, 0.530326247215271, -0.7963207960128784, -0.3819698095321655, 0.10407111048698425, 0.10231901705265045, 0.08385509252548218, 0.14739179611206055, -0.035271111875772476, 0.20893912017345428, 0.31899183988571167, 0.3188844919204712, 0.36219459772109985, 0.08659786731004715, -0.03893635421991348, -0.3946651816368103, -0.3349798023700714, 0.23951098322868347, 0.21263360977172852, 0.2790404260158539, -0.08854840695858002, 0.054143261164426804, 0.30256325006484985, 0.26032766699790955, -0.030880045145750046, -0.08162035793066025, 0.14831100404262543, 0.08815573155879974, -0.38451018929481506, 0.4469735622406006, -0.44909822940826416, -0.12497689574956894, 0.26207709312438965, -0.24678434431552887, 0.14305385947227478, 0.19012297689914703, -0.21158970892429352, -0.5357016921043396, -0.06854227185249329, -0.2574714422225952, -0.292927622795105, 0.1065358966588974, -0.10110102593898773, -0.0752999410033226, 0.10313169658184052, -0.22473958134651184, -0.4532231390476227, -0.01956912875175476, -0.24088548123836517, -0.11878138780593872, 0.1513802409172058, -0.17197902500629425, -0.004895344376564026, -0.09042907506227493, 0.5494769811630249, 0.3549342453479767, 0.10410301387310028, -0.18883207440376282, 0.15889713168144226, 0.1774716079235077, -0.1692018210887909, 0.07050368189811707, 0.005109749734401703, 0.1755654215812683, -0.48998528718948364, -0.21205854415893555, 0.35284680128097534, 0.07011362910270691, 0.08396562933921814, -0.34327447414398193, 0.49366748332977295, 0.49721160531044006, 0.21871918439865112, -0.06710998713970184, -0.009209226816892624, 0.06866006553173065, -0.07733821123838425, 0.17879995703697205, -0.6360124349594116, -0.11584021151065826, 0.002712210640311241, -0.3520045578479767, -0.06085296720266342, 0.3221627473831177, 0.007851187139749527, 0.5351020693778992, -0.3102358281612396, 0.21174584329128265, 0.16689682006835938, -0.23717492818832397, -0.2241245061159134, -0.060740359127521515, -0.3223336338996887, 0.26395097374916077, 0.1426147073507309, 0.09127718955278397, -0.18130625784397125, -0.12623539566993713, -0.18861714005470276, 0.22720161080360413, 0.08733043074607849, -0.20680855214595795, 0.33567672967910767, 0.14402468502521515, -0.0007149651646614075, -0.026139236986637115, 0.24972641468048096, -0.11087975651025772, 0.14134439826011658, -0.3804962635040283, 0.06163769215345383, -0.3431946039199829, 0.091471828520298, 0.03942505270242691, -0.04448577016592026, -0.058157846331596375, -0.239507257938385, 0.3174019753932953, -0.3953227698802948, 0.0009894222021102905, 0.38439100980758667, 0.03686732053756714, 0.20746159553527832, 0.18020814657211304, -0.21620504558086395, -0.10617735236883163, -0.4253188371658325, -0.5265461206436157, -0.013806991279125214, -0.05498863011598587, 0.2112901359796524, 0.13157181441783905, -0.200798898935318, -0.09603952616453171, -0.20328938961029053, -0.33118510246276855, 0.10668094456195831, 0.005158551037311554, 0.5423403382301331, 0.08162209391593933, 0.06436524540185928, -0.23058809340000153, -0.07863029837608337, 0.1916847974061966, -0.14610493183135986, -0.018807988613843918, 0.18672707676887512, -0.2653248608112335, 0.013072356581687927, -0.06597797572612762, -0.5332697629928589, -0.03577923774719238, -0.1628330647945404, -0.07364553213119507, 0.1272086799144745, 0.028871463611721992, 0.014616291970014572, 0.13940966129302979, 0.10030072927474976, 0.0106474868953228, 0.11864323914051056, -0.37579911947250366, 0.1430666744709015, 0.4438846707344055, -0.1163061186671257, -0.6027717590332031, -0.1899777054786682, -0.3372933268547058, 0.15618076920509338, -0.034950293600559235, -0.29979944229125977, -0.38387906551361084, -0.04220420867204666, 0.28292834758758545, 0.13741442561149597, 0.27888065576553345, 0.3808440566062927, -0.19911453127861023, -0.04133927822113037, -0.26700717210769653, 0.17263607680797577, 0.15676096081733704, -0.1671481877565384, 0.18759943544864655, -0.11221465468406677, 0.18939293920993805, -0.16150659322738647, 0.7556715607643127, 0.3029806911945343, -0.23276421427726746, 0.24845056235790253, -0.1737375557422638, 0.1601209193468094, -0.041581444442272186, 0.025339223444461823, 0.3213287889957428, 0.06859464198350906, 0.1566201001405716, 0.3667297959327698, 0.04195787385106087, -0.3852424621582031, -0.06662546098232269, 0.1649581640958786, -0.3789331018924713, -0.2051967978477478, -0.020063558593392372, 0.2579375207424164, 0.1608867347240448, 0.02400660514831543, 0.39175909757614136, -0.44681915640830994, -0.2155815064907074, 0.2543105483055115, 0.33715417981147766, -0.17323637008666992, -0.03429587557911873, 0.08918095380067825, -0.21204008162021637, -0.30835944414138794, 0.40165185928344727, 0.32759833335876465, 0.43532657623291016, -0.10750852525234222, 0.024959921836853027, 0.13235005736351013, 0.026771672070026398, 0.3477502167224884, -0.38117292523384094, 0.08894667029380798, 0.364040344953537, 0.2865222096443176, -0.5273367166519165, -0.16313979029655457, -0.32165080308914185, -0.34932175278663635, -0.1171485036611557, 0.6443755030632019, -0.42019763588905334, -0.2167714685201645, 0.18223387002944946, 0.10806390643119812, -0.2598586976528168, -0.13392344117164612, -0.45775797963142395, -0.40013739466667175, -0.029574327170848846, 0.1637541949748993, 0.12593001127243042, 0.6089532971382141, -0.19505617022514343, -0.08806759119033813, -0.5045982003211975, 0.14990022778511047, -0.2555246353149414, 0.2705609202384949, 0.31055259704589844, 0.15236182510852814, 0.020475417375564575, 0.08353196084499359, 0.15605883300304413, 0.028730230405926704, 0.04723019897937775, 0.21979567408561707, -0.0743231326341629, 0.27071937918663025, 0.032430507242679596, -0.1292944848537445, 0.1766873598098755, -0.3299225866794586, 0.0465921089053154, 0.13722798228263855, 0.35324934124946594, -0.38751256465911865, 0.037554509937763214, 0.4753808379173279, 0.003957938402891159, -0.21726951003074646, -0.19400301575660706, 0.8071783185005188, 0.07335126399993896, -0.07286498695611954, 0.15014708042144775, 0.3299150764942169, -0.15949369966983795, 0.4889228940010071, 0.5268920063972473, 0.7543565034866333, 0.0040694791823625565, 0.025908660143613815, 0.4947259724140167, 0.0888633131980896, 0.35636720061302185, -0.4767024517059326, 0.2482067197561264, -0.2657148241996765, -0.16924487054347992, -0.042521487921476364, 0.02877875417470932, -0.012996498495340347, -0.038770951330661774, -0.34535712003707886, 0.16665083169937134, -0.04913085699081421, -0.0010448875837028027, 0.06921075284481049, 0.21545623242855072, -0.02816927619278431, -0.1255878210067749, -0.16539305448532104, 0.016713786870241165, 0.13181021809577942, 0.12081355601549149, 0.03208703547716141, -0.05945616215467453, -0.2082023173570633, -0.3268352746963501, -0.31699228286743164, -0.10628943890333176, -0.009776834398508072, 0.22355613112449646, 0.09122641384601593, -0.23116546869277954, 0.02499939501285553, 0.2835477292537689, 0.2906751334667206, -0.028806431218981743, -0.5874632000923157, 0.46530282497406006, -0.4874243140220642, 0.18235377967357635, 0.022325776517391205, -0.1253894716501236, 0.2450558841228485, -0.11260425299406052, -0.3584791421890259, 0.040102578699588776, -0.01544811949133873, 0.03608463704586029, -0.08336099982261658, -0.050165560096502304, -0.24105463922023773, -0.1805286407470703, 0.12163349241018295, -0.2518969178199768, 0.17754998803138733, -0.2014111876487732, 0.1027233824133873, -0.158596009016037, -0.20169900357723236, 0.2623477280139923, 0.12140439450740814, -0.273826539516449, 0.08552402257919312, 0.6880028247833252, 0.2266675978899002, -0.40132778882980347, 0.3392312526702881, -0.0740518718957901, -0.21095603704452515, -0.20992818474769592, -0.12838783860206604, 0.4196529686450958, -0.2005559504032135, 0.04786323383450508, 0.14382804930210114, -0.21717709302902222, 0.009051263332366943, 0.4494774043560028, 0.1269841492176056, -0.07994484156370163, -0.2821950912475586, -0.24881204962730408, -0.19518721103668213, 0.20374751091003418, -0.10594233870506287, 0.24159935116767883, -0.17117488384246826, -0.03269995376467705, -0.03652619943022728, 0.17692025005817413, -0.2305728793144226, -0.034799039363861084, -0.5351478457450867, 0.1775321215391159, -0.3105655908584595, -0.15886621177196503, 0.14510518312454224, 0.09188129007816315, 0.03395804017782211, -0.15948089957237244, -0.1297023892402649, -0.19534505903720856, -0.21739238500595093, 0.19098280370235443, 0.12355726212263107, -0.013979615643620491, -0.04384264349937439, 0.04200465977191925, -0.25134027004241943, -0.2898198366165161, 0.22906477749347687, -0.07495837658643723, -0.21265153586864471, 0.27005088329315186, 0.013273268938064575, 0.24299529194831848, -0.10100118815898895, -0.07002371549606323, 0.1757921278476715, 0.4275139272212982, 0.01390063762664795, 0.00333075737580657, 0.03268316388130188, 0.10225974023342133, -0.1402449607849121, 0.08724655210971832, 0.21841758489608765, 0.01746537536382675, 0.2843278646469116, -0.1987106204032898, -0.23059937357902527, 0.18798620998859406, 0.16020730137825012, 0.1070251315832138, -0.20773771405220032, -0.1036570742726326, -0.0892912745475769, 0.10776053369045258, -0.149265319108963, -0.08481161296367645, 0.3550737500190735, 0.029911883175373077, 0.05600651353597641, 0.07062648236751556, 0.15304771065711975, -0.0699116513133049, -0.08167718350887299, -0.010544754564762115, 0.023319486528635025, -0.08081647753715515, 0.18102477490901947, 0.4042758345603943, 0.19509008526802063, 0.15047746896743774, -0.0714266374707222, -0.1528446078300476, 0.24661904573440552, 0.3342994153499603, -0.14973829686641693, 0.6204262971878052, -0.20885063707828522, 0.17186586558818817, -0.07492774724960327, -0.04977396875619888, 0.36163145303726196, -0.22380585968494415, -0.04892093688249588, 0.040604859590530396, -0.0881054550409317, 0.16202634572982788, -0.1130116805434227, -0.048309341073036194, -0.4860081970691681, -0.1284455806016922, -0.13851985335350037, -0.287920206785202, -0.1082630455493927, -0.023952506482601166, -0.20036840438842773, -0.1449144184589386, 0.13264581561088562, 0.12900567054748535, -0.19142593443393707, 0.06148428097367287, -0.27196204662323, 0.047143757343292236, -0.008832527324557304, 0.3554242253303528, 0.5550036430358887, -0.010190069675445557, 0.18988262116909027, 0.37547633051872253, 0.02573137730360031, -0.01403956487774849, 0.34489306807518005, 0.17167890071868896, 0.2499094307422638, -0.3992231786251068, -0.04275752976536751, 0.4151097536087036, -0.13599860668182373, 0.02231963723897934, 0.2705293893814087, 0.1347285360097885, -0.046369172632694244, 0.11902544647455215, 0.1065935343503952, -0.17237208783626556, -0.1236778050661087, -0.11152343451976776, 0.266384482383728, -0.12252695858478546, 0.1391526162624359, -0.4007030427455902, 0.09779195487499237, -0.016217026859521866, -0.023076742887496948, -0.35879063606262207, 0.3732084035873413, 0.10808256268501282, 0.33301734924316406, 0.32581332325935364, -0.16194820404052734, 0.050240397453308105, -0.07631346583366394, 0.5051534175872803, 0.027082039043307304, 0.17093782126903534, -0.34731289744377136, 0.11947977542877197, -0.4343653917312622, 0.351284921169281, 0.14222578704357147, -0.14711548388004303, 0.404725581407547, 0.1730346530675888, -0.3356096148490906, 0.13240492343902588, 0.11003220081329346, 0.22781500220298767, 0.448452889919281, 0.46703678369522095, -0.2754208743572235, -0.27726227045059204, -0.12302292883396149, -0.1665825992822647, -0.09395803511142731, -0.33834290504455566, 0.0783194750547409, -0.1796264499425888, -0.047783806920051575, -0.040222663432359695, -0.12410350143909454, 0.09840131551027298, 0.2750330865383148, 0.2324194312095642, 0.29732662439346313, 0.46878737211227417, -0.21464481949806213, 0.16356593370437622, -0.18925026059150696, -0.10736677050590515, -0.032661158591508865, -0.03795319423079491, -0.2876109480857849, 0.1999247670173645, -0.08265139907598495, -0.2079460173845291, -0.10995692014694214, 0.1716710329055786, 0.16537679731845856, -0.05610718950629234, -0.176441490650177, 0.030883513391017914, -0.22960737347602844, -0.06670860946178436, 0.19110286235809326, 0.10321348905563354, 0.011771230958402157, 0.2576737403869629, 0.10850927233695984, -0.43216943740844727, 0.4834272861480713, -0.6419909596443176, -0.2284313291311264, -0.22336064279079437, 0.23645693063735962, 0.2204904854297638, 0.1384013444185257, -0.5475014448165894, 0.013679936528205872, 0.44653409719467163, 0.19552132487297058, -0.20056265592575073, -0.08841042220592499, -0.0015550516545772552, 0.048635244369506836, -0.21299666166305542, -0.002783864736557007, 0.08010442554950714, 0.13539716601371765, -0.15412425994873047, -0.2767115831375122 ]
https://github.com/huggingface/datasets/issues/6010
Yes, feel free to work on this. You can check the PyArrow Table `__repr__` and Polars DataFrame `__repr__`/`_repr_html_` implementations for some pointers/ideas.
Improve `Dataset`'s string representation
Currently, `Dataset.__repr__` outputs a dataset's column names and the number of rows. We could improve it by printing its features and the first few rows. We should also implement `_repr_html_` to have a rich HTML representation in notebooks/Streamlit.
22
Improve `Dataset`'s string representation Currently, `Dataset.__repr__` outputs a dataset's column names and the number of rows. We could improve it by printing its features and the first few rows. We should also implement `_repr_html_` to have a rich HTML representation in notebooks/Streamlit. Yes, feel free to work on this. You can check the PyArrow Table `__repr__` and Polars DataFrame `__repr__`/`_repr_html_` implementations for some pointers/ideas.
[ -0.2611526548862457, -0.06325697153806686, -0.13544954359531403, 0.1877852976322174, 0.4518061876296997, 0.06964315474033356, 0.07831280678510666, 0.4281670153141022, -0.2540845572948456, 0.060619812458753586, -0.21277019381523132, 0.42051470279693604, 0.17750614881515503, 0.2843800485134125, 0.1298353672027588, -0.3189602494239807, 0.06471820175647736, 0.403964638710022, 0.015249844640493393, -0.08866938948631287, -0.13798129558563232, -0.03254981338977814, 0.02683883160352707, 0.25116482377052307, -0.108782559633255, -0.09075537323951721, -0.2022845596075058, 0.0345318466424942, -0.25253984332084656, -0.32612261176109314, -0.16928362846374512, 0.13970279693603516, 0.2811741530895233, 0.10994531959295273, -0.00010154438496101648, -0.1594175100326538, 0.26106059551239014, 0.15848669409751892, -0.28999993205070496, 0.12118601053953171, 0.1820661872625351, -0.2291194498538971, 0.2470659464597702, -0.34555166959762573, 0.04917073994874954, -0.545755922794342, 0.0073977988213300705, 0.10693694651126862, 0.2214808613061905, 0.15030398964881897, 0.32153481245040894, 0.35835516452789307, -0.2558753192424774, 0.14641247689723969, 0.6256158351898193, 0.35240110754966736, -0.24072031676769257, 0.07478919625282288, 0.4151258170604706, -0.16500672698020935, -0.3502742648124695, 0.33577290177345276, -0.1315784603357315, 0.03197939693927765, 0.020719079300761223, 0.27223414182662964, -0.03633853793144226, -0.06292332708835602, 0.05070270970463753, 0.35215237736701965, 0.445333868265152, -0.4515377879142761, -0.06942857801914215, 0.015539586544036865, 0.05845436826348305, -0.2686800956726074, -0.01570729911327362, 0.22731143236160278, -0.09700170159339905, 0.36924850940704346, -0.11252963542938232, -0.11753030866384506, -0.31500059366226196, 0.09690370410680771, -0.02079087495803833, 0.24770550429821014, 0.059887081384658813, 0.011389994993805885, -0.07387633621692657, -0.011558853089809418, 0.3842674195766449, -0.03967307507991791, -0.031696468591690063, -0.08465468883514404, -0.116485595703125, 0.09188444912433624, 0.018474677577614784, -0.05260204151272774, 0.11300583183765411, 0.07518023252487183, 0.32619500160217285, 0.2300901859998703, 0.18333886563777924, 0.17579825222492218, 0.03122849389910698, -0.0837542712688446, -0.020806066691875458, 0.35749614238739014, 0.44571980834007263, 0.008596714586019516, 0.1320887804031372, -0.24670365452766418, -0.15114831924438477, 0.2363278567790985, 0.20319917798042297, -0.1668720692396164, 0.05634089559316635, -0.11702308058738708, -0.20441287755966187, 0.23137745261192322, -0.21056202054023743, -0.0797581896185875, 0.04283752292394638, 0.5208721160888672, -0.212982177734375, 0.16849827766418457, 0.13857071101665497, -0.11909124255180359, 0.045270808041095734, -0.35570988059043884, -0.1822950839996338, 0.011676069349050522, -0.2872608006000519, 0.0007021520286798477, -0.07752987742424011, -0.1597316861152649, -0.05841364711523056, -0.008182018995285034, 0.3062325716018677, 0.18965205550193787, 0.07498130947351456, -0.10388469696044922, 0.20982536673545837, 0.2375352382659912, -0.1866900771856308, 0.04298550635576248, -0.1052747592329979, -0.025534622371196747, -0.09528614580631256, 0.1636580228805542, 0.12657923996448517, -0.1592181921005249, -0.3220946490764618, 0.27726709842681885, -0.0755232572555542, 0.05985843762755394, -0.09699434041976929, 0.25186988711357117, -0.051443930715322495, -0.005737856030464172, 0.02106180414557457, -0.000892365351319313, 0.10036882758140564, -0.294298380613327, 0.287920743227005, 0.12789477407932281, -0.4116426110267639, 0.027858026325702667, 0.11812292039394379, -0.13408802449703217, 0.5801008939743042, 0.23004032671451569, -0.07921687513589859, 0.11853868514299393, 0.03789013624191284, 0.14731645584106445, 0.4025355577468872, -0.052556898444890976, -0.3687595725059509, 0.4460527300834656, 0.1598394513130188, -0.0498611181974411, 0.12730272114276886, 0.24026140570640564, 0.3275480270385742, 0.17315272986888885, 0.012116314843297005, 0.35338184237480164, -0.06683281809091568, 0.147242933511734, -0.32247427105903625, -0.0893888995051384, 0.21636448800563812, 0.4473769962787628, 0.018741223961114883, -0.05392933636903763, 0.006284140050411224, -0.16397985816001892, 0.441488116979599, -0.3484269380569458, 0.10701014846563339, -0.09739115834236145, 0.3925166130065918, 0.07926391810178757, -0.01826392114162445, -0.30636051297187805, -0.18089249730110168, -0.03218492120504379, 0.04571538418531418, 0.21682988107204437, -0.19711759686470032, -0.3773024082183838, -0.039650365710258484, 0.17562422156333923, -0.03972643241286278, 0.02791094407439232, 0.29645881056785583, 0.12394333630800247, -0.07172465324401855, -0.03661126643419266, -0.12377740442752838, 0.3592711091041565, -0.43942204117774963, -0.027905814349651337, -0.002641908824443817, 0.40660160779953003, -0.010113168507814407, -0.06564787775278091, 0.1902233213186264, 0.12349964678287506, 0.028999025002121925, 0.07749123871326447, 0.10286962985992432, 0.38351970911026, -0.07465585321187973, -0.15990996360778809, 0.04614979028701782, 0.068221315741539, 0.17840929329395294, -0.23481225967407227, 0.002028094604611397, 0.046810802072286606, 0.019009828567504883, 0.07390666007995605, -0.08825433254241943, 0.16090458631515503, -0.05058678612112999, 0.03042551316320896, -0.05887436121702194, 0.08168880641460419, 0.15469631552696228, 0.11368731409311295, -0.10151505470275879, -0.12591421604156494, 0.08264575898647308, 0.24787798523902893, 0.11176875233650208, -0.012733443640172482, -0.7459777593612671, 0.15886378288269043, 0.3759649097919464, -0.23822593688964844, 0.0837792232632637, 0.1964520961046219, -0.1965954601764679, -0.0838506892323494, 0.23421712219715118, 0.2337873876094818, 0.07809405028820038, 0.4482286274433136, -0.003904428333044052, -0.040487952530384064, -0.2681396007537842, -0.11850963532924652, 0.09484007209539413, 0.14566372334957123, -0.04434027150273323, -0.016292419284582138, 0.27984264492988586, -0.11923621594905853, -0.3133808374404907, -0.1502932906150818, -0.08502263575792313, 0.36264950037002563, -0.13755609095096588, 0.08106156438589096, -0.22002896666526794, -0.39874210953712463, 0.06917931139469147, -0.16492053866386414, -0.03408090025186539, -0.3332469165325165, 0.21005786955356598, -0.10947772115468979, -0.1782635599374771, 0.3064870834350586, 0.19811320304870605, 0.22250667214393616, 0.04708770662546158, 0.03211219608783722, -0.43774595856666565, -0.249058797955513, -0.28497469425201416, 0.2122848629951477, 0.08763158321380615, 0.23516514897346497, 0.35064828395843506, -0.29554516077041626, 0.24683094024658203, -0.5815830826759338, -0.332599401473999, 0.2613093852996826, -0.10660552978515625, 0.31540846824645996, 0.21866552531719208, 0.19618652760982513, -0.15590088069438934, 0.04832657426595688, 0.28800877928733826, -0.10441289097070694, -0.09109978377819061, 0.23756282031536102, -0.053448863327503204, -0.14503583312034607, -0.07500720024108887, -0.20885318517684937, -0.2653675377368927, -0.40995338559150696, 0.165296271443367, -0.0685664564371109, 0.258784681558609, -0.3091786801815033, 0.09149616956710815, -0.04318102076649666, -0.08347705006599426, 0.06264479458332062, -0.2193993180990219, -0.15839235484600067, 0.488689124584198, -0.13603956997394562, -0.42027249932289124, -0.15828754007816315, 0.11540649831295013, -0.15222790837287903, 0.16961848735809326, -0.37540000677108765, -0.12253879010677338, -0.2336585372686386, 0.1464533656835556, -0.010942691005766392, 0.21159735321998596, -0.032190509140491486, 0.20837701857089996, -0.23398464918136597, 0.06753334403038025, -0.022335290908813477, -0.015832889825105667, -0.05289807170629501, 0.08623463660478592, -0.05241008102893829, 0.21221709251403809, -0.07014384865760803, 0.12099970877170563, -0.04218443110585213, -0.20756493508815765, 0.22611352801322937, -0.23228314518928528, 0.3141040802001953, 0.09716823697090149, -0.14777493476867676, -0.058040693402290344, -0.1358068436384201, 0.022807009518146515, 0.29183897376060486, -0.05214102938771248, -0.17451827228069305, -0.006194449961185455, -0.17906908690929413, -0.19874966144561768, -0.09142488241195679, 0.34437987208366394, 0.18114745616912842, 0.3264121115207672, -0.13619038462638855, 0.028486832976341248, 0.013995539397001266, -0.17740613222122192, 0.08899138122797012, 0.03319074586033821, -0.07041624188423157, -0.03381732106208801, -0.16689735651016235, -0.14726492762565613, -0.39510729908943176, 0.2853049635887146, 0.20620015263557434, 0.045508358627557755, -0.04178640618920326, -0.2701351046562195, 0.10156084597110748, -0.02125653065741062, 0.299058198928833, -0.20423324406147003, -0.3846379816532135, 0.11504403501749039, -0.14875906705856323, -0.1521286815404892, 0.09729595482349396, -0.472290575504303, 0.03267106041312218, -0.09923219680786133, 0.2648090124130249, -0.2501286268234253, -0.17652572691440582, 0.3519591689109802, 0.20513460040092468, -0.34724825620651245, -0.19392357766628265, -0.2687157988548279, -0.0022265538573265076, -0.024781763553619385, 0.006709270179271698, -0.0006115511059761047, -0.03552026301622391, 0.03041357547044754, -0.15612024068832397, -0.05316917225718498, 0.02666623890399933, 0.1855427324771881, 0.6372539401054382, 0.2377781718969345, -0.4532111883163452, 0.011194147169589996, -0.011973340064287186, 0.12165183573961258, 0.5663913488388062, 0.22313466668128967, -0.33123162388801575, -0.20724685490131378, 0.04645105078816414, -0.3022618591785431, 0.484743595123291, 0.016739413142204285, -0.060809023678302765, 0.15624243021011353, -0.03177544102072716, 0.19605225324630737, -0.24598684906959534, -0.02557002566754818, 0.2311021238565445, 0.13678289949893951, -0.15697011351585388, -0.5079060792922974, 0.32724082469940186, -0.06615925580263138, -0.2127320021390915, 0.07961954921483994, 0.18869738280773163, -0.05895087495446205, 0.326895534992218, 0.33161661028862, 1.0911141633987427, -0.3330954909324646, 0.17859619855880737, 0.09968307614326477, -0.5094998478889465, 0.2958254814147949, -0.38686347007751465, -0.019021255895495415, -0.48592740297317505, -0.15715235471725464, -0.07101428508758545, 0.06393055617809296, 0.20063382387161255, -0.14252984523773193, -0.3925603926181793, 0.11579399555921555, 0.10348734259605408, 0.09268170595169067, 0.20498758554458618, 0.2743251919746399, 0.11601483076810837, -0.2753976285457611, -0.5050892233848572, 0.2086302638053894, -0.3551464080810547, -0.5389158725738525, -0.01134323701262474, -0.14279237389564514, -0.03642097860574722, 0.02263263612985611, -0.1261214017868042, -0.06905214488506317, -0.15382862091064453, -0.12541979551315308, 0.04314783960580826, -0.254208505153656, -0.053480103611946106, 0.0761808529496193, -0.03945993259549141, 0.15612508356571198, -0.03485153242945671, 0.0674097090959549, -0.09345575422048569, 0.11505790054798126, -0.04566133767366409, 0.014227382838726044, 0.22377853095531464, 0.025921255350112915, -0.3922572135925293, 0.202799454331398, 0.2738795578479767, -0.052020709961652756, -0.14126405119895935, 0.0015666093677282333, 0.37777942419052124, -0.35507193207740784, 0.247981995344162, -0.1720389723777771, -0.17754781246185303, -0.32207995653152466, 0.23672300577163696, 0.0019973833113908768, -0.13866043090820312, 0.08512832224369049, 0.3326931595802307, -0.05637083202600479, -0.2642521858215332, 0.021390311419963837, 0.15312665700912476, 0.1791338473558426, -0.1264071762561798, 0.3089219331741333, -0.33244219422340393, -0.34662213921546936, 0.1613413244485855, 0.2485726773738861, -0.30991679430007935, 0.04053130000829697, -0.2207120805978775, -0.23289448022842407, -0.14570803940296173, 0.2620837390422821, 0.2528945803642273, -0.2139432728290558, -0.2692691683769226, -0.08360432088375092, -0.5212860107421875, 0.3030802309513092, 0.27202069759368896, 0.14513084292411804, 0.04582768678665161, -0.04533657431602478, -0.11261597275733948, 0.21045081317424774, -0.475884348154068, -0.21932776272296906, -0.19292381405830383, 0.1006104126572609, -0.049378130584955215, -0.006771329790353775, 0.25990450382232666, -0.16566291451454163, 0.23113998770713806, 0.23171952366828918, -0.008268937468528748, -0.3556133508682251, -0.18696433305740356, 0.04331950843334198, -0.06338903307914734, 0.044746287167072296, -0.024166371673345566, 0.0406462699174881, -0.09092015027999878, -0.34981390833854675, 0.1478659063577652, 0.07421109825372696, -0.07347865402698517, 0.38029518723487854, 0.2998431324958801, -0.30953481793403625, -0.14716844260692596, -0.13238301873207092, -0.1773633509874344, 0.1699148267507553, 0.11909203231334686, -0.025427427142858505, 0.07894794642925262, -0.20103825628757477, 0.2115907073020935, 0.10265472531318665, 0.2114744484424591, 0.026405800133943558, 0.32626643776893616, 0.040506988763809204, -0.07650968432426453, -0.06400959193706512, 0.5510309934616089, 0.14407971501350403, 0.03648807480931282, -0.146058589220047, 0.30468830466270447, 0.3513537049293518, -0.45354560017585754, -0.2595737874507904, 0.011639557778835297, -0.20984449982643127, 0.17956367135047913, 0.2960972785949707, -0.008697323501110077, 0.01882047951221466, -0.032578010112047195, -0.04328382760286331, 0.34973058104515076, -0.2077309787273407, -0.3735050559043884, 0.2640432119369507, 0.1136806309223175, 0.13271987438201904, 0.32710668444633484, 0.3234957456588745, 0.05132079869508743, 0.46760228276252747, 0.009272919967770576, 0.006770230829715729, 0.10214546322822571, 0.23686254024505615, 0.05377541482448578, 0.17736001312732697, 0.06727011501789093, 0.1522183120250702, 0.013270772993564606, 0.16459764540195465, 0.217630073428154, 0.4743981659412384, 0.46884408593177795, -0.03958635777235031, -0.07561007887125015, 0.1868312656879425, -0.07987871766090393, -0.04566001519560814, -0.1881580650806427, -0.11061586439609528, -0.28745123744010925, -0.057437069714069366, 0.07164469361305237, -0.12503428757190704, 0.4711144268512726, 0.07416917383670807, 0.28595057129859924, -0.2948342263698578, -0.04395855590701103, 0.05401904881000519, 0.18221889436244965, -0.2480742633342743, -0.09860024601221085, 0.2674647271633148, 0.09486138075590134, 0.040817372500896454, 0.24527791142463684, 0.2607867121696472, 0.11451379954814911, -0.1328735053539276, 0.09910204261541367, -0.2634982466697693, -0.12817096710205078, -0.07325737923383713, 0.14039164781570435, 0.35489320755004883, 0.2617330551147461, 0.07139580696821213, 0.23851484060287476, -0.27350592613220215, 0.10726238787174225, 0.0025517791509628296, 0.056990232318639755, 0.03806043043732643, 0.15065568685531616, 0.19683218002319336, -0.5286505222320557, -0.19672206044197083, -0.3790050446987152, -0.5372138023376465, 0.27280452847480774, 0.3679444193840027, -0.0012102462351322174, -0.018751420080661774, -0.04393255338072777, 0.15594302117824554, 0.09617504477500916, 0.5469948053359985, 0.30661991238594055, 0.16920331120491028, -0.21445295214653015, -0.24738889932632446, -0.566681444644928, 0.1552744209766388, -0.2993222177028656, -0.40702325105667114, 0.22744128108024597, 0.10371877998113632, 0.2630350887775421, 0.06442102044820786, 0.2498810887336731, -0.08671750128269196, -0.41375723481178284, 0.05158302187919617, -0.46674954891204834, -0.1687391698360443, 0.06967216730117798, 0.09054422378540039, -0.09110262989997864, -0.10267084091901779, 0.1942668855190277, 0.11237494647502899, 0.24862892925739288, -0.3069781959056854, -0.018242105841636658, -0.02704053372144699, 0.12383665144443512, 0.23744016885757446, 0.05430011451244354, 0.05819210782647133, -0.31523454189300537, -0.06916813552379608, 0.2433958351612091, -0.15141957998275757, 0.11552609503269196, 0.3105532228946686, 0.09796012938022614, 0.2632319927215576, -0.04646766558289528, -0.4125639796257019, -0.30819171667099, 0.05759245157241821, 0.11148442327976227, -0.11550703644752502, -0.2992333173751831, 0.29750630259513855, 0.18288472294807434, -0.11767042428255081, -0.26110389828681946, 0.24429096281528473, 0.06133589521050453, -0.19711031019687653, -0.3108685612678528, -0.3686724603176117, 0.4142916798591614, -0.5133085250854492, -0.3810001015663147, 0.23977257311344147, -0.01806577295064926, 0.46961233019828796, 0.1887974590063095, -0.6306344866752625, -0.0325741246342659, 0.16671222448349, -0.10998731851577759, -0.367209792137146, 0.3264695405960083, 0.0014550276100635529, 0.1661655455827713, -0.1324465572834015, 0.05024102330207825, 0.051264435052871704, -0.28999388217926025, -0.26039057970046997, -0.4345032274723053 ]
https://github.com/huggingface/datasets/issues/6010
@mariosasko are there any other similar issues that I could work on? I see this has been already solved.
Improve `Dataset`'s string representation
Currently, `Dataset.__repr__` outputs a dataset's column names and the number of rows. We could improve it by printing its features and the first few rows. We should also implement `_repr_html_` to have a rich HTML representation in notebooks/Streamlit.
19
Improve `Dataset`'s string representation Currently, `Dataset.__repr__` outputs a dataset's column names and the number of rows. We could improve it by printing its features and the first few rows. We should also implement `_repr_html_` to have a rich HTML representation in notebooks/Streamlit. @mariosasko are there any other similar issues that I could work on? I see this has been already solved.
[ -0.24637530744075775, -0.09395340830087662, -0.15906363725662231, 0.2803180515766144, 0.4878694415092468, 0.09331372380256653, 0.08115609735250473, 0.46818283200263977, -0.2016535997390747, 0.05637377128005028, 0.03029661625623703, 0.2372809499502182, 0.06472807377576828, 0.32773149013519287, 0.1807263344526291, -0.30503976345062256, 0.17368677258491516, 0.22153311967849731, 0.00020510144531726837, -0.19426582753658295, -0.11831912398338318, 0.10095342993736267, -0.02963973581790924, 0.12251807749271393, -0.08139541745185852, -0.11518076807260513, -0.029217440634965897, 0.00819073710590601, -0.20730143785476685, -0.2394399344921112, -0.3045264184474945, 0.03802742809057236, 0.24221239984035492, -0.06608308851718903, -0.00010934031888609752, -0.19680647552013397, 0.2860354483127594, 0.12401679158210754, -0.41642317175865173, 0.09944841265678406, -0.12008146196603775, -0.38661307096481323, 0.19639644026756287, -0.1456788331270218, 0.1238202452659607, -0.2227441370487213, -0.060109786689281464, -0.2936449646949768, 0.19933776557445526, 0.2250736504793167, 0.24401621520519257, 0.17633508145809174, -0.3507179319858551, 0.07592225074768066, 0.4502173960208893, 0.6551045775413513, -0.28684860467910767, -0.03243229538202286, 0.5934624075889587, 0.02714826911687851, -0.11725428700447083, 0.3100275695323944, -0.2774869501590729, 0.06566384434700012, 0.08487186580896378, 0.2606086730957031, -0.23120011389255524, -0.010012088343501091, 0.3024527430534363, 0.1965056210756302, 0.7088379263877869, -0.16576999425888062, -0.14227092266082764, -0.05996091291308403, 0.08710235357284546, -0.21421918272972107, 0.07205958664417267, 0.1795489490032196, -0.04166813939809799, 0.4426715075969696, -0.4044673442840576, -0.35493844747543335, -0.28776484727859497, 0.02906239591538906, 0.08139342069625854, 0.007307574152946472, -0.08271501958370209, -0.09122169017791748, -0.13126638531684875, 0.0263909250497818, 0.32112205028533936, -0.09284265339374542, -0.11427724361419678, -0.11149737983942032, -0.18901194632053375, 0.2006571888923645, -0.13114716112613678, -0.018218226730823517, 0.11568485200405121, 0.11943645030260086, 0.5118370652198792, 0.39000403881073, 0.12333418428897858, 0.05047128349542618, -0.0005817469209432602, 0.09221267700195312, 0.20716236531734467, 0.49743491411209106, 0.40614259243011475, -0.0246240496635437, 0.008374422788619995, -0.2341645061969757, -0.26485714316368103, 0.44076448678970337, 0.21918267011642456, 0.016100145876407623, 0.09135414659976959, -0.22600114345550537, -0.1645953357219696, 0.39887356758117676, -0.2596547603607178, -0.21461421251296997, 0.08441026508808136, 0.3673417568206787, -0.22223928570747375, 0.3437631130218506, 0.1732815057039261, -0.1426672637462616, 0.18172088265419006, -0.7180556058883667, -0.10558651387691498, -0.18316812813282013, -0.28142765164375305, 0.06236913800239563, -0.07251544296741486, -0.0660744309425354, -0.09622204303741455, -0.12123996019363403, 0.18143132328987122, 0.03664952516555786, 0.1243363469839096, -0.14046379923820496, 0.10973121225833893, 0.0658574104309082, -0.28290966153144836, 0.18920138478279114, -0.042826395481824875, -0.010701090097427368, -0.07610426098108292, 0.08688215911388397, -0.11745709180831909, -0.22340625524520874, -0.2775346040725708, 0.2301977127790451, 0.013273008167743683, 0.05585622414946556, -0.3539874851703644, 0.19792786240577698, -0.0512622594833374, 0.09527619183063507, -0.05544247105717659, -0.04989060387015343, 0.06075192987918854, -0.2971792221069336, 0.3592742085456848, 0.05968046933412552, -0.5064218044281006, 0.09409305453300476, -0.06398271769285202, -0.08476246893405914, 0.5918560028076172, 0.17899683117866516, 0.0876544639468193, 0.25520992279052734, 0.020560510456562042, 0.057621151208877563, 0.542839765548706, -0.14380164444446564, -0.32246893644332886, 0.4955480098724365, 0.2492242008447647, 0.033895187079906464, 0.043041910976171494, 0.16586555540561676, 0.36191004514694214, 0.2616439461708069, -0.05049734190106392, 0.46152639389038086, -0.037156473845243454, 0.03997722268104553, -0.30399811267852783, 0.04714873433113098, 0.00800190307199955, 0.38618004322052, 0.052409276366233826, 0.03031141683459282, 0.003391522914171219, -0.15604814887046814, 0.348203182220459, -0.28927287459373474, 0.2332296222448349, -0.13777819275856018, 0.38684675097465515, 0.1822272539138794, -0.10518214106559753, -0.2502957582473755, -0.2994920611381531, -0.03829262778162956, 0.19568279385566711, -0.0830356627702713, 0.0469474270939827, -0.28645724058151245, -0.022047843784093857, 0.26604941487312317, 0.028715025633573532, 0.13746178150177002, 0.1496100127696991, 0.2842482924461365, -0.2246919572353363, 0.026223011314868927, -0.16298572719097137, 0.4765302538871765, -0.450911283493042, -0.08413664251565933, -0.029152262955904007, 0.28953608870506287, 0.16259028017520905, -0.08865997940301895, 0.034536778926849365, 0.13906219601631165, -0.04279324412345886, 0.12440255284309387, -0.01908697932958603, 0.32972055673599243, 0.053533799946308136, -0.12033791840076447, 0.020347556099295616, -0.027040734887123108, 0.2829868495464325, -0.10200541466474533, 0.14393974840641022, 0.18357627093791962, -0.09826341271400452, -0.0031243786215782166, -0.24511873722076416, 0.004491753876209259, -0.14113472402095795, 0.14305803179740906, -0.0336490198969841, 0.14851024746894836, 0.10150217264890671, 0.19592943787574768, -0.024203013628721237, -0.23462486267089844, 0.15741556882858276, 0.10845305025577545, 0.316675066947937, -0.03960507735610008, -0.7575672268867493, 0.18111562728881836, 0.326140820980072, -0.2842024564743042, 0.03002272918820381, 0.32129615545272827, -0.12329234182834625, -0.05101637542247772, 0.26443836092948914, 0.3626452088356018, 0.02835250273346901, 0.3019617199897766, 0.17247453331947327, 0.005332641303539276, 0.046265266835689545, -0.07396609336137772, 0.1284271776676178, -0.03172009438276291, 0.01344330981373787, 0.04228022322058678, 0.13336047530174255, -0.15698914229869843, -0.12955012917518616, -0.14232032001018524, -0.10153666883707047, 0.36119207739830017, -0.19426903128623962, -0.147657573223114, -0.4629860818386078, -0.42596620321273804, -0.08498495817184448, -0.09204643964767456, -0.0460832342505455, -0.3252216875553131, 0.12288563698530197, -0.11276257038116455, -0.09751329571008682, 0.14269089698791504, -0.01556212455034256, 0.3208293616771698, -0.029723752290010452, 0.21433748304843903, -0.38618314266204834, -0.10197216272354126, -0.4257553815841675, 0.09298720955848694, 0.25165846943855286, 0.22413022816181183, 0.38065263628959656, -0.35596638917922974, 0.18771231174468994, -0.558813750743866, -0.09612014889717102, 0.30056557059288025, -0.013984248042106628, 0.29735079407691956, 0.2555403709411621, 0.03041599504649639, -0.17553210258483887, 0.022999271750450134, 0.2965502440929413, 0.019815951585769653, -0.09442830085754395, 0.15420013666152954, 0.15419185161590576, -0.25746649503707886, 0.04380571097135544, -0.17606177926063538, -0.2410048395395279, -0.39922046661376953, 0.20769494771957397, -0.26155489683151245, 0.23021923005580902, -0.2766789197921753, -0.08780205249786377, 0.008661530911922455, 0.037637777626514435, 0.18377479910850525, -0.17595291137695312, -0.3829742968082428, 0.5001042485237122, -0.08451353758573532, -0.3486019968986511, -0.09992985427379608, 0.27632656693458557, -0.2894192039966583, 0.3351171016693115, -0.45090919733047485, -0.059494875371456146, -0.12321388721466064, -0.05257817730307579, 0.007308575324714184, 0.059286028146743774, -0.09958870708942413, 0.20476359128952026, -0.1725165843963623, 0.030367083847522736, -0.19019046425819397, -0.0067556872963905334, -0.058720607310533524, 0.18160396814346313, 0.11135804653167725, 0.3729374408721924, -0.13138306140899658, 0.003409160301089287, 0.10323722660541534, 0.020750464871525764, 0.12349381297826767, -0.055402375757694244, 0.20730148255825043, 0.04315418004989624, -0.26865410804748535, -0.016234956681728363, -0.1545974761247635, -0.18113568425178528, 0.36332789063453674, 0.03154987096786499, -0.016986191272735596, -0.004629284143447876, -0.1938166320323944, -0.200376957654953, -0.1158633753657341, 0.3712867200374603, -0.1692200005054474, 0.4385777413845062, -0.23924216628074646, 0.1677141934633255, 0.1457822322845459, -0.11238419264554977, 0.19233423471450806, -0.10475247353315353, -0.01945999264717102, -0.044185902923345566, -0.4196474552154541, -0.15304234623908997, -0.22534304857254028, 0.4484921991825104, 0.24054844677448273, 0.36879318952560425, -0.1883416473865509, -0.28950709104537964, 0.028178919106721878, 0.12036106735467911, 0.287828654050827, -0.5260471701622009, -0.30110499262809753, 0.0880952775478363, -0.19792404770851135, 0.2632097601890564, -0.04496008902788162, -0.29361867904663086, 0.22073182463645935, -0.023317668586969376, 0.29066935181617737, -0.045000284910202026, -0.19107934832572937, 0.3202677071094513, 0.1976584792137146, -0.33332183957099915, 0.0063004158437252045, -0.06154058501124382, 0.1376906931400299, 0.19830478727817535, -0.05880004167556763, -0.2806752920150757, -0.1254730224609375, 0.16494795680046082, -0.2477136254310608, -0.13515694439411163, -0.02695579081773758, 0.2656692564487457, 0.4640742242336273, 0.31553134322166443, -0.410184770822525, 0.08473990857601166, 0.08693976700305939, 0.40309229493141174, 0.5526228547096252, 0.21842172741889954, -0.38931259512901306, -0.44014906883239746, 0.009926050901412964, -0.5505465865135193, 0.7221749424934387, 0.05412743240594864, -0.10628968477249146, 0.04002675786614418, 0.11919733136892319, 0.10382625460624695, -0.2606562674045563, -0.08894620090723038, 0.29350680112838745, 0.14900703728199005, -0.3029191195964813, -0.5877940058708191, 0.2726990580558777, -0.07323982566595078, -0.16460011899471283, 0.0963592380285263, 0.04368836432695389, -0.18900886178016663, 0.15868264436721802, 0.4145559072494507, 1.0873332023620605, -0.1753724068403244, -0.06654916703701019, -0.2006518542766571, -0.5942754149436951, 0.21857956051826477, -0.3865094780921936, -0.03415214642882347, -0.36110442876815796, -0.280670702457428, -0.13096298277378082, 0.06568782031536102, 0.2811852991580963, -0.01993703655898571, -0.4624367356300354, 0.14868348836898804, 0.13295504450798035, 0.10366533696651459, 0.159047469496727, 0.2734546661376953, 0.09581533074378967, -0.17080947756767273, -0.3672148883342743, 0.14082440733909607, -0.39670008420944214, -0.7062702775001526, -0.006748076528310776, -0.01899944618344307, 0.05629190802574158, 0.0479467511177063, -0.3367237448692322, -0.1428767591714859, -0.18129606544971466, -0.13621275126934052, 0.1654743105173111, -0.4581760764122009, 0.08585852384567261, 0.08058342337608337, 0.033746667206287384, 0.26400017738342285, -0.01375042088329792, -0.03492545336484909, -0.17321927845478058, 0.3353973627090454, 0.03254969045519829, -0.06035953760147095, 0.259777694940567, 0.03228890150785446, -0.2471066117286682, 0.13536739349365234, 0.2658606469631195, -0.1171530932188034, -0.2502567768096924, -0.20225287973880768, 0.4603576362133026, -0.3996011018753052, 0.05050411820411682, -0.09362660348415375, -0.0616200715303421, -0.27192938327789307, 0.14207632839679718, 0.01448078639805317, -0.11198529601097107, 0.19495685398578644, 0.3486582934856415, -0.0825464278459549, -0.09892664849758148, -0.03781643509864807, 0.17555636167526245, -0.12876200675964355, -0.043663717806339264, 0.33197981119155884, -0.38709816336631775, -0.33161473274230957, 0.25056764483451843, 0.25863468647003174, -0.06138499081134796, 0.1178477555513382, -0.4190160930156708, -0.3183629512786865, -0.12877115607261658, 0.317850798368454, 0.20918232202529907, -0.26300710439682007, -0.3223949670791626, -0.15646834671497345, -0.3932963013648987, 0.31260010600090027, 0.33574241399765015, 0.21101127564907074, -0.22375482320785522, -0.31035009026527405, -0.11279720067977905, 0.2773723304271698, -0.35557878017425537, -0.2972515821456909, -0.09365914762020111, -0.022336632013320923, -0.13295704126358032, 0.12224186956882477, 0.13197897374629974, -0.2026645690202713, 0.1393643021583557, 0.03683900088071823, 0.05215341970324516, -0.20003212988376617, -0.15485934913158417, 0.1378096491098404, -0.1318708062171936, 0.17810583114624023, 0.020932406187057495, -0.031139448285102844, 0.04612312093377113, -0.48177143931388855, -0.008641179651021957, 0.034002967178821564, -0.039101094007492065, 0.44724926352500916, 0.19094645977020264, -0.13013187050819397, -0.19403672218322754, -0.0018122773617506027, -0.13454867899417877, 0.23629629611968994, 0.06447191536426544, -0.09398332238197327, 0.44682952761650085, -0.17545604705810547, 0.1256086230278015, 0.08250747621059418, 0.29907500743865967, -0.010891239158809185, 0.4923725128173828, -0.03185783699154854, 0.09740471839904785, 0.18906299769878387, 0.4554100036621094, 0.19553408026695251, 0.10299435257911682, -0.1519271284341812, 0.24362288415431976, 0.2718401551246643, -0.3330291509628296, -0.3067778944969177, 0.16839097440242767, -0.21121574938297272, -0.1310737133026123, 0.22779816389083862, 0.0057983845472335815, 0.005951926112174988, 0.0029996298253536224, -0.017826080322265625, 0.4268954396247864, -0.24091728031635284, -0.17514032125473022, 0.24293938279151917, 0.09588707983493805, 0.14067864418029785, 0.10920561105012894, 0.1834484040737152, 0.022785253822803497, 0.5106213688850403, 0.08872091770172119, 0.021699896082282066, 0.3488205671310425, 0.490345299243927, -0.02036425843834877, -0.022629812359809875, 0.1895686686038971, 0.12325099855661392, -0.08227953314781189, 0.28879162669181824, 0.10740844905376434, 0.303597092628479, 0.2654135823249817, -0.09945999830961227, -0.12536031007766724, 0.009169163182377815, -0.0512361116707325, 0.049690429121255875, -0.12943702936172485, -0.12021970748901367, -0.3287881016731262, 0.0506146103143692, -0.012155835516750813, 0.06653426587581635, 0.5475667715072632, 0.06227321922779083, 0.20703047513961792, -0.2936152219772339, -0.019326115027070045, -0.16725793480873108, 0.13561314344406128, -0.32282018661499023, 0.037913501262664795, 0.10391516983509064, 0.2700319290161133, 0.12538856267929077, 0.3044368326663971, 0.18996413052082062, 0.3566494584083557, -0.10048776865005493, 0.12014690041542053, -0.2646240293979645, -0.08652351796627045, -0.0644715428352356, 0.3967393636703491, 0.30748021602630615, 0.16768842935562134, -0.013995639979839325, 0.13587510585784912, -0.08098673075437546, 0.3183322846889496, -0.1295163929462433, -0.1686936318874359, 0.09318475425243378, 0.22055931389331818, 0.2906203269958496, -0.5930883884429932, -0.21356891095638275, -0.4401909112930298, -0.4928882420063019, 0.17050796747207642, 0.43760088086128235, 0.06634218990802765, -0.05359485372900963, 0.09290860593318939, 0.10389644652605057, 0.09780119359493256, 0.4204592704772949, 0.3549850583076477, 0.004868439864367247, -0.18188120424747467, -0.37185826897621155, -0.5038097500801086, 0.10015438497066498, -0.1283257156610489, -0.42781001329421997, 0.26499179005622864, 0.06516080349683762, 0.3722267746925354, 0.07933953404426575, 0.2286502569913864, -0.17848078906536102, -0.4460592269897461, 0.11730849742889404, -0.4006696045398712, -0.24375739693641663, 0.37522628903388977, 0.1472863405942917, -0.19700947403907776, -0.045771051198244095, 0.3735131323337555, 0.2180784046649933, 0.07671618461608887, -0.3352435231208801, -0.023644782602787018, 0.06330766528844833, 0.07936502993106842, 0.27507734298706055, 0.11750682443380356, 0.07255735993385315, -0.19164994359016418, -0.1044502705335617, 0.09238635748624802, -0.2331194132566452, 0.20836833119392395, 0.554477334022522, 0.03189922124147415, 0.15994462370872498, -0.09478787332773209, -0.1456214040517807, -0.41065075993537903, 0.11797082424163818, 0.09096743166446686, 0.035500213503837585, -0.49838268756866455, 0.23152795433998108, 0.02327348291873932, -0.1121889129281044, -0.06965049356222153, 0.1797240972518921, -0.024395927786827087, -0.16379283368587494, -0.3955059051513672, -0.1830817461013794, 0.36040452122688293, -0.3482533097267151, -0.3547818064689636, 0.08940454572439194, 0.09716559201478958, 0.4749771058559418, 0.27738577127456665, -0.8428733348846436, -0.3434155285358429, 0.2823025584220886, -0.24363598227500916, -0.25079646706581116, 0.4607989192008972, 0.16013512015342712, 0.19067580997943878, -0.07823320478200912, 0.20573842525482178, -0.004514872096478939, -0.2811393737792969, -0.19766488671302795, -0.36450761556625366 ]