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/5856
Hi! You can avoid this error by using the preprocessed version: ```python import datasets ds = datasets.load_dataset('natural_questions') ``` PS: Once we finish https://github.com/huggingface/datasets/pull/5364, this error will no longer be a problem.
Error loading natural_questions
### Describe the bug When try to load natural_questions through datasets == 2.12.0 with python == 3.8.9: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` It failed with following info: `pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs` ### Steps to reproduce the bug In python console: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` Then the trace is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 2019, in _download_and_prepare num_examples, num_bytes = beam_writer.finalize(metrics.query(m_filter)) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 694, in finalize shard_num_bytes, _ = parquet_to_arrow(source, destination) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 737, in parquet_to_arrow for record_batch in parquet_file.iter_batches(): File "pyarrow/_parquet.pyx", line 1323, in iter_batches File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs ``` ### Expected behavior load natural_question questions ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-3.10.0-1160.42.2.el7.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.9 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 ```
31
Error loading natural_questions ### Describe the bug When try to load natural_questions through datasets == 2.12.0 with python == 3.8.9: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` It failed with following info: `pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs` ### Steps to reproduce the bug In python console: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` Then the trace is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 2019, in _download_and_prepare num_examples, num_bytes = beam_writer.finalize(metrics.query(m_filter)) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 694, in finalize shard_num_bytes, _ = parquet_to_arrow(source, destination) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 737, in parquet_to_arrow for record_batch in parquet_file.iter_batches(): File "pyarrow/_parquet.pyx", line 1323, in iter_batches File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs ``` ### Expected behavior load natural_question questions ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-3.10.0-1160.42.2.el7.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.9 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 ``` Hi! You can avoid this error by using the preprocessed version: ```python import datasets ds = datasets.load_dataset('natural_questions') ``` PS: Once we finish https://github.com/huggingface/datasets/pull/5364, this error will no longer be a problem.
[ -0.373348593711853, 0.09020346403121948, -0.024216623976826668, 0.4655776023864746, 0.35770848393440247, -0.21396303176879883, 0.1596500426530838, 0.511631965637207, 0.04409634321928024, 0.017488248646259308, -0.09487833082675934, 0.6436846256256104, -0.23180031776428223, -0.04579784348607063, 0.08076232671737671, -0.3519928753376007, 0.23471906781196594, 0.19334769248962402, -0.02878519520163536, 0.1111941784620285, -0.25435060262680054, 0.2039722353219986, -0.40420079231262207, -0.1529565453529358, 0.19254010915756226, 0.06791694462299347, -0.10321895033121109, 0.45519715547561646, -0.0788886621594429, -0.5378273129463196, 0.06372132897377014, -0.17365051805973053, 0.1679588258266449, 0.2926742732524872, -0.00012154433352407068, 0.030275478959083557, 0.5700413584709167, 0.1325608789920807, -0.5188647508621216, -0.30212652683258057, 0.09661577641963959, -0.33464404940605164, 0.38245633244514465, -0.1317058652639389, -0.02577924355864525, -0.38564902544021606, -0.07225389778614044, -0.30671587586402893, 0.42002469301223755, 0.33741167187690735, 0.16243663430213928, 0.31344103813171387, 0.2738202214241028, 0.05462873727083206, 0.3843570053577423, 0.1191008985042572, -0.09707491099834442, 0.4757145047187805, 0.010156204923987389, 0.05298973619937897, -0.1713852882385254, 0.06551123410463333, 0.021807648241519928, 0.10379553586244583, 0.09638011455535889, -0.09464038908481598, 0.0064848195761442184, -0.24647651612758636, -0.06692780554294586, 0.24080826342105865, 0.2166953980922699, -0.18768362700939178, -0.24707308411598206, -0.3649212419986725, -0.04141875356435776, -0.20120592415332794, 0.18055300414562225, 0.12362662702798843, -0.388834685087204, -0.039832670241594315, -0.1923816204071045, -0.097011499106884, -0.18994128704071045, 0.19312933087348938, -0.06346819549798965, 0.1973644495010376, -0.16481339931488037, 0.17277425527572632, -0.03991914168000221, -0.19952958822250366, 0.5150946378707886, 0.03694027289748192, -0.02170436829328537, 0.05740761384367943, -0.4892054796218872, 0.1127312108874321, -0.11784110963344574, -0.055382031947374344, 0.08839854598045349, 0.2802152633666992, 0.1527705043554306, 0.18204498291015625, 0.20612379908561707, 0.016251612454652786, 0.15164715051651, 0.2228683978319168, 0.08160457760095596, 0.29745787382125854, -0.1140364482998848, 0.4246990382671356, -0.013645350933074951, 0.06390848755836487, -0.3210018277168274, -0.340750128030777, -0.10103261470794678, 0.19810199737548828, 0.4270132780075073, -0.17778292298316956, -0.3542732894420624, 0.0998723953962326, -0.26244181394577026, 0.1228874921798706, 0.08386167883872986, 0.26529788970947266, -0.11889806389808655, 0.448991596698761, 0.04264861345291138, 0.37010207772254944, -0.2746621072292328, -0.08969229459762573, -0.11598845571279526, -0.08684372901916504, -0.23488914966583252, -0.008444011211395264, 0.19953835010528564, -0.04275510832667351, 0.25681373476982117, 0.023107584565877914, 0.25280189514160156, -0.14594630897045135, -0.031161457300186157, 0.01835693046450615, 0.035965874791145325, 0.2847030758857727, -0.02227555215358734, 0.1630302220582962, 0.185417041182518, 0.1084941178560257, 0.043864041566848755, 0.45517972111701965, -0.3689994215965271, -0.24741065502166748, -0.24271729588508606, 0.19291916489601135, -0.3657178580760956, -0.023011792451143265, -0.0554049126803875, 0.17451904714107513, 0.21899017691612244, -0.1678878664970398, 0.011544343084096909, -0.3856860399246216, -0.20554128289222717, -0.3987971246242523, 0.39229848980903625, 0.24502277374267578, -0.5100700855255127, 0.23114322125911713, -0.2191028892993927, -0.0215519517660141, 0.3059684634208679, 0.08108966052532196, -0.26891377568244934, 0.15523163974285126, -0.3725828528404236, 0.1540953665971756, 0.5670835971832275, -0.2162613570690155, -0.17929086089134216, 0.2914259433746338, -0.06385010480880737, 0.2512024939060211, -0.028685670346021652, -0.3393743932247162, -0.08766809850931168, -0.029095426201820374, -0.014251958578824997, 0.34165066480636597, 0.11634669452905655, 0.04070993512868881, -0.3933362066745758, -0.18952535092830658, 0.2357475757598877, 0.3073160648345947, 0.10392129421234131, -0.01225055381655693, 0.16926176846027374, -0.023844264447689056, 0.20378628373146057, -0.10312298685312271, 0.1464756727218628, 0.26149266958236694, -0.021543413400650024, -0.2587963938713074, 0.11565828323364258, -0.3058244287967682, -0.5536489486694336, 0.2352527678012848, -0.501363217830658, 0.04115524888038635, -0.16544653475284576, 0.1366683393716812, -0.4373858571052551, 0.1757669299840927, -0.32173484563827515, 0.051912907510995865, 0.15099164843559265, 0.06704643368721008, -0.20254532992839813, 0.05997508764266968, -0.18166810274124146, -0.12373322248458862, 0.025975018739700317, 0.16903698444366455, -0.41465944051742554, 0.4829026460647583, 0.08538062870502472, -0.4083600640296936, 0.057162173092365265, 0.20590177178382874, 0.3159416913986206, -0.03566702455282211, -0.17465028166770935, 0.39486610889434814, -0.16711020469665527, 0.20863884687423706, -0.27729707956314087, -0.2471996545791626, 0.17259271442890167, -0.28686314821243286, 0.2725267708301544, 0.26783400774002075, 0.04493415728211403, -0.08024788647890091, 0.16954386234283447, 0.40236642956733704, 0.04891818389296532, 0.1663711667060852, -0.08787468075752258, 0.04819406569004059, -0.07282347232103348, -0.08459363877773285, 0.15859201550483704, -0.22100305557250977, 0.2580985426902771, 0.3160131871700287, 0.31032687425613403, -0.15805234014987946, -0.12854118645191193, 0.3545125722885132, 0.42495715618133545, -0.05362873524427414, -0.19071194529533386, 0.19992321729660034, -0.2562757730484009, -0.285070538520813, 0.33515700697898865, -0.03651401400566101, 0.5007320642471313, 0.1869247704744339, 0.3531700372695923, 0.3510761260986328, -0.07035285979509354, -0.1323854923248291, 0.3181307315826416, 0.07768713682889938, 0.45283767580986023, 0.48327043652534485, 0.16880479454994202, -0.008893070742487907, -0.32245302200317383, -0.22772160172462463, 0.08918525278568268, 0.17884694039821625, -0.5985531210899353, 0.03527143597602844, -0.3278709650039673, 0.033950336277484894, -0.33481118083000183, -0.44901466369628906, -0.0141219487413764, -0.3591228425502777, 0.003997739404439926, 0.250195175409317, -0.2706429660320282, 0.29109638929367065, 0.17236463725566864, -0.03878502547740936, 0.2056325227022171, -0.19311605393886566, -0.3736477494239807, -0.06255188584327698, -0.27070045471191406, 0.041662830859422684, 0.40024906396865845, 0.07353650778532028, 0.10396619886159897, -0.1104857474565506, 0.062331825494766235, -0.059097327291965485, -0.24624931812286377, -0.06175892427563667, 0.08304310590028763, 0.5011274218559265, 0.09770815074443817, 0.15468552708625793, -0.189704030752182, -0.30027690529823303, 0.39828336238861084, 0.10226869583129883, -0.26219603419303894, 0.31657618284225464, 0.06851145625114441, 0.11338965594768524, -0.17738856375217438, -0.2792094945907593, -0.17826586961746216, -0.49011802673339844, -0.05439593270421028, 0.2125367820262909, 0.10236099362373352, 0.19991174340248108, 0.27310454845428467, 0.13716241717338562, 0.02661352977156639, 0.1690254807472229, 0.0452345535159111, -0.08033637702465057, 0.13406211137771606, -0.2267274409532547, -0.18135586380958557, -0.22199669480323792, -0.09305544197559357, -0.011073548346757889, 0.3357551097869873, -0.4468621015548706, 0.1124405562877655, -0.11042844504117966, 0.18368539214134216, -0.18107736110687256, -0.03252578526735306, 0.2233247607946396, 0.13446733355522156, -0.06183840334415436, -0.08607892692089081, 0.1563500314950943, 0.011044695973396301, -0.2819206118583679, 0.06434513628482819, 0.042462967336177826, 0.3580836355686188, 0.13160477578639984, 0.6938093304634094, 0.36956164240837097, 0.1152317225933075, 0.3420696258544922, -0.09568151831626892, 0.193084716796875, -0.2883315682411194, -0.0896628201007843, 0.22238458693027496, -0.0911674052476883, 0.03613019734621048, 0.18719856441020966, 0.0868442952632904, -0.24054713547229767, -0.1555888056755066, -0.028584308922290802, -0.3145942986011505, -0.19771981239318848, 0.10709265619516373, -0.5572810173034668, -0.05762052163481712, -0.11766473948955536, 0.06184250861406326, 0.04641270637512207, -0.2356773465871811, 0.009784411638975143, -0.05692332237958908, -0.18655408918857574, 0.03015078231692314, -0.3900296092033386, 0.036598414182662964, -0.1282515823841095, 0.3627792298793793, 0.14737775921821594, 0.46133163571357727, -0.0017088130116462708, -0.3327649235725403, 0.1346760094165802, -0.19686666131019592, 0.5109778642654419, -0.14003247022628784, 0.09236853569746017, 0.191274493932724, 0.10039542615413666, -0.4244192838668823, -0.246326744556427, -0.19664867222309113, 0.1666518896818161, -0.06346673518419266, 0.4234616756439209, -0.37905025482177734, -0.03506482392549515, 0.06570872664451599, 0.42919838428497314, -0.04900223761796951, -0.25212496519088745, -0.2525370717048645, -0.13002485036849976, -0.18573333323001862, -0.11397673189640045, -0.08703817427158356, 0.4408881664276123, -0.3027993440628052, -0.3442826271057129, -0.19712203741073608, -0.07330317050218582, -0.011838853359222412, -0.07058630883693695, 0.25833621621131897, -0.23762266337871552, 0.11689594388008118, -0.06449852883815765, 0.13367289304733276, 0.12904693186283112, 0.550513744354248, 0.11511732637882233, -0.38223621249198914, -0.12667632102966309, 0.1683609038591385, 0.05312681198120117, 0.3242952227592468, -0.1796397864818573, -0.17220214009284973, 0.2050807774066925, 0.06479527056217194, 0.11361142992973328, -0.04046347364783287, 0.07683025300502777, -0.17334717512130737, -0.02773975394666195, 0.006951421499252319, 0.3970697820186615, -0.006853476166725159, -0.02209506928920746, 0.3341817855834961, -0.007329057902097702, -0.15496575832366943, 0.14790230989456177, 0.14967769384384155, 0.8178806304931641, 0.1508188247680664, 0.09595870971679688, 0.7469649314880371, -0.4764227271080017, 0.39377644658088684, 0.20663325488567352, -0.05460300296545029, -0.623026967048645, -0.08933904021978378, 0.10515642166137695, -0.17114821076393127, 0.1920834332704544, -0.010493835434317589, -0.10631516575813293, 0.23964214324951172, -0.1094328910112381, 0.10113786160945892, 0.2357240915298462, -0.005075834691524506, 0.0909440740942955, -0.02679956518113613, -0.4016321301460266, 0.054717984050512314, -0.22890737652778625, -0.0827169120311737, -0.07068310678005219, -0.27217307686805725, -0.003695540130138397, -0.1648501455783844, -0.11408788710832596, 0.5330749154090881, -0.33516210317611694, -0.08766563981771469, 0.2705247402191162, -0.772316038608551, 0.0019581764936447144, 0.25664180517196655, 0.09633937478065491, -0.14649182558059692, -0.27929481863975525, 0.042331185191869736, 0.13886556029319763, -0.024046529084444046, 0.3794187009334564, -0.10519430041313171, 0.4341900646686554, -0.10507159680128098, -0.04615166783332825, -0.05195361375808716, -0.29066067934036255, 0.06557220220565796, 0.05955800414085388, 0.06908388435840607, 0.17353513836860657, -0.33705928921699524, -0.15651610493659973, -0.23038816452026367, 0.2761504054069519, -0.17745864391326904, 0.08467249572277069, -0.2420942634344101, -0.04132092744112015, -0.14533010125160217, 0.2732222080230713, -0.10935799777507782, 0.07831335067749023, 0.4244082272052765, 0.1186634749174118, -0.08047036826610565, 0.38412922620773315, 0.06723639369010925, -0.2325635850429535, -0.14358928799629211, 0.06991387903690338, 0.13645675778388977, -0.7520313858985901, 0.16855020821094513, -0.02038821391761303, 0.04837648570537567, 0.06917853653430939, -0.03909485787153244, 0.13024985790252686, 0.05896797776222229, -0.01603557914495468, -0.41812536120414734, -0.12819810211658478, 0.16240879893302917, -0.393031507730484, 0.11222324520349503, -0.015487879514694214, -0.09627009928226471, -0.034642867743968964, -0.18795834481716156, -0.24524152278900146, 0.11517040431499481, -0.04411788284778595, 0.007027601823210716, -0.5165122747421265, -0.14264769852161407, -0.06445349752902985, 0.3308504819869995, 0.11378449201583862, -0.019772812724113464, -0.14057491719722748, -0.11545941978693008, 0.030104465782642365, 0.13607126474380493, 0.08572416007518768, -0.276936411857605, -0.03726857155561447, -0.10131281614303589, -0.01257497537881136, -0.09661384671926498, 0.1847505122423172, -0.18063554167747498, -0.09570221602916718, 0.0019541531801223755, 0.3042293190956116, 0.28481346368789673, -0.16720691323280334, 0.47237223386764526, -0.15833084285259247, 0.19421200454235077, -0.25080397725105286, 0.17101746797561646, -0.029180161654949188, -0.10005278140306473, -0.32120493054389954, -0.023078955709934235, 0.26531291007995605, 0.06945602595806122, 0.3127336800098419, -0.45177510380744934, -0.20185503363609314, -0.38853421807289124, 0.44437316060066223, 0.4610661566257477, -0.35380566120147705, 0.007634125649929047, 0.1242825835943222, 0.16786807775497437, -0.29560941457748413, 0.09629704803228378, 0.18045063316822052, -0.0412667877972126, -0.1310146152973175, 0.09616820514202118, 0.14276035130023956, -0.4819558560848236, 0.31080755591392517, 0.11564956605434418, 0.20292840898036957, 0.10643261671066284, -0.05374656990170479, 0.25048646330833435, -0.09958019852638245, -0.10390489548444748, 0.2528764009475708, -0.09186206758022308, 0.14723622798919678, 0.46281999349594116, -0.26709944009780884, 0.3286902606487274, 0.4341474175453186, 0.12333475053310394, -0.11104531586170197, -0.2072988748550415, -0.07873155921697617, 0.3722330331802368, 0.26080864667892456, -0.12864390015602112, 0.09249694645404816, 0.5752445459365845, -0.03753642365336418, -0.2526894807815552, -0.10964168608188629, 0.054922301322221756, -0.18789701163768768, 0.0019630007445812225, -0.40755125880241394, -0.16526564955711365, -0.2724306583404541, -0.15209291875362396, -0.23024499416351318, -0.18897053599357605, 0.23738382756710052, 0.1653394103050232, -0.12330418080091476, -0.36759427189826965, 0.18466590344905853, 0.40141695737838745, -0.01980312168598175, -0.373857319355011, 0.5425704121589661, 0.33080875873565674, 0.08703025430440903, 0.06100945174694061, 0.22898231446743011, 0.548026442527771, 0.4146087169647217, -0.48933467268943787, -0.3070249557495117, 0.33168238401412964, -0.13489362597465515, -0.07509325444698334, 0.25017791986465454, 0.17681169509887695, 0.488619327545166, 0.5422008633613586, 0.13608910143375397, -0.19544756412506104, 0.4946777820587158, 0.24053750932216644, 0.15473859012126923, -0.30721959471702576, 0.20125174522399902, -0.245584174990654, -0.07354284822940826, 0.076423779129982, -0.3310765027999878, -0.44890403747558594, -0.1877361387014389, 0.19781970977783203, -0.027153877541422844, 0.05455530807375908, -0.06616640090942383, 0.09213092923164368, -0.025267798453569412, 0.3087098002433777, 0.3008807897567749, 0.357816606760025, -0.1992572844028473, -0.21572111546993256, -0.537550687789917, 0.3796558082103729, 0.2186964750289917, -0.07319813221693039, 0.12355229258537292, -0.02713031694293022, -0.05322159081697464, 0.293398380279541, -0.282326340675354, 0.13951553404331207, 0.0657842755317688, 0.22929954528808594, -0.4746503233909607, -0.12370333075523376, 0.16017891466617584, -0.07270177453756332, -0.07503093779087067, -0.48798516392707825, 0.11678240448236465, -0.25003135204315186, -0.03926382586359978, 0.203110009431839, -0.15356534719467163, 0.15114271640777588, -0.022653063759207726, 0.3370394706726074, 0.09928687661886215, 0.4646206498146057, -0.0037836432456970215, -0.19319069385528564, -0.26457807421684265, -0.2899380028247833, -0.09361640363931656, 0.2256745845079422, -0.07268168032169342, 0.48331326246261597, -0.07392944395542145, 0.2508976459503174, 0.011868584901094437, -0.017346488311886787, -0.0442558191716671, 0.38009339570999146, -0.18031573295593262, 0.19268402457237244, -0.013274744153022766, 0.17289479076862335, 0.025538098067045212, 0.0966595709323883, 0.18414339423179626, 0.14265309274196625, -0.3361716866493225, -0.47475606203079224, 0.5450258255004883, -0.27436643838882446, -0.28320664167404175, 0.1815662533044815, 0.046024810522794724, 0.1032051146030426, -0.1387946903705597, -0.49625229835510254, -0.06277462840080261, 0.3960728645324707, -0.15226133167743683, -0.00016036629676818848, 0.2609781324863434, -0.2961609661579132, 0.024008624255657196, -0.2083100825548172, 0.12464124709367752, 0.1644146889448166, -0.02221587300300598, -0.1505635678768158, -0.24504008889198303 ]
https://github.com/huggingface/datasets/issues/5856
> Hi! You can avoid this error by using the preprocessed version: > > ```python > import datasets > ds = datasets.load_dataset('natural_questions') > ``` > > PS: Once we finish #5364, this error will no longer be a problem. Thanks, wish #5364 finish early
Error loading natural_questions
### Describe the bug When try to load natural_questions through datasets == 2.12.0 with python == 3.8.9: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` It failed with following info: `pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs` ### Steps to reproduce the bug In python console: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` Then the trace is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 2019, in _download_and_prepare num_examples, num_bytes = beam_writer.finalize(metrics.query(m_filter)) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 694, in finalize shard_num_bytes, _ = parquet_to_arrow(source, destination) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 737, in parquet_to_arrow for record_batch in parquet_file.iter_batches(): File "pyarrow/_parquet.pyx", line 1323, in iter_batches File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs ``` ### Expected behavior load natural_question questions ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-3.10.0-1160.42.2.el7.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.9 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 ```
44
Error loading natural_questions ### Describe the bug When try to load natural_questions through datasets == 2.12.0 with python == 3.8.9: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` It failed with following info: `pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs` ### Steps to reproduce the bug In python console: ```python import datasets datasets.load_dataset('natural_questions',beam_runner='DirectRunner') ``` Then the trace is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/builder.py", line 2019, in _download_and_prepare num_examples, num_bytes = beam_writer.finalize(metrics.query(m_filter)) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 694, in finalize shard_num_bytes, _ = parquet_to_arrow(source, destination) File "/home/nlp/.cache/pypoetry/virtualenvs/drg-W3LF4Ol9-py3.8/lib/python3.8/site-packages/datasets/arrow_writer.py", line 737, in parquet_to_arrow for record_batch in parquet_file.iter_batches(): File "pyarrow/_parquet.pyx", line 1323, in iter_batches File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status pyarrow.lib.ArrowNotImplementedError: Nested data conversions not implemented for chunked array outputs ``` ### Expected behavior load natural_question questions ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-3.10.0-1160.42.2.el7.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.9 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 ``` > Hi! You can avoid this error by using the preprocessed version: > > ```python > import datasets > ds = datasets.load_dataset('natural_questions') > ``` > > PS: Once we finish #5364, this error will no longer be a problem. Thanks, wish #5364 finish early
[ -0.373348593711853, 0.09020346403121948, -0.024216623976826668, 0.4655776023864746, 0.35770848393440247, -0.21396303176879883, 0.1596500426530838, 0.511631965637207, 0.04409634321928024, 0.017488248646259308, -0.09487833082675934, 0.6436846256256104, -0.23180031776428223, -0.04579784348607063, 0.08076232671737671, -0.3519928753376007, 0.23471906781196594, 0.19334769248962402, -0.02878519520163536, 0.1111941784620285, -0.25435060262680054, 0.2039722353219986, -0.40420079231262207, -0.1529565453529358, 0.19254010915756226, 0.06791694462299347, -0.10321895033121109, 0.45519715547561646, -0.0788886621594429, -0.5378273129463196, 0.06372132897377014, -0.17365051805973053, 0.1679588258266449, 0.2926742732524872, -0.00012154433352407068, 0.030275478959083557, 0.5700413584709167, 0.1325608789920807, -0.5188647508621216, -0.30212652683258057, 0.09661577641963959, -0.33464404940605164, 0.38245633244514465, -0.1317058652639389, -0.02577924355864525, -0.38564902544021606, -0.07225389778614044, -0.30671587586402893, 0.42002469301223755, 0.33741167187690735, 0.16243663430213928, 0.31344103813171387, 0.2738202214241028, 0.05462873727083206, 0.3843570053577423, 0.1191008985042572, -0.09707491099834442, 0.4757145047187805, 0.010156204923987389, 0.05298973619937897, -0.1713852882385254, 0.06551123410463333, 0.021807648241519928, 0.10379553586244583, 0.09638011455535889, -0.09464038908481598, 0.0064848195761442184, -0.24647651612758636, -0.06692780554294586, 0.24080826342105865, 0.2166953980922699, -0.18768362700939178, -0.24707308411598206, -0.3649212419986725, -0.04141875356435776, -0.20120592415332794, 0.18055300414562225, 0.12362662702798843, -0.388834685087204, -0.039832670241594315, -0.1923816204071045, -0.097011499106884, -0.18994128704071045, 0.19312933087348938, -0.06346819549798965, 0.1973644495010376, -0.16481339931488037, 0.17277425527572632, -0.03991914168000221, -0.19952958822250366, 0.5150946378707886, 0.03694027289748192, -0.02170436829328537, 0.05740761384367943, -0.4892054796218872, 0.1127312108874321, -0.11784110963344574, -0.055382031947374344, 0.08839854598045349, 0.2802152633666992, 0.1527705043554306, 0.18204498291015625, 0.20612379908561707, 0.016251612454652786, 0.15164715051651, 0.2228683978319168, 0.08160457760095596, 0.29745787382125854, -0.1140364482998848, 0.4246990382671356, -0.013645350933074951, 0.06390848755836487, -0.3210018277168274, -0.340750128030777, -0.10103261470794678, 0.19810199737548828, 0.4270132780075073, -0.17778292298316956, -0.3542732894420624, 0.0998723953962326, -0.26244181394577026, 0.1228874921798706, 0.08386167883872986, 0.26529788970947266, -0.11889806389808655, 0.448991596698761, 0.04264861345291138, 0.37010207772254944, -0.2746621072292328, -0.08969229459762573, -0.11598845571279526, -0.08684372901916504, -0.23488914966583252, -0.008444011211395264, 0.19953835010528564, -0.04275510832667351, 0.25681373476982117, 0.023107584565877914, 0.25280189514160156, -0.14594630897045135, -0.031161457300186157, 0.01835693046450615, 0.035965874791145325, 0.2847030758857727, -0.02227555215358734, 0.1630302220582962, 0.185417041182518, 0.1084941178560257, 0.043864041566848755, 0.45517972111701965, -0.3689994215965271, -0.24741065502166748, -0.24271729588508606, 0.19291916489601135, -0.3657178580760956, -0.023011792451143265, -0.0554049126803875, 0.17451904714107513, 0.21899017691612244, -0.1678878664970398, 0.011544343084096909, -0.3856860399246216, -0.20554128289222717, -0.3987971246242523, 0.39229848980903625, 0.24502277374267578, -0.5100700855255127, 0.23114322125911713, -0.2191028892993927, -0.0215519517660141, 0.3059684634208679, 0.08108966052532196, -0.26891377568244934, 0.15523163974285126, -0.3725828528404236, 0.1540953665971756, 0.5670835971832275, -0.2162613570690155, -0.17929086089134216, 0.2914259433746338, -0.06385010480880737, 0.2512024939060211, -0.028685670346021652, -0.3393743932247162, -0.08766809850931168, -0.029095426201820374, -0.014251958578824997, 0.34165066480636597, 0.11634669452905655, 0.04070993512868881, -0.3933362066745758, -0.18952535092830658, 0.2357475757598877, 0.3073160648345947, 0.10392129421234131, -0.01225055381655693, 0.16926176846027374, -0.023844264447689056, 0.20378628373146057, -0.10312298685312271, 0.1464756727218628, 0.26149266958236694, -0.021543413400650024, -0.2587963938713074, 0.11565828323364258, -0.3058244287967682, -0.5536489486694336, 0.2352527678012848, -0.501363217830658, 0.04115524888038635, -0.16544653475284576, 0.1366683393716812, -0.4373858571052551, 0.1757669299840927, -0.32173484563827515, 0.051912907510995865, 0.15099164843559265, 0.06704643368721008, -0.20254532992839813, 0.05997508764266968, -0.18166810274124146, -0.12373322248458862, 0.025975018739700317, 0.16903698444366455, -0.41465944051742554, 0.4829026460647583, 0.08538062870502472, -0.4083600640296936, 0.057162173092365265, 0.20590177178382874, 0.3159416913986206, -0.03566702455282211, -0.17465028166770935, 0.39486610889434814, -0.16711020469665527, 0.20863884687423706, -0.27729707956314087, -0.2471996545791626, 0.17259271442890167, -0.28686314821243286, 0.2725267708301544, 0.26783400774002075, 0.04493415728211403, -0.08024788647890091, 0.16954386234283447, 0.40236642956733704, 0.04891818389296532, 0.1663711667060852, -0.08787468075752258, 0.04819406569004059, -0.07282347232103348, -0.08459363877773285, 0.15859201550483704, -0.22100305557250977, 0.2580985426902771, 0.3160131871700287, 0.31032687425613403, -0.15805234014987946, -0.12854118645191193, 0.3545125722885132, 0.42495715618133545, -0.05362873524427414, -0.19071194529533386, 0.19992321729660034, -0.2562757730484009, -0.285070538520813, 0.33515700697898865, -0.03651401400566101, 0.5007320642471313, 0.1869247704744339, 0.3531700372695923, 0.3510761260986328, -0.07035285979509354, -0.1323854923248291, 0.3181307315826416, 0.07768713682889938, 0.45283767580986023, 0.48327043652534485, 0.16880479454994202, -0.008893070742487907, -0.32245302200317383, -0.22772160172462463, 0.08918525278568268, 0.17884694039821625, -0.5985531210899353, 0.03527143597602844, -0.3278709650039673, 0.033950336277484894, -0.33481118083000183, -0.44901466369628906, -0.0141219487413764, -0.3591228425502777, 0.003997739404439926, 0.250195175409317, -0.2706429660320282, 0.29109638929367065, 0.17236463725566864, -0.03878502547740936, 0.2056325227022171, -0.19311605393886566, -0.3736477494239807, -0.06255188584327698, -0.27070045471191406, 0.041662830859422684, 0.40024906396865845, 0.07353650778532028, 0.10396619886159897, -0.1104857474565506, 0.062331825494766235, -0.059097327291965485, -0.24624931812286377, -0.06175892427563667, 0.08304310590028763, 0.5011274218559265, 0.09770815074443817, 0.15468552708625793, -0.189704030752182, -0.30027690529823303, 0.39828336238861084, 0.10226869583129883, -0.26219603419303894, 0.31657618284225464, 0.06851145625114441, 0.11338965594768524, -0.17738856375217438, -0.2792094945907593, -0.17826586961746216, -0.49011802673339844, -0.05439593270421028, 0.2125367820262909, 0.10236099362373352, 0.19991174340248108, 0.27310454845428467, 0.13716241717338562, 0.02661352977156639, 0.1690254807472229, 0.0452345535159111, -0.08033637702465057, 0.13406211137771606, -0.2267274409532547, -0.18135586380958557, -0.22199669480323792, -0.09305544197559357, -0.011073548346757889, 0.3357551097869873, -0.4468621015548706, 0.1124405562877655, -0.11042844504117966, 0.18368539214134216, -0.18107736110687256, -0.03252578526735306, 0.2233247607946396, 0.13446733355522156, -0.06183840334415436, -0.08607892692089081, 0.1563500314950943, 0.011044695973396301, -0.2819206118583679, 0.06434513628482819, 0.042462967336177826, 0.3580836355686188, 0.13160477578639984, 0.6938093304634094, 0.36956164240837097, 0.1152317225933075, 0.3420696258544922, -0.09568151831626892, 0.193084716796875, -0.2883315682411194, -0.0896628201007843, 0.22238458693027496, -0.0911674052476883, 0.03613019734621048, 0.18719856441020966, 0.0868442952632904, -0.24054713547229767, -0.1555888056755066, -0.028584308922290802, -0.3145942986011505, -0.19771981239318848, 0.10709265619516373, -0.5572810173034668, -0.05762052163481712, -0.11766473948955536, 0.06184250861406326, 0.04641270637512207, -0.2356773465871811, 0.009784411638975143, -0.05692332237958908, -0.18655408918857574, 0.03015078231692314, -0.3900296092033386, 0.036598414182662964, -0.1282515823841095, 0.3627792298793793, 0.14737775921821594, 0.46133163571357727, -0.0017088130116462708, -0.3327649235725403, 0.1346760094165802, -0.19686666131019592, 0.5109778642654419, -0.14003247022628784, 0.09236853569746017, 0.191274493932724, 0.10039542615413666, -0.4244192838668823, -0.246326744556427, -0.19664867222309113, 0.1666518896818161, -0.06346673518419266, 0.4234616756439209, -0.37905025482177734, -0.03506482392549515, 0.06570872664451599, 0.42919838428497314, -0.04900223761796951, -0.25212496519088745, -0.2525370717048645, -0.13002485036849976, -0.18573333323001862, -0.11397673189640045, -0.08703817427158356, 0.4408881664276123, -0.3027993440628052, -0.3442826271057129, -0.19712203741073608, -0.07330317050218582, -0.011838853359222412, -0.07058630883693695, 0.25833621621131897, -0.23762266337871552, 0.11689594388008118, -0.06449852883815765, 0.13367289304733276, 0.12904693186283112, 0.550513744354248, 0.11511732637882233, -0.38223621249198914, -0.12667632102966309, 0.1683609038591385, 0.05312681198120117, 0.3242952227592468, -0.1796397864818573, -0.17220214009284973, 0.2050807774066925, 0.06479527056217194, 0.11361142992973328, -0.04046347364783287, 0.07683025300502777, -0.17334717512130737, -0.02773975394666195, 0.006951421499252319, 0.3970697820186615, -0.006853476166725159, -0.02209506928920746, 0.3341817855834961, -0.007329057902097702, -0.15496575832366943, 0.14790230989456177, 0.14967769384384155, 0.8178806304931641, 0.1508188247680664, 0.09595870971679688, 0.7469649314880371, -0.4764227271080017, 0.39377644658088684, 0.20663325488567352, -0.05460300296545029, -0.623026967048645, -0.08933904021978378, 0.10515642166137695, -0.17114821076393127, 0.1920834332704544, -0.010493835434317589, -0.10631516575813293, 0.23964214324951172, -0.1094328910112381, 0.10113786160945892, 0.2357240915298462, -0.005075834691524506, 0.0909440740942955, -0.02679956518113613, -0.4016321301460266, 0.054717984050512314, -0.22890737652778625, -0.0827169120311737, -0.07068310678005219, -0.27217307686805725, -0.003695540130138397, -0.1648501455783844, -0.11408788710832596, 0.5330749154090881, -0.33516210317611694, -0.08766563981771469, 0.2705247402191162, -0.772316038608551, 0.0019581764936447144, 0.25664180517196655, 0.09633937478065491, -0.14649182558059692, -0.27929481863975525, 0.042331185191869736, 0.13886556029319763, -0.024046529084444046, 0.3794187009334564, -0.10519430041313171, 0.4341900646686554, -0.10507159680128098, -0.04615166783332825, -0.05195361375808716, -0.29066067934036255, 0.06557220220565796, 0.05955800414085388, 0.06908388435840607, 0.17353513836860657, -0.33705928921699524, -0.15651610493659973, -0.23038816452026367, 0.2761504054069519, -0.17745864391326904, 0.08467249572277069, -0.2420942634344101, -0.04132092744112015, -0.14533010125160217, 0.2732222080230713, -0.10935799777507782, 0.07831335067749023, 0.4244082272052765, 0.1186634749174118, -0.08047036826610565, 0.38412922620773315, 0.06723639369010925, -0.2325635850429535, -0.14358928799629211, 0.06991387903690338, 0.13645675778388977, -0.7520313858985901, 0.16855020821094513, -0.02038821391761303, 0.04837648570537567, 0.06917853653430939, -0.03909485787153244, 0.13024985790252686, 0.05896797776222229, -0.01603557914495468, -0.41812536120414734, -0.12819810211658478, 0.16240879893302917, -0.393031507730484, 0.11222324520349503, -0.015487879514694214, -0.09627009928226471, -0.034642867743968964, -0.18795834481716156, -0.24524152278900146, 0.11517040431499481, -0.04411788284778595, 0.007027601823210716, -0.5165122747421265, -0.14264769852161407, -0.06445349752902985, 0.3308504819869995, 0.11378449201583862, -0.019772812724113464, -0.14057491719722748, -0.11545941978693008, 0.030104465782642365, 0.13607126474380493, 0.08572416007518768, -0.276936411857605, -0.03726857155561447, -0.10131281614303589, -0.01257497537881136, -0.09661384671926498, 0.1847505122423172, -0.18063554167747498, -0.09570221602916718, 0.0019541531801223755, 0.3042293190956116, 0.28481346368789673, -0.16720691323280334, 0.47237223386764526, -0.15833084285259247, 0.19421200454235077, -0.25080397725105286, 0.17101746797561646, -0.029180161654949188, -0.10005278140306473, -0.32120493054389954, -0.023078955709934235, 0.26531291007995605, 0.06945602595806122, 0.3127336800098419, -0.45177510380744934, -0.20185503363609314, -0.38853421807289124, 0.44437316060066223, 0.4610661566257477, -0.35380566120147705, 0.007634125649929047, 0.1242825835943222, 0.16786807775497437, -0.29560941457748413, 0.09629704803228378, 0.18045063316822052, -0.0412667877972126, -0.1310146152973175, 0.09616820514202118, 0.14276035130023956, -0.4819558560848236, 0.31080755591392517, 0.11564956605434418, 0.20292840898036957, 0.10643261671066284, -0.05374656990170479, 0.25048646330833435, -0.09958019852638245, -0.10390489548444748, 0.2528764009475708, -0.09186206758022308, 0.14723622798919678, 0.46281999349594116, -0.26709944009780884, 0.3286902606487274, 0.4341474175453186, 0.12333475053310394, -0.11104531586170197, -0.2072988748550415, -0.07873155921697617, 0.3722330331802368, 0.26080864667892456, -0.12864390015602112, 0.09249694645404816, 0.5752445459365845, -0.03753642365336418, -0.2526894807815552, -0.10964168608188629, 0.054922301322221756, -0.18789701163768768, 0.0019630007445812225, -0.40755125880241394, -0.16526564955711365, -0.2724306583404541, -0.15209291875362396, -0.23024499416351318, -0.18897053599357605, 0.23738382756710052, 0.1653394103050232, -0.12330418080091476, -0.36759427189826965, 0.18466590344905853, 0.40141695737838745, -0.01980312168598175, -0.373857319355011, 0.5425704121589661, 0.33080875873565674, 0.08703025430440903, 0.06100945174694061, 0.22898231446743011, 0.548026442527771, 0.4146087169647217, -0.48933467268943787, -0.3070249557495117, 0.33168238401412964, -0.13489362597465515, -0.07509325444698334, 0.25017791986465454, 0.17681169509887695, 0.488619327545166, 0.5422008633613586, 0.13608910143375397, -0.19544756412506104, 0.4946777820587158, 0.24053750932216644, 0.15473859012126923, -0.30721959471702576, 0.20125174522399902, -0.245584174990654, -0.07354284822940826, 0.076423779129982, -0.3310765027999878, -0.44890403747558594, -0.1877361387014389, 0.19781970977783203, -0.027153877541422844, 0.05455530807375908, -0.06616640090942383, 0.09213092923164368, -0.025267798453569412, 0.3087098002433777, 0.3008807897567749, 0.357816606760025, -0.1992572844028473, -0.21572111546993256, -0.537550687789917, 0.3796558082103729, 0.2186964750289917, -0.07319813221693039, 0.12355229258537292, -0.02713031694293022, -0.05322159081697464, 0.293398380279541, -0.282326340675354, 0.13951553404331207, 0.0657842755317688, 0.22929954528808594, -0.4746503233909607, -0.12370333075523376, 0.16017891466617584, -0.07270177453756332, -0.07503093779087067, -0.48798516392707825, 0.11678240448236465, -0.25003135204315186, -0.03926382586359978, 0.203110009431839, -0.15356534719467163, 0.15114271640777588, -0.022653063759207726, 0.3370394706726074, 0.09928687661886215, 0.4646206498146057, -0.0037836432456970215, -0.19319069385528564, -0.26457807421684265, -0.2899380028247833, -0.09361640363931656, 0.2256745845079422, -0.07268168032169342, 0.48331326246261597, -0.07392944395542145, 0.2508976459503174, 0.011868584901094437, -0.017346488311886787, -0.0442558191716671, 0.38009339570999146, -0.18031573295593262, 0.19268402457237244, -0.013274744153022766, 0.17289479076862335, 0.025538098067045212, 0.0966595709323883, 0.18414339423179626, 0.14265309274196625, -0.3361716866493225, -0.47475606203079224, 0.5450258255004883, -0.27436643838882446, -0.28320664167404175, 0.1815662533044815, 0.046024810522794724, 0.1032051146030426, -0.1387946903705597, -0.49625229835510254, -0.06277462840080261, 0.3960728645324707, -0.15226133167743683, -0.00016036629676818848, 0.2609781324863434, -0.2961609661579132, 0.024008624255657196, -0.2083100825548172, 0.12464124709367752, 0.1644146889448166, -0.02221587300300598, -0.1505635678768158, -0.24504008889198303 ]
https://github.com/huggingface/datasets/issues/5855
Cc @amyeroberts @Rocketknight1 Indded I think it's because it does something like this under the hood when there's no multiprocessing: ```python tf_dataset = tf_dataset.shuffle(len(dataset)) ``` PS: with multiprocessing it appears to be different: ```python indices = np.arange(len(dataset)) if shuffle: np.random.shuffle(indices) ```
`to_tf_dataset` consumes too much memory
### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3
41
`to_tf_dataset` consumes too much memory ### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3 Cc @amyeroberts @Rocketknight1 Indded I think it's because it does something like this under the hood when there's no multiprocessing: ```python tf_dataset = tf_dataset.shuffle(len(dataset)) ``` PS: with multiprocessing it appears to be different: ```python indices = np.arange(len(dataset)) if shuffle: np.random.shuffle(indices) ```
[ -0.15822795033454895, -0.23407281935214996, 0.09227368235588074, 0.3770810663700104, 0.5104161500930786, 0.20725011825561523, -0.034461960196495056, 0.27628540992736816, -0.2560502588748932, 0.33825477957725525, -0.024285780265927315, 0.16308927536010742, -0.44833457469940186, -0.05245983228087425, 0.22439958155155182, -0.08521826565265656, 0.18257606029510498, -0.12151472270488739, -0.2156122326850891, 0.009591400623321533, -0.18600952625274658, -0.1572999805212021, -0.15149500966072083, -0.2762797176837921, -0.07886103540658951, 0.053714267909526825, 0.24288222193717957, 0.11352112889289856, 0.045504018664360046, 0.11847153306007385, 0.01778903603553772, 0.1438693404197693, -0.0733426958322525, 0.5193463563919067, -0.00011887728032888845, 0.04248824715614319, 0.025390028953552246, 0.017749294638633728, -0.20652887225151062, 0.23555652797222137, -0.04330485314130783, 0.15754064917564392, -0.2680107355117798, 0.06575962901115417, 0.0760931521654129, 0.03503500297665596, -0.03358433023095131, -0.24468737840652466, 0.07239236682653427, 0.18836039304733276, 0.109595887362957, 0.2446056455373764, 0.006833113729953766, 0.270402193069458, 0.5546197295188904, 0.12427662312984467, -0.15182797610759735, 0.14158600568771362, -0.012111354619264603, -0.04732375964522362, -0.021348528563976288, 0.29770517349243164, 0.022721730172634125, 0.1004084125161171, 0.5147581696510315, -0.11135412752628326, -0.08168546855449677, -0.10393235087394714, 0.050984639674425125, 0.38528546690940857, 0.21881836652755737, -0.32709190249443054, -0.1110735759139061, -0.43611541390419006, 0.006830643862485886, -0.19580242037773132, -0.0015779752284288406, -0.16257792711257935, -0.19865477085113525, -0.0887514054775238, -0.493394136428833, -0.17700889706611633, -0.008836276829242706, -0.0027658287435770035, -0.03837714344263077, 0.13156798481941223, -0.03315071389079094, 0.09095780551433563, 0.3398818075656891, -0.33399325609207153, 0.43166130781173706, -0.02433749847114086, 0.04527401179075241, 0.30649685859680176, -0.6095265746116638, -0.16167253255844116, 0.1596611738204956, -0.316594660282135, 0.3132362961769104, -0.3122553527355194, 0.100961834192276, -0.05228731036186218, -0.10514922440052032, -0.16306732594966888, 0.28074881434440613, 0.19066482782363892, -0.4858037233352661, 0.3186251223087311, -0.14500170946121216, 0.03644493594765663, 0.12369365990161896, -0.027226882055401802, -0.1824026256799698, -0.03729328140616417, 0.29054003953933716, -0.3843509256839752, 0.016435787081718445, 0.13605031371116638, -0.3258666396141052, 0.20667308568954468, -0.09889593720436096, 0.1302201896905899, 0.14773458242416382, 0.19901233911514282, -0.17840144038200378, 0.3223017752170563, -0.0452161468565464, -0.3347390294075012, -0.304980993270874, 0.0041634999215602875, -0.35149040818214417, -0.0897970199584961, -0.16642096638679504, 0.13250336050987244, -0.01263660192489624, -0.08056504279375076, -0.07188165187835693, 0.014275938272476196, 0.055781807750463486, 0.19539496302604675, -0.026906903833150864, -0.18719743192195892, 0.1945086270570755, 0.24641911685466766, -0.20861206948757172, 0.11154647916555405, -0.003336576046422124, 0.2812846302986145, -0.2202146351337433, 0.43640977144241333, -0.483782559633255, -0.32899218797683716, 0.26731571555137634, 0.11374073475599289, -0.04881042242050171, -0.17855024337768555, -0.5278759598731995, 0.3185975253582001, 0.33576613664627075, -0.09799480438232422, -0.0755024179816246, -0.3261210322380066, -0.5926900506019592, -0.20952314138412476, 0.29131969809532166, 0.3965590000152588, -0.21711915731430054, 0.050279535353183746, 0.1674906611442566, -0.1879318207502365, 0.5304161310195923, 0.4585167169570923, -0.05516388639807701, 0.23215115070343018, -0.1334109753370285, -0.2894537150859833, 0.13035140931606293, 0.07149605453014374, -0.36872777342796326, 0.2032485157251358, -0.39450615644454956, 0.43354323506355286, -0.07670700550079346, 0.21166951954364777, -0.05271966755390167, -0.1228688582777977, 0.663454532623291, 0.46041277050971985, -0.41860708594322205, 0.3542313575744629, -0.3050636649131775, -0.25038132071495056, 0.01200302317738533, 0.244306743144989, -0.15035055577754974, -0.034811802208423615, -0.2754697799682617, 0.2806409001350403, 0.378619521856308, 0.012948361225426197, -0.03716804459691048, 0.008611271157860756, 0.074164018034935, 0.17260384559631348, -0.09916602075099945, -0.11206565797328949, -0.21806247532367706, 0.1275118738412857, 0.33926501870155334, -0.2996363639831543, 0.442605584859848, -0.12897726893424988, 0.05751074105501175, 0.05668080598115921, 0.11044256389141083, 0.1626492738723755, -0.08989255130290985, -0.12691332399845123, 0.0695994570851326, 0.136696457862854, -0.02060823142528534, 0.07255836576223373, -0.5407472252845764, -0.057005804032087326, -0.1719483882188797, 0.006793111562728882, 0.534357488155365, 0.0020376890897750854, -0.08064915239810944, 0.2960575520992279, -0.23769083619117737, 0.02618344873189926, -0.20081713795661926, 0.3088263273239136, 0.10361236333847046, 0.13968168199062347, -0.5283290147781372, 0.33386194705963135, 0.15441542863845825, 0.2373167723417282, -0.06043571978807449, -0.16132444143295288, 0.12394431233406067, -0.17714056372642517, 0.04661877825856209, 0.16795021295547485, -0.26283514499664307, 0.1996668130159378, 0.1460491120815277, -0.39305514097213745, 0.04160843789577484, 0.23073440790176392, 0.3403039872646332, 0.07789529114961624, 0.30625396966934204, 0.01676129922270775, -0.02632104605436325, 0.19134144484996796, -0.4669661819934845, 0.12852191925048828, 0.4062877297401428, -0.25462955236434937, -0.412368506193161, 0.3201993405818939, -0.21434976160526276, -0.2726609706878662, -0.06783248484134674, 0.23716837167739868, 0.39496198296546936, 0.20873963832855225, 0.03850436955690384, -0.0012676753103733063, 0.2793407738208771, -0.25210970640182495, 0.23384179174900055, 0.009548891335725784, 0.2387600839138031, 0.09445735812187195, 0.09712453186511993, 0.16576015949249268, -0.23766714334487915, 0.11029346287250519, 0.06793426722288132, 0.5655380487442017, -0.6202950477600098, 0.0001902356743812561, -0.17497774958610535, -0.4075888991355896, -0.04994173347949982, 0.15242907404899597, 0.018436729907989502, -0.27393096685409546, -0.03808270022273064, 0.4757695496082306, -0.12147482484579086, -0.11154402792453766, 0.20765390992164612, 0.2794783115386963, 0.22618697583675385, -0.3254437744617462, -0.0791223794221878, 0.001916591078042984, -0.31224584579467773, 0.0612463653087616, 0.37046706676483154, -0.36138349771499634, 0.31395646929740906, -0.03583309054374695, 0.013472914695739746, 0.06545081734657288, -0.1621350795030594, 0.1349334418773651, -0.16973216831684113, 0.17653362452983856, -0.06483833491802216, 0.26808586716651917, 0.01739254593849182, -0.23078212141990662, -0.07960046082735062, -0.33142513036727905, -0.1621951311826706, 0.40560030937194824, -0.05554796755313873, -0.009013041853904724, -0.10923530906438828, 0.05241349712014198, 0.022907594218850136, -0.2459293156862259, 0.09321222454309464, -0.16864919662475586, 0.18882086873054504, 0.5482213497161865, 0.1692103147506714, 0.08859626948833466, -0.17286795377731323, -0.1251889318227768, -0.3345068097114563, -0.6612553596496582, 0.2639760971069336, 0.010323800146579742, -0.139260932803154, -0.2664072513580322, 0.19944588840007782, -0.04556683078408241, 0.6737167835235596, -0.5157793760299683, 0.21188221871852875, -0.3649276793003082, -0.2603416442871094, -0.37849509716033936, -0.002674780786037445, 0.08660809695720673, -0.1095304787158966, 0.03451857715845108, 0.06594706326723099, 0.03707633167505264, -0.14054398238658905, -0.02610766887664795, 0.19118031859397888, 0.004456499591469765, 0.35010725259780884, 0.3764932155609131, 0.877342164516449, -0.1726303994655609, 0.06925512850284576, 0.03995027020573616, -0.12991805374622345, 0.2168785035610199, -0.2427341639995575, -0.21414372324943542, 0.38901641964912415, 0.08829881995916367, -0.09715888649225235, 0.16371874511241913, -0.0527983196079731, -0.1754903793334961, 0.09468559920787811, 0.13791798055171967, 0.22236719727516174, -0.2896282970905304, 0.27841779589653015, -0.16788817942142487, 0.006256626918911934, 0.15850526094436646, 0.0009059831500053406, -0.2519923746585846, -0.44577863812446594, -0.13196170330047607, -0.021984603255987167, 0.2603362202644348, 0.034964632242918015, -0.38602691888809204, -0.1755267232656479, -0.6771333813667297, -0.033371828496456146, 0.11903660744428635, 0.4629742503166199, 0.010056920349597931, -0.09503553062677383, 0.057861652225255966, 0.39301660656929016, 0.8252864480018616, 0.24476651847362518, -0.059740133583545685, 0.08257050812244415, 0.011883914470672607, -0.4002179503440857, -0.07734110206365585, -0.06249719113111496, 0.05276608094573021, 0.04735922813415527, 0.3315272927284241, -0.10680888593196869, -0.17009899020195007, 0.11005518585443497, 0.16296324133872986, -0.04946983978152275, -0.19701337814331055, -0.19799743592739105, -0.2646736800670624, 0.027264416217803955, 0.17396774888038635, 0.1535199135541916, 0.1426929235458374, 0.07120383530855179, -0.14464563131332397, 0.07071465253829956, 0.07777199894189835, 0.3107278645038605, -0.10372333228588104, 0.13864846527576447, 0.354793518781662, 0.30826473236083984, 0.029450464993715286, -0.3700515031814575, 0.4333224594593048, 0.16342654824256897, 0.018670864403247833, -0.2741889953613281, -0.016005095094442368, 0.3746204376220703, 0.11667551845312119, 0.2916150987148285, -0.2565803825855255, 0.05515236407518387, -0.1264248490333557, 0.292450487613678, -0.4006596803665161, 0.4228612780570984, 0.08970098197460175, 0.014303851872682571, -0.38425412774086, -0.7844337224960327, 0.16677410900592804, 0.22344958782196045, 0.23551805317401886, 0.6276204586029053, -0.11336159706115723, -0.14105460047721863, 0.1554947942495346, 0.10613292455673218, 0.7833775281906128, -0.4129960536956787, 0.34167689085006714, 0.7345877289772034, 0.28683599829673767, 0.298482209444046, -0.20301179587841034, 0.23297949135303497, -0.013918928802013397, -0.4319678544998169, 0.16043123602867126, -0.1378307193517685, -0.310440331697464, -0.047996699810028076, 0.22493594884872437, 0.2308184802532196, -0.053054727613925934, 0.08264545351266861, -0.04071617126464844, 0.2017822116613388, -0.12828031182289124, -0.28415048122406006, 0.10861042886972427, 0.0717562660574913, -0.13105043768882751, -0.07062262296676636, 0.06737986207008362, 0.027156192809343338, -0.20953775942325592, 0.14492562413215637, -0.2531062364578247, -0.10729682445526123, -0.44492465257644653, 0.06430135667324066, -0.3429420590400696, 0.12741681933403015, 0.10564520210027695, 0.11235418915748596, -0.03542947396636009, 0.22347351908683777, -0.16487877070903778, 0.08296120166778564, -0.07078687101602554, 0.2883510887622833, 0.20269665122032166, 0.03631189838051796, 0.3064688742160797, 0.12304988503456116, 0.03479817509651184, -0.1278008371591568, 0.10382798314094543, -0.214501291513443, -0.47922736406326294, -0.20934006571769714, 0.24734383821487427, -0.12416313588619232, -0.36982113122940063, 0.0449414998292923, 0.09599778801202774, 0.10751938819885254, 0.07635769993066788, -0.02413146197795868, 0.0007837675511837006, 0.25554394721984863, -0.19630052149295807, -0.23334340751171112, 0.048118844628334045, 0.30197083950042725, 0.14214029908180237, 0.16217249631881714, 0.21273469924926758, 0.08796831965446472, -0.10769953578710556, 0.07944459468126297, 0.26643791794776917, 0.31152185797691345, -0.031834349036216736, 0.24130013585090637, -0.04447343572974205, 0.25648170709609985, -0.14365218579769135, -0.02265230566263199, -0.13797898590564728, -0.09591836482286453, -0.0177992582321167, 0.06536536663770676, -0.46515733003616333, 0.1711570918560028, 0.03990771621465683, 0.22818121314048767, -0.034839898347854614, 0.33610379695892334, -0.2940639555454254, 0.1822604238986969, -0.19940011203289032, -0.11219799518585205, 0.14886817336082458, 0.02094946801662445, -0.0917256772518158, 0.017208576202392578, 0.1477029025554657, -0.17550736665725708, -0.020897891372442245, 0.05855478346347809, -0.19234149158000946, -0.21130894124507904, -0.035233598202466965, 0.14376163482666016, 0.1267503947019577, -0.21118204295635223, 0.21184656023979187, -0.3128011226654053, -0.2946197986602783, -0.36606425046920776, 0.3459402322769165, 0.3402777314186096, -0.14977487921714783, -0.16905343532562256, 0.5087978839874268, 0.01338118128478527, 0.27052077651023865, 0.32309916615486145, -0.10687310993671417, 0.0817311555147171, -0.055674273520708084, 0.2115539312362671, 0.12259471416473389, -0.218672513961792, -0.407997727394104, 0.11515190452337265, 0.21594969928264618, -0.24732327461242676, 0.10155363380908966, -0.03632888197898865, -0.07952646911144257, 0.2992042303085327, -0.05582408607006073, 0.4100866913795471, -0.20784863829612732, -0.1362880915403366, 0.14723984897136688, 0.06824329495429993, 0.1740475296974182, -0.13710233569145203, -0.059635747224092484, 0.039002735167741776, -0.22452060878276825, 0.017728015780448914, -0.3877726197242737, 0.06932730972766876, -0.29476696252822876, 0.05635476112365723, 0.13929840922355652, -0.2168029248714447, 0.06503237038850784, 0.36470064520835876, -0.009760506451129913, -0.03600402548909187, 0.15351247787475586, 0.13205355405807495, 0.02153017744421959, 0.45732763409614563, 0.29610979557037354, 0.421818345785141, -0.11053568124771118, 0.001726686954498291, -0.05092310160398483, -0.5716678500175476, -0.26885008811950684, 0.851121187210083, -0.502113401889801, 0.5085180997848511, 0.00045435503125190735, 0.05891123041510582, 0.1629047989845276, -0.11558903753757477, 0.17450785636901855, 0.1867327243089676, -0.1600344479084015, -0.11428433656692505, 0.18294018507003784, -0.013408102095127106, -0.04834476113319397, 0.135089710354805, -0.17091058194637299, -0.3627505302429199, 0.012971553951501846, 0.055869877338409424, -0.25521206855773926, -0.061231255531311035, -0.12356172502040863, 0.2098342776298523, 0.16079723834991455, -0.30922651290893555, 0.016063237562775612, -0.2848983705043793, -0.13307341933250427, 0.036349762231111526, 0.09357219189405441, 0.10250943899154663, 0.4337397515773773, 0.2703842520713806, 0.13394415378570557, 0.09615318477153778, 0.010728143155574799, 0.021360665559768677, 0.3807562291622162, 0.10398228466510773, 0.21150486171245575, 0.0026781708002090454, -0.06588265299797058, -0.0332086905837059, -0.2720206081867218, 0.17727521061897278, 0.019932281225919724, -0.5029805302619934, 0.1554557979106903, 0.017435239627957344, -0.011953026056289673, -0.0991809219121933, 0.21687982976436615, -0.23837444186210632, 0.15399470925331116, 0.13669317960739136, -0.20927806198596954, 0.09904779493808746, 0.03429543972015381, 0.04052596539258957, -0.10328435152769089, 0.43288910388946533, 0.0768943578004837, -0.0667915791273117, -0.31940174102783203, -0.16572162508964539, -0.3538491129875183, 0.0070986635982990265, -0.1577225923538208, 0.5562393069267273, 0.32587164640426636, 0.22583362460136414, -0.20518861711025238, 0.03584401309490204, -0.38131213188171387, -0.16255459189414978, -0.3154142200946808, 0.1318141222000122, -0.01798243075609207, -0.223582461476326, -0.5401554107666016, -0.0309935100376606, 0.0700172632932663, -0.421720951795578, 0.4001044034957886, -0.11711923778057098, -0.1338585764169693, -0.12931939959526062, 0.29516279697418213, 0.0883685052394867, 0.2794725000858307, 0.1318768858909607, 0.0929877981543541, 0.00502656027674675, 0.06784512102603912, 0.03173079341650009, -0.21476812660694122, 0.016171012073755264, -0.31830307841300964, -0.1079016625881195, -0.1723623275756836, 0.017918705940246582, -0.09081953018903732, -0.3339090049266815, -0.06265701353549957, 0.1843472123146057, -0.038682837039232254, -0.1469016969203949, -0.3085178732872009, 0.09216337651014328, 0.08388330042362213, 0.394920289516449, 0.1664564311504364, 0.29557517170906067, -0.13276177644729614, 0.08053185045719147, -0.19377665221691132, -0.12918582558631897, 0.4818224310874939, -0.2891770601272583, -0.12095453590154648, -0.058361563831567764, 0.059344153851270676, 0.03084678202867508, -0.20525270700454712, -0.39586445689201355, 0.16866758465766907, 0.31409451365470886, -0.019982391968369484, -0.026513386517763138, 0.5844383239746094, -0.21932198107242584, 0.11298778653144836, -0.03731111064553261, 0.5549224615097046, 0.08031053841114044, -0.25588130950927734, 0.4122040569782257, -0.3177897334098816 ]
https://github.com/huggingface/datasets/issues/5855
Hi @massquantity, the dataset being shuffled there is not the full dataset. If you look at [the line above](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L182), the dataset is actually just a single indices array at that point, and that array is the only thing that gets fully loaded into memory and shuffled. We then load samples from the dataset by applying a transform function to the shuffled dataset, which fetches samples based on the indices it receives. If your dataset is **really** gigantic, then this index tensor might be a memory issue, but since it's just an int64 tensor it will only use 1GB of memory per 125 million samples. Still, if you're encountering memory issues, there might be another cause here - can you share some code to reproduce the error, or does it depend on some internal/proprietary dataset?
`to_tf_dataset` consumes too much memory
### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3
134
`to_tf_dataset` consumes too much memory ### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3 Hi @massquantity, the dataset being shuffled there is not the full dataset. If you look at [the line above](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L182), the dataset is actually just a single indices array at that point, and that array is the only thing that gets fully loaded into memory and shuffled. We then load samples from the dataset by applying a transform function to the shuffled dataset, which fetches samples based on the indices it receives. If your dataset is **really** gigantic, then this index tensor might be a memory issue, but since it's just an int64 tensor it will only use 1GB of memory per 125 million samples. Still, if you're encountering memory issues, there might be another cause here - can you share some code to reproduce the error, or does it depend on some internal/proprietary dataset?
[ -0.15822795033454895, -0.23407281935214996, 0.09227368235588074, 0.3770810663700104, 0.5104161500930786, 0.20725011825561523, -0.034461960196495056, 0.27628540992736816, -0.2560502588748932, 0.33825477957725525, -0.024285780265927315, 0.16308927536010742, -0.44833457469940186, -0.05245983228087425, 0.22439958155155182, -0.08521826565265656, 0.18257606029510498, -0.12151472270488739, -0.2156122326850891, 0.009591400623321533, -0.18600952625274658, -0.1572999805212021, -0.15149500966072083, -0.2762797176837921, -0.07886103540658951, 0.053714267909526825, 0.24288222193717957, 0.11352112889289856, 0.045504018664360046, 0.11847153306007385, 0.01778903603553772, 0.1438693404197693, -0.0733426958322525, 0.5193463563919067, -0.00011887728032888845, 0.04248824715614319, 0.025390028953552246, 0.017749294638633728, -0.20652887225151062, 0.23555652797222137, -0.04330485314130783, 0.15754064917564392, -0.2680107355117798, 0.06575962901115417, 0.0760931521654129, 0.03503500297665596, -0.03358433023095131, -0.24468737840652466, 0.07239236682653427, 0.18836039304733276, 0.109595887362957, 0.2446056455373764, 0.006833113729953766, 0.270402193069458, 0.5546197295188904, 0.12427662312984467, -0.15182797610759735, 0.14158600568771362, -0.012111354619264603, -0.04732375964522362, -0.021348528563976288, 0.29770517349243164, 0.022721730172634125, 0.1004084125161171, 0.5147581696510315, -0.11135412752628326, -0.08168546855449677, -0.10393235087394714, 0.050984639674425125, 0.38528546690940857, 0.21881836652755737, -0.32709190249443054, -0.1110735759139061, -0.43611541390419006, 0.006830643862485886, -0.19580242037773132, -0.0015779752284288406, -0.16257792711257935, -0.19865477085113525, -0.0887514054775238, -0.493394136428833, -0.17700889706611633, -0.008836276829242706, -0.0027658287435770035, -0.03837714344263077, 0.13156798481941223, -0.03315071389079094, 0.09095780551433563, 0.3398818075656891, -0.33399325609207153, 0.43166130781173706, -0.02433749847114086, 0.04527401179075241, 0.30649685859680176, -0.6095265746116638, -0.16167253255844116, 0.1596611738204956, -0.316594660282135, 0.3132362961769104, -0.3122553527355194, 0.100961834192276, -0.05228731036186218, -0.10514922440052032, -0.16306732594966888, 0.28074881434440613, 0.19066482782363892, -0.4858037233352661, 0.3186251223087311, -0.14500170946121216, 0.03644493594765663, 0.12369365990161896, -0.027226882055401802, -0.1824026256799698, -0.03729328140616417, 0.29054003953933716, -0.3843509256839752, 0.016435787081718445, 0.13605031371116638, -0.3258666396141052, 0.20667308568954468, -0.09889593720436096, 0.1302201896905899, 0.14773458242416382, 0.19901233911514282, -0.17840144038200378, 0.3223017752170563, -0.0452161468565464, -0.3347390294075012, -0.304980993270874, 0.0041634999215602875, -0.35149040818214417, -0.0897970199584961, -0.16642096638679504, 0.13250336050987244, -0.01263660192489624, -0.08056504279375076, -0.07188165187835693, 0.014275938272476196, 0.055781807750463486, 0.19539496302604675, -0.026906903833150864, -0.18719743192195892, 0.1945086270570755, 0.24641911685466766, -0.20861206948757172, 0.11154647916555405, -0.003336576046422124, 0.2812846302986145, -0.2202146351337433, 0.43640977144241333, -0.483782559633255, -0.32899218797683716, 0.26731571555137634, 0.11374073475599289, -0.04881042242050171, -0.17855024337768555, -0.5278759598731995, 0.3185975253582001, 0.33576613664627075, -0.09799480438232422, -0.0755024179816246, -0.3261210322380066, -0.5926900506019592, -0.20952314138412476, 0.29131969809532166, 0.3965590000152588, -0.21711915731430054, 0.050279535353183746, 0.1674906611442566, -0.1879318207502365, 0.5304161310195923, 0.4585167169570923, -0.05516388639807701, 0.23215115070343018, -0.1334109753370285, -0.2894537150859833, 0.13035140931606293, 0.07149605453014374, -0.36872777342796326, 0.2032485157251358, -0.39450615644454956, 0.43354323506355286, -0.07670700550079346, 0.21166951954364777, -0.05271966755390167, -0.1228688582777977, 0.663454532623291, 0.46041277050971985, -0.41860708594322205, 0.3542313575744629, -0.3050636649131775, -0.25038132071495056, 0.01200302317738533, 0.244306743144989, -0.15035055577754974, -0.034811802208423615, -0.2754697799682617, 0.2806409001350403, 0.378619521856308, 0.012948361225426197, -0.03716804459691048, 0.008611271157860756, 0.074164018034935, 0.17260384559631348, -0.09916602075099945, -0.11206565797328949, -0.21806247532367706, 0.1275118738412857, 0.33926501870155334, -0.2996363639831543, 0.442605584859848, -0.12897726893424988, 0.05751074105501175, 0.05668080598115921, 0.11044256389141083, 0.1626492738723755, -0.08989255130290985, -0.12691332399845123, 0.0695994570851326, 0.136696457862854, -0.02060823142528534, 0.07255836576223373, -0.5407472252845764, -0.057005804032087326, -0.1719483882188797, 0.006793111562728882, 0.534357488155365, 0.0020376890897750854, -0.08064915239810944, 0.2960575520992279, -0.23769083619117737, 0.02618344873189926, -0.20081713795661926, 0.3088263273239136, 0.10361236333847046, 0.13968168199062347, -0.5283290147781372, 0.33386194705963135, 0.15441542863845825, 0.2373167723417282, -0.06043571978807449, -0.16132444143295288, 0.12394431233406067, -0.17714056372642517, 0.04661877825856209, 0.16795021295547485, -0.26283514499664307, 0.1996668130159378, 0.1460491120815277, -0.39305514097213745, 0.04160843789577484, 0.23073440790176392, 0.3403039872646332, 0.07789529114961624, 0.30625396966934204, 0.01676129922270775, -0.02632104605436325, 0.19134144484996796, -0.4669661819934845, 0.12852191925048828, 0.4062877297401428, -0.25462955236434937, -0.412368506193161, 0.3201993405818939, -0.21434976160526276, -0.2726609706878662, -0.06783248484134674, 0.23716837167739868, 0.39496198296546936, 0.20873963832855225, 0.03850436955690384, -0.0012676753103733063, 0.2793407738208771, -0.25210970640182495, 0.23384179174900055, 0.009548891335725784, 0.2387600839138031, 0.09445735812187195, 0.09712453186511993, 0.16576015949249268, -0.23766714334487915, 0.11029346287250519, 0.06793426722288132, 0.5655380487442017, -0.6202950477600098, 0.0001902356743812561, -0.17497774958610535, -0.4075888991355896, -0.04994173347949982, 0.15242907404899597, 0.018436729907989502, -0.27393096685409546, -0.03808270022273064, 0.4757695496082306, -0.12147482484579086, -0.11154402792453766, 0.20765390992164612, 0.2794783115386963, 0.22618697583675385, -0.3254437744617462, -0.0791223794221878, 0.001916591078042984, -0.31224584579467773, 0.0612463653087616, 0.37046706676483154, -0.36138349771499634, 0.31395646929740906, -0.03583309054374695, 0.013472914695739746, 0.06545081734657288, -0.1621350795030594, 0.1349334418773651, -0.16973216831684113, 0.17653362452983856, -0.06483833491802216, 0.26808586716651917, 0.01739254593849182, -0.23078212141990662, -0.07960046082735062, -0.33142513036727905, -0.1621951311826706, 0.40560030937194824, -0.05554796755313873, -0.009013041853904724, -0.10923530906438828, 0.05241349712014198, 0.022907594218850136, -0.2459293156862259, 0.09321222454309464, -0.16864919662475586, 0.18882086873054504, 0.5482213497161865, 0.1692103147506714, 0.08859626948833466, -0.17286795377731323, -0.1251889318227768, -0.3345068097114563, -0.6612553596496582, 0.2639760971069336, 0.010323800146579742, -0.139260932803154, -0.2664072513580322, 0.19944588840007782, -0.04556683078408241, 0.6737167835235596, -0.5157793760299683, 0.21188221871852875, -0.3649276793003082, -0.2603416442871094, -0.37849509716033936, -0.002674780786037445, 0.08660809695720673, -0.1095304787158966, 0.03451857715845108, 0.06594706326723099, 0.03707633167505264, -0.14054398238658905, -0.02610766887664795, 0.19118031859397888, 0.004456499591469765, 0.35010725259780884, 0.3764932155609131, 0.877342164516449, -0.1726303994655609, 0.06925512850284576, 0.03995027020573616, -0.12991805374622345, 0.2168785035610199, -0.2427341639995575, -0.21414372324943542, 0.38901641964912415, 0.08829881995916367, -0.09715888649225235, 0.16371874511241913, -0.0527983196079731, -0.1754903793334961, 0.09468559920787811, 0.13791798055171967, 0.22236719727516174, -0.2896282970905304, 0.27841779589653015, -0.16788817942142487, 0.006256626918911934, 0.15850526094436646, 0.0009059831500053406, -0.2519923746585846, -0.44577863812446594, -0.13196170330047607, -0.021984603255987167, 0.2603362202644348, 0.034964632242918015, -0.38602691888809204, -0.1755267232656479, -0.6771333813667297, -0.033371828496456146, 0.11903660744428635, 0.4629742503166199, 0.010056920349597931, -0.09503553062677383, 0.057861652225255966, 0.39301660656929016, 0.8252864480018616, 0.24476651847362518, -0.059740133583545685, 0.08257050812244415, 0.011883914470672607, -0.4002179503440857, -0.07734110206365585, -0.06249719113111496, 0.05276608094573021, 0.04735922813415527, 0.3315272927284241, -0.10680888593196869, -0.17009899020195007, 0.11005518585443497, 0.16296324133872986, -0.04946983978152275, -0.19701337814331055, -0.19799743592739105, -0.2646736800670624, 0.027264416217803955, 0.17396774888038635, 0.1535199135541916, 0.1426929235458374, 0.07120383530855179, -0.14464563131332397, 0.07071465253829956, 0.07777199894189835, 0.3107278645038605, -0.10372333228588104, 0.13864846527576447, 0.354793518781662, 0.30826473236083984, 0.029450464993715286, -0.3700515031814575, 0.4333224594593048, 0.16342654824256897, 0.018670864403247833, -0.2741889953613281, -0.016005095094442368, 0.3746204376220703, 0.11667551845312119, 0.2916150987148285, -0.2565803825855255, 0.05515236407518387, -0.1264248490333557, 0.292450487613678, -0.4006596803665161, 0.4228612780570984, 0.08970098197460175, 0.014303851872682571, -0.38425412774086, -0.7844337224960327, 0.16677410900592804, 0.22344958782196045, 0.23551805317401886, 0.6276204586029053, -0.11336159706115723, -0.14105460047721863, 0.1554947942495346, 0.10613292455673218, 0.7833775281906128, -0.4129960536956787, 0.34167689085006714, 0.7345877289772034, 0.28683599829673767, 0.298482209444046, -0.20301179587841034, 0.23297949135303497, -0.013918928802013397, -0.4319678544998169, 0.16043123602867126, -0.1378307193517685, -0.310440331697464, -0.047996699810028076, 0.22493594884872437, 0.2308184802532196, -0.053054727613925934, 0.08264545351266861, -0.04071617126464844, 0.2017822116613388, -0.12828031182289124, -0.28415048122406006, 0.10861042886972427, 0.0717562660574913, -0.13105043768882751, -0.07062262296676636, 0.06737986207008362, 0.027156192809343338, -0.20953775942325592, 0.14492562413215637, -0.2531062364578247, -0.10729682445526123, -0.44492465257644653, 0.06430135667324066, -0.3429420590400696, 0.12741681933403015, 0.10564520210027695, 0.11235418915748596, -0.03542947396636009, 0.22347351908683777, -0.16487877070903778, 0.08296120166778564, -0.07078687101602554, 0.2883510887622833, 0.20269665122032166, 0.03631189838051796, 0.3064688742160797, 0.12304988503456116, 0.03479817509651184, -0.1278008371591568, 0.10382798314094543, -0.214501291513443, -0.47922736406326294, -0.20934006571769714, 0.24734383821487427, -0.12416313588619232, -0.36982113122940063, 0.0449414998292923, 0.09599778801202774, 0.10751938819885254, 0.07635769993066788, -0.02413146197795868, 0.0007837675511837006, 0.25554394721984863, -0.19630052149295807, -0.23334340751171112, 0.048118844628334045, 0.30197083950042725, 0.14214029908180237, 0.16217249631881714, 0.21273469924926758, 0.08796831965446472, -0.10769953578710556, 0.07944459468126297, 0.26643791794776917, 0.31152185797691345, -0.031834349036216736, 0.24130013585090637, -0.04447343572974205, 0.25648170709609985, -0.14365218579769135, -0.02265230566263199, -0.13797898590564728, -0.09591836482286453, -0.0177992582321167, 0.06536536663770676, -0.46515733003616333, 0.1711570918560028, 0.03990771621465683, 0.22818121314048767, -0.034839898347854614, 0.33610379695892334, -0.2940639555454254, 0.1822604238986969, -0.19940011203289032, -0.11219799518585205, 0.14886817336082458, 0.02094946801662445, -0.0917256772518158, 0.017208576202392578, 0.1477029025554657, -0.17550736665725708, -0.020897891372442245, 0.05855478346347809, -0.19234149158000946, -0.21130894124507904, -0.035233598202466965, 0.14376163482666016, 0.1267503947019577, -0.21118204295635223, 0.21184656023979187, -0.3128011226654053, -0.2946197986602783, -0.36606425046920776, 0.3459402322769165, 0.3402777314186096, -0.14977487921714783, -0.16905343532562256, 0.5087978839874268, 0.01338118128478527, 0.27052077651023865, 0.32309916615486145, -0.10687310993671417, 0.0817311555147171, -0.055674273520708084, 0.2115539312362671, 0.12259471416473389, -0.218672513961792, -0.407997727394104, 0.11515190452337265, 0.21594969928264618, -0.24732327461242676, 0.10155363380908966, -0.03632888197898865, -0.07952646911144257, 0.2992042303085327, -0.05582408607006073, 0.4100866913795471, -0.20784863829612732, -0.1362880915403366, 0.14723984897136688, 0.06824329495429993, 0.1740475296974182, -0.13710233569145203, -0.059635747224092484, 0.039002735167741776, -0.22452060878276825, 0.017728015780448914, -0.3877726197242737, 0.06932730972766876, -0.29476696252822876, 0.05635476112365723, 0.13929840922355652, -0.2168029248714447, 0.06503237038850784, 0.36470064520835876, -0.009760506451129913, -0.03600402548909187, 0.15351247787475586, 0.13205355405807495, 0.02153017744421959, 0.45732763409614563, 0.29610979557037354, 0.421818345785141, -0.11053568124771118, 0.001726686954498291, -0.05092310160398483, -0.5716678500175476, -0.26885008811950684, 0.851121187210083, -0.502113401889801, 0.5085180997848511, 0.00045435503125190735, 0.05891123041510582, 0.1629047989845276, -0.11558903753757477, 0.17450785636901855, 0.1867327243089676, -0.1600344479084015, -0.11428433656692505, 0.18294018507003784, -0.013408102095127106, -0.04834476113319397, 0.135089710354805, -0.17091058194637299, -0.3627505302429199, 0.012971553951501846, 0.055869877338409424, -0.25521206855773926, -0.061231255531311035, -0.12356172502040863, 0.2098342776298523, 0.16079723834991455, -0.30922651290893555, 0.016063237562775612, -0.2848983705043793, -0.13307341933250427, 0.036349762231111526, 0.09357219189405441, 0.10250943899154663, 0.4337397515773773, 0.2703842520713806, 0.13394415378570557, 0.09615318477153778, 0.010728143155574799, 0.021360665559768677, 0.3807562291622162, 0.10398228466510773, 0.21150486171245575, 0.0026781708002090454, -0.06588265299797058, -0.0332086905837059, -0.2720206081867218, 0.17727521061897278, 0.019932281225919724, -0.5029805302619934, 0.1554557979106903, 0.017435239627957344, -0.011953026056289673, -0.0991809219121933, 0.21687982976436615, -0.23837444186210632, 0.15399470925331116, 0.13669317960739136, -0.20927806198596954, 0.09904779493808746, 0.03429543972015381, 0.04052596539258957, -0.10328435152769089, 0.43288910388946533, 0.0768943578004837, -0.0667915791273117, -0.31940174102783203, -0.16572162508964539, -0.3538491129875183, 0.0070986635982990265, -0.1577225923538208, 0.5562393069267273, 0.32587164640426636, 0.22583362460136414, -0.20518861711025238, 0.03584401309490204, -0.38131213188171387, -0.16255459189414978, -0.3154142200946808, 0.1318141222000122, -0.01798243075609207, -0.223582461476326, -0.5401554107666016, -0.0309935100376606, 0.0700172632932663, -0.421720951795578, 0.4001044034957886, -0.11711923778057098, -0.1338585764169693, -0.12931939959526062, 0.29516279697418213, 0.0883685052394867, 0.2794725000858307, 0.1318768858909607, 0.0929877981543541, 0.00502656027674675, 0.06784512102603912, 0.03173079341650009, -0.21476812660694122, 0.016171012073755264, -0.31830307841300964, -0.1079016625881195, -0.1723623275756836, 0.017918705940246582, -0.09081953018903732, -0.3339090049266815, -0.06265701353549957, 0.1843472123146057, -0.038682837039232254, -0.1469016969203949, -0.3085178732872009, 0.09216337651014328, 0.08388330042362213, 0.394920289516449, 0.1664564311504364, 0.29557517170906067, -0.13276177644729614, 0.08053185045719147, -0.19377665221691132, -0.12918582558631897, 0.4818224310874939, -0.2891770601272583, -0.12095453590154648, -0.058361563831567764, 0.059344153851270676, 0.03084678202867508, -0.20525270700454712, -0.39586445689201355, 0.16866758465766907, 0.31409451365470886, -0.019982391968369484, -0.026513386517763138, 0.5844383239746094, -0.21932198107242584, 0.11298778653144836, -0.03731111064553261, 0.5549224615097046, 0.08031053841114044, -0.25588130950927734, 0.4122040569782257, -0.3177897334098816 ]
https://github.com/huggingface/datasets/issues/5855
Hi @Rocketknight1, you're right and I also noticed that only indices are used in shuffling. My data has shape (50000000, 10), but really the problem doesn't relate to a specific dataset. Simply running the following code costs me 10GB of memory. ```python from datasets import Dataset def gen(): for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=1, shuffle=True, drop_remainder=False, prefetch=True, ) tf_ds = iter(tf_ds) next(tf_ds) # {'data': <tf.Tensor: shape=(1,), dtype=int64, numpy=array([0])>} ``` I just realized maybe it was an issue from tensorflow (I'm using tf 2.12). So I tried the following code, and it used 10GB of memory too. ```python import numpy as np import tensorflow as tf data_size = 50000000 tf_dataset = tf.data.Dataset.from_tensor_slices(np.arange(data_size)) tf_dataset = iter(tf_dataset.shuffle(data_size)) next(tf_dataset) # <tf.Tensor: shape=(), dtype=int64, numpy=24774043> ``` By the way, as @lhoestq mentioned, multiprocessing uses numpy shuffling, and it uses less than 1 GB of memory: ```python tf_ds_mp = ds.to_tf_dataset( batch_size=1, shuffle=True, drop_remainder=False, prefetch=True, num_workers=2, ) ```
`to_tf_dataset` consumes too much memory
### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3
160
`to_tf_dataset` consumes too much memory ### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3 Hi @Rocketknight1, you're right and I also noticed that only indices are used in shuffling. My data has shape (50000000, 10), but really the problem doesn't relate to a specific dataset. Simply running the following code costs me 10GB of memory. ```python from datasets import Dataset def gen(): for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=1, shuffle=True, drop_remainder=False, prefetch=True, ) tf_ds = iter(tf_ds) next(tf_ds) # {'data': <tf.Tensor: shape=(1,), dtype=int64, numpy=array([0])>} ``` I just realized maybe it was an issue from tensorflow (I'm using tf 2.12). So I tried the following code, and it used 10GB of memory too. ```python import numpy as np import tensorflow as tf data_size = 50000000 tf_dataset = tf.data.Dataset.from_tensor_slices(np.arange(data_size)) tf_dataset = iter(tf_dataset.shuffle(data_size)) next(tf_dataset) # <tf.Tensor: shape=(), dtype=int64, numpy=24774043> ``` By the way, as @lhoestq mentioned, multiprocessing uses numpy shuffling, and it uses less than 1 GB of memory: ```python tf_ds_mp = ds.to_tf_dataset( batch_size=1, shuffle=True, drop_remainder=False, prefetch=True, num_workers=2, ) ```
[ -0.15822795033454895, -0.23407281935214996, 0.09227368235588074, 0.3770810663700104, 0.5104161500930786, 0.20725011825561523, -0.034461960196495056, 0.27628540992736816, -0.2560502588748932, 0.33825477957725525, -0.024285780265927315, 0.16308927536010742, -0.44833457469940186, -0.05245983228087425, 0.22439958155155182, -0.08521826565265656, 0.18257606029510498, -0.12151472270488739, -0.2156122326850891, 0.009591400623321533, -0.18600952625274658, -0.1572999805212021, -0.15149500966072083, -0.2762797176837921, -0.07886103540658951, 0.053714267909526825, 0.24288222193717957, 0.11352112889289856, 0.045504018664360046, 0.11847153306007385, 0.01778903603553772, 0.1438693404197693, -0.0733426958322525, 0.5193463563919067, -0.00011887728032888845, 0.04248824715614319, 0.025390028953552246, 0.017749294638633728, -0.20652887225151062, 0.23555652797222137, -0.04330485314130783, 0.15754064917564392, -0.2680107355117798, 0.06575962901115417, 0.0760931521654129, 0.03503500297665596, -0.03358433023095131, -0.24468737840652466, 0.07239236682653427, 0.18836039304733276, 0.109595887362957, 0.2446056455373764, 0.006833113729953766, 0.270402193069458, 0.5546197295188904, 0.12427662312984467, -0.15182797610759735, 0.14158600568771362, -0.012111354619264603, -0.04732375964522362, -0.021348528563976288, 0.29770517349243164, 0.022721730172634125, 0.1004084125161171, 0.5147581696510315, -0.11135412752628326, -0.08168546855449677, -0.10393235087394714, 0.050984639674425125, 0.38528546690940857, 0.21881836652755737, -0.32709190249443054, -0.1110735759139061, -0.43611541390419006, 0.006830643862485886, -0.19580242037773132, -0.0015779752284288406, -0.16257792711257935, -0.19865477085113525, -0.0887514054775238, -0.493394136428833, -0.17700889706611633, -0.008836276829242706, -0.0027658287435770035, -0.03837714344263077, 0.13156798481941223, -0.03315071389079094, 0.09095780551433563, 0.3398818075656891, -0.33399325609207153, 0.43166130781173706, -0.02433749847114086, 0.04527401179075241, 0.30649685859680176, -0.6095265746116638, -0.16167253255844116, 0.1596611738204956, -0.316594660282135, 0.3132362961769104, -0.3122553527355194, 0.100961834192276, -0.05228731036186218, -0.10514922440052032, -0.16306732594966888, 0.28074881434440613, 0.19066482782363892, -0.4858037233352661, 0.3186251223087311, -0.14500170946121216, 0.03644493594765663, 0.12369365990161896, -0.027226882055401802, -0.1824026256799698, -0.03729328140616417, 0.29054003953933716, -0.3843509256839752, 0.016435787081718445, 0.13605031371116638, -0.3258666396141052, 0.20667308568954468, -0.09889593720436096, 0.1302201896905899, 0.14773458242416382, 0.19901233911514282, -0.17840144038200378, 0.3223017752170563, -0.0452161468565464, -0.3347390294075012, -0.304980993270874, 0.0041634999215602875, -0.35149040818214417, -0.0897970199584961, -0.16642096638679504, 0.13250336050987244, -0.01263660192489624, -0.08056504279375076, -0.07188165187835693, 0.014275938272476196, 0.055781807750463486, 0.19539496302604675, -0.026906903833150864, -0.18719743192195892, 0.1945086270570755, 0.24641911685466766, -0.20861206948757172, 0.11154647916555405, -0.003336576046422124, 0.2812846302986145, -0.2202146351337433, 0.43640977144241333, -0.483782559633255, -0.32899218797683716, 0.26731571555137634, 0.11374073475599289, -0.04881042242050171, -0.17855024337768555, -0.5278759598731995, 0.3185975253582001, 0.33576613664627075, -0.09799480438232422, -0.0755024179816246, -0.3261210322380066, -0.5926900506019592, -0.20952314138412476, 0.29131969809532166, 0.3965590000152588, -0.21711915731430054, 0.050279535353183746, 0.1674906611442566, -0.1879318207502365, 0.5304161310195923, 0.4585167169570923, -0.05516388639807701, 0.23215115070343018, -0.1334109753370285, -0.2894537150859833, 0.13035140931606293, 0.07149605453014374, -0.36872777342796326, 0.2032485157251358, -0.39450615644454956, 0.43354323506355286, -0.07670700550079346, 0.21166951954364777, -0.05271966755390167, -0.1228688582777977, 0.663454532623291, 0.46041277050971985, -0.41860708594322205, 0.3542313575744629, -0.3050636649131775, -0.25038132071495056, 0.01200302317738533, 0.244306743144989, -0.15035055577754974, -0.034811802208423615, -0.2754697799682617, 0.2806409001350403, 0.378619521856308, 0.012948361225426197, -0.03716804459691048, 0.008611271157860756, 0.074164018034935, 0.17260384559631348, -0.09916602075099945, -0.11206565797328949, -0.21806247532367706, 0.1275118738412857, 0.33926501870155334, -0.2996363639831543, 0.442605584859848, -0.12897726893424988, 0.05751074105501175, 0.05668080598115921, 0.11044256389141083, 0.1626492738723755, -0.08989255130290985, -0.12691332399845123, 0.0695994570851326, 0.136696457862854, -0.02060823142528534, 0.07255836576223373, -0.5407472252845764, -0.057005804032087326, -0.1719483882188797, 0.006793111562728882, 0.534357488155365, 0.0020376890897750854, -0.08064915239810944, 0.2960575520992279, -0.23769083619117737, 0.02618344873189926, -0.20081713795661926, 0.3088263273239136, 0.10361236333847046, 0.13968168199062347, -0.5283290147781372, 0.33386194705963135, 0.15441542863845825, 0.2373167723417282, -0.06043571978807449, -0.16132444143295288, 0.12394431233406067, -0.17714056372642517, 0.04661877825856209, 0.16795021295547485, -0.26283514499664307, 0.1996668130159378, 0.1460491120815277, -0.39305514097213745, 0.04160843789577484, 0.23073440790176392, 0.3403039872646332, 0.07789529114961624, 0.30625396966934204, 0.01676129922270775, -0.02632104605436325, 0.19134144484996796, -0.4669661819934845, 0.12852191925048828, 0.4062877297401428, -0.25462955236434937, -0.412368506193161, 0.3201993405818939, -0.21434976160526276, -0.2726609706878662, -0.06783248484134674, 0.23716837167739868, 0.39496198296546936, 0.20873963832855225, 0.03850436955690384, -0.0012676753103733063, 0.2793407738208771, -0.25210970640182495, 0.23384179174900055, 0.009548891335725784, 0.2387600839138031, 0.09445735812187195, 0.09712453186511993, 0.16576015949249268, -0.23766714334487915, 0.11029346287250519, 0.06793426722288132, 0.5655380487442017, -0.6202950477600098, 0.0001902356743812561, -0.17497774958610535, -0.4075888991355896, -0.04994173347949982, 0.15242907404899597, 0.018436729907989502, -0.27393096685409546, -0.03808270022273064, 0.4757695496082306, -0.12147482484579086, -0.11154402792453766, 0.20765390992164612, 0.2794783115386963, 0.22618697583675385, -0.3254437744617462, -0.0791223794221878, 0.001916591078042984, -0.31224584579467773, 0.0612463653087616, 0.37046706676483154, -0.36138349771499634, 0.31395646929740906, -0.03583309054374695, 0.013472914695739746, 0.06545081734657288, -0.1621350795030594, 0.1349334418773651, -0.16973216831684113, 0.17653362452983856, -0.06483833491802216, 0.26808586716651917, 0.01739254593849182, -0.23078212141990662, -0.07960046082735062, -0.33142513036727905, -0.1621951311826706, 0.40560030937194824, -0.05554796755313873, -0.009013041853904724, -0.10923530906438828, 0.05241349712014198, 0.022907594218850136, -0.2459293156862259, 0.09321222454309464, -0.16864919662475586, 0.18882086873054504, 0.5482213497161865, 0.1692103147506714, 0.08859626948833466, -0.17286795377731323, -0.1251889318227768, -0.3345068097114563, -0.6612553596496582, 0.2639760971069336, 0.010323800146579742, -0.139260932803154, -0.2664072513580322, 0.19944588840007782, -0.04556683078408241, 0.6737167835235596, -0.5157793760299683, 0.21188221871852875, -0.3649276793003082, -0.2603416442871094, -0.37849509716033936, -0.002674780786037445, 0.08660809695720673, -0.1095304787158966, 0.03451857715845108, 0.06594706326723099, 0.03707633167505264, -0.14054398238658905, -0.02610766887664795, 0.19118031859397888, 0.004456499591469765, 0.35010725259780884, 0.3764932155609131, 0.877342164516449, -0.1726303994655609, 0.06925512850284576, 0.03995027020573616, -0.12991805374622345, 0.2168785035610199, -0.2427341639995575, -0.21414372324943542, 0.38901641964912415, 0.08829881995916367, -0.09715888649225235, 0.16371874511241913, -0.0527983196079731, -0.1754903793334961, 0.09468559920787811, 0.13791798055171967, 0.22236719727516174, -0.2896282970905304, 0.27841779589653015, -0.16788817942142487, 0.006256626918911934, 0.15850526094436646, 0.0009059831500053406, -0.2519923746585846, -0.44577863812446594, -0.13196170330047607, -0.021984603255987167, 0.2603362202644348, 0.034964632242918015, -0.38602691888809204, -0.1755267232656479, -0.6771333813667297, -0.033371828496456146, 0.11903660744428635, 0.4629742503166199, 0.010056920349597931, -0.09503553062677383, 0.057861652225255966, 0.39301660656929016, 0.8252864480018616, 0.24476651847362518, -0.059740133583545685, 0.08257050812244415, 0.011883914470672607, -0.4002179503440857, -0.07734110206365585, -0.06249719113111496, 0.05276608094573021, 0.04735922813415527, 0.3315272927284241, -0.10680888593196869, -0.17009899020195007, 0.11005518585443497, 0.16296324133872986, -0.04946983978152275, -0.19701337814331055, -0.19799743592739105, -0.2646736800670624, 0.027264416217803955, 0.17396774888038635, 0.1535199135541916, 0.1426929235458374, 0.07120383530855179, -0.14464563131332397, 0.07071465253829956, 0.07777199894189835, 0.3107278645038605, -0.10372333228588104, 0.13864846527576447, 0.354793518781662, 0.30826473236083984, 0.029450464993715286, -0.3700515031814575, 0.4333224594593048, 0.16342654824256897, 0.018670864403247833, -0.2741889953613281, -0.016005095094442368, 0.3746204376220703, 0.11667551845312119, 0.2916150987148285, -0.2565803825855255, 0.05515236407518387, -0.1264248490333557, 0.292450487613678, -0.4006596803665161, 0.4228612780570984, 0.08970098197460175, 0.014303851872682571, -0.38425412774086, -0.7844337224960327, 0.16677410900592804, 0.22344958782196045, 0.23551805317401886, 0.6276204586029053, -0.11336159706115723, -0.14105460047721863, 0.1554947942495346, 0.10613292455673218, 0.7833775281906128, -0.4129960536956787, 0.34167689085006714, 0.7345877289772034, 0.28683599829673767, 0.298482209444046, -0.20301179587841034, 0.23297949135303497, -0.013918928802013397, -0.4319678544998169, 0.16043123602867126, -0.1378307193517685, -0.310440331697464, -0.047996699810028076, 0.22493594884872437, 0.2308184802532196, -0.053054727613925934, 0.08264545351266861, -0.04071617126464844, 0.2017822116613388, -0.12828031182289124, -0.28415048122406006, 0.10861042886972427, 0.0717562660574913, -0.13105043768882751, -0.07062262296676636, 0.06737986207008362, 0.027156192809343338, -0.20953775942325592, 0.14492562413215637, -0.2531062364578247, -0.10729682445526123, -0.44492465257644653, 0.06430135667324066, -0.3429420590400696, 0.12741681933403015, 0.10564520210027695, 0.11235418915748596, -0.03542947396636009, 0.22347351908683777, -0.16487877070903778, 0.08296120166778564, -0.07078687101602554, 0.2883510887622833, 0.20269665122032166, 0.03631189838051796, 0.3064688742160797, 0.12304988503456116, 0.03479817509651184, -0.1278008371591568, 0.10382798314094543, -0.214501291513443, -0.47922736406326294, -0.20934006571769714, 0.24734383821487427, -0.12416313588619232, -0.36982113122940063, 0.0449414998292923, 0.09599778801202774, 0.10751938819885254, 0.07635769993066788, -0.02413146197795868, 0.0007837675511837006, 0.25554394721984863, -0.19630052149295807, -0.23334340751171112, 0.048118844628334045, 0.30197083950042725, 0.14214029908180237, 0.16217249631881714, 0.21273469924926758, 0.08796831965446472, -0.10769953578710556, 0.07944459468126297, 0.26643791794776917, 0.31152185797691345, -0.031834349036216736, 0.24130013585090637, -0.04447343572974205, 0.25648170709609985, -0.14365218579769135, -0.02265230566263199, -0.13797898590564728, -0.09591836482286453, -0.0177992582321167, 0.06536536663770676, -0.46515733003616333, 0.1711570918560028, 0.03990771621465683, 0.22818121314048767, -0.034839898347854614, 0.33610379695892334, -0.2940639555454254, 0.1822604238986969, -0.19940011203289032, -0.11219799518585205, 0.14886817336082458, 0.02094946801662445, -0.0917256772518158, 0.017208576202392578, 0.1477029025554657, -0.17550736665725708, -0.020897891372442245, 0.05855478346347809, -0.19234149158000946, -0.21130894124507904, -0.035233598202466965, 0.14376163482666016, 0.1267503947019577, -0.21118204295635223, 0.21184656023979187, -0.3128011226654053, -0.2946197986602783, -0.36606425046920776, 0.3459402322769165, 0.3402777314186096, -0.14977487921714783, -0.16905343532562256, 0.5087978839874268, 0.01338118128478527, 0.27052077651023865, 0.32309916615486145, -0.10687310993671417, 0.0817311555147171, -0.055674273520708084, 0.2115539312362671, 0.12259471416473389, -0.218672513961792, -0.407997727394104, 0.11515190452337265, 0.21594969928264618, -0.24732327461242676, 0.10155363380908966, -0.03632888197898865, -0.07952646911144257, 0.2992042303085327, -0.05582408607006073, 0.4100866913795471, -0.20784863829612732, -0.1362880915403366, 0.14723984897136688, 0.06824329495429993, 0.1740475296974182, -0.13710233569145203, -0.059635747224092484, 0.039002735167741776, -0.22452060878276825, 0.017728015780448914, -0.3877726197242737, 0.06932730972766876, -0.29476696252822876, 0.05635476112365723, 0.13929840922355652, -0.2168029248714447, 0.06503237038850784, 0.36470064520835876, -0.009760506451129913, -0.03600402548909187, 0.15351247787475586, 0.13205355405807495, 0.02153017744421959, 0.45732763409614563, 0.29610979557037354, 0.421818345785141, -0.11053568124771118, 0.001726686954498291, -0.05092310160398483, -0.5716678500175476, -0.26885008811950684, 0.851121187210083, -0.502113401889801, 0.5085180997848511, 0.00045435503125190735, 0.05891123041510582, 0.1629047989845276, -0.11558903753757477, 0.17450785636901855, 0.1867327243089676, -0.1600344479084015, -0.11428433656692505, 0.18294018507003784, -0.013408102095127106, -0.04834476113319397, 0.135089710354805, -0.17091058194637299, -0.3627505302429199, 0.012971553951501846, 0.055869877338409424, -0.25521206855773926, -0.061231255531311035, -0.12356172502040863, 0.2098342776298523, 0.16079723834991455, -0.30922651290893555, 0.016063237562775612, -0.2848983705043793, -0.13307341933250427, 0.036349762231111526, 0.09357219189405441, 0.10250943899154663, 0.4337397515773773, 0.2703842520713806, 0.13394415378570557, 0.09615318477153778, 0.010728143155574799, 0.021360665559768677, 0.3807562291622162, 0.10398228466510773, 0.21150486171245575, 0.0026781708002090454, -0.06588265299797058, -0.0332086905837059, -0.2720206081867218, 0.17727521061897278, 0.019932281225919724, -0.5029805302619934, 0.1554557979106903, 0.017435239627957344, -0.011953026056289673, -0.0991809219121933, 0.21687982976436615, -0.23837444186210632, 0.15399470925331116, 0.13669317960739136, -0.20927806198596954, 0.09904779493808746, 0.03429543972015381, 0.04052596539258957, -0.10328435152769089, 0.43288910388946533, 0.0768943578004837, -0.0667915791273117, -0.31940174102783203, -0.16572162508964539, -0.3538491129875183, 0.0070986635982990265, -0.1577225923538208, 0.5562393069267273, 0.32587164640426636, 0.22583362460136414, -0.20518861711025238, 0.03584401309490204, -0.38131213188171387, -0.16255459189414978, -0.3154142200946808, 0.1318141222000122, -0.01798243075609207, -0.223582461476326, -0.5401554107666016, -0.0309935100376606, 0.0700172632932663, -0.421720951795578, 0.4001044034957886, -0.11711923778057098, -0.1338585764169693, -0.12931939959526062, 0.29516279697418213, 0.0883685052394867, 0.2794725000858307, 0.1318768858909607, 0.0929877981543541, 0.00502656027674675, 0.06784512102603912, 0.03173079341650009, -0.21476812660694122, 0.016171012073755264, -0.31830307841300964, -0.1079016625881195, -0.1723623275756836, 0.017918705940246582, -0.09081953018903732, -0.3339090049266815, -0.06265701353549957, 0.1843472123146057, -0.038682837039232254, -0.1469016969203949, -0.3085178732872009, 0.09216337651014328, 0.08388330042362213, 0.394920289516449, 0.1664564311504364, 0.29557517170906067, -0.13276177644729614, 0.08053185045719147, -0.19377665221691132, -0.12918582558631897, 0.4818224310874939, -0.2891770601272583, -0.12095453590154648, -0.058361563831567764, 0.059344153851270676, 0.03084678202867508, -0.20525270700454712, -0.39586445689201355, 0.16866758465766907, 0.31409451365470886, -0.019982391968369484, -0.026513386517763138, 0.5844383239746094, -0.21932198107242584, 0.11298778653144836, -0.03731111064553261, 0.5549224615097046, 0.08031053841114044, -0.25588130950927734, 0.4122040569782257, -0.3177897334098816 ]
https://github.com/huggingface/datasets/issues/5855
Thanks for that reproduction script - I've confirmed the same issue is occurring for me. Investigating it now!
`to_tf_dataset` consumes too much memory
### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3
18
`to_tf_dataset` consumes too much memory ### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3 Thanks for that reproduction script - I've confirmed the same issue is occurring for me. Investigating it now!
[ -0.15822795033454895, -0.23407281935214996, 0.09227368235588074, 0.3770810663700104, 0.5104161500930786, 0.20725011825561523, -0.034461960196495056, 0.27628540992736816, -0.2560502588748932, 0.33825477957725525, -0.024285780265927315, 0.16308927536010742, -0.44833457469940186, -0.05245983228087425, 0.22439958155155182, -0.08521826565265656, 0.18257606029510498, -0.12151472270488739, -0.2156122326850891, 0.009591400623321533, -0.18600952625274658, -0.1572999805212021, -0.15149500966072083, -0.2762797176837921, -0.07886103540658951, 0.053714267909526825, 0.24288222193717957, 0.11352112889289856, 0.045504018664360046, 0.11847153306007385, 0.01778903603553772, 0.1438693404197693, -0.0733426958322525, 0.5193463563919067, -0.00011887728032888845, 0.04248824715614319, 0.025390028953552246, 0.017749294638633728, -0.20652887225151062, 0.23555652797222137, -0.04330485314130783, 0.15754064917564392, -0.2680107355117798, 0.06575962901115417, 0.0760931521654129, 0.03503500297665596, -0.03358433023095131, -0.24468737840652466, 0.07239236682653427, 0.18836039304733276, 0.109595887362957, 0.2446056455373764, 0.006833113729953766, 0.270402193069458, 0.5546197295188904, 0.12427662312984467, -0.15182797610759735, 0.14158600568771362, -0.012111354619264603, -0.04732375964522362, -0.021348528563976288, 0.29770517349243164, 0.022721730172634125, 0.1004084125161171, 0.5147581696510315, -0.11135412752628326, -0.08168546855449677, -0.10393235087394714, 0.050984639674425125, 0.38528546690940857, 0.21881836652755737, -0.32709190249443054, -0.1110735759139061, -0.43611541390419006, 0.006830643862485886, -0.19580242037773132, -0.0015779752284288406, -0.16257792711257935, -0.19865477085113525, -0.0887514054775238, -0.493394136428833, -0.17700889706611633, -0.008836276829242706, -0.0027658287435770035, -0.03837714344263077, 0.13156798481941223, -0.03315071389079094, 0.09095780551433563, 0.3398818075656891, -0.33399325609207153, 0.43166130781173706, -0.02433749847114086, 0.04527401179075241, 0.30649685859680176, -0.6095265746116638, -0.16167253255844116, 0.1596611738204956, -0.316594660282135, 0.3132362961769104, -0.3122553527355194, 0.100961834192276, -0.05228731036186218, -0.10514922440052032, -0.16306732594966888, 0.28074881434440613, 0.19066482782363892, -0.4858037233352661, 0.3186251223087311, -0.14500170946121216, 0.03644493594765663, 0.12369365990161896, -0.027226882055401802, -0.1824026256799698, -0.03729328140616417, 0.29054003953933716, -0.3843509256839752, 0.016435787081718445, 0.13605031371116638, -0.3258666396141052, 0.20667308568954468, -0.09889593720436096, 0.1302201896905899, 0.14773458242416382, 0.19901233911514282, -0.17840144038200378, 0.3223017752170563, -0.0452161468565464, -0.3347390294075012, -0.304980993270874, 0.0041634999215602875, -0.35149040818214417, -0.0897970199584961, -0.16642096638679504, 0.13250336050987244, -0.01263660192489624, -0.08056504279375076, -0.07188165187835693, 0.014275938272476196, 0.055781807750463486, 0.19539496302604675, -0.026906903833150864, -0.18719743192195892, 0.1945086270570755, 0.24641911685466766, -0.20861206948757172, 0.11154647916555405, -0.003336576046422124, 0.2812846302986145, -0.2202146351337433, 0.43640977144241333, -0.483782559633255, -0.32899218797683716, 0.26731571555137634, 0.11374073475599289, -0.04881042242050171, -0.17855024337768555, -0.5278759598731995, 0.3185975253582001, 0.33576613664627075, -0.09799480438232422, -0.0755024179816246, -0.3261210322380066, -0.5926900506019592, -0.20952314138412476, 0.29131969809532166, 0.3965590000152588, -0.21711915731430054, 0.050279535353183746, 0.1674906611442566, -0.1879318207502365, 0.5304161310195923, 0.4585167169570923, -0.05516388639807701, 0.23215115070343018, -0.1334109753370285, -0.2894537150859833, 0.13035140931606293, 0.07149605453014374, -0.36872777342796326, 0.2032485157251358, -0.39450615644454956, 0.43354323506355286, -0.07670700550079346, 0.21166951954364777, -0.05271966755390167, -0.1228688582777977, 0.663454532623291, 0.46041277050971985, -0.41860708594322205, 0.3542313575744629, -0.3050636649131775, -0.25038132071495056, 0.01200302317738533, 0.244306743144989, -0.15035055577754974, -0.034811802208423615, -0.2754697799682617, 0.2806409001350403, 0.378619521856308, 0.012948361225426197, -0.03716804459691048, 0.008611271157860756, 0.074164018034935, 0.17260384559631348, -0.09916602075099945, -0.11206565797328949, -0.21806247532367706, 0.1275118738412857, 0.33926501870155334, -0.2996363639831543, 0.442605584859848, -0.12897726893424988, 0.05751074105501175, 0.05668080598115921, 0.11044256389141083, 0.1626492738723755, -0.08989255130290985, -0.12691332399845123, 0.0695994570851326, 0.136696457862854, -0.02060823142528534, 0.07255836576223373, -0.5407472252845764, -0.057005804032087326, -0.1719483882188797, 0.006793111562728882, 0.534357488155365, 0.0020376890897750854, -0.08064915239810944, 0.2960575520992279, -0.23769083619117737, 0.02618344873189926, -0.20081713795661926, 0.3088263273239136, 0.10361236333847046, 0.13968168199062347, -0.5283290147781372, 0.33386194705963135, 0.15441542863845825, 0.2373167723417282, -0.06043571978807449, -0.16132444143295288, 0.12394431233406067, -0.17714056372642517, 0.04661877825856209, 0.16795021295547485, -0.26283514499664307, 0.1996668130159378, 0.1460491120815277, -0.39305514097213745, 0.04160843789577484, 0.23073440790176392, 0.3403039872646332, 0.07789529114961624, 0.30625396966934204, 0.01676129922270775, -0.02632104605436325, 0.19134144484996796, -0.4669661819934845, 0.12852191925048828, 0.4062877297401428, -0.25462955236434937, -0.412368506193161, 0.3201993405818939, -0.21434976160526276, -0.2726609706878662, -0.06783248484134674, 0.23716837167739868, 0.39496198296546936, 0.20873963832855225, 0.03850436955690384, -0.0012676753103733063, 0.2793407738208771, -0.25210970640182495, 0.23384179174900055, 0.009548891335725784, 0.2387600839138031, 0.09445735812187195, 0.09712453186511993, 0.16576015949249268, -0.23766714334487915, 0.11029346287250519, 0.06793426722288132, 0.5655380487442017, -0.6202950477600098, 0.0001902356743812561, -0.17497774958610535, -0.4075888991355896, -0.04994173347949982, 0.15242907404899597, 0.018436729907989502, -0.27393096685409546, -0.03808270022273064, 0.4757695496082306, -0.12147482484579086, -0.11154402792453766, 0.20765390992164612, 0.2794783115386963, 0.22618697583675385, -0.3254437744617462, -0.0791223794221878, 0.001916591078042984, -0.31224584579467773, 0.0612463653087616, 0.37046706676483154, -0.36138349771499634, 0.31395646929740906, -0.03583309054374695, 0.013472914695739746, 0.06545081734657288, -0.1621350795030594, 0.1349334418773651, -0.16973216831684113, 0.17653362452983856, -0.06483833491802216, 0.26808586716651917, 0.01739254593849182, -0.23078212141990662, -0.07960046082735062, -0.33142513036727905, -0.1621951311826706, 0.40560030937194824, -0.05554796755313873, -0.009013041853904724, -0.10923530906438828, 0.05241349712014198, 0.022907594218850136, -0.2459293156862259, 0.09321222454309464, -0.16864919662475586, 0.18882086873054504, 0.5482213497161865, 0.1692103147506714, 0.08859626948833466, -0.17286795377731323, -0.1251889318227768, -0.3345068097114563, -0.6612553596496582, 0.2639760971069336, 0.010323800146579742, -0.139260932803154, -0.2664072513580322, 0.19944588840007782, -0.04556683078408241, 0.6737167835235596, -0.5157793760299683, 0.21188221871852875, -0.3649276793003082, -0.2603416442871094, -0.37849509716033936, -0.002674780786037445, 0.08660809695720673, -0.1095304787158966, 0.03451857715845108, 0.06594706326723099, 0.03707633167505264, -0.14054398238658905, -0.02610766887664795, 0.19118031859397888, 0.004456499591469765, 0.35010725259780884, 0.3764932155609131, 0.877342164516449, -0.1726303994655609, 0.06925512850284576, 0.03995027020573616, -0.12991805374622345, 0.2168785035610199, -0.2427341639995575, -0.21414372324943542, 0.38901641964912415, 0.08829881995916367, -0.09715888649225235, 0.16371874511241913, -0.0527983196079731, -0.1754903793334961, 0.09468559920787811, 0.13791798055171967, 0.22236719727516174, -0.2896282970905304, 0.27841779589653015, -0.16788817942142487, 0.006256626918911934, 0.15850526094436646, 0.0009059831500053406, -0.2519923746585846, -0.44577863812446594, -0.13196170330047607, -0.021984603255987167, 0.2603362202644348, 0.034964632242918015, -0.38602691888809204, -0.1755267232656479, -0.6771333813667297, -0.033371828496456146, 0.11903660744428635, 0.4629742503166199, 0.010056920349597931, -0.09503553062677383, 0.057861652225255966, 0.39301660656929016, 0.8252864480018616, 0.24476651847362518, -0.059740133583545685, 0.08257050812244415, 0.011883914470672607, -0.4002179503440857, -0.07734110206365585, -0.06249719113111496, 0.05276608094573021, 0.04735922813415527, 0.3315272927284241, -0.10680888593196869, -0.17009899020195007, 0.11005518585443497, 0.16296324133872986, -0.04946983978152275, -0.19701337814331055, -0.19799743592739105, -0.2646736800670624, 0.027264416217803955, 0.17396774888038635, 0.1535199135541916, 0.1426929235458374, 0.07120383530855179, -0.14464563131332397, 0.07071465253829956, 0.07777199894189835, 0.3107278645038605, -0.10372333228588104, 0.13864846527576447, 0.354793518781662, 0.30826473236083984, 0.029450464993715286, -0.3700515031814575, 0.4333224594593048, 0.16342654824256897, 0.018670864403247833, -0.2741889953613281, -0.016005095094442368, 0.3746204376220703, 0.11667551845312119, 0.2916150987148285, -0.2565803825855255, 0.05515236407518387, -0.1264248490333557, 0.292450487613678, -0.4006596803665161, 0.4228612780570984, 0.08970098197460175, 0.014303851872682571, -0.38425412774086, -0.7844337224960327, 0.16677410900592804, 0.22344958782196045, 0.23551805317401886, 0.6276204586029053, -0.11336159706115723, -0.14105460047721863, 0.1554947942495346, 0.10613292455673218, 0.7833775281906128, -0.4129960536956787, 0.34167689085006714, 0.7345877289772034, 0.28683599829673767, 0.298482209444046, -0.20301179587841034, 0.23297949135303497, -0.013918928802013397, -0.4319678544998169, 0.16043123602867126, -0.1378307193517685, -0.310440331697464, -0.047996699810028076, 0.22493594884872437, 0.2308184802532196, -0.053054727613925934, 0.08264545351266861, -0.04071617126464844, 0.2017822116613388, -0.12828031182289124, -0.28415048122406006, 0.10861042886972427, 0.0717562660574913, -0.13105043768882751, -0.07062262296676636, 0.06737986207008362, 0.027156192809343338, -0.20953775942325592, 0.14492562413215637, -0.2531062364578247, -0.10729682445526123, -0.44492465257644653, 0.06430135667324066, -0.3429420590400696, 0.12741681933403015, 0.10564520210027695, 0.11235418915748596, -0.03542947396636009, 0.22347351908683777, -0.16487877070903778, 0.08296120166778564, -0.07078687101602554, 0.2883510887622833, 0.20269665122032166, 0.03631189838051796, 0.3064688742160797, 0.12304988503456116, 0.03479817509651184, -0.1278008371591568, 0.10382798314094543, -0.214501291513443, -0.47922736406326294, -0.20934006571769714, 0.24734383821487427, -0.12416313588619232, -0.36982113122940063, 0.0449414998292923, 0.09599778801202774, 0.10751938819885254, 0.07635769993066788, -0.02413146197795868, 0.0007837675511837006, 0.25554394721984863, -0.19630052149295807, -0.23334340751171112, 0.048118844628334045, 0.30197083950042725, 0.14214029908180237, 0.16217249631881714, 0.21273469924926758, 0.08796831965446472, -0.10769953578710556, 0.07944459468126297, 0.26643791794776917, 0.31152185797691345, -0.031834349036216736, 0.24130013585090637, -0.04447343572974205, 0.25648170709609985, -0.14365218579769135, -0.02265230566263199, -0.13797898590564728, -0.09591836482286453, -0.0177992582321167, 0.06536536663770676, -0.46515733003616333, 0.1711570918560028, 0.03990771621465683, 0.22818121314048767, -0.034839898347854614, 0.33610379695892334, -0.2940639555454254, 0.1822604238986969, -0.19940011203289032, -0.11219799518585205, 0.14886817336082458, 0.02094946801662445, -0.0917256772518158, 0.017208576202392578, 0.1477029025554657, -0.17550736665725708, -0.020897891372442245, 0.05855478346347809, -0.19234149158000946, -0.21130894124507904, -0.035233598202466965, 0.14376163482666016, 0.1267503947019577, -0.21118204295635223, 0.21184656023979187, -0.3128011226654053, -0.2946197986602783, -0.36606425046920776, 0.3459402322769165, 0.3402777314186096, -0.14977487921714783, -0.16905343532562256, 0.5087978839874268, 0.01338118128478527, 0.27052077651023865, 0.32309916615486145, -0.10687310993671417, 0.0817311555147171, -0.055674273520708084, 0.2115539312362671, 0.12259471416473389, -0.218672513961792, -0.407997727394104, 0.11515190452337265, 0.21594969928264618, -0.24732327461242676, 0.10155363380908966, -0.03632888197898865, -0.07952646911144257, 0.2992042303085327, -0.05582408607006073, 0.4100866913795471, -0.20784863829612732, -0.1362880915403366, 0.14723984897136688, 0.06824329495429993, 0.1740475296974182, -0.13710233569145203, -0.059635747224092484, 0.039002735167741776, -0.22452060878276825, 0.017728015780448914, -0.3877726197242737, 0.06932730972766876, -0.29476696252822876, 0.05635476112365723, 0.13929840922355652, -0.2168029248714447, 0.06503237038850784, 0.36470064520835876, -0.009760506451129913, -0.03600402548909187, 0.15351247787475586, 0.13205355405807495, 0.02153017744421959, 0.45732763409614563, 0.29610979557037354, 0.421818345785141, -0.11053568124771118, 0.001726686954498291, -0.05092310160398483, -0.5716678500175476, -0.26885008811950684, 0.851121187210083, -0.502113401889801, 0.5085180997848511, 0.00045435503125190735, 0.05891123041510582, 0.1629047989845276, -0.11558903753757477, 0.17450785636901855, 0.1867327243089676, -0.1600344479084015, -0.11428433656692505, 0.18294018507003784, -0.013408102095127106, -0.04834476113319397, 0.135089710354805, -0.17091058194637299, -0.3627505302429199, 0.012971553951501846, 0.055869877338409424, -0.25521206855773926, -0.061231255531311035, -0.12356172502040863, 0.2098342776298523, 0.16079723834991455, -0.30922651290893555, 0.016063237562775612, -0.2848983705043793, -0.13307341933250427, 0.036349762231111526, 0.09357219189405441, 0.10250943899154663, 0.4337397515773773, 0.2703842520713806, 0.13394415378570557, 0.09615318477153778, 0.010728143155574799, 0.021360665559768677, 0.3807562291622162, 0.10398228466510773, 0.21150486171245575, 0.0026781708002090454, -0.06588265299797058, -0.0332086905837059, -0.2720206081867218, 0.17727521061897278, 0.019932281225919724, -0.5029805302619934, 0.1554557979106903, 0.017435239627957344, -0.011953026056289673, -0.0991809219121933, 0.21687982976436615, -0.23837444186210632, 0.15399470925331116, 0.13669317960739136, -0.20927806198596954, 0.09904779493808746, 0.03429543972015381, 0.04052596539258957, -0.10328435152769089, 0.43288910388946533, 0.0768943578004837, -0.0667915791273117, -0.31940174102783203, -0.16572162508964539, -0.3538491129875183, 0.0070986635982990265, -0.1577225923538208, 0.5562393069267273, 0.32587164640426636, 0.22583362460136414, -0.20518861711025238, 0.03584401309490204, -0.38131213188171387, -0.16255459189414978, -0.3154142200946808, 0.1318141222000122, -0.01798243075609207, -0.223582461476326, -0.5401554107666016, -0.0309935100376606, 0.0700172632932663, -0.421720951795578, 0.4001044034957886, -0.11711923778057098, -0.1338585764169693, -0.12931939959526062, 0.29516279697418213, 0.0883685052394867, 0.2794725000858307, 0.1318768858909607, 0.0929877981543541, 0.00502656027674675, 0.06784512102603912, 0.03173079341650009, -0.21476812660694122, 0.016171012073755264, -0.31830307841300964, -0.1079016625881195, -0.1723623275756836, 0.017918705940246582, -0.09081953018903732, -0.3339090049266815, -0.06265701353549957, 0.1843472123146057, -0.038682837039232254, -0.1469016969203949, -0.3085178732872009, 0.09216337651014328, 0.08388330042362213, 0.394920289516449, 0.1664564311504364, 0.29557517170906067, -0.13276177644729614, 0.08053185045719147, -0.19377665221691132, -0.12918582558631897, 0.4818224310874939, -0.2891770601272583, -0.12095453590154648, -0.058361563831567764, 0.059344153851270676, 0.03084678202867508, -0.20525270700454712, -0.39586445689201355, 0.16866758465766907, 0.31409451365470886, -0.019982391968369484, -0.026513386517763138, 0.5844383239746094, -0.21932198107242584, 0.11298778653144836, -0.03731111064553261, 0.5549224615097046, 0.08031053841114044, -0.25588130950927734, 0.4122040569782257, -0.3177897334098816 ]
https://github.com/huggingface/datasets/issues/5855
Update: The memory usage is occurring in creation of the index and shuffle buffer. You can reproduce it very simply with: ```python import tensorflow as tf indices = tf.range(50_000_000, dtype=tf.int64) dataset = tf.data.Dataset.from_tensor_slices(indices) dataset = dataset.shuffle(len(dataset)) print(next(iter(dataset)) ``` When I wrote this code I thought `tf.data` had an optimization for shuffling an entire tensor that wouldn't create the entire shuffle buffer, but evidently it's just creating the enormous buffer in memory. I'll see if I can find a more efficient way to do this - we might end up moving everything to the `numpy` multiprocessing path to avoid it.
`to_tf_dataset` consumes too much memory
### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3
99
`to_tf_dataset` consumes too much memory ### Describe the bug Hi, I'm using `to_tf_dataset` to convert a _large_ dataset to `tf.data.Dataset`. I observed that the data loading *before* training took a lot of time and memory, even with `batch_size=1`. After some digging, i believe the reason lies in the shuffle behavior. The [source code](https://github.com/huggingface/datasets/blob/main/src/datasets/utils/tf_utils.py#L185) uses `len(dataset)` as the `buffer_size`, which may load all the data into the memory, and the [tf.data doc](https://www.tensorflow.org/guide/data#randomly_shuffling_input_data) also states that "While large buffer_sizes shuffle more thoroughly, they can take a lot of memory, and significant time to fill". ### Steps to reproduce the bug ```python from datasets import Dataset def gen(): # some large data for i in range(50000000): yield {"data": i} ds = Dataset.from_generator(gen, cache_dir="./huggingface") tf_ds = ds.to_tf_dataset( batch_size=64, shuffle=False, # no shuffle drop_remainder=False, prefetch=True, ) # fast and memory friendly 🤗 for batch in tf_ds: ... tf_ds_shuffle = ds.to_tf_dataset( batch_size=64, shuffle=True, drop_remainder=False, prefetch=True, ) # slow and memory hungry for simple iteration 😱 for batch in tf_ds_shuffle: ... ``` ### Expected behavior Shuffling should not load all the data into the memory. Would adding a `buffer_size` parameter in the `to_tf_dataset` API alleviate the problem? ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.17.1-051701-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.3 Update: The memory usage is occurring in creation of the index and shuffle buffer. You can reproduce it very simply with: ```python import tensorflow as tf indices = tf.range(50_000_000, dtype=tf.int64) dataset = tf.data.Dataset.from_tensor_slices(indices) dataset = dataset.shuffle(len(dataset)) print(next(iter(dataset)) ``` When I wrote this code I thought `tf.data` had an optimization for shuffling an entire tensor that wouldn't create the entire shuffle buffer, but evidently it's just creating the enormous buffer in memory. I'll see if I can find a more efficient way to do this - we might end up moving everything to the `numpy` multiprocessing path to avoid it.
[ -0.15822795033454895, -0.23407281935214996, 0.09227368235588074, 0.3770810663700104, 0.5104161500930786, 0.20725011825561523, -0.034461960196495056, 0.27628540992736816, -0.2560502588748932, 0.33825477957725525, -0.024285780265927315, 0.16308927536010742, -0.44833457469940186, -0.05245983228087425, 0.22439958155155182, -0.08521826565265656, 0.18257606029510498, -0.12151472270488739, -0.2156122326850891, 0.009591400623321533, -0.18600952625274658, -0.1572999805212021, -0.15149500966072083, -0.2762797176837921, -0.07886103540658951, 0.053714267909526825, 0.24288222193717957, 0.11352112889289856, 0.045504018664360046, 0.11847153306007385, 0.01778903603553772, 0.1438693404197693, -0.0733426958322525, 0.5193463563919067, -0.00011887728032888845, 0.04248824715614319, 0.025390028953552246, 0.017749294638633728, -0.20652887225151062, 0.23555652797222137, -0.04330485314130783, 0.15754064917564392, -0.2680107355117798, 0.06575962901115417, 0.0760931521654129, 0.03503500297665596, -0.03358433023095131, -0.24468737840652466, 0.07239236682653427, 0.18836039304733276, 0.109595887362957, 0.2446056455373764, 0.006833113729953766, 0.270402193069458, 0.5546197295188904, 0.12427662312984467, -0.15182797610759735, 0.14158600568771362, -0.012111354619264603, -0.04732375964522362, -0.021348528563976288, 0.29770517349243164, 0.022721730172634125, 0.1004084125161171, 0.5147581696510315, -0.11135412752628326, -0.08168546855449677, -0.10393235087394714, 0.050984639674425125, 0.38528546690940857, 0.21881836652755737, -0.32709190249443054, -0.1110735759139061, -0.43611541390419006, 0.006830643862485886, -0.19580242037773132, -0.0015779752284288406, -0.16257792711257935, -0.19865477085113525, -0.0887514054775238, -0.493394136428833, -0.17700889706611633, -0.008836276829242706, -0.0027658287435770035, -0.03837714344263077, 0.13156798481941223, -0.03315071389079094, 0.09095780551433563, 0.3398818075656891, -0.33399325609207153, 0.43166130781173706, -0.02433749847114086, 0.04527401179075241, 0.30649685859680176, -0.6095265746116638, -0.16167253255844116, 0.1596611738204956, -0.316594660282135, 0.3132362961769104, -0.3122553527355194, 0.100961834192276, -0.05228731036186218, -0.10514922440052032, -0.16306732594966888, 0.28074881434440613, 0.19066482782363892, -0.4858037233352661, 0.3186251223087311, -0.14500170946121216, 0.03644493594765663, 0.12369365990161896, -0.027226882055401802, -0.1824026256799698, -0.03729328140616417, 0.29054003953933716, -0.3843509256839752, 0.016435787081718445, 0.13605031371116638, -0.3258666396141052, 0.20667308568954468, -0.09889593720436096, 0.1302201896905899, 0.14773458242416382, 0.19901233911514282, -0.17840144038200378, 0.3223017752170563, -0.0452161468565464, -0.3347390294075012, -0.304980993270874, 0.0041634999215602875, -0.35149040818214417, -0.0897970199584961, -0.16642096638679504, 0.13250336050987244, -0.01263660192489624, -0.08056504279375076, -0.07188165187835693, 0.014275938272476196, 0.055781807750463486, 0.19539496302604675, -0.026906903833150864, -0.18719743192195892, 0.1945086270570755, 0.24641911685466766, -0.20861206948757172, 0.11154647916555405, -0.003336576046422124, 0.2812846302986145, -0.2202146351337433, 0.43640977144241333, -0.483782559633255, -0.32899218797683716, 0.26731571555137634, 0.11374073475599289, -0.04881042242050171, -0.17855024337768555, -0.5278759598731995, 0.3185975253582001, 0.33576613664627075, -0.09799480438232422, -0.0755024179816246, -0.3261210322380066, -0.5926900506019592, -0.20952314138412476, 0.29131969809532166, 0.3965590000152588, -0.21711915731430054, 0.050279535353183746, 0.1674906611442566, -0.1879318207502365, 0.5304161310195923, 0.4585167169570923, -0.05516388639807701, 0.23215115070343018, -0.1334109753370285, -0.2894537150859833, 0.13035140931606293, 0.07149605453014374, -0.36872777342796326, 0.2032485157251358, -0.39450615644454956, 0.43354323506355286, -0.07670700550079346, 0.21166951954364777, -0.05271966755390167, -0.1228688582777977, 0.663454532623291, 0.46041277050971985, -0.41860708594322205, 0.3542313575744629, -0.3050636649131775, -0.25038132071495056, 0.01200302317738533, 0.244306743144989, -0.15035055577754974, -0.034811802208423615, -0.2754697799682617, 0.2806409001350403, 0.378619521856308, 0.012948361225426197, -0.03716804459691048, 0.008611271157860756, 0.074164018034935, 0.17260384559631348, -0.09916602075099945, -0.11206565797328949, -0.21806247532367706, 0.1275118738412857, 0.33926501870155334, -0.2996363639831543, 0.442605584859848, -0.12897726893424988, 0.05751074105501175, 0.05668080598115921, 0.11044256389141083, 0.1626492738723755, -0.08989255130290985, -0.12691332399845123, 0.0695994570851326, 0.136696457862854, -0.02060823142528534, 0.07255836576223373, -0.5407472252845764, -0.057005804032087326, -0.1719483882188797, 0.006793111562728882, 0.534357488155365, 0.0020376890897750854, -0.08064915239810944, 0.2960575520992279, -0.23769083619117737, 0.02618344873189926, -0.20081713795661926, 0.3088263273239136, 0.10361236333847046, 0.13968168199062347, -0.5283290147781372, 0.33386194705963135, 0.15441542863845825, 0.2373167723417282, -0.06043571978807449, -0.16132444143295288, 0.12394431233406067, -0.17714056372642517, 0.04661877825856209, 0.16795021295547485, -0.26283514499664307, 0.1996668130159378, 0.1460491120815277, -0.39305514097213745, 0.04160843789577484, 0.23073440790176392, 0.3403039872646332, 0.07789529114961624, 0.30625396966934204, 0.01676129922270775, -0.02632104605436325, 0.19134144484996796, -0.4669661819934845, 0.12852191925048828, 0.4062877297401428, -0.25462955236434937, -0.412368506193161, 0.3201993405818939, -0.21434976160526276, -0.2726609706878662, -0.06783248484134674, 0.23716837167739868, 0.39496198296546936, 0.20873963832855225, 0.03850436955690384, -0.0012676753103733063, 0.2793407738208771, -0.25210970640182495, 0.23384179174900055, 0.009548891335725784, 0.2387600839138031, 0.09445735812187195, 0.09712453186511993, 0.16576015949249268, -0.23766714334487915, 0.11029346287250519, 0.06793426722288132, 0.5655380487442017, -0.6202950477600098, 0.0001902356743812561, -0.17497774958610535, -0.4075888991355896, -0.04994173347949982, 0.15242907404899597, 0.018436729907989502, -0.27393096685409546, -0.03808270022273064, 0.4757695496082306, -0.12147482484579086, -0.11154402792453766, 0.20765390992164612, 0.2794783115386963, 0.22618697583675385, -0.3254437744617462, -0.0791223794221878, 0.001916591078042984, -0.31224584579467773, 0.0612463653087616, 0.37046706676483154, -0.36138349771499634, 0.31395646929740906, -0.03583309054374695, 0.013472914695739746, 0.06545081734657288, -0.1621350795030594, 0.1349334418773651, -0.16973216831684113, 0.17653362452983856, -0.06483833491802216, 0.26808586716651917, 0.01739254593849182, -0.23078212141990662, -0.07960046082735062, -0.33142513036727905, -0.1621951311826706, 0.40560030937194824, -0.05554796755313873, -0.009013041853904724, -0.10923530906438828, 0.05241349712014198, 0.022907594218850136, -0.2459293156862259, 0.09321222454309464, -0.16864919662475586, 0.18882086873054504, 0.5482213497161865, 0.1692103147506714, 0.08859626948833466, -0.17286795377731323, -0.1251889318227768, -0.3345068097114563, -0.6612553596496582, 0.2639760971069336, 0.010323800146579742, -0.139260932803154, -0.2664072513580322, 0.19944588840007782, -0.04556683078408241, 0.6737167835235596, -0.5157793760299683, 0.21188221871852875, -0.3649276793003082, -0.2603416442871094, -0.37849509716033936, -0.002674780786037445, 0.08660809695720673, -0.1095304787158966, 0.03451857715845108, 0.06594706326723099, 0.03707633167505264, -0.14054398238658905, -0.02610766887664795, 0.19118031859397888, 0.004456499591469765, 0.35010725259780884, 0.3764932155609131, 0.877342164516449, -0.1726303994655609, 0.06925512850284576, 0.03995027020573616, -0.12991805374622345, 0.2168785035610199, -0.2427341639995575, -0.21414372324943542, 0.38901641964912415, 0.08829881995916367, -0.09715888649225235, 0.16371874511241913, -0.0527983196079731, -0.1754903793334961, 0.09468559920787811, 0.13791798055171967, 0.22236719727516174, -0.2896282970905304, 0.27841779589653015, -0.16788817942142487, 0.006256626918911934, 0.15850526094436646, 0.0009059831500053406, -0.2519923746585846, -0.44577863812446594, -0.13196170330047607, -0.021984603255987167, 0.2603362202644348, 0.034964632242918015, -0.38602691888809204, -0.1755267232656479, -0.6771333813667297, -0.033371828496456146, 0.11903660744428635, 0.4629742503166199, 0.010056920349597931, -0.09503553062677383, 0.057861652225255966, 0.39301660656929016, 0.8252864480018616, 0.24476651847362518, -0.059740133583545685, 0.08257050812244415, 0.011883914470672607, -0.4002179503440857, -0.07734110206365585, -0.06249719113111496, 0.05276608094573021, 0.04735922813415527, 0.3315272927284241, -0.10680888593196869, -0.17009899020195007, 0.11005518585443497, 0.16296324133872986, -0.04946983978152275, -0.19701337814331055, -0.19799743592739105, -0.2646736800670624, 0.027264416217803955, 0.17396774888038635, 0.1535199135541916, 0.1426929235458374, 0.07120383530855179, -0.14464563131332397, 0.07071465253829956, 0.07777199894189835, 0.3107278645038605, -0.10372333228588104, 0.13864846527576447, 0.354793518781662, 0.30826473236083984, 0.029450464993715286, -0.3700515031814575, 0.4333224594593048, 0.16342654824256897, 0.018670864403247833, -0.2741889953613281, -0.016005095094442368, 0.3746204376220703, 0.11667551845312119, 0.2916150987148285, -0.2565803825855255, 0.05515236407518387, -0.1264248490333557, 0.292450487613678, -0.4006596803665161, 0.4228612780570984, 0.08970098197460175, 0.014303851872682571, -0.38425412774086, -0.7844337224960327, 0.16677410900592804, 0.22344958782196045, 0.23551805317401886, 0.6276204586029053, -0.11336159706115723, -0.14105460047721863, 0.1554947942495346, 0.10613292455673218, 0.7833775281906128, -0.4129960536956787, 0.34167689085006714, 0.7345877289772034, 0.28683599829673767, 0.298482209444046, -0.20301179587841034, 0.23297949135303497, -0.013918928802013397, -0.4319678544998169, 0.16043123602867126, -0.1378307193517685, -0.310440331697464, -0.047996699810028076, 0.22493594884872437, 0.2308184802532196, -0.053054727613925934, 0.08264545351266861, -0.04071617126464844, 0.2017822116613388, -0.12828031182289124, -0.28415048122406006, 0.10861042886972427, 0.0717562660574913, -0.13105043768882751, -0.07062262296676636, 0.06737986207008362, 0.027156192809343338, -0.20953775942325592, 0.14492562413215637, -0.2531062364578247, -0.10729682445526123, -0.44492465257644653, 0.06430135667324066, -0.3429420590400696, 0.12741681933403015, 0.10564520210027695, 0.11235418915748596, -0.03542947396636009, 0.22347351908683777, -0.16487877070903778, 0.08296120166778564, -0.07078687101602554, 0.2883510887622833, 0.20269665122032166, 0.03631189838051796, 0.3064688742160797, 0.12304988503456116, 0.03479817509651184, -0.1278008371591568, 0.10382798314094543, -0.214501291513443, -0.47922736406326294, -0.20934006571769714, 0.24734383821487427, -0.12416313588619232, -0.36982113122940063, 0.0449414998292923, 0.09599778801202774, 0.10751938819885254, 0.07635769993066788, -0.02413146197795868, 0.0007837675511837006, 0.25554394721984863, -0.19630052149295807, -0.23334340751171112, 0.048118844628334045, 0.30197083950042725, 0.14214029908180237, 0.16217249631881714, 0.21273469924926758, 0.08796831965446472, -0.10769953578710556, 0.07944459468126297, 0.26643791794776917, 0.31152185797691345, -0.031834349036216736, 0.24130013585090637, -0.04447343572974205, 0.25648170709609985, -0.14365218579769135, -0.02265230566263199, -0.13797898590564728, -0.09591836482286453, -0.0177992582321167, 0.06536536663770676, -0.46515733003616333, 0.1711570918560028, 0.03990771621465683, 0.22818121314048767, -0.034839898347854614, 0.33610379695892334, -0.2940639555454254, 0.1822604238986969, -0.19940011203289032, -0.11219799518585205, 0.14886817336082458, 0.02094946801662445, -0.0917256772518158, 0.017208576202392578, 0.1477029025554657, -0.17550736665725708, -0.020897891372442245, 0.05855478346347809, -0.19234149158000946, -0.21130894124507904, -0.035233598202466965, 0.14376163482666016, 0.1267503947019577, -0.21118204295635223, 0.21184656023979187, -0.3128011226654053, -0.2946197986602783, -0.36606425046920776, 0.3459402322769165, 0.3402777314186096, -0.14977487921714783, -0.16905343532562256, 0.5087978839874268, 0.01338118128478527, 0.27052077651023865, 0.32309916615486145, -0.10687310993671417, 0.0817311555147171, -0.055674273520708084, 0.2115539312362671, 0.12259471416473389, -0.218672513961792, -0.407997727394104, 0.11515190452337265, 0.21594969928264618, -0.24732327461242676, 0.10155363380908966, -0.03632888197898865, -0.07952646911144257, 0.2992042303085327, -0.05582408607006073, 0.4100866913795471, -0.20784863829612732, -0.1362880915403366, 0.14723984897136688, 0.06824329495429993, 0.1740475296974182, -0.13710233569145203, -0.059635747224092484, 0.039002735167741776, -0.22452060878276825, 0.017728015780448914, -0.3877726197242737, 0.06932730972766876, -0.29476696252822876, 0.05635476112365723, 0.13929840922355652, -0.2168029248714447, 0.06503237038850784, 0.36470064520835876, -0.009760506451129913, -0.03600402548909187, 0.15351247787475586, 0.13205355405807495, 0.02153017744421959, 0.45732763409614563, 0.29610979557037354, 0.421818345785141, -0.11053568124771118, 0.001726686954498291, -0.05092310160398483, -0.5716678500175476, -0.26885008811950684, 0.851121187210083, -0.502113401889801, 0.5085180997848511, 0.00045435503125190735, 0.05891123041510582, 0.1629047989845276, -0.11558903753757477, 0.17450785636901855, 0.1867327243089676, -0.1600344479084015, -0.11428433656692505, 0.18294018507003784, -0.013408102095127106, -0.04834476113319397, 0.135089710354805, -0.17091058194637299, -0.3627505302429199, 0.012971553951501846, 0.055869877338409424, -0.25521206855773926, -0.061231255531311035, -0.12356172502040863, 0.2098342776298523, 0.16079723834991455, -0.30922651290893555, 0.016063237562775612, -0.2848983705043793, -0.13307341933250427, 0.036349762231111526, 0.09357219189405441, 0.10250943899154663, 0.4337397515773773, 0.2703842520713806, 0.13394415378570557, 0.09615318477153778, 0.010728143155574799, 0.021360665559768677, 0.3807562291622162, 0.10398228466510773, 0.21150486171245575, 0.0026781708002090454, -0.06588265299797058, -0.0332086905837059, -0.2720206081867218, 0.17727521061897278, 0.019932281225919724, -0.5029805302619934, 0.1554557979106903, 0.017435239627957344, -0.011953026056289673, -0.0991809219121933, 0.21687982976436615, -0.23837444186210632, 0.15399470925331116, 0.13669317960739136, -0.20927806198596954, 0.09904779493808746, 0.03429543972015381, 0.04052596539258957, -0.10328435152769089, 0.43288910388946533, 0.0768943578004837, -0.0667915791273117, -0.31940174102783203, -0.16572162508964539, -0.3538491129875183, 0.0070986635982990265, -0.1577225923538208, 0.5562393069267273, 0.32587164640426636, 0.22583362460136414, -0.20518861711025238, 0.03584401309490204, -0.38131213188171387, -0.16255459189414978, -0.3154142200946808, 0.1318141222000122, -0.01798243075609207, -0.223582461476326, -0.5401554107666016, -0.0309935100376606, 0.0700172632932663, -0.421720951795578, 0.4001044034957886, -0.11711923778057098, -0.1338585764169693, -0.12931939959526062, 0.29516279697418213, 0.0883685052394867, 0.2794725000858307, 0.1318768858909607, 0.0929877981543541, 0.00502656027674675, 0.06784512102603912, 0.03173079341650009, -0.21476812660694122, 0.016171012073755264, -0.31830307841300964, -0.1079016625881195, -0.1723623275756836, 0.017918705940246582, -0.09081953018903732, -0.3339090049266815, -0.06265701353549957, 0.1843472123146057, -0.038682837039232254, -0.1469016969203949, -0.3085178732872009, 0.09216337651014328, 0.08388330042362213, 0.394920289516449, 0.1664564311504364, 0.29557517170906067, -0.13276177644729614, 0.08053185045719147, -0.19377665221691132, -0.12918582558631897, 0.4818224310874939, -0.2891770601272583, -0.12095453590154648, -0.058361563831567764, 0.059344153851270676, 0.03084678202867508, -0.20525270700454712, -0.39586445689201355, 0.16866758465766907, 0.31409451365470886, -0.019982391968369484, -0.026513386517763138, 0.5844383239746094, -0.21932198107242584, 0.11298778653144836, -0.03731111064553261, 0.5549224615097046, 0.08031053841114044, -0.25588130950927734, 0.4122040569782257, -0.3177897334098816 ]
https://github.com/huggingface/datasets/issues/5854
Hi! `audiofolder` requires `datasets>=2.5.0`, so please update the `datasets`' installation (`pip install -U datasets`) in the environment (and restart the env for the update to take effect) to resolve the issue.
Can not load audiofolder dataset on kaggle
### Describe the bug It's crash log: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/audiofolder/audiofolder.py or any data file in the same directory. Couldn't find 'audiofolder' on the Hugging Face Hub either: FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/audiofolder/audiofolder.py ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/93691919/a2829d27-d15c-4acc-86fb-d1987c760468) common_voice = load_dataset("audiofolder", data_dir="/kaggle/working/data") ### Expected behavior load dataset without error. It works ok on colab, but on kaggle it happends. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.31 - Python version: 3.10.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
31
Can not load audiofolder dataset on kaggle ### Describe the bug It's crash log: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/audiofolder/audiofolder.py or any data file in the same directory. Couldn't find 'audiofolder' on the Hugging Face Hub either: FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/audiofolder/audiofolder.py ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/93691919/a2829d27-d15c-4acc-86fb-d1987c760468) common_voice = load_dataset("audiofolder", data_dir="/kaggle/working/data") ### Expected behavior load dataset without error. It works ok on colab, but on kaggle it happends. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.31 - Python version: 3.10.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 Hi! `audiofolder` requires `datasets>=2.5.0`, so please update the `datasets`' installation (`pip install -U datasets`) in the environment (and restart the env for the update to take effect) to resolve the issue.
[ -0.33059805631637573, -0.3415958285331726, 0.04055991768836975, 0.6100748777389526, 0.37537503242492676, -0.13818277418613434, 0.2699607312679291, -0.027829112485051155, 0.33419615030288696, 0.1420486867427826, -0.3253091275691986, 0.5460795760154724, -0.33598366379737854, 0.3882445991039276, 0.04722278192639351, -0.16263878345489502, 0.09584661573171616, 0.12402669340372086, 0.022005198523402214, 0.18885226547718048, -0.09627307951450348, 0.2148638218641281, -0.3911969065666199, 0.21580255031585693, -0.263854444026947, -0.019454993307590485, 0.0010818243026733398, 0.3691571354866028, -0.1349053978919983, -0.3142620027065277, 0.6429016590118408, -0.2210542857646942, 0.26369327306747437, 0.7068495154380798, -0.00011586208711378276, 0.06835843622684479, 0.5479382872581482, -0.17097501456737518, -0.3255726099014282, -0.2170582413673401, -0.45351460576057434, -0.00716671347618103, -0.10312734544277191, 0.10655249655246735, 0.02377435564994812, -0.18909958004951477, -0.18624313175678253, -0.0775451511144638, 0.16192321479320526, 0.18487602472305298, 0.14739029109477997, 0.2762097120285034, 0.31614431738853455, 0.02279246225953102, 0.290859580039978, 0.19658775627613068, -0.08915069699287415, 0.47945111989974976, 0.3108491897583008, -0.18989679217338562, -0.02783985435962677, 0.07516772300004959, -0.13556168973445892, -0.30648910999298096, 0.290596067905426, 0.040625713765621185, -0.37903955578804016, -0.4207732081413269, 0.19617274403572083, 0.38457587361335754, 0.5610538721084595, -0.4205891788005829, -0.3404529392719269, -0.3355548083782196, 0.059022754430770874, 0.017669469118118286, 0.3566802144050598, 0.22682824730873108, -0.19220727682113647, -0.01980796456336975, 0.06318499892950058, -0.209441140294075, -0.028300106525421143, 0.026822442188858986, 0.11336427927017212, 0.26098254323005676, -0.17394182085990906, 0.0582897923886776, 0.4915878176689148, -0.20757070183753967, 0.167413592338562, 0.047177284955978394, -0.32785582542419434, 0.18787312507629395, -0.2960730195045471, 0.0983191654086113, -0.0777350515127182, 0.3331259489059448, 0.032509125769138336, -0.13320307433605194, -0.05557761713862419, 0.08861225098371506, -0.3526732623577118, 0.20481562614440918, 0.34684664011001587, 0.40369606018066406, 0.26751959323883057, 0.03563448414206505, 0.27277013659477234, 0.38983702659606934, 0.20663873851299286, -0.040993597358465195, -0.08432914316654205, -0.14419393241405487, -0.1131792664527893, -0.03648336976766586, 0.2213536649942398, -0.05916370451450348, -0.33360785245895386, -0.19842948019504547, -0.2557597756385803, -0.0245912317186594, 0.30823951959609985, 0.5078748464584351, 0.08316057175397873, 0.2513011693954468, 0.027549006044864655, 0.3081987798213959, -0.04740336537361145, 0.18985895812511444, -0.13959698379039764, 0.2755308747291565, 0.04239176958799362, 0.13217824697494507, 0.10488469153642654, -0.5139139294624329, 0.4334681034088135, 0.03767959773540497, 0.2575058341026306, -0.10077794641256332, -0.16398362815380096, 0.17529909312725067, -0.5310567617416382, 0.20494946837425232, 0.08797165006399155, 0.07686866819858551, -0.07194002717733383, -0.0746343731880188, -0.03376367688179016, 0.1891157478094101, -0.32570040225982666, -0.13542702794075012, 0.2492830455303192, 0.0939333513379097, -0.4282640516757965, 0.0001705307513475418, -0.6368201971054077, -0.044057585299015045, -0.13392142951488495, -0.3959822952747345, 0.10753215849399567, -0.10767844319343567, -0.08530467003583908, -0.135312020778656, 0.45778346061706543, 0.4380442500114441, -0.09114603698253632, -0.37114807963371277, -0.16119149327278137, -0.20534364879131317, -0.024471938610076904, 0.30624109506607056, -0.11399974673986435, 0.03593875467777252, -0.4523431658744812, 0.07317334413528442, 0.3529096841812134, -0.6470752358436584, -0.5300218462944031, 0.05305897071957588, -0.23757624626159668, 0.3521844148635864, 0.12291277945041656, -0.002288777381181717, -0.2788618206977844, -0.1261346936225891, 0.20488423109054565, 0.023506246507167816, 0.14064109325408936, -0.03338956460356712, -0.15688632428646088, -0.33692628145217896, 0.1364123821258545, 0.2351188361644745, -0.23382435739040375, -0.09900761395692825, -0.03176865354180336, 0.11817288398742676, 0.20823410153388977, -0.0702812522649765, -0.05906058847904205, 0.2149703949689865, 0.469748854637146, -0.04631379619240761, 0.0395401194691658, -0.1984415054321289, -0.32819652557373047, 0.3716275691986084, 0.001694314181804657, -0.06752130389213562, -0.02668612077832222, -0.09647853672504425, -0.2971314787864685, 0.03491897135972977, -0.39748844504356384, -0.2156398743391037, -0.006885811686515808, 0.04486554488539696, 0.12205889821052551, 0.10284357517957687, -0.16488438844680786, 0.5685047507286072, 0.1108713299036026, -0.018802165985107422, -0.467833936214447, 0.2564813494682312, -0.0571664497256279, -0.07131372392177582, 0.23107703030109406, 0.35586294531822205, 0.18457946181297302, -0.07603487372398376, 0.05210495367646217, 0.41370898485183716, 0.203277587890625, 0.4975890815258026, -0.06277202069759369, -0.34376245737075806, 0.2371176779270172, -0.4147324860095978, 0.21385008096694946, 0.13307377696037292, 0.22148078680038452, 0.011656716465950012, -0.09602247178554535, 0.21073661744594574, -0.1886233538389206, 0.1247522383928299, 0.11228181421756744, -0.005397476255893707, 0.050087347626686096, 0.14774389564990997, -0.007000163197517395, -0.023037247359752655, 0.1788063943386078, -0.5186100602149963, 0.428280234336853, 0.11959921568632126, -0.2986525893211365, -0.04134832322597504, 0.2708662152290344, -0.13818861544132233, 0.32465454936027527, 0.16594481468200684, -0.41634559631347656, 0.04908584803342819, 0.028691036626696587, 0.1389942765235901, 0.36055320501327515, 0.22042854130268097, -0.1466202288866043, -0.05400330573320389, 0.12343938648700714, -0.10076837241649628, 0.2503735423088074, 0.17802008986473083, 0.19964034855365753, 0.4490715563297272, 0.14202667772769928, -0.01030280813574791, -0.25436392426490784, -0.16994613409042358, -0.22368288040161133, 0.2621731162071228, -0.35382309556007385, 0.010231010615825653, -0.1786121279001236, -0.20959249138832092, -0.21968401968479156, -0.26752346754074097, -0.1851610392332077, -0.11570417881011963, -0.07512255012989044, 0.36326831579208374, 0.13782714307308197, 0.13309726119041443, 0.05440480262041092, 0.06196517497301102, -0.013555645942687988, 0.02165624313056469, -0.36379677057266235, -0.03320210799574852, -0.3231600821018219, -0.0037338286638259888, 0.3693036735057831, 0.2235586941242218, -0.11760607361793518, -0.06072646379470825, -0.0021985769271850586, -0.1516444981098175, -0.18363657593727112, -0.052501071244478226, -0.12459452450275421, 0.2219666838645935, 0.06802895665168762, 0.30698856711387634, 0.058413490653038025, -0.5061444044113159, 0.25385674834251404, 0.046341463923454285, -0.259392648935318, 0.13450875878334045, -0.026247626170516014, 0.06482817977666855, -0.13428732752799988, -0.2675788104534149, -0.2970070540904999, -0.5503560900688171, 0.44721466302871704, -0.08242632448673248, -0.11175978183746338, 0.0417008101940155, 0.15041442215442657, 0.23876000940799713, -0.05028857663273811, -0.1326979696750641, -0.025250762701034546, -0.10001994669437408, 0.19454115629196167, 0.15993504226207733, -0.12557286024093628, -0.03759634494781494, 0.01329968124628067, 0.2047680765390396, -0.14171773195266724, -0.43978947401046753, -0.1888483613729477, -0.06049239635467529, -0.06741751730442047, -0.00989819597452879, 0.11213266104459763, 0.09968185424804688, 0.24440784752368927, 0.18917891383171082, -0.04049200564622879, -0.31746354699134827, -0.17420414090156555, 0.09968654811382294, 0.24211522936820984, 0.07662941515445709, 0.36807551980018616, -0.2015720009803772, 0.45978203415870667, 0.3658798336982727, 0.23419001698493958, 0.26943954825401306, -0.16324351727962494, 0.4525437355041504, -0.2260739952325821, -0.37360644340515137, 0.03379204124212265, 0.06203996390104294, 0.013476461172103882, 0.02797982096672058, 0.19604694843292236, -0.038293324410915375, -0.3661077618598938, -0.6091545820236206, -0.03731519728899002, -0.09936507791280746, -0.15911108255386353, 0.12394280731678009, -0.09527255594730377, -0.22538931667804718, 0.20923608541488647, 0.21180589497089386, -0.13467702269554138, 0.3460789918899536, 0.28155264258384705, 0.18619227409362793, 0.08588264882564545, -0.42568570375442505, -0.34756946563720703, -0.30811813473701477, -0.017210938036441803, 0.03331867232918739, 0.482603520154953, -0.043621569871902466, -0.134532630443573, -0.04288864508271217, -0.14336583018302917, 0.5779718160629272, 0.029026607051491737, 0.2825250029563904, -0.15320909023284912, 0.16190141439437866, -0.636361837387085, -0.04225490614771843, -0.12212641537189484, -0.026497814804315567, -0.06079043075442314, 0.4802352488040924, -0.1085461676120758, 0.023626241832971573, -0.20083582401275635, 0.39656931161880493, -0.05639248713850975, -0.07375485450029373, -0.38580769300460815, -0.23424184322357178, -0.24370557069778442, -0.1291140615940094, -0.20644205808639526, 0.1379014104604721, -0.06636054813861847, 0.084668830037117, 0.24124595522880554, -0.34766656160354614, -0.004337601363658905, 0.2140774428844452, 0.43057629466056824, -0.18017718195915222, 0.374504029750824, 0.19281181693077087, -0.20903876423835754, 0.35444021224975586, 0.6904030442237854, 0.05808510631322861, -0.4942876696586609, -0.034216366708278656, 0.09734871983528137, 0.21617092192173004, 0.19317898154258728, -0.14234009385108948, 0.01504017785191536, 0.09400022029876709, -0.000831281766295433, -0.4205694794654846, 0.026365336030721664, 0.20063546299934387, 0.06691919267177582, -0.18878966569900513, -0.18825945258140564, 0.6458069086074829, 0.09666937589645386, -0.1059013158082962, 0.3643353581428528, 0.4942786991596222, -0.28367215394973755, 0.27807536721229553, -0.32313352823257446, 0.6159173250198364, 0.21944931149482727, 0.13956081867218018, 0.5669517517089844, -0.19617128372192383, 0.17316031455993652, 0.012060113251209259, 0.07041700184345245, -0.2396266907453537, -0.2592068910598755, 0.025778450071811676, -0.16529613733291626, -0.052109088748693466, -0.2737996578216553, -0.2805527448654175, 0.24996717274188995, -0.16484934091567993, 0.01678309589624405, -0.14965158700942993, 0.1525956690311432, -0.518751323223114, -0.1408318132162094, -0.29279160499572754, 0.07579811662435532, -0.026429638266563416, 0.40878403186798096, 0.08733496069908142, -0.0606306716799736, -0.29772549867630005, -0.19049933552742004, -0.3019253611564636, 0.30297011137008667, -0.07542620599269867, 0.07830433547496796, 0.1160387396812439, -0.3151510953903198, 0.12529155611991882, 0.5302606225013733, 0.05051171034574509, 0.07657358050346375, -0.33668452501296997, 0.29868894815444946, -0.18204738199710846, 0.08719515800476074, 0.12197230011224747, 0.05770791321992874, 0.04292610287666321, 0.01766274869441986, -0.30927878618240356, 0.1113705188035965, -0.18189719319343567, -0.026336871087551117, -0.12398962676525116, 0.16264551877975464, -0.40962350368499756, -0.07376540452241898, -0.36898767948150635, -0.03839179500937462, 0.2044779658317566, -0.06578391790390015, 0.07708980143070221, 0.12040045857429504, -0.0963740199804306, -0.10112801939249039, -0.02646377868950367, 0.03198400139808655, -0.028455954045057297, 0.4389338791370392, -0.2146265208721161, 0.1992713361978531, 0.3108494281768799, 0.10855290293693542, -0.08713105320930481, -0.12869201600551605, 0.15110448002815247, 0.2543700933456421, -0.2370869368314743, -0.0840395912528038, 0.19869554042816162, -0.029039740562438965, 0.04821410030126572, 0.193720281124115, 0.16322028636932373, -0.26824015378952026, -0.14234782755374908, -0.4506353437900543, -0.42055365443229675, 0.5818816423416138, -0.016497988253831863, 0.1064424067735672, -0.11336654424667358, -0.1553109586238861, -0.020610127598047256, -0.016263864934444427, -0.20386594533920288, 0.15903614461421967, -0.09820950031280518, -0.11361454427242279, 0.39428985118865967, 0.06659714877605438, 0.32636523246765137, -0.11300568282604218, 0.0612792931497097, 0.036622777581214905, -0.0559132844209671, -0.0351363830268383, 0.05811740458011627, 0.08107370138168335, 0.035241734236478806, -0.013961384072899818, -0.14423933625221252, -0.2749471366405487, 0.07013452053070068, -0.17705218493938446, 0.4255678653717041, 0.38044503331184387, -0.11269480735063553, 0.054138969630002975, -0.14077092707157135, 0.08441024273633957, -0.16921979188919067, 0.3271777629852295, -0.15748970210552216, -0.3146720826625824, 0.21235623955726624, -0.06648190319538116, 0.13877438008785248, 0.0622200071811676, 0.2238028645515442, 0.084830641746521, -0.1172071248292923, 0.18729862570762634, 0.24476754665374756, -0.1770833134651184, 0.1317289173603058, 0.013858668506145477, 0.13946248590946198, 0.43927210569381714, -0.1736314743757248, 0.0699019581079483, 0.13145942986011505, 0.07129712402820587, -0.23962558805942535, -0.31489428877830505, 0.18133273720741272, -0.05876568332314491, -0.007873594760894775, 0.10711351037025452, -0.06759806722402573, -0.25446873903274536, 0.008159542456269264, 0.17166981101036072, 0.5848773121833801, -0.0532754510641098, 0.20923355221748352, 0.3309687376022339, -0.15720582008361816, -0.023887887597084045, -0.02539040520787239, -0.006915886886417866, 0.2331990897655487, 0.6372760534286499, -0.37746694684028625, 0.09053108096122742, -0.2239760309457779, 0.11663231253623962, 0.2496541142463684, -0.3020799458026886, -0.42067253589630127, -0.013581179082393646, -0.2754863202571869, -0.18638813495635986, 0.07269741594791412, 0.48842117190361023, -0.4969138503074646, 0.1479954719543457, -0.011042624711990356, -0.23059961199760437, -0.2704319953918457, 0.0005705729126930237, 0.16389437019824982, -0.30567604303359985, 0.19121170043945312, 0.050962671637535095, 0.12648427486419678, -0.22997812926769257, 0.007653538137674332, 0.03659043833613396, -0.3239876329898834, 0.06660593301057816, -0.3247334659099579, 0.6027864217758179, 0.03996264934539795, 0.009717918932437897, 0.19521288573741913, 0.34724870324134827, -0.22260630130767822, 0.15923526883125305, 0.0546121820807457, 0.5137354135513306, 0.07476642727851868, -0.1845070868730545, 0.2937244772911072, 0.229197695851326, -0.17418378591537476, 0.044343918561935425, 0.18155859410762787, 0.11693732440471649, 0.1744852513074875, 0.10261229425668716, 0.19446051120758057, -0.08257143199443817, -0.021584976464509964, 0.14705553650856018, 0.27104321122169495, -0.24254272878170013, 0.14139050245285034, -0.6466181874275208, 0.018635980784893036, -0.15687818825244904, 0.05187004432082176, -0.35798323154449463, 0.008403882384300232, 0.07238930463790894, 0.29247477650642395, 0.15050774812698364, 0.001000732183456421, 0.02155996859073639, 0.09736748039722443, 0.26787635684013367, 0.3950587213039398, -0.07652030885219574, 0.018055442720651627, -0.10180103033781052, -0.5897470712661743, 0.033905044198036194, 0.1337384730577469, -0.10054183006286621, -0.18432742357254028, -0.3238065242767334, 0.0893363282084465, -0.08165252208709717, 0.0794355720281601, 0.3209393620491028, 0.5108519196510315, -0.0959767997264862, -0.35612523555755615, -0.2745448052883148, 0.19337259232997894, 0.08874844014644623, -0.05068541318178177, -0.35929983854293823, 0.12231746315956116, -0.2717331051826477, -0.02119797095656395, 0.13365435600280762, 0.14682637155056, -0.32006412744522095, -0.24934767186641693, 0.3652527928352356, -0.13247591257095337, 0.49317431449890137, -0.05581149086356163, 0.06304590404033661, -0.17359454929828644, -0.25081607699394226, 0.002066485583782196, -0.1609267145395279, 0.16407248377799988, 0.4394671618938446, -0.25620508193969727, -0.11935052275657654, -0.39359593391418457, 0.2234809249639511, 0.17821815609931946, 0.24411025643348694, -0.2328636348247528, 0.12387634068727493, -0.1219332367181778, -0.15458762645721436, 0.24437427520751953, -0.08283655345439911, -0.05286216735839844, -0.18737095594406128, -0.30144375562667847, -0.22735075652599335, 0.6532713174819946, -0.20773693919181824, -0.08256630599498749, -0.17953713238239288, 0.15363627672195435, 0.08266618102788925, -0.2047467976808548, -0.47802162170410156, 0.2385629117488861, 0.10706464946269989, 0.07045827805995941, -0.1743827909231186, -0.058056190609931946, -0.14915654063224792, -0.038000963628292084, -0.011740021407604218, 0.20814143121242523, 0.10987018793821335, -0.07699067890644073, 0.39617499709129333, 0.016720741987228394 ]
https://github.com/huggingface/datasets/issues/5854
> Hi! `audiofolder` requires `datasets>=2.5.0`, so please update the `datasets`' installation (`pip install -U datasets`) in the environment to resolve the issue. I don't think it is a problem of the version. It runs ok on colab or local machine. Only on kaggle will has this bug.
Can not load audiofolder dataset on kaggle
### Describe the bug It's crash log: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/audiofolder/audiofolder.py or any data file in the same directory. Couldn't find 'audiofolder' on the Hugging Face Hub either: FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/audiofolder/audiofolder.py ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/93691919/a2829d27-d15c-4acc-86fb-d1987c760468) common_voice = load_dataset("audiofolder", data_dir="/kaggle/working/data") ### Expected behavior load dataset without error. It works ok on colab, but on kaggle it happends. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.31 - Python version: 3.10.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
47
Can not load audiofolder dataset on kaggle ### Describe the bug It's crash log: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/audiofolder/audiofolder.py or any data file in the same directory. Couldn't find 'audiofolder' on the Hugging Face Hub either: FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/audiofolder/audiofolder.py ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/93691919/a2829d27-d15c-4acc-86fb-d1987c760468) common_voice = load_dataset("audiofolder", data_dir="/kaggle/working/data") ### Expected behavior load dataset without error. It works ok on colab, but on kaggle it happends. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.31 - Python version: 3.10.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 > Hi! `audiofolder` requires `datasets>=2.5.0`, so please update the `datasets`' installation (`pip install -U datasets`) in the environment to resolve the issue. I don't think it is a problem of the version. It runs ok on colab or local machine. Only on kaggle will has this bug.
[ -0.32287678122520447, -0.287451833486557, 0.04319688305258751, 0.5809459686279297, 0.32738155126571655, -0.14868700504302979, 0.29481619596481323, -0.014694088138639927, 0.3119141459465027, 0.16970306634902954, -0.3131583333015442, 0.5365290641784668, -0.352512001991272, 0.39629653096199036, 0.02446022629737854, -0.17617952823638916, 0.12592875957489014, 0.13220113515853882, 0.015113169327378273, 0.16004261374473572, -0.11684980243444443, 0.21957196295261383, -0.40511760115623474, 0.21072325110435486, -0.26150602102279663, -0.025920802727341652, -0.019975755363702774, 0.3429509401321411, -0.1546722650527954, -0.35368669033050537, 0.6723780035972595, -0.2101173996925354, 0.3172789216041565, 0.7560901641845703, -0.00011724286014214158, 0.08449709415435791, 0.5423210859298706, -0.15710383653640747, -0.34514573216438293, -0.24083271622657776, -0.4480912685394287, 0.006483800709247589, -0.07135932147502899, 0.10858777165412903, 0.03644160181283951, -0.18472175300121307, -0.14326877892017365, -0.04427418112754822, 0.15054088830947876, 0.18536974489688873, 0.1488681137561798, 0.2873431444168091, 0.27593880891799927, 0.021988462656736374, 0.3028565049171448, 0.18304601311683655, -0.13635875284671783, 0.5129883289337158, 0.31689977645874023, -0.1579587310552597, -0.02640451490879059, 0.1021520346403122, -0.14506033062934875, -0.2648141086101532, 0.2817137837409973, 0.009843606501817703, -0.3624514043331146, -0.4125850200653076, 0.23343293368816376, 0.3857065439224243, 0.5894563794136047, -0.43427205085754395, -0.3869800567626953, -0.3126157522201538, 0.04888858273625374, 0.023139148950576782, 0.37794429063796997, 0.2192188799381256, -0.1461358219385147, 0.011692195199429989, 0.05917147547006607, -0.19835974276065826, -0.0649416446685791, 0.03386468440294266, 0.11856240034103394, 0.2738357484340668, -0.19753490388393402, 0.07801693677902222, 0.4351605176925659, -0.20861691236495972, 0.21138250827789307, 0.03681380674242973, -0.32677161693573, 0.16859880089759827, -0.2794606685638428, 0.10076341778039932, -0.10276150703430176, 0.36439818143844604, -0.006413884460926056, -0.1537245512008667, -0.09229449927806854, 0.07689864933490753, -0.3384469449520111, 0.199793741106987, 0.35031694173812866, 0.37354087829589844, 0.3122333884239197, 0.031205125153064728, 0.3313567340373993, 0.36914145946502686, 0.2001536786556244, -0.00964320544153452, -0.13484683632850647, -0.16258114576339722, -0.10146020352840424, -0.04683975875377655, 0.22238074243068695, -0.09607356786727905, -0.30521953105926514, -0.23392289876937866, -0.2539518475532532, -0.011119954288005829, 0.29990604519844055, 0.49843648076057434, 0.0346224382519722, 0.2374366968870163, -0.007634483277797699, 0.29255977272987366, -0.05897611752152443, 0.18737252056598663, -0.11968366801738739, 0.26658526062965393, 0.03366031497716904, 0.13360516726970673, 0.11625058203935623, -0.5409310460090637, 0.42550310492515564, -0.007318232208490372, 0.2091444730758667, -0.0647578239440918, -0.18367117643356323, 0.1494617760181427, -0.49558931589126587, 0.21686047315597534, 0.11104556918144226, 0.11149534583091736, -0.11468872427940369, -0.06444942951202393, -0.05315320938825607, 0.1983599215745926, -0.323083758354187, -0.16020165383815765, 0.21443505585193634, 0.07733140140771866, -0.44759926199913025, -0.008980900049209595, -0.6338582634925842, -0.048690687865018845, -0.14203104376792908, -0.4287128746509552, 0.09683580696582794, -0.15190839767456055, -0.12520426511764526, -0.15839692950248718, 0.41345030069351196, 0.44250524044036865, -0.10764843970537186, -0.3717886209487915, -0.17383384704589844, -0.22855216264724731, -0.03485391288995743, 0.3111746907234192, -0.09139121323823929, 0.0007264241576194763, -0.42451590299606323, 0.022206738591194153, 0.37153714895248413, -0.6355443596839905, -0.5770821571350098, 0.08898571133613586, -0.21576005220413208, 0.32177168130874634, 0.1551292985677719, -0.013608429580926895, -0.24027898907661438, -0.15428674221038818, 0.18450000882148743, 0.00021263957023620605, 0.16248822212219238, -0.02703065797686577, -0.16462171077728271, -0.363341361284256, 0.11429346352815628, 0.23734469711780548, -0.20975610613822937, -0.09496991336345673, 0.0070725418627262115, 0.1261051446199417, 0.19829702377319336, -0.057331956923007965, -0.07204164564609528, 0.2185865044593811, 0.5161214470863342, -0.06035030633211136, 0.042940396815538406, -0.2337891310453415, -0.32990407943725586, 0.39058977365493774, 0.039093390107154846, -0.05541720613837242, -0.0036568008363246918, -0.0938655287027359, -0.2953410744667053, 0.052230335772037506, -0.4017493724822998, -0.19401639699935913, -0.03023851104080677, 0.054203182458877563, 0.16181035339832306, 0.11790703237056732, -0.14766544103622437, 0.5654836297035217, 0.09818504750728607, -0.03510335087776184, -0.43331465125083923, 0.2706940770149231, -0.06333652138710022, -0.09056203067302704, 0.2273849993944168, 0.31885531544685364, 0.18506938219070435, -0.10299383103847504, 0.01876787841320038, 0.41522201895713806, 0.18563026189804077, 0.4969760775566101, -0.07624833285808563, -0.3068273067474365, 0.23667211830615997, -0.3878077268600464, 0.24717935919761658, 0.12523968517780304, 0.21743355691432953, 0.04462352395057678, -0.07318611443042755, 0.19176556169986725, -0.13965757191181183, 0.11600115895271301, 0.14236146211624146, -0.011674173176288605, 0.0361706018447876, 0.19192910194396973, -0.015332870185375214, -0.025031402707099915, 0.1609257161617279, -0.49551814794540405, 0.42971789836883545, 0.11915376037359238, -0.30847489833831787, -0.03367432579398155, 0.31584158539772034, -0.13969263434410095, 0.35328978300094604, 0.17887639999389648, -0.42801281809806824, 0.014448888599872589, 0.04509532451629639, 0.17312367260456085, 0.38520103693008423, 0.20858736336231232, -0.1333121657371521, -0.03407786786556244, 0.11045707762241364, -0.11346998065710068, 0.22754409909248352, 0.18025174736976624, 0.19166597723960876, 0.4378497898578644, 0.15112335979938507, 0.005560111254453659, -0.2555820643901825, -0.15951189398765564, -0.22578321397304535, 0.2675211727619171, -0.379469096660614, 0.05153045803308487, -0.21732503175735474, -0.24132852256298065, -0.2563543915748596, -0.23273254930973053, -0.20032022893428802, -0.08754891902208328, -0.08121119439601898, 0.3769230842590332, 0.14983467757701874, 0.16309164464473724, 0.06816180050373077, 0.057563699781894684, -0.018271632492542267, -0.010886743664741516, -0.3020070493221283, -0.034768346697092056, -0.3839524984359741, -0.012057974934577942, 0.3630502223968506, 0.22112350165843964, -0.11303102225065231, -0.12219296395778656, -0.04007542133331299, -0.1530422866344452, -0.19897955656051636, -0.025046635419130325, -0.12796831130981445, 0.2523738443851471, 0.09219580143690109, 0.2814234495162964, 0.03710520267486572, -0.4411190152168274, 0.23423177003860474, 0.0032527074217796326, -0.2530535161495209, 0.08812466263771057, -0.045997507870197296, 0.04135322570800781, -0.11983178555965424, -0.2741553783416748, -0.31349867582321167, -0.5242335796356201, 0.458196759223938, -0.07361306250095367, -0.0642058253288269, 0.05813669413328171, 0.13906991481781006, 0.24798066914081573, -0.034172967076301575, -0.10826481878757477, -0.012069502845406532, -0.10455170273780823, 0.2055296003818512, 0.1473141610622406, -0.153785839676857, -0.003992453217506409, 0.039251722395420074, 0.15378141403198242, -0.10572484135627747, -0.4299718141555786, -0.2163868248462677, -0.05839897692203522, -0.05982603505253792, 0.04747984558343887, 0.11838424205780029, 0.10887103527784348, 0.2319067418575287, 0.2109026461839676, -0.04731639474630356, -0.3713182806968689, -0.1743791103363037, 0.1277584433555603, 0.23053394258022308, 0.10871466994285583, 0.3693014979362488, -0.18662360310554504, 0.4647126793861389, 0.35079413652420044, 0.19815480709075928, 0.26629021763801575, -0.16883225739002228, 0.4789331257343292, -0.2526804506778717, -0.37111276388168335, 0.05655025318264961, 0.06142483279109001, -0.0035729333758354187, 0.03937205299735069, 0.20949220657348633, -0.0496501624584198, -0.3649258315563202, -0.6459710597991943, -0.02492775022983551, -0.08707653731107712, -0.17970967292785645, 0.14772501587867737, -0.09343422949314117, -0.19316312670707703, 0.24027442932128906, 0.2084496021270752, -0.13746508955955505, 0.3459816873073578, 0.32658129930496216, 0.14163939654827118, 0.11147727072238922, -0.4075498580932617, -0.3257458508014679, -0.32504189014434814, 0.008267056196928024, 0.07539136707782745, 0.48450127243995667, -0.02929702401161194, -0.14810112118721008, -0.026831258088350296, -0.1424219310283661, 0.5545704960823059, -0.008273079991340637, 0.27762967348098755, -0.1795303076505661, 0.14853812754154205, -0.6316167116165161, -0.055612314492464066, -0.13854514062404633, -0.00018952041864395142, -0.05308995023369789, 0.4763833284378052, -0.08064214885234833, -0.009248029440641403, -0.14616569876670837, 0.41346555948257446, -0.04969533160328865, -0.06637676805257797, -0.40829652547836304, -0.2221781313419342, -0.20896784961223602, -0.15856364369392395, -0.22074028849601746, 0.11223899573087692, -0.08822900801897049, 0.08491280674934387, 0.2013155072927475, -0.35347986221313477, -0.011046268045902252, 0.2664249837398529, 0.4002092778682709, -0.19619086384773254, 0.3716399073600769, 0.18012893199920654, -0.17031046748161316, 0.394220769405365, 0.6661950349807739, 0.02555660530924797, -0.48120155930519104, 0.02061966061592102, 0.09882734715938568, 0.20352114737033844, 0.22129756212234497, -0.16261154413223267, -0.02068757638335228, 0.09615986049175262, -0.022560153156518936, -0.3766801953315735, 0.0038679316639900208, 0.21336650848388672, 0.06878044456243515, -0.20717793703079224, -0.21675175428390503, 0.6350030899047852, 0.12993742525577545, -0.13269560039043427, 0.351887971162796, 0.49403679370880127, -0.25605854392051697, 0.25891247391700745, -0.3523918092250824, 0.6219233870506287, 0.2122880220413208, 0.13303259015083313, 0.5805882811546326, -0.23188281059265137, 0.19266554713249207, 0.09232129156589508, 0.07763317227363586, -0.23531150817871094, -0.27479004859924316, 0.01986861228942871, -0.1571294665336609, -0.03091852366924286, -0.27102601528167725, -0.2640978693962097, 0.3143981099128723, -0.12224339693784714, 0.0230549369007349, -0.14312836527824402, 0.16169464588165283, -0.5005107522010803, -0.11702972650527954, -0.3412249684333801, 0.0661601796746254, -0.019692247733473778, 0.4087604284286499, 0.07336448132991791, -0.038403674960136414, -0.2901805639266968, -0.2084214687347412, -0.309234619140625, 0.30305764079093933, -0.08282000571489334, 0.07377144694328308, 0.1437958925962448, -0.3334173858165741, 0.15830734372138977, 0.4991452991962433, 0.08034306764602661, 0.0765259712934494, -0.3419443368911743, 0.27639955282211304, -0.1847032904624939, 0.0867132842540741, 0.1251462996006012, 0.06729429215192795, 0.057899780571460724, -0.0009310469031333923, -0.3042066693305969, 0.07221713662147522, -0.18676888942718506, -0.01332729309797287, -0.08809049427509308, 0.13630184531211853, -0.3846040368080139, -0.04713590070605278, -0.36137816309928894, -0.06148839741945267, 0.21084146201610565, -0.08282973617315292, 0.0717443972826004, 0.10093490779399872, -0.0490584559738636, -0.09770680963993073, -0.046519048511981964, 0.0012126266956329346, -0.049184493720531464, 0.4695137143135071, -0.20830334722995758, 0.2183588147163391, 0.32648134231567383, 0.11852952837944031, -0.09238448739051819, -0.12292398512363434, 0.147683247923851, 0.21703550219535828, -0.2535099387168884, -0.07173914462327957, 0.18207840621471405, -0.024681583046913147, 0.06798839569091797, 0.21334710717201233, 0.15911683440208435, -0.2526749074459076, -0.1628606915473938, -0.43043458461761475, -0.3541751801967621, 0.5653424859046936, -0.03350100666284561, 0.09037917852401733, -0.06833620369434357, -0.14614346623420715, 0.03150367736816406, -0.07931359112262726, -0.1965833306312561, 0.1430949568748474, -0.06217718496918678, -0.13431623578071594, 0.38596007227897644, 0.10791593790054321, 0.36118361353874207, -0.10700461268424988, 0.03646913915872574, 0.02945878729224205, -0.08439497649669647, -0.024174904450774193, 0.03364315629005432, 0.09315699338912964, 0.04047108069062233, -0.026088615879416466, -0.15162083506584167, -0.2851065993309021, 0.034294307231903076, -0.18614432215690613, 0.44609659910202026, 0.403455913066864, -0.11508585512638092, 0.07705642282962799, -0.1744818538427353, 0.10446831583976746, -0.16683927178382874, 0.34858065843582153, -0.16686004400253296, -0.2766984701156616, 0.20189730823040009, -0.02476787380874157, 0.1609555184841156, 0.058404676616191864, 0.2048979550600052, 0.05103147029876709, -0.1651322841644287, 0.1840369701385498, 0.21510165929794312, -0.18995249271392822, 0.13213136792182922, 0.01501091942191124, 0.14667898416519165, 0.47939637303352356, -0.12978675961494446, -0.0068571679294109344, 0.1673833429813385, 0.053392693400382996, -0.2556074261665344, -0.3001176118850708, 0.18087725341320038, -0.03671877458691597, -0.01800236850976944, 0.11274250596761703, -0.03162673860788345, -0.2308928519487381, 0.033470623195171356, 0.1737704575061798, 0.565467119216919, -0.03407569229602814, 0.2446947693824768, 0.37594130635261536, -0.11321313679218292, 0.03425384312868118, -0.036374032497406006, -0.0051595838740468025, 0.24088603258132935, 0.6228575706481934, -0.38373515009880066, 0.10564615577459335, -0.21608442068099976, 0.12158844619989395, 0.2629896402359009, -0.30142468214035034, -0.4254678189754486, -0.01785186678171158, -0.2576291263103485, -0.19204944372177124, 0.08490211516618729, 0.4933445453643799, -0.5389107465744019, 0.15313905477523804, -0.04481252282857895, -0.2199166864156723, -0.25731223821640015, -0.0200636088848114, 0.14343056082725525, -0.2685048580169678, 0.16455452144145966, 0.05388452857732773, 0.0810135155916214, -0.21371018886566162, 0.03006543219089508, 0.039927415549755096, -0.29879865050315857, 0.023072201758623123, -0.3106521666049957, 0.5774549245834351, 0.035412292927503586, 0.03459140658378601, 0.22383719682693481, 0.30544930696487427, -0.23209312558174133, 0.13532871007919312, 0.07474608719348907, 0.5354486703872681, 0.08074773848056793, -0.171280637383461, 0.2405342161655426, 0.21071991324424744, -0.16462838649749756, 0.05321240425109863, 0.16423547267913818, 0.08423976600170135, 0.17360933125019073, 0.10796639323234558, 0.17392471432685852, -0.05740933492779732, 0.03041817620396614, 0.1342928111553192, 0.2807691991329193, -0.26885032653808594, 0.16616040468215942, -0.6542649269104004, 0.041676849126815796, -0.12407758831977844, 0.068271704018116, -0.37109094858169556, 0.04986904188990593, 0.07607944309711456, 0.30154353380203247, 0.14924338459968567, -0.019205693155527115, 0.014729931950569153, 0.09123924374580383, 0.31237101554870605, 0.42293038964271545, -0.0589519701898098, 0.04182853549718857, -0.07523120939731598, -0.589847207069397, 0.044212330132722855, 0.13457104563713074, -0.0797743871808052, -0.20290705561637878, -0.3242912292480469, 0.05900389701128006, -0.0809609442949295, 0.05578398331999779, 0.3087022006511688, 0.47775548696517944, -0.11530078947544098, -0.3628780245780945, -0.2609620690345764, 0.1915053427219391, 0.06971322745084763, -0.054937638342380524, -0.39102882146835327, 0.1364157497882843, -0.3208685517311096, -0.06282636523246765, 0.11139054596424103, 0.1290927678346634, -0.3073912560939789, -0.2766640782356262, 0.39732417464256287, -0.12715978920459747, 0.46928322315216064, -0.041253313422203064, 0.05571521818637848, -0.2115688920021057, -0.24779552221298218, -0.01194683089852333, -0.11985644698143005, 0.16666409373283386, 0.4504806399345398, -0.26440051198005676, -0.0822412371635437, -0.38791677355766296, 0.25143349170684814, 0.15629462897777557, 0.2667619287967682, -0.19232413172721863, 0.1093708872795105, -0.13443563878536224, -0.1432894915342331, 0.23699015378952026, -0.1361771821975708, -0.061189472675323486, -0.20732492208480835, -0.330132395029068, -0.21155333518981934, 0.6269444227218628, -0.2514312267303467, -0.08617698401212692, -0.23673143982887268, 0.17784999310970306, 0.1388101577758789, -0.24548205733299255, -0.4797414243221283, 0.2681531608104706, 0.11597444117069244, 0.0830402746796608, -0.16020344197750092, -0.05671809986233711, -0.17565536499023438, -0.0038617998361587524, -0.01687060296535492, 0.22165606915950775, 0.0568716824054718, -0.12044046819210052, 0.37475672364234924, -0.009697817265987396 ]
https://github.com/huggingface/datasets/issues/5854
Based on your dataset info, the installed version is `2.1.0`, which does not include `audiofolder`. By default, Kaggle preinstalls `datasets` into a new env, but the version it installs is outdated and does not contain newer features such as `audiofolder`
Can not load audiofolder dataset on kaggle
### Describe the bug It's crash log: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/audiofolder/audiofolder.py or any data file in the same directory. Couldn't find 'audiofolder' on the Hugging Face Hub either: FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/audiofolder/audiofolder.py ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/93691919/a2829d27-d15c-4acc-86fb-d1987c760468) common_voice = load_dataset("audiofolder", data_dir="/kaggle/working/data") ### Expected behavior load dataset without error. It works ok on colab, but on kaggle it happends. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.31 - Python version: 3.10.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
40
Can not load audiofolder dataset on kaggle ### Describe the bug It's crash log: FileNotFoundError: Couldn't find a dataset script at /kaggle/working/audiofolder/audiofolder.py or any data file in the same directory. Couldn't find 'audiofolder' on the Hugging Face Hub either: FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/datasets/audiofolder/audiofolder.py ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/93691919/a2829d27-d15c-4acc-86fb-d1987c760468) common_voice = load_dataset("audiofolder", data_dir="/kaggle/working/data") ### Expected behavior load dataset without error. It works ok on colab, but on kaggle it happends. ### Environment info - `datasets` version: 2.1.0 - Platform: Linux-5.15.109+-x86_64-with-glibc2.31 - Python version: 3.10.10 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 Based on your dataset info, the installed version is `2.1.0`, which does not include `audiofolder`. By default, Kaggle preinstalls `datasets` into a new env, but the version it installs is outdated and does not contain newer features such as `audiofolder`
[ -0.3101239502429962, -0.32566794753074646, 0.0438629575073719, 0.5551077127456665, 0.32403919100761414, -0.10100151598453522, 0.24710452556610107, -0.008645685389637947, 0.31990259885787964, 0.11650456488132477, -0.3348088562488556, 0.5558660626411438, -0.33686235547065735, 0.3863137662410736, 0.054153043776750565, -0.11628960072994232, 0.12124533951282501, 0.1297144591808319, 0.07728569209575653, 0.17491745948791504, -0.0812910720705986, 0.2100258767604828, -0.39213547110557556, 0.20556172728538513, -0.2656930387020111, -0.023352384567260742, -0.03158227354288101, 0.3692905902862549, -0.1554316282272339, -0.36065855622291565, 0.6697273254394531, -0.19592270255088806, 0.3180302381515503, 0.6729811429977417, -0.00011398454807931557, 0.05080075562000275, 0.556036114692688, -0.15891727805137634, -0.3350867033004761, -0.18499892950057983, -0.43626901507377625, -0.011581487953662872, -0.11735212057828903, 0.08940108120441437, 0.034240663051605225, -0.21326912939548492, -0.17304950952529907, -0.06948096305131912, 0.13735730946063995, 0.1508340984582901, 0.17132529616355896, 0.25439316034317017, 0.34298989176750183, -0.011051535606384277, 0.29356592893600464, 0.19160614907741547, -0.08538339287042618, 0.47195711731910706, 0.28060483932495117, -0.17141753435134888, -0.039922505617141724, 0.09490083903074265, -0.08888481557369232, -0.29882732033729553, 0.27304497361183167, 0.06492871046066284, -0.4057564437389374, -0.36661335825920105, 0.1742110252380371, 0.3500947952270508, 0.5511340498924255, -0.4366970956325531, -0.33878010511398315, -0.3704906702041626, 0.07532230019569397, 0.00460062175989151, 0.3331744074821472, 0.17340710759162903, -0.15943118929862976, -0.024721793830394745, 0.06723110377788544, -0.24051450192928314, 0.005275696516036987, 0.005494678393006325, 0.10486529022455215, 0.2686001658439636, -0.17093835771083832, 0.05039951950311661, 0.5201859474182129, -0.20459997653961182, 0.1882675141096115, 0.024305619299411774, -0.3178643584251404, 0.15426260232925415, -0.26669856905937195, 0.08865930140018463, -0.04684099927544594, 0.33865460753440857, 0.036126136779785156, -0.13975614309310913, -0.08940364420413971, 0.10624879598617554, -0.351117342710495, 0.17067855596542358, 0.3335675597190857, 0.41883426904678345, 0.2779455780982971, 0.00014589354395866394, 0.2536860704421997, 0.39258724451065063, 0.22824102640151978, -0.040844567120075226, -0.09282796084880829, -0.1342260241508484, -0.10668622702360153, -0.05684295669198036, 0.23370899260044098, -0.03639425337314606, -0.33292171359062195, -0.2313515990972519, -0.25252220034599304, -0.05203448235988617, 0.29446280002593994, 0.48738566040992737, 0.0180744007229805, 0.25502288341522217, -0.0027451366186141968, 0.276256263256073, -0.06767341494560242, 0.1985434889793396, -0.14376947283744812, 0.2800308167934418, 0.04751928150653839, 0.11215214431285858, 0.10784664750099182, -0.5477739572525024, 0.428283154964447, 0.012274738401174545, 0.25742003321647644, -0.08710082620382309, -0.16678667068481445, 0.1576930284500122, -0.5149288177490234, 0.1545877903699875, 0.08994464576244354, 0.0919945016503334, -0.08643347024917603, -0.10427224636077881, -0.05031698942184448, 0.12650415301322937, -0.32425981760025024, -0.16131462156772614, 0.2791590094566345, 0.11681979894638062, -0.43684837222099304, -0.027602845802903175, -0.5889972448348999, -0.04491545259952545, -0.14610527455806732, -0.41272589564323425, 0.09767845273017883, -0.11600624024868011, -0.11994070559740067, -0.1338055580854416, 0.4660421311855316, 0.42768359184265137, -0.12351135909557343, -0.3607999384403229, -0.18041956424713135, -0.2009894847869873, -0.09372599422931671, 0.2832595705986023, -0.08448517322540283, 0.04356842860579491, -0.464354008436203, 0.08668653666973114, 0.33642953634262085, -0.6393659114837646, -0.5271522998809814, 0.020872823894023895, -0.22239360213279724, 0.38940513134002686, 0.08393015712499619, -0.009014368057250977, -0.2569888234138489, -0.16388918459415436, 0.2253594994544983, -0.011404372751712799, 0.10940267890691757, -0.06631581485271454, -0.13629348576068878, -0.33967921137809753, 0.09568193554878235, 0.23624777793884277, -0.269443154335022, -0.07836513966321945, -0.04444641247391701, 0.108524389564991, 0.22139552235603333, -0.0344642698764801, -0.03864758089184761, 0.2051343470811844, 0.46388402581214905, -0.004238681867718697, 0.017886105924844742, -0.17287883162498474, -0.34636226296424866, 0.4069226384162903, 0.03341377526521683, -0.08343099057674408, -0.012483399361371994, -0.11898857355117798, -0.29652291536331177, 0.04808928072452545, -0.4126319885253906, -0.23036979138851166, 0.008911557495594025, 0.09869544953107834, 0.15106900036334991, 0.10502895712852478, -0.13678133487701416, 0.5461153388023376, 0.14032074809074402, -0.04326599836349487, -0.481096088886261, 0.25901952385902405, -0.08883059024810791, -0.058029577136039734, 0.24318528175354004, 0.36477506160736084, 0.1682162582874298, -0.07360297441482544, 0.07459427416324615, 0.4403703212738037, 0.20533061027526855, 0.4832093417644501, -0.06572099030017853, -0.32626181840896606, 0.263226717710495, -0.4125273525714874, 0.213756263256073, 0.10133799910545349, 0.2076655775308609, 0.015128262341022491, -0.12692855298519135, 0.20012016594409943, -0.11982433497905731, 0.08699607849121094, 0.1572936624288559, 0.009155675768852234, 0.03696935623884201, 0.14756810665130615, 0.01709718257188797, -0.06287830322980881, 0.12773871421813965, -0.5481069684028625, 0.39624643325805664, 0.11765629798173904, -0.29067498445510864, 0.0001600310206413269, 0.35845714807510376, -0.12350010871887207, 0.29142624139785767, 0.18809209764003754, -0.4325343072414398, 0.02786818891763687, 0.056296736001968384, 0.13219106197357178, 0.36035650968551636, 0.24238677322864532, -0.11410309374332428, -0.046415217220783234, 0.10873055458068848, -0.09200720489025116, 0.21319782733917236, 0.15859732031822205, 0.2517411410808563, 0.4026675820350647, 0.1207355484366417, 0.002037055790424347, -0.2382063865661621, -0.18478986620903015, -0.22439751029014587, 0.25549209117889404, -0.33024823665618896, -0.007450249046087265, -0.2060011625289917, -0.23444980382919312, -0.2203294187784195, -0.24927164614200592, -0.1527089774608612, -0.1111232340335846, -0.07990045845508575, 0.3698594570159912, 0.12491802871227264, 0.12355247139930725, 0.04899134486913681, 0.03687216341495514, -0.0068221986293792725, -0.013069521635770798, -0.3117963969707489, -0.048834312707185745, -0.3743687868118286, 0.024115994572639465, 0.3179316222667694, 0.19193051755428314, -0.13231778144836426, -0.03328041732311249, 0.024210423231124878, -0.18892478942871094, -0.2174001783132553, -0.029691234230995178, -0.14177191257476807, 0.17597684264183044, 0.07758602499961853, 0.2934296131134033, 0.037009045481681824, -0.5198168754577637, 0.24111686646938324, 0.030744358897209167, -0.28022271394729614, 0.10069634020328522, 0.004854463040828705, 0.05990532040596008, -0.12081484496593475, -0.3043142855167389, -0.3036419749259949, -0.5611914992332458, 0.4288807809352875, -0.04210488498210907, -0.13016939163208008, 0.07518599182367325, 0.16626499593257904, 0.23152370750904083, -0.008914463222026825, -0.09304587543010712, -0.05027148500084877, -0.06371498852968216, 0.19442233443260193, 0.1379360556602478, -0.11448276042938232, -0.035771727561950684, -0.012252170592546463, 0.1794641762971878, -0.1409468948841095, -0.46498021483421326, -0.2115655094385147, -0.04728937894105911, -0.046739362180233, 0.017651116475462914, 0.08106488734483719, 0.1427420675754547, 0.276463121175766, 0.1570751667022705, -0.03236737102270126, -0.35544562339782715, -0.18496662378311157, 0.1157466322183609, 0.24685432016849518, 0.08281001448631287, 0.3886035084724426, -0.18758246302604675, 0.4405288100242615, 0.33603787422180176, 0.22931203246116638, 0.2521614730358124, -0.1503535956144333, 0.48386693000793457, -0.23082542419433594, -0.3318300247192383, 0.07816725969314575, 0.020156927406787872, 0.026504456996917725, 0.09060969948768616, 0.2074885368347168, -0.04171779751777649, -0.35566967725753784, -0.5788869261741638, -0.007171519100666046, -0.09266216307878494, -0.17529195547103882, 0.11120536923408508, -0.08820804953575134, -0.2217937707901001, 0.24860239028930664, 0.21718986332416534, -0.1058698296546936, 0.35038983821868896, 0.23900392651557922, 0.14488060772418976, 0.09230436384677887, -0.46700140833854675, -0.3335556089878082, -0.2964324355125427, -0.012717068195343018, 0.07018274813890457, 0.46922194957733154, -0.02213631570339203, -0.19977551698684692, -0.04305735602974892, -0.16439983248710632, 0.5789527893066406, 0.05189768970012665, 0.25406575202941895, -0.14924460649490356, 0.15477357804775238, -0.6351093053817749, -0.06084844842553139, -0.10830771178007126, -0.08024533092975616, -0.07117380201816559, 0.4457307755947113, -0.09958766400814056, 0.03389262035489082, -0.19000877439975739, 0.4175914525985718, -0.04087968170642853, -0.014377843588590622, -0.3840523958206177, -0.25674664974212646, -0.2620161771774292, -0.1359625607728958, -0.26741328835487366, 0.10842770338058472, -0.07831193506717682, 0.09749071300029755, 0.2585943043231964, -0.3675953447818756, -0.012673810124397278, 0.21252310276031494, 0.45485919713974, -0.1363874226808548, 0.3455790877342224, 0.19560138881206512, -0.1944587677717209, 0.3886655271053314, 0.6931660771369934, 0.03368766978383064, -0.5004355311393738, -0.02511209063231945, 0.09776261448860168, 0.18403594195842743, 0.19056308269500732, -0.10101506114006042, 0.025377962738275528, 0.1281755268573761, 0.012053906917572021, -0.4638974070549011, 0.05956651642918587, 0.22952209413051605, 0.04603632912039757, -0.20321501791477203, -0.2002040445804596, 0.622883141040802, 0.07345695793628693, -0.09730395674705505, 0.31724488735198975, 0.5024236440658569, -0.27504220604896545, 0.2498500645160675, -0.3174431025981903, 0.5558556318283081, 0.2641735076904297, 0.15736690163612366, 0.5902430415153503, -0.22280988097190857, 0.20973755419254303, 0.01748325675725937, 0.07458531856536865, -0.17603108286857605, -0.2503546476364136, 0.022906534373760223, -0.1391914188861847, -0.06245670095086098, -0.3097047209739685, -0.3164127469062805, 0.2178809940814972, -0.1529439091682434, 0.04866236820816994, -0.140487402677536, 0.20800042152404785, -0.4950546622276306, -0.13124243915081024, -0.25986477732658386, 0.1082245409488678, -0.0010000132024288177, 0.4027310609817505, 0.07300452142953873, -0.04674149304628372, -0.2872650623321533, -0.17674773931503296, -0.27981555461883545, 0.31320688128471375, -0.018136590719223022, 0.08494852483272552, 0.12895804643630981, -0.32187148928642273, 0.1236141175031662, 0.48402494192123413, 0.1025799885392189, 0.08854279667139053, -0.33418887853622437, 0.3108707666397095, -0.15055973827838898, 0.11825987696647644, 0.11799599975347519, 0.027218684554100037, 0.08172484487295151, 0.014152511954307556, -0.284857839345932, 0.14458130300045013, -0.18424375355243683, -0.04113783314824104, -0.16856709122657776, 0.1876801997423172, -0.43670332431793213, -0.07331155240535736, -0.33086609840393066, -0.023410961031913757, 0.186537504196167, -0.08604518324136734, 0.0878717228770256, 0.09659619629383087, -0.0776636153459549, -0.09753792732954025, -0.008686408400535583, 0.03730514645576477, -0.04597892984747887, 0.4277719557285309, -0.19416064023971558, 0.1789088249206543, 0.35312604904174805, 0.10037925839424133, -0.10238916426897049, -0.11930951476097107, 0.08470316976308823, 0.27665403485298157, -0.19355586171150208, -0.09662407636642456, 0.18973106145858765, -0.02188529074192047, 0.07465463876724243, 0.1667260378599167, 0.16184841096401215, -0.2494344562292099, -0.13714368641376495, -0.4089544415473938, -0.4229162037372589, 0.5903453826904297, -0.01594230905175209, 0.10471860319375992, -0.09469114989042282, -0.10753707587718964, 0.006924256682395935, -0.025111183524131775, -0.2293941080570221, 0.1424092948436737, -0.11410623043775558, -0.11741028726100922, 0.37534189224243164, 0.057564541697502136, 0.3273915946483612, -0.13055352866649628, 0.0818517655134201, 0.02499927580356598, -0.09213444590568542, -0.035496704280376434, 0.04124747961759567, 0.06931665539741516, 0.04160226136445999, -0.02858584187924862, -0.13339751958847046, -0.27481168508529663, 0.06432891637086868, -0.16293875873088837, 0.4178597331047058, 0.3673073649406433, -0.11963249742984772, 0.03540442883968353, -0.1804446130990982, 0.08376987278461456, -0.13474994897842407, 0.2683033049106598, -0.15418477356433868, -0.29520684480667114, 0.23350220918655396, -0.05459859222173691, 0.1279035210609436, 0.0570724681019783, 0.24354878067970276, 0.10755191743373871, -0.11267732083797455, 0.13797101378440857, 0.23652464151382446, -0.16748937964439392, 0.14823298156261444, 0.0009352751076221466, 0.150326207280159, 0.4370604157447815, -0.12262915074825287, 0.027326315641403198, 0.17321467399597168, 0.08850044012069702, -0.24611397087574005, -0.3062765300273895, 0.15379628539085388, -0.08063633739948273, 0.0045775845646858215, 0.07952576875686646, -0.0762452632188797, -0.17703568935394287, 0.0335601344704628, 0.19775602221488953, 0.5925670266151428, -0.09612931311130524, 0.22462889552116394, 0.3208780884742737, -0.14765365421772003, -0.002420436590909958, -0.025125056505203247, 0.005259711295366287, 0.23782312870025635, 0.6515082716941833, -0.39848920702934265, 0.08844419568777084, -0.21712610125541687, 0.10193438082933426, 0.25507357716560364, -0.33583348989486694, -0.4311200678348541, 0.014925695955753326, -0.280948281288147, -0.1832958459854126, 0.0718846395611763, 0.5094605088233948, -0.48294198513031006, 0.14105157554149628, 0.009469367563724518, -0.22222928702831268, -0.24381974339485168, -0.013701356947422028, 0.13757538795471191, -0.2681082487106323, 0.17958441376686096, 0.06063692271709442, 0.1287253051996231, -0.2485751211643219, -0.005769889801740646, 0.007914822548627853, -0.3511160910129547, 0.04505843669176102, -0.312162309885025, 0.5238393545150757, 0.03801456466317177, 0.03605574369430542, 0.19995306432247162, 0.3603421747684479, -0.2419014871120453, 0.1753636598587036, 0.05798311531543732, 0.504282534122467, 0.0236496739089489, -0.16895730793476105, 0.28205233812332153, 0.2505073845386505, -0.1576281487941742, 0.022262796759605408, 0.14679750800132751, 0.14096783101558685, 0.130141481757164, 0.1115005612373352, 0.2102319598197937, -0.0931912362575531, -0.008115559816360474, 0.13887915015220642, 0.21138706803321838, -0.2503252625465393, 0.15564048290252686, -0.6006414890289307, 0.0319521427154541, -0.11946192383766174, 0.1008523479104042, -0.37449416518211365, 0.017979435622692108, 0.07069235295057297, 0.27603885531425476, 0.15362675487995148, 0.004022758454084396, 0.03678937256336212, 0.09957986325025558, 0.28577226400375366, 0.4049673080444336, -0.08813374489545822, 0.08180008828639984, -0.09863825887441635, -0.6058333516120911, 0.014598336070775986, 0.13285326957702637, -0.09943948686122894, -0.18166516721248627, -0.2994902729988098, 0.10639339685440063, -0.10897482931613922, 0.032878048717975616, 0.29419293999671936, 0.5190720558166504, -0.1597830355167389, -0.3587851822376251, -0.2515135705471039, 0.22106432914733887, 0.08276141434907913, -0.04352341219782829, -0.3616252541542053, 0.11273129284381866, -0.3047167658805847, -0.016684338450431824, 0.1419384628534317, 0.1365281641483307, -0.31524917483329773, -0.2905968129634857, 0.3818405866622925, -0.14794915914535522, 0.46090269088745117, -0.08307184278964996, 0.05129099637269974, -0.2168712019920349, -0.2171436995267868, -0.006231196224689484, -0.19140982627868652, 0.14824721217155457, 0.4864268898963928, -0.24003081023693085, -0.10380813479423523, -0.37035927176475525, 0.25640955567359924, 0.21731621026992798, 0.24836809933185577, -0.22138118743896484, 0.15972843766212463, -0.13394373655319214, -0.16005933284759521, 0.2826131582260132, -0.08712344616651535, -0.031663402915000916, -0.17700587213039398, -0.33844417333602905, -0.21805039048194885, 0.6699175238609314, -0.16886690258979797, -0.06257818639278412, -0.21243058145046234, 0.12983742356300354, 0.11333194375038147, -0.2142002284526825, -0.4333171248435974, 0.23624704778194427, 0.10758814215660095, 0.08236929774284363, -0.21641261875629425, -0.06768909096717834, -0.14762958884239197, -0.06934492290019989, -0.026293374598026276, 0.22944721579551697, 0.1165907084941864, -0.1128334254026413, 0.40098267793655396, 0.004303544759750366 ]
https://github.com/huggingface/datasets/issues/5847
[`KeyDataset`](https://github.com/huggingface/transformers/blob/7f8b909189547944617741d8d3c6c84504701693/src/transformers/pipelines/pt_utils.py#L296) doesn't support iterable datasets, so you either need to implement a version that does (and also indexing nested (translation) fields): ```python from torch.utils.data import Dataset, IterableDataset def build_key_fetcher(key: str): def _key_fetcher(item): for sub_key in key.split("."): item = item[sub_key] return item return _key_fetcher class KeyDataset(Dataset): def __new__(cls, dataset: Dataset, key: str): cls = _KeyIterableDataset if isinstance(dataset, IterableDataset) else _KeyMapDataset self = object.__new__(cls) self.dataset = dataset self.key = key self._key_fetcher = build_key_fetcher(key) return self class _KeyMapDataset(KeyDataset): def __getitem__(self, i): return self._key_fetcher(self.dataset[i]) def __len__(self): return len(self.dataset) class _KeyIterableDataset(KeyDataset): def __iter__(self): for ex in self.dataset: yield self._key_fetcher(ex) ks = KeyDataset(ds, "translation.en") ``` or use `IterableDataset`'s `map`: ```python def fetch_en_translation(ex): return {"en": ex["translation"]["en"]} ks = ds.map(fetch_en_translation, remove_columns=ds.column_names) ``` cc @sgugger: Perhaps the `KeyDataset` + PyTorch `IterableDataset` case should be supported by Transformers
Streaming IterableDataset not working with translation pipeline
### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ```
128
Streaming IterableDataset not working with translation pipeline ### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ``` [`KeyDataset`](https://github.com/huggingface/transformers/blob/7f8b909189547944617741d8d3c6c84504701693/src/transformers/pipelines/pt_utils.py#L296) doesn't support iterable datasets, so you either need to implement a version that does (and also indexing nested (translation) fields): ```python from torch.utils.data import Dataset, IterableDataset def build_key_fetcher(key: str): def _key_fetcher(item): for sub_key in key.split("."): item = item[sub_key] return item return _key_fetcher class KeyDataset(Dataset): def __new__(cls, dataset: Dataset, key: str): cls = _KeyIterableDataset if isinstance(dataset, IterableDataset) else _KeyMapDataset self = object.__new__(cls) self.dataset = dataset self.key = key self._key_fetcher = build_key_fetcher(key) return self class _KeyMapDataset(KeyDataset): def __getitem__(self, i): return self._key_fetcher(self.dataset[i]) def __len__(self): return len(self.dataset) class _KeyIterableDataset(KeyDataset): def __iter__(self): for ex in self.dataset: yield self._key_fetcher(ex) ks = KeyDataset(ds, "translation.en") ``` or use `IterableDataset`'s `map`: ```python def fetch_en_translation(ex): return {"en": ex["translation"]["en"]} ks = ds.map(fetch_en_translation, remove_columns=ds.column_names) ``` cc @sgugger: Perhaps the `KeyDataset` + PyTorch `IterableDataset` case should be supported by Transformers
[ -0.5097402334213257, -0.1700969636440277, -0.03699735552072525, 0.1410585343837738, 0.32595449686050415, -0.04014071822166443, 0.5023482441902161, 0.08091886341571808, -0.21698808670043945, 0.3707205653190613, 0.11250735074281693, -0.12919551134109497, -0.09642905741930008, -0.056972090154886246, 0.24075904488563538, -0.1401120275259018, 0.14402469992637634, 0.11066155135631561, 0.07620875537395477, 0.025537937879562378, -0.1345769762992859, 0.419960618019104, -0.3393276333808899, -0.13462135195732117, 0.07164821028709412, -0.020041603595018387, 0.07546335458755493, -0.06072026491165161, 0.10995739698410034, -0.0972297340631485, 0.2946396470069885, 0.08511921763420105, 0.3027557134628296, 0.35239145159721375, -0.00012714500189758837, 0.07905419915914536, 0.28028425574302673, -0.18852919340133667, -0.23983651399612427, -0.24718943238258362, 0.06415900588035583, -0.04391658306121826, -0.2632408142089844, -0.1516910344362259, -0.10690533369779587, -0.1233992874622345, -0.0009501222521066666, -0.6041090488433838, 0.27238205075263977, 0.35920193791389465, 0.0669078528881073, 0.1592809408903122, -0.03286817669868469, 0.14321640133857727, -0.24326962232589722, -0.20158545672893524, -0.2896386384963989, -0.040483687072992325, 0.3940836787223816, 0.31063175201416016, 0.23769241571426392, 0.2160363346338272, -0.09335566312074661, 0.039544034749269485, 0.013658847659826279, -0.08215659856796265, -0.18719595670700073, -0.2938418984413147, 0.355713814496994, 0.2636595368385315, 0.1755864918231964, -0.3200145363807678, -0.20304788649082184, -0.34278014302253723, -0.0711405873298645, -0.6014050841331482, 0.07055695354938507, 0.1000886857509613, -0.21229995787143707, -0.007286093197762966, -0.3974710702896118, -0.10858047753572464, -0.35362544655799866, 0.15915684401988983, -0.0850362777709961, 0.326413631439209, -0.08511316031217575, 0.2675486207008362, -0.1415335237979889, 0.012549718841910362, 0.4891425669193268, -0.2344309389591217, -0.19036218523979187, 0.3076048493385315, -0.22657936811447144, -0.024596519768238068, 0.1515607386827469, -0.08294159173965454, 0.04803165793418884, -0.15568676590919495, 0.07480666041374207, 0.13651800155639648, -0.03592266887426376, -0.1607162058353424, 0.20335620641708374, 0.3483774662017822, -0.07834616303443909, 0.16780833899974823, 0.15385472774505615, 0.16383272409439087, 0.024051278829574585, -0.22132831811904907, -0.21857406198978424, -0.22887767851352692, 0.10207559913396835, 0.26342862844467163, 0.31498581171035767, -0.0394933819770813, -0.12510105967521667, -0.04131017625331879, -0.5802354216575623, -0.05286068841814995, 0.12952543795108795, 0.22888964414596558, -0.04450557380914688, 0.2143705189228058, -0.1489899456501007, 0.11406884342432022, -0.15631341934204102, -0.5252845287322998, -0.15230534970760345, -0.04130159690976143, -0.1952512264251709, -0.0504196397960186, 0.20020370185375214, -0.26024043560028076, 0.07499642670154572, -0.4126899242401123, 0.04635615646839142, -0.09593067318201065, -0.062235187739133835, -0.33685359358787537, 0.49023789167404175, 0.06026052311062813, 0.1704496443271637, 0.22255763411521912, -0.026821617037057877, -0.30965301394462585, -0.009809121489524841, 0.19359742105007172, 0.04299314320087433, -0.2842552363872528, 0.2825937867164612, -0.01908278465270996, -0.41798704862594604, 0.02458900585770607, -0.28187859058380127, 0.5110830068588257, 0.28072112798690796, -0.2482677698135376, -0.09234276413917542, -0.11012259125709534, -0.3919673562049866, -0.02711804211139679, 0.3800787627696991, 0.2984222173690796, -0.4647061824798584, -0.13047990202903748, -0.14865444600582123, 0.06488573551177979, 0.4687230587005615, 0.20888984203338623, -0.16553334891796112, 0.13570353388786316, -0.13617652654647827, 0.1485339105129242, 0.37663498520851135, -0.018508493900299072, -0.5099626183509827, 0.40919873118400574, 0.024875901639461517, 0.35645920038223267, -0.061860740184783936, -0.09003415703773499, 0.3700574040412903, -0.1855018436908722, 0.06217982620000839, 0.32021740078926086, -0.36143913865089417, 0.059831373393535614, -0.1008855551481247, -0.042543355375528336, -0.06351915001869202, 0.009736642241477966, 0.2629832327365875, 0.29891377687454224, -0.010900549590587616, 0.5163140892982483, 0.14717401564121246, -0.12125247716903687, 0.3402221202850342, 0.3987255096435547, 0.14896412193775177, -0.24811458587646484, 0.13294312357902527, -0.17207071185112, -0.28794512152671814, 0.12335008382797241, 0.15981341898441315, -0.1589256227016449, 0.11470885574817657, 0.1677647829055786, -0.007817432284355164, 0.17429935932159424, -0.08922751247882843, -0.38155555725097656, 0.01310047134757042, 0.27395081520080566, 0.21945102512836456, 0.08004723489284515, -0.20099705457687378, -0.0020223520696163177, -0.324116051197052, -0.3929927349090576, -0.2253016084432602, 0.18459272384643555, 0.3023614287376404, -0.3261498212814331, -0.031161155551671982, 0.2662419080734253, 0.08309777081012726, -0.10790251195430756, -0.2516555190086365, 0.147996723651886, -0.2230628877878189, 0.3441162705421448, -0.3123112916946411, 0.48378291726112366, 0.20421332120895386, -0.20268231630325317, 0.029003093019127846, 0.2141982614994049, 0.08959848433732986, 0.0038378536701202393, 0.029247021302580833, 0.24680738151073456, -0.3722628951072693, 0.3738165497779846, 0.22064760327339172, 0.06693238765001297, 0.5222475528717041, 0.1722707897424698, -0.2533802092075348, 0.022777721285820007, 0.2827177941799164, -0.3295366168022156, 0.13036280870437622, -0.20388175547122955, -0.1531578004360199, 0.07777111232280731, 0.4700506031513214, 0.2944859266281128, -0.25459691882133484, 0.010294485837221146, -0.34874987602233887, 0.0132361501455307, 0.29047513008117676, 0.3347748816013336, 0.5133265852928162, 0.08286193013191223, 0.4048360586166382, 0.027135225012898445, 0.07283669710159302, -0.18930478394031525, 0.2459898740053177, 0.121004618704319, 0.0422380231320858, 0.23451611399650574, -0.05061178654432297, -0.014471171423792839, -0.30086827278137207, -0.2677822709083557, -0.02701488509774208, 0.34101179242134094, -0.1795780062675476, 0.3285972774028778, -0.1869487166404724, -0.5258563160896301, -0.2493913769721985, -0.42008721828460693, 0.09096720814704895, -0.26039597392082214, -0.24614030122756958, 0.6363250017166138, 0.09580276906490326, 0.25799477100372314, 0.2614666223526001, 0.010100871324539185, 0.03513988107442856, -0.3091830015182495, -0.2604149580001831, -0.030847206711769104, -0.3381432890892029, 0.01218661293387413, 0.22496730089187622, -0.5655850172042847, 0.14965176582336426, 0.05588705837726593, -0.16169637441635132, -0.4472847282886505, -0.25835326313972473, 0.06282490491867065, 0.03442738205194473, 0.1328677386045456, 0.04207587614655495, 0.17169027030467987, 0.032257288694381714, -0.22236527502536774, 0.18904761970043182, -0.10048633813858032, 0.12347210943698883, 0.2570123076438904, -0.1227370947599411, -0.23438559472560883, -0.08149804919958115, -0.15780046582221985, -0.008499113842844963, -0.24298377335071564, 0.2185041606426239, -0.11355282366275787, -0.06133060157299042, 0.29016146063804626, 0.15836748480796814, 0.09765595197677612, 0.36389967799186707, -0.27774399518966675, -0.004409894347190857, -0.011163420975208282, 0.3102588951587677, -0.06170318275690079, -0.37744784355163574, 0.1305561363697052, -0.10305023193359375, 0.5736470222473145, 0.4722553789615631, -0.36675554513931274, 0.4969738721847534, -0.13309672474861145, -0.023624420166015625, 0.1415407657623291, -0.346807599067688, 0.3868023157119751, -0.10289718955755234, 0.21995067596435547, -0.3032906651496887, -0.05935177952051163, -0.03216379135847092, 0.009532969444990158, 0.321751207113266, 0.2923639118671417, 0.6657269597053528, 0.2420278936624527, 0.47865578532218933, 0.4446183443069458, -0.0005874449852854013, 0.4814021587371826, -0.1304384469985962, -0.014948513358831406, -0.1103869378566742, -0.32574570178985596, 0.43386635184288025, 0.012280315160751343, -0.43305301666259766, 0.29366636276245117, -0.026101987808942795, -0.5804478526115417, -0.304279625415802, -0.013165414333343506, 0.019447796046733856, -0.26244598627090454, 0.10254847258329391, -0.4967917203903198, 0.28169047832489014, 0.16246914863586426, 0.07804405689239502, -0.051917605102062225, -0.3575783669948578, -0.22453497350215912, -0.09790784120559692, 0.26826873421669006, 0.09420183300971985, -0.08738338947296143, -0.4789060056209564, -0.6240471005439758, 0.09542933106422424, 0.0259515643119812, 0.8507583141326904, -0.3016420602798462, 0.06684945523738861, 0.13790692389011383, -0.11230231821537018, 0.36936652660369873, -0.3686111867427826, -0.3116148114204407, 0.044050730764865875, -0.1440379023551941, -0.4558681845664978, -0.0267493799328804, -0.1088896244764328, 0.36277857422828674, 0.1317962259054184, 0.1196616142988205, -0.10454361885786057, 0.12356239557266235, 0.11704692989587784, 0.048298802226781845, -0.055353350937366486, 0.1295182853937149, -0.35110852122306824, -0.26264452934265137, -0.2264123558998108, -0.006704673171043396, 0.2354058027267456, 0.25542962551116943, 0.16052186489105225, 0.0024959370493888855, -0.19201456010341644, -0.13521863520145416, 0.1586378812789917, 0.1320643424987793, 0.07402597367763519, 0.09946610778570175, 0.33338940143585205, 0.03057406097650528, 0.11037997901439667, 0.006246449425816536, 0.16217535734176636, 0.45004403591156006, -0.6469939351081848, 0.1418789178133011, 0.1591213345527649, 0.23682163655757904, 0.2832711338996887, -0.3737642467021942, 0.0311543270945549, 0.33048585057258606, 0.041840434074401855, -0.08856377750635147, 0.12949620187282562, 0.24539640545845032, 0.2427753359079361, -0.2580759525299072, -0.4980113208293915, -0.07324159145355225, 0.010365352034568787, 0.15298199653625488, 1.0651347637176514, -0.3188483715057373, -0.2834668755531311, 0.0743548721075058, -0.0008077174425125122, 0.6970158219337463, 0.1164979487657547, -0.260940819978714, 0.3354590833187103, -0.21530231833457947, -0.05213002488017082, -0.2056259959936142, 0.3161839246749878, -0.05351719632744789, -0.38143524527549744, -0.03073643147945404, 0.04525168240070343, 0.08809536695480347, 0.0736406147480011, -0.18265381455421448, 0.15021800994873047, 0.33546823263168335, -0.03630806878209114, 0.07664898037910461, -0.11901270598173141, -0.35014715790748596, -0.21331053972244263, -0.23232728242874146, -0.03147019445896149, -0.15123078227043152, 0.2589576244354248, -0.01778842881321907, 0.015140961855649948, 0.10851715505123138, -0.10917045921087265, -0.5198310017585754, 0.15902847051620483, -0.28374984860420227, -0.26490330696105957, -0.18733857572078705, -0.15330398082733154, 0.058704063296318054, 0.5819187760353088, 0.5288028120994568, -0.0791500136256218, -0.42739132046699524, 0.14896871149539948, -0.07171106338500977, 0.06601816415786743, 0.05448652058839798, -0.027680987492203712, 0.07156626880168915, -0.1966579109430313, -0.15502305328845978, 0.19098447263240814, 0.09106926620006561, -0.13824716210365295, -0.25829678773880005, 0.04875756800174713, 0.5852702260017395, 0.17149463295936584, 0.052848126739263535, 0.210751473903656, -0.2142046093940735, -0.10880020260810852, 0.014164171181619167, -0.14087790250778198, -0.16722248494625092, 0.1469080150127411, -0.3392793536186218, -0.1921525001525879, -0.0557459257543087, 0.4201357364654541, -0.05096374452114105, 0.04706472158432007, 0.5612228512763977, 0.03416723757982254, -0.16820506751537323, -0.05934956669807434, -0.1351885199546814, -0.07012719660997391, -0.42977064847946167, 0.09501009434461594, -0.10564132779836655, 0.15587235987186432, -0.2654730975627899, 0.30117496848106384, -0.07767674326896667, 0.04983878880739212, -0.1742165982723236, -0.20085588097572327, -0.09092190861701965, 0.13721497356891632, -0.13386091589927673, 0.037347909063100815, -0.053436025977134705, 0.07019851356744766, 0.21060582995414734, -0.1085272803902626, -0.13909797370433807, -0.23052692413330078, -0.1029244214296341, -0.017518309876322746, -0.17927587032318115, 0.11383206397294998, 0.11358842253684998, -0.08203466236591339, -0.08665300905704498, 0.13853877782821655, 0.022660281509160995, -0.04187888652086258, -0.16119077801704407, 0.20741517841815948, 0.09688635170459747, -0.14210961759090424, -0.00027925893664360046, -0.19889536499977112, -0.2830061912536621, -0.39699047803878784, 0.2553092837333679, 0.190293550491333, -0.05466294661164284, 0.17581269145011902, 0.485058069229126, 0.2491113841533661, -0.4220195710659027, -0.1723881959915161, 0.07108211517333984, 0.20867975056171417, 0.056530460715293884, 0.32056036591529846, 0.4527581036090851, -0.036353498697280884, -0.543766975402832, -0.014612078666687012, 0.13224977254867554, -0.015123410150408745, 0.32165735960006714, -0.14316719770431519, 0.2803913354873657, 0.05190158262848854, 0.09312538802623749, 0.27040842175483704, -0.18726111948490143, -0.0963691845536232, 0.21131162345409393, -0.004326893016695976, -0.10293255746364594, 0.03930233046412468, 0.013966497033834457, 0.05566101148724556, -0.03642371669411659, 0.28303539752960205, 0.030113771557807922, -0.18932051956653595, 0.47271624207496643, 0.005825497210025787, 0.24205712974071503, -0.7060971856117249, 0.12967118620872498, 0.3432742953300476, 0.061650440096855164, 0.3266792893409729, -0.27359986305236816, -0.013564045540988445, -0.04680752754211426, 0.5956479907035828, -0.2728615999221802, 0.18911457061767578, 0.10747037827968597, 0.10961738228797913, -0.13751909136772156, -0.19431579113006592, -0.3989015519618988, -0.2471207231283188, -0.30182796716690063, 0.29770421981811523, 0.1341850757598877, 0.09745864570140839, 0.16177138686180115, 0.11049339175224304, -0.12215176969766617, 0.006319399923086166, -0.027407115325331688, -0.10729774832725525, -0.3614981770515442, 0.07211209833621979, -0.07649165391921997, -0.10157216340303421, 0.24862423539161682, 0.1590639054775238, 0.09669911861419678, 0.2033318281173706, -0.16958758234977722, -0.16075655817985535, 0.19356533885002136, 0.14461930096149445, 0.15964451432228088, -0.16845087707042694, 0.4067174792289734, 0.1370929628610611, 0.2602723240852356, 0.046857159584760666, 0.06992078572511673, 0.19277554750442505, 0.32983243465423584, 0.25709521770477295, 0.24162349104881287, 0.06905724108219147, -0.05773047357797623, -0.09349443763494492, 0.5506805181503296, 0.15459704399108887, 0.5155318379402161, 0.13955242931842804, -0.07244820147752762, 0.04975445568561554, 0.2017499804496765, 0.15053638815879822, 0.24782022833824158, -0.19300775229930878, 0.4139023721218109, -0.26512765884399414, 0.07221271097660065, -0.29713839292526245, -0.0883868932723999, 0.02066248655319214, 0.28611522912979126, 0.14641493558883667, -0.309806227684021, 0.14287684857845306, -0.1046009361743927, -0.027164779603481293, -0.04068894311785698, 0.18010291457176208, 0.22020690143108368, 0.1832214593887329, -0.1920764297246933, -0.2980017066001892, -0.4625641107559204, 0.09024259448051453, 0.07369155436754227, 0.11706189811229706, 0.13281939923763275, 0.3102108836174011, -0.10108831524848938, 0.027877360582351685, -0.02991851419210434, -0.3623301386833191, 0.0876467376947403, 0.5618104338645935, -0.28569990396499634, -0.5416406393051147, 0.13000144064426422, 0.24649113416671753, -0.01511421799659729, -0.34270280599594116, 0.21287325024604797, -0.17544899880886078, -0.13592606782913208, 0.10361748188734055, -0.2636096179485321, 0.010239727795124054, 0.42691099643707275, 0.010891958139836788, 0.15366333723068237, 0.1841680407524109, -0.02898280695080757, 0.333159476518631, -0.4873127341270447, 0.06524572521448135, -0.1905340552330017, 0.18577799201011658, -0.13104884326457977, 0.18858222663402557, -0.14417950809001923, -0.19125621020793915, -0.15048840641975403, 0.12513606250286102, 0.2964513897895813, -0.091572105884552, -0.2358931601047516, 0.22055473923683167, -0.13149060308933258, 0.6817532777786255, -0.13294877111911774, 0.36386045813560486, 0.00797970686107874, 0.1565515547990799, -0.3677428662776947, -0.2640225291252136, 0.4869004786014557, -0.4265178143978119, -0.43845134973526, 0.1617879867553711, 0.07544254511594772, 0.20788496732711792, -0.18640699982643127, -0.37275180220603943, -0.037394292652606964, 0.3786779046058655, -0.16843055188655853, -0.13043218851089478, 0.17067986726760864, 0.15229937434196472, 0.3160434365272522, -0.02862032875418663, 0.25623220205307007, 0.37204989790916443, -0.2064376324415207, 0.25408434867858887, -0.22080868482589722 ]
https://github.com/huggingface/datasets/issues/5847
@mariosasko The map snippet didn't quite work, but gave me enough of a clue to get it working. The following snippet does work: ``` def en_translation(x): return {"en":x['translation']['en']} ks = ds.map(en_translation, remove_columns=['translation']) test=[] for x in iter(ks): test.append(x['en']) xx= mt(test) for x in xx: print(x) ``` I tried just returning `x['translation']['en`]` in the helper function instead of the dict, but that didn't give me an iterator over strings that pipeline would work with either. The snippet as is gives the following error: ``` Traceback (most recent call last): File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/pdb.py", line 1704, in main pdb._runscript(mainpyfile) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/pdb.py", line 1573, in _runscript self.run(statement) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/bdb.py", line 580, in run exec(cmd, globals, locals) File "<string>", line 1, in <module> File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 1, in <module> from transformers import pipeline File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 335, in __call__ return super().__call__(*args, **kwargs) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 138, in __call__ result = super().__call__(*args, **kwargs) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/base.py", line 1027, in __call__ return self.run_single(inputs, preprocess_params, forward_params, postprocess_params) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/base.py", line 1033, in run_single model_inputs = self.preprocess(inputs, **preprocess_params) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 287, in preprocess return super()._parse_and_tokenize(*args, truncation=truncation) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 100, in _parse_and_tokenize raise ValueError( ValueError: `args[0]`: <datasets.iterable_dataset.IterableDataset object at 0x7f5fd38ef1c0> have the wrong format. The should be either of type `str` or type `list` Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program ```
Streaming IterableDataset not working with translation pipeline
### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ```
219
Streaming IterableDataset not working with translation pipeline ### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ``` @mariosasko The map snippet didn't quite work, but gave me enough of a clue to get it working. The following snippet does work: ``` def en_translation(x): return {"en":x['translation']['en']} ks = ds.map(en_translation, remove_columns=['translation']) test=[] for x in iter(ks): test.append(x['en']) xx= mt(test) for x in xx: print(x) ``` I tried just returning `x['translation']['en`]` in the helper function instead of the dict, but that didn't give me an iterator over strings that pipeline would work with either. The snippet as is gives the following error: ``` Traceback (most recent call last): File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/pdb.py", line 1704, in main pdb._runscript(mainpyfile) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/pdb.py", line 1573, in _runscript self.run(statement) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/bdb.py", line 580, in run exec(cmd, globals, locals) File "<string>", line 1, in <module> File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 1, in <module> from transformers import pipeline File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 335, in __call__ return super().__call__(*args, **kwargs) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 138, in __call__ result = super().__call__(*args, **kwargs) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/base.py", line 1027, in __call__ return self.run_single(inputs, preprocess_params, forward_params, postprocess_params) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/base.py", line 1033, in run_single model_inputs = self.preprocess(inputs, **preprocess_params) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 287, in preprocess return super()._parse_and_tokenize(*args, truncation=truncation) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/text2text_generation.py", line 100, in _parse_and_tokenize raise ValueError( ValueError: `args[0]`: <datasets.iterable_dataset.IterableDataset object at 0x7f5fd38ef1c0> have the wrong format. The should be either of type `str` or type `list` Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program ```
[ -0.5097402334213257, -0.1700969636440277, -0.03699735552072525, 0.1410585343837738, 0.32595449686050415, -0.04014071822166443, 0.5023482441902161, 0.08091886341571808, -0.21698808670043945, 0.3707205653190613, 0.11250735074281693, -0.12919551134109497, -0.09642905741930008, -0.056972090154886246, 0.24075904488563538, -0.1401120275259018, 0.14402469992637634, 0.11066155135631561, 0.07620875537395477, 0.025537937879562378, -0.1345769762992859, 0.419960618019104, -0.3393276333808899, -0.13462135195732117, 0.07164821028709412, -0.020041603595018387, 0.07546335458755493, -0.06072026491165161, 0.10995739698410034, -0.0972297340631485, 0.2946396470069885, 0.08511921763420105, 0.3027557134628296, 0.35239145159721375, -0.00012714500189758837, 0.07905419915914536, 0.28028425574302673, -0.18852919340133667, -0.23983651399612427, -0.24718943238258362, 0.06415900588035583, -0.04391658306121826, -0.2632408142089844, -0.1516910344362259, -0.10690533369779587, -0.1233992874622345, -0.0009501222521066666, -0.6041090488433838, 0.27238205075263977, 0.35920193791389465, 0.0669078528881073, 0.1592809408903122, -0.03286817669868469, 0.14321640133857727, -0.24326962232589722, -0.20158545672893524, -0.2896386384963989, -0.040483687072992325, 0.3940836787223816, 0.31063175201416016, 0.23769241571426392, 0.2160363346338272, -0.09335566312074661, 0.039544034749269485, 0.013658847659826279, -0.08215659856796265, -0.18719595670700073, -0.2938418984413147, 0.355713814496994, 0.2636595368385315, 0.1755864918231964, -0.3200145363807678, -0.20304788649082184, -0.34278014302253723, -0.0711405873298645, -0.6014050841331482, 0.07055695354938507, 0.1000886857509613, -0.21229995787143707, -0.007286093197762966, -0.3974710702896118, -0.10858047753572464, -0.35362544655799866, 0.15915684401988983, -0.0850362777709961, 0.326413631439209, -0.08511316031217575, 0.2675486207008362, -0.1415335237979889, 0.012549718841910362, 0.4891425669193268, -0.2344309389591217, -0.19036218523979187, 0.3076048493385315, -0.22657936811447144, -0.024596519768238068, 0.1515607386827469, -0.08294159173965454, 0.04803165793418884, -0.15568676590919495, 0.07480666041374207, 0.13651800155639648, -0.03592266887426376, -0.1607162058353424, 0.20335620641708374, 0.3483774662017822, -0.07834616303443909, 0.16780833899974823, 0.15385472774505615, 0.16383272409439087, 0.024051278829574585, -0.22132831811904907, -0.21857406198978424, -0.22887767851352692, 0.10207559913396835, 0.26342862844467163, 0.31498581171035767, -0.0394933819770813, -0.12510105967521667, -0.04131017625331879, -0.5802354216575623, -0.05286068841814995, 0.12952543795108795, 0.22888964414596558, -0.04450557380914688, 0.2143705189228058, -0.1489899456501007, 0.11406884342432022, -0.15631341934204102, -0.5252845287322998, -0.15230534970760345, -0.04130159690976143, -0.1952512264251709, -0.0504196397960186, 0.20020370185375214, -0.26024043560028076, 0.07499642670154572, -0.4126899242401123, 0.04635615646839142, -0.09593067318201065, -0.062235187739133835, -0.33685359358787537, 0.49023789167404175, 0.06026052311062813, 0.1704496443271637, 0.22255763411521912, -0.026821617037057877, -0.30965301394462585, -0.009809121489524841, 0.19359742105007172, 0.04299314320087433, -0.2842552363872528, 0.2825937867164612, -0.01908278465270996, -0.41798704862594604, 0.02458900585770607, -0.28187859058380127, 0.5110830068588257, 0.28072112798690796, -0.2482677698135376, -0.09234276413917542, -0.11012259125709534, -0.3919673562049866, -0.02711804211139679, 0.3800787627696991, 0.2984222173690796, -0.4647061824798584, -0.13047990202903748, -0.14865444600582123, 0.06488573551177979, 0.4687230587005615, 0.20888984203338623, -0.16553334891796112, 0.13570353388786316, -0.13617652654647827, 0.1485339105129242, 0.37663498520851135, -0.018508493900299072, -0.5099626183509827, 0.40919873118400574, 0.024875901639461517, 0.35645920038223267, -0.061860740184783936, -0.09003415703773499, 0.3700574040412903, -0.1855018436908722, 0.06217982620000839, 0.32021740078926086, -0.36143913865089417, 0.059831373393535614, -0.1008855551481247, -0.042543355375528336, -0.06351915001869202, 0.009736642241477966, 0.2629832327365875, 0.29891377687454224, -0.010900549590587616, 0.5163140892982483, 0.14717401564121246, -0.12125247716903687, 0.3402221202850342, 0.3987255096435547, 0.14896412193775177, -0.24811458587646484, 0.13294312357902527, -0.17207071185112, -0.28794512152671814, 0.12335008382797241, 0.15981341898441315, -0.1589256227016449, 0.11470885574817657, 0.1677647829055786, -0.007817432284355164, 0.17429935932159424, -0.08922751247882843, -0.38155555725097656, 0.01310047134757042, 0.27395081520080566, 0.21945102512836456, 0.08004723489284515, -0.20099705457687378, -0.0020223520696163177, -0.324116051197052, -0.3929927349090576, -0.2253016084432602, 0.18459272384643555, 0.3023614287376404, -0.3261498212814331, -0.031161155551671982, 0.2662419080734253, 0.08309777081012726, -0.10790251195430756, -0.2516555190086365, 0.147996723651886, -0.2230628877878189, 0.3441162705421448, -0.3123112916946411, 0.48378291726112366, 0.20421332120895386, -0.20268231630325317, 0.029003093019127846, 0.2141982614994049, 0.08959848433732986, 0.0038378536701202393, 0.029247021302580833, 0.24680738151073456, -0.3722628951072693, 0.3738165497779846, 0.22064760327339172, 0.06693238765001297, 0.5222475528717041, 0.1722707897424698, -0.2533802092075348, 0.022777721285820007, 0.2827177941799164, -0.3295366168022156, 0.13036280870437622, -0.20388175547122955, -0.1531578004360199, 0.07777111232280731, 0.4700506031513214, 0.2944859266281128, -0.25459691882133484, 0.010294485837221146, -0.34874987602233887, 0.0132361501455307, 0.29047513008117676, 0.3347748816013336, 0.5133265852928162, 0.08286193013191223, 0.4048360586166382, 0.027135225012898445, 0.07283669710159302, -0.18930478394031525, 0.2459898740053177, 0.121004618704319, 0.0422380231320858, 0.23451611399650574, -0.05061178654432297, -0.014471171423792839, -0.30086827278137207, -0.2677822709083557, -0.02701488509774208, 0.34101179242134094, -0.1795780062675476, 0.3285972774028778, -0.1869487166404724, -0.5258563160896301, -0.2493913769721985, -0.42008721828460693, 0.09096720814704895, -0.26039597392082214, -0.24614030122756958, 0.6363250017166138, 0.09580276906490326, 0.25799477100372314, 0.2614666223526001, 0.010100871324539185, 0.03513988107442856, -0.3091830015182495, -0.2604149580001831, -0.030847206711769104, -0.3381432890892029, 0.01218661293387413, 0.22496730089187622, -0.5655850172042847, 0.14965176582336426, 0.05588705837726593, -0.16169637441635132, -0.4472847282886505, -0.25835326313972473, 0.06282490491867065, 0.03442738205194473, 0.1328677386045456, 0.04207587614655495, 0.17169027030467987, 0.032257288694381714, -0.22236527502536774, 0.18904761970043182, -0.10048633813858032, 0.12347210943698883, 0.2570123076438904, -0.1227370947599411, -0.23438559472560883, -0.08149804919958115, -0.15780046582221985, -0.008499113842844963, -0.24298377335071564, 0.2185041606426239, -0.11355282366275787, -0.06133060157299042, 0.29016146063804626, 0.15836748480796814, 0.09765595197677612, 0.36389967799186707, -0.27774399518966675, -0.004409894347190857, -0.011163420975208282, 0.3102588951587677, -0.06170318275690079, -0.37744784355163574, 0.1305561363697052, -0.10305023193359375, 0.5736470222473145, 0.4722553789615631, -0.36675554513931274, 0.4969738721847534, -0.13309672474861145, -0.023624420166015625, 0.1415407657623291, -0.346807599067688, 0.3868023157119751, -0.10289718955755234, 0.21995067596435547, -0.3032906651496887, -0.05935177952051163, -0.03216379135847092, 0.009532969444990158, 0.321751207113266, 0.2923639118671417, 0.6657269597053528, 0.2420278936624527, 0.47865578532218933, 0.4446183443069458, -0.0005874449852854013, 0.4814021587371826, -0.1304384469985962, -0.014948513358831406, -0.1103869378566742, -0.32574570178985596, 0.43386635184288025, 0.012280315160751343, -0.43305301666259766, 0.29366636276245117, -0.026101987808942795, -0.5804478526115417, -0.304279625415802, -0.013165414333343506, 0.019447796046733856, -0.26244598627090454, 0.10254847258329391, -0.4967917203903198, 0.28169047832489014, 0.16246914863586426, 0.07804405689239502, -0.051917605102062225, -0.3575783669948578, -0.22453497350215912, -0.09790784120559692, 0.26826873421669006, 0.09420183300971985, -0.08738338947296143, -0.4789060056209564, -0.6240471005439758, 0.09542933106422424, 0.0259515643119812, 0.8507583141326904, -0.3016420602798462, 0.06684945523738861, 0.13790692389011383, -0.11230231821537018, 0.36936652660369873, -0.3686111867427826, -0.3116148114204407, 0.044050730764865875, -0.1440379023551941, -0.4558681845664978, -0.0267493799328804, -0.1088896244764328, 0.36277857422828674, 0.1317962259054184, 0.1196616142988205, -0.10454361885786057, 0.12356239557266235, 0.11704692989587784, 0.048298802226781845, -0.055353350937366486, 0.1295182853937149, -0.35110852122306824, -0.26264452934265137, -0.2264123558998108, -0.006704673171043396, 0.2354058027267456, 0.25542962551116943, 0.16052186489105225, 0.0024959370493888855, -0.19201456010341644, -0.13521863520145416, 0.1586378812789917, 0.1320643424987793, 0.07402597367763519, 0.09946610778570175, 0.33338940143585205, 0.03057406097650528, 0.11037997901439667, 0.006246449425816536, 0.16217535734176636, 0.45004403591156006, -0.6469939351081848, 0.1418789178133011, 0.1591213345527649, 0.23682163655757904, 0.2832711338996887, -0.3737642467021942, 0.0311543270945549, 0.33048585057258606, 0.041840434074401855, -0.08856377750635147, 0.12949620187282562, 0.24539640545845032, 0.2427753359079361, -0.2580759525299072, -0.4980113208293915, -0.07324159145355225, 0.010365352034568787, 0.15298199653625488, 1.0651347637176514, -0.3188483715057373, -0.2834668755531311, 0.0743548721075058, -0.0008077174425125122, 0.6970158219337463, 0.1164979487657547, -0.260940819978714, 0.3354590833187103, -0.21530231833457947, -0.05213002488017082, -0.2056259959936142, 0.3161839246749878, -0.05351719632744789, -0.38143524527549744, -0.03073643147945404, 0.04525168240070343, 0.08809536695480347, 0.0736406147480011, -0.18265381455421448, 0.15021800994873047, 0.33546823263168335, -0.03630806878209114, 0.07664898037910461, -0.11901270598173141, -0.35014715790748596, -0.21331053972244263, -0.23232728242874146, -0.03147019445896149, -0.15123078227043152, 0.2589576244354248, -0.01778842881321907, 0.015140961855649948, 0.10851715505123138, -0.10917045921087265, -0.5198310017585754, 0.15902847051620483, -0.28374984860420227, -0.26490330696105957, -0.18733857572078705, -0.15330398082733154, 0.058704063296318054, 0.5819187760353088, 0.5288028120994568, -0.0791500136256218, -0.42739132046699524, 0.14896871149539948, -0.07171106338500977, 0.06601816415786743, 0.05448652058839798, -0.027680987492203712, 0.07156626880168915, -0.1966579109430313, -0.15502305328845978, 0.19098447263240814, 0.09106926620006561, -0.13824716210365295, -0.25829678773880005, 0.04875756800174713, 0.5852702260017395, 0.17149463295936584, 0.052848126739263535, 0.210751473903656, -0.2142046093940735, -0.10880020260810852, 0.014164171181619167, -0.14087790250778198, -0.16722248494625092, 0.1469080150127411, -0.3392793536186218, -0.1921525001525879, -0.0557459257543087, 0.4201357364654541, -0.05096374452114105, 0.04706472158432007, 0.5612228512763977, 0.03416723757982254, -0.16820506751537323, -0.05934956669807434, -0.1351885199546814, -0.07012719660997391, -0.42977064847946167, 0.09501009434461594, -0.10564132779836655, 0.15587235987186432, -0.2654730975627899, 0.30117496848106384, -0.07767674326896667, 0.04983878880739212, -0.1742165982723236, -0.20085588097572327, -0.09092190861701965, 0.13721497356891632, -0.13386091589927673, 0.037347909063100815, -0.053436025977134705, 0.07019851356744766, 0.21060582995414734, -0.1085272803902626, -0.13909797370433807, -0.23052692413330078, -0.1029244214296341, -0.017518309876322746, -0.17927587032318115, 0.11383206397294998, 0.11358842253684998, -0.08203466236591339, -0.08665300905704498, 0.13853877782821655, 0.022660281509160995, -0.04187888652086258, -0.16119077801704407, 0.20741517841815948, 0.09688635170459747, -0.14210961759090424, -0.00027925893664360046, -0.19889536499977112, -0.2830061912536621, -0.39699047803878784, 0.2553092837333679, 0.190293550491333, -0.05466294661164284, 0.17581269145011902, 0.485058069229126, 0.2491113841533661, -0.4220195710659027, -0.1723881959915161, 0.07108211517333984, 0.20867975056171417, 0.056530460715293884, 0.32056036591529846, 0.4527581036090851, -0.036353498697280884, -0.543766975402832, -0.014612078666687012, 0.13224977254867554, -0.015123410150408745, 0.32165735960006714, -0.14316719770431519, 0.2803913354873657, 0.05190158262848854, 0.09312538802623749, 0.27040842175483704, -0.18726111948490143, -0.0963691845536232, 0.21131162345409393, -0.004326893016695976, -0.10293255746364594, 0.03930233046412468, 0.013966497033834457, 0.05566101148724556, -0.03642371669411659, 0.28303539752960205, 0.030113771557807922, -0.18932051956653595, 0.47271624207496643, 0.005825497210025787, 0.24205712974071503, -0.7060971856117249, 0.12967118620872498, 0.3432742953300476, 0.061650440096855164, 0.3266792893409729, -0.27359986305236816, -0.013564045540988445, -0.04680752754211426, 0.5956479907035828, -0.2728615999221802, 0.18911457061767578, 0.10747037827968597, 0.10961738228797913, -0.13751909136772156, -0.19431579113006592, -0.3989015519618988, -0.2471207231283188, -0.30182796716690063, 0.29770421981811523, 0.1341850757598877, 0.09745864570140839, 0.16177138686180115, 0.11049339175224304, -0.12215176969766617, 0.006319399923086166, -0.027407115325331688, -0.10729774832725525, -0.3614981770515442, 0.07211209833621979, -0.07649165391921997, -0.10157216340303421, 0.24862423539161682, 0.1590639054775238, 0.09669911861419678, 0.2033318281173706, -0.16958758234977722, -0.16075655817985535, 0.19356533885002136, 0.14461930096149445, 0.15964451432228088, -0.16845087707042694, 0.4067174792289734, 0.1370929628610611, 0.2602723240852356, 0.046857159584760666, 0.06992078572511673, 0.19277554750442505, 0.32983243465423584, 0.25709521770477295, 0.24162349104881287, 0.06905724108219147, -0.05773047357797623, -0.09349443763494492, 0.5506805181503296, 0.15459704399108887, 0.5155318379402161, 0.13955242931842804, -0.07244820147752762, 0.04975445568561554, 0.2017499804496765, 0.15053638815879822, 0.24782022833824158, -0.19300775229930878, 0.4139023721218109, -0.26512765884399414, 0.07221271097660065, -0.29713839292526245, -0.0883868932723999, 0.02066248655319214, 0.28611522912979126, 0.14641493558883667, -0.309806227684021, 0.14287684857845306, -0.1046009361743927, -0.027164779603481293, -0.04068894311785698, 0.18010291457176208, 0.22020690143108368, 0.1832214593887329, -0.1920764297246933, -0.2980017066001892, -0.4625641107559204, 0.09024259448051453, 0.07369155436754227, 0.11706189811229706, 0.13281939923763275, 0.3102108836174011, -0.10108831524848938, 0.027877360582351685, -0.02991851419210434, -0.3623301386833191, 0.0876467376947403, 0.5618104338645935, -0.28569990396499634, -0.5416406393051147, 0.13000144064426422, 0.24649113416671753, -0.01511421799659729, -0.34270280599594116, 0.21287325024604797, -0.17544899880886078, -0.13592606782913208, 0.10361748188734055, -0.2636096179485321, 0.010239727795124054, 0.42691099643707275, 0.010891958139836788, 0.15366333723068237, 0.1841680407524109, -0.02898280695080757, 0.333159476518631, -0.4873127341270447, 0.06524572521448135, -0.1905340552330017, 0.18577799201011658, -0.13104884326457977, 0.18858222663402557, -0.14417950809001923, -0.19125621020793915, -0.15048840641975403, 0.12513606250286102, 0.2964513897895813, -0.091572105884552, -0.2358931601047516, 0.22055473923683167, -0.13149060308933258, 0.6817532777786255, -0.13294877111911774, 0.36386045813560486, 0.00797970686107874, 0.1565515547990799, -0.3677428662776947, -0.2640225291252136, 0.4869004786014557, -0.4265178143978119, -0.43845134973526, 0.1617879867553711, 0.07544254511594772, 0.20788496732711792, -0.18640699982643127, -0.37275180220603943, -0.037394292652606964, 0.3786779046058655, -0.16843055188655853, -0.13043218851089478, 0.17067986726760864, 0.15229937434196472, 0.3160434365272522, -0.02862032875418663, 0.25623220205307007, 0.37204989790916443, -0.2064376324415207, 0.25408434867858887, -0.22080868482589722 ]
https://github.com/huggingface/datasets/issues/5847
So perhaps there's no bug exactly, but I would love to see two things: 1) improve the documentation to better understand what's really getting returned. 2) update the example provided of using transformer pipeline with a dataset to include the oddball case that translation appears to be.
Streaming IterableDataset not working with translation pipeline
### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ```
47
Streaming IterableDataset not working with translation pipeline ### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ``` So perhaps there's no bug exactly, but I would love to see two things: 1) improve the documentation to better understand what's really getting returned. 2) update the example provided of using transformer pipeline with a dataset to include the oddball case that translation appears to be.
[ -0.5097402334213257, -0.1700969636440277, -0.03699735552072525, 0.1410585343837738, 0.32595449686050415, -0.04014071822166443, 0.5023482441902161, 0.08091886341571808, -0.21698808670043945, 0.3707205653190613, 0.11250735074281693, -0.12919551134109497, -0.09642905741930008, -0.056972090154886246, 0.24075904488563538, -0.1401120275259018, 0.14402469992637634, 0.11066155135631561, 0.07620875537395477, 0.025537937879562378, -0.1345769762992859, 0.419960618019104, -0.3393276333808899, -0.13462135195732117, 0.07164821028709412, -0.020041603595018387, 0.07546335458755493, -0.06072026491165161, 0.10995739698410034, -0.0972297340631485, 0.2946396470069885, 0.08511921763420105, 0.3027557134628296, 0.35239145159721375, -0.00012714500189758837, 0.07905419915914536, 0.28028425574302673, -0.18852919340133667, -0.23983651399612427, -0.24718943238258362, 0.06415900588035583, -0.04391658306121826, -0.2632408142089844, -0.1516910344362259, -0.10690533369779587, -0.1233992874622345, -0.0009501222521066666, -0.6041090488433838, 0.27238205075263977, 0.35920193791389465, 0.0669078528881073, 0.1592809408903122, -0.03286817669868469, 0.14321640133857727, -0.24326962232589722, -0.20158545672893524, -0.2896386384963989, -0.040483687072992325, 0.3940836787223816, 0.31063175201416016, 0.23769241571426392, 0.2160363346338272, -0.09335566312074661, 0.039544034749269485, 0.013658847659826279, -0.08215659856796265, -0.18719595670700073, -0.2938418984413147, 0.355713814496994, 0.2636595368385315, 0.1755864918231964, -0.3200145363807678, -0.20304788649082184, -0.34278014302253723, -0.0711405873298645, -0.6014050841331482, 0.07055695354938507, 0.1000886857509613, -0.21229995787143707, -0.007286093197762966, -0.3974710702896118, -0.10858047753572464, -0.35362544655799866, 0.15915684401988983, -0.0850362777709961, 0.326413631439209, -0.08511316031217575, 0.2675486207008362, -0.1415335237979889, 0.012549718841910362, 0.4891425669193268, -0.2344309389591217, -0.19036218523979187, 0.3076048493385315, -0.22657936811447144, -0.024596519768238068, 0.1515607386827469, -0.08294159173965454, 0.04803165793418884, -0.15568676590919495, 0.07480666041374207, 0.13651800155639648, -0.03592266887426376, -0.1607162058353424, 0.20335620641708374, 0.3483774662017822, -0.07834616303443909, 0.16780833899974823, 0.15385472774505615, 0.16383272409439087, 0.024051278829574585, -0.22132831811904907, -0.21857406198978424, -0.22887767851352692, 0.10207559913396835, 0.26342862844467163, 0.31498581171035767, -0.0394933819770813, -0.12510105967521667, -0.04131017625331879, -0.5802354216575623, -0.05286068841814995, 0.12952543795108795, 0.22888964414596558, -0.04450557380914688, 0.2143705189228058, -0.1489899456501007, 0.11406884342432022, -0.15631341934204102, -0.5252845287322998, -0.15230534970760345, -0.04130159690976143, -0.1952512264251709, -0.0504196397960186, 0.20020370185375214, -0.26024043560028076, 0.07499642670154572, -0.4126899242401123, 0.04635615646839142, -0.09593067318201065, -0.062235187739133835, -0.33685359358787537, 0.49023789167404175, 0.06026052311062813, 0.1704496443271637, 0.22255763411521912, -0.026821617037057877, -0.30965301394462585, -0.009809121489524841, 0.19359742105007172, 0.04299314320087433, -0.2842552363872528, 0.2825937867164612, -0.01908278465270996, -0.41798704862594604, 0.02458900585770607, -0.28187859058380127, 0.5110830068588257, 0.28072112798690796, -0.2482677698135376, -0.09234276413917542, -0.11012259125709534, -0.3919673562049866, -0.02711804211139679, 0.3800787627696991, 0.2984222173690796, -0.4647061824798584, -0.13047990202903748, -0.14865444600582123, 0.06488573551177979, 0.4687230587005615, 0.20888984203338623, -0.16553334891796112, 0.13570353388786316, -0.13617652654647827, 0.1485339105129242, 0.37663498520851135, -0.018508493900299072, -0.5099626183509827, 0.40919873118400574, 0.024875901639461517, 0.35645920038223267, -0.061860740184783936, -0.09003415703773499, 0.3700574040412903, -0.1855018436908722, 0.06217982620000839, 0.32021740078926086, -0.36143913865089417, 0.059831373393535614, -0.1008855551481247, -0.042543355375528336, -0.06351915001869202, 0.009736642241477966, 0.2629832327365875, 0.29891377687454224, -0.010900549590587616, 0.5163140892982483, 0.14717401564121246, -0.12125247716903687, 0.3402221202850342, 0.3987255096435547, 0.14896412193775177, -0.24811458587646484, 0.13294312357902527, -0.17207071185112, -0.28794512152671814, 0.12335008382797241, 0.15981341898441315, -0.1589256227016449, 0.11470885574817657, 0.1677647829055786, -0.007817432284355164, 0.17429935932159424, -0.08922751247882843, -0.38155555725097656, 0.01310047134757042, 0.27395081520080566, 0.21945102512836456, 0.08004723489284515, -0.20099705457687378, -0.0020223520696163177, -0.324116051197052, -0.3929927349090576, -0.2253016084432602, 0.18459272384643555, 0.3023614287376404, -0.3261498212814331, -0.031161155551671982, 0.2662419080734253, 0.08309777081012726, -0.10790251195430756, -0.2516555190086365, 0.147996723651886, -0.2230628877878189, 0.3441162705421448, -0.3123112916946411, 0.48378291726112366, 0.20421332120895386, -0.20268231630325317, 0.029003093019127846, 0.2141982614994049, 0.08959848433732986, 0.0038378536701202393, 0.029247021302580833, 0.24680738151073456, -0.3722628951072693, 0.3738165497779846, 0.22064760327339172, 0.06693238765001297, 0.5222475528717041, 0.1722707897424698, -0.2533802092075348, 0.022777721285820007, 0.2827177941799164, -0.3295366168022156, 0.13036280870437622, -0.20388175547122955, -0.1531578004360199, 0.07777111232280731, 0.4700506031513214, 0.2944859266281128, -0.25459691882133484, 0.010294485837221146, -0.34874987602233887, 0.0132361501455307, 0.29047513008117676, 0.3347748816013336, 0.5133265852928162, 0.08286193013191223, 0.4048360586166382, 0.027135225012898445, 0.07283669710159302, -0.18930478394031525, 0.2459898740053177, 0.121004618704319, 0.0422380231320858, 0.23451611399650574, -0.05061178654432297, -0.014471171423792839, -0.30086827278137207, -0.2677822709083557, -0.02701488509774208, 0.34101179242134094, -0.1795780062675476, 0.3285972774028778, -0.1869487166404724, -0.5258563160896301, -0.2493913769721985, -0.42008721828460693, 0.09096720814704895, -0.26039597392082214, -0.24614030122756958, 0.6363250017166138, 0.09580276906490326, 0.25799477100372314, 0.2614666223526001, 0.010100871324539185, 0.03513988107442856, -0.3091830015182495, -0.2604149580001831, -0.030847206711769104, -0.3381432890892029, 0.01218661293387413, 0.22496730089187622, -0.5655850172042847, 0.14965176582336426, 0.05588705837726593, -0.16169637441635132, -0.4472847282886505, -0.25835326313972473, 0.06282490491867065, 0.03442738205194473, 0.1328677386045456, 0.04207587614655495, 0.17169027030467987, 0.032257288694381714, -0.22236527502536774, 0.18904761970043182, -0.10048633813858032, 0.12347210943698883, 0.2570123076438904, -0.1227370947599411, -0.23438559472560883, -0.08149804919958115, -0.15780046582221985, -0.008499113842844963, -0.24298377335071564, 0.2185041606426239, -0.11355282366275787, -0.06133060157299042, 0.29016146063804626, 0.15836748480796814, 0.09765595197677612, 0.36389967799186707, -0.27774399518966675, -0.004409894347190857, -0.011163420975208282, 0.3102588951587677, -0.06170318275690079, -0.37744784355163574, 0.1305561363697052, -0.10305023193359375, 0.5736470222473145, 0.4722553789615631, -0.36675554513931274, 0.4969738721847534, -0.13309672474861145, -0.023624420166015625, 0.1415407657623291, -0.346807599067688, 0.3868023157119751, -0.10289718955755234, 0.21995067596435547, -0.3032906651496887, -0.05935177952051163, -0.03216379135847092, 0.009532969444990158, 0.321751207113266, 0.2923639118671417, 0.6657269597053528, 0.2420278936624527, 0.47865578532218933, 0.4446183443069458, -0.0005874449852854013, 0.4814021587371826, -0.1304384469985962, -0.014948513358831406, -0.1103869378566742, -0.32574570178985596, 0.43386635184288025, 0.012280315160751343, -0.43305301666259766, 0.29366636276245117, -0.026101987808942795, -0.5804478526115417, -0.304279625415802, -0.013165414333343506, 0.019447796046733856, -0.26244598627090454, 0.10254847258329391, -0.4967917203903198, 0.28169047832489014, 0.16246914863586426, 0.07804405689239502, -0.051917605102062225, -0.3575783669948578, -0.22453497350215912, -0.09790784120559692, 0.26826873421669006, 0.09420183300971985, -0.08738338947296143, -0.4789060056209564, -0.6240471005439758, 0.09542933106422424, 0.0259515643119812, 0.8507583141326904, -0.3016420602798462, 0.06684945523738861, 0.13790692389011383, -0.11230231821537018, 0.36936652660369873, -0.3686111867427826, -0.3116148114204407, 0.044050730764865875, -0.1440379023551941, -0.4558681845664978, -0.0267493799328804, -0.1088896244764328, 0.36277857422828674, 0.1317962259054184, 0.1196616142988205, -0.10454361885786057, 0.12356239557266235, 0.11704692989587784, 0.048298802226781845, -0.055353350937366486, 0.1295182853937149, -0.35110852122306824, -0.26264452934265137, -0.2264123558998108, -0.006704673171043396, 0.2354058027267456, 0.25542962551116943, 0.16052186489105225, 0.0024959370493888855, -0.19201456010341644, -0.13521863520145416, 0.1586378812789917, 0.1320643424987793, 0.07402597367763519, 0.09946610778570175, 0.33338940143585205, 0.03057406097650528, 0.11037997901439667, 0.006246449425816536, 0.16217535734176636, 0.45004403591156006, -0.6469939351081848, 0.1418789178133011, 0.1591213345527649, 0.23682163655757904, 0.2832711338996887, -0.3737642467021942, 0.0311543270945549, 0.33048585057258606, 0.041840434074401855, -0.08856377750635147, 0.12949620187282562, 0.24539640545845032, 0.2427753359079361, -0.2580759525299072, -0.4980113208293915, -0.07324159145355225, 0.010365352034568787, 0.15298199653625488, 1.0651347637176514, -0.3188483715057373, -0.2834668755531311, 0.0743548721075058, -0.0008077174425125122, 0.6970158219337463, 0.1164979487657547, -0.260940819978714, 0.3354590833187103, -0.21530231833457947, -0.05213002488017082, -0.2056259959936142, 0.3161839246749878, -0.05351719632744789, -0.38143524527549744, -0.03073643147945404, 0.04525168240070343, 0.08809536695480347, 0.0736406147480011, -0.18265381455421448, 0.15021800994873047, 0.33546823263168335, -0.03630806878209114, 0.07664898037910461, -0.11901270598173141, -0.35014715790748596, -0.21331053972244263, -0.23232728242874146, -0.03147019445896149, -0.15123078227043152, 0.2589576244354248, -0.01778842881321907, 0.015140961855649948, 0.10851715505123138, -0.10917045921087265, -0.5198310017585754, 0.15902847051620483, -0.28374984860420227, -0.26490330696105957, -0.18733857572078705, -0.15330398082733154, 0.058704063296318054, 0.5819187760353088, 0.5288028120994568, -0.0791500136256218, -0.42739132046699524, 0.14896871149539948, -0.07171106338500977, 0.06601816415786743, 0.05448652058839798, -0.027680987492203712, 0.07156626880168915, -0.1966579109430313, -0.15502305328845978, 0.19098447263240814, 0.09106926620006561, -0.13824716210365295, -0.25829678773880005, 0.04875756800174713, 0.5852702260017395, 0.17149463295936584, 0.052848126739263535, 0.210751473903656, -0.2142046093940735, -0.10880020260810852, 0.014164171181619167, -0.14087790250778198, -0.16722248494625092, 0.1469080150127411, -0.3392793536186218, -0.1921525001525879, -0.0557459257543087, 0.4201357364654541, -0.05096374452114105, 0.04706472158432007, 0.5612228512763977, 0.03416723757982254, -0.16820506751537323, -0.05934956669807434, -0.1351885199546814, -0.07012719660997391, -0.42977064847946167, 0.09501009434461594, -0.10564132779836655, 0.15587235987186432, -0.2654730975627899, 0.30117496848106384, -0.07767674326896667, 0.04983878880739212, -0.1742165982723236, -0.20085588097572327, -0.09092190861701965, 0.13721497356891632, -0.13386091589927673, 0.037347909063100815, -0.053436025977134705, 0.07019851356744766, 0.21060582995414734, -0.1085272803902626, -0.13909797370433807, -0.23052692413330078, -0.1029244214296341, -0.017518309876322746, -0.17927587032318115, 0.11383206397294998, 0.11358842253684998, -0.08203466236591339, -0.08665300905704498, 0.13853877782821655, 0.022660281509160995, -0.04187888652086258, -0.16119077801704407, 0.20741517841815948, 0.09688635170459747, -0.14210961759090424, -0.00027925893664360046, -0.19889536499977112, -0.2830061912536621, -0.39699047803878784, 0.2553092837333679, 0.190293550491333, -0.05466294661164284, 0.17581269145011902, 0.485058069229126, 0.2491113841533661, -0.4220195710659027, -0.1723881959915161, 0.07108211517333984, 0.20867975056171417, 0.056530460715293884, 0.32056036591529846, 0.4527581036090851, -0.036353498697280884, -0.543766975402832, -0.014612078666687012, 0.13224977254867554, -0.015123410150408745, 0.32165735960006714, -0.14316719770431519, 0.2803913354873657, 0.05190158262848854, 0.09312538802623749, 0.27040842175483704, -0.18726111948490143, -0.0963691845536232, 0.21131162345409393, -0.004326893016695976, -0.10293255746364594, 0.03930233046412468, 0.013966497033834457, 0.05566101148724556, -0.03642371669411659, 0.28303539752960205, 0.030113771557807922, -0.18932051956653595, 0.47271624207496643, 0.005825497210025787, 0.24205712974071503, -0.7060971856117249, 0.12967118620872498, 0.3432742953300476, 0.061650440096855164, 0.3266792893409729, -0.27359986305236816, -0.013564045540988445, -0.04680752754211426, 0.5956479907035828, -0.2728615999221802, 0.18911457061767578, 0.10747037827968597, 0.10961738228797913, -0.13751909136772156, -0.19431579113006592, -0.3989015519618988, -0.2471207231283188, -0.30182796716690063, 0.29770421981811523, 0.1341850757598877, 0.09745864570140839, 0.16177138686180115, 0.11049339175224304, -0.12215176969766617, 0.006319399923086166, -0.027407115325331688, -0.10729774832725525, -0.3614981770515442, 0.07211209833621979, -0.07649165391921997, -0.10157216340303421, 0.24862423539161682, 0.1590639054775238, 0.09669911861419678, 0.2033318281173706, -0.16958758234977722, -0.16075655817985535, 0.19356533885002136, 0.14461930096149445, 0.15964451432228088, -0.16845087707042694, 0.4067174792289734, 0.1370929628610611, 0.2602723240852356, 0.046857159584760666, 0.06992078572511673, 0.19277554750442505, 0.32983243465423584, 0.25709521770477295, 0.24162349104881287, 0.06905724108219147, -0.05773047357797623, -0.09349443763494492, 0.5506805181503296, 0.15459704399108887, 0.5155318379402161, 0.13955242931842804, -0.07244820147752762, 0.04975445568561554, 0.2017499804496765, 0.15053638815879822, 0.24782022833824158, -0.19300775229930878, 0.4139023721218109, -0.26512765884399414, 0.07221271097660065, -0.29713839292526245, -0.0883868932723999, 0.02066248655319214, 0.28611522912979126, 0.14641493558883667, -0.309806227684021, 0.14287684857845306, -0.1046009361743927, -0.027164779603481293, -0.04068894311785698, 0.18010291457176208, 0.22020690143108368, 0.1832214593887329, -0.1920764297246933, -0.2980017066001892, -0.4625641107559204, 0.09024259448051453, 0.07369155436754227, 0.11706189811229706, 0.13281939923763275, 0.3102108836174011, -0.10108831524848938, 0.027877360582351685, -0.02991851419210434, -0.3623301386833191, 0.0876467376947403, 0.5618104338645935, -0.28569990396499634, -0.5416406393051147, 0.13000144064426422, 0.24649113416671753, -0.01511421799659729, -0.34270280599594116, 0.21287325024604797, -0.17544899880886078, -0.13592606782913208, 0.10361748188734055, -0.2636096179485321, 0.010239727795124054, 0.42691099643707275, 0.010891958139836788, 0.15366333723068237, 0.1841680407524109, -0.02898280695080757, 0.333159476518631, -0.4873127341270447, 0.06524572521448135, -0.1905340552330017, 0.18577799201011658, -0.13104884326457977, 0.18858222663402557, -0.14417950809001923, -0.19125621020793915, -0.15048840641975403, 0.12513606250286102, 0.2964513897895813, -0.091572105884552, -0.2358931601047516, 0.22055473923683167, -0.13149060308933258, 0.6817532777786255, -0.13294877111911774, 0.36386045813560486, 0.00797970686107874, 0.1565515547990799, -0.3677428662776947, -0.2640225291252136, 0.4869004786014557, -0.4265178143978119, -0.43845134973526, 0.1617879867553711, 0.07544254511594772, 0.20788496732711792, -0.18640699982643127, -0.37275180220603943, -0.037394292652606964, 0.3786779046058655, -0.16843055188655853, -0.13043218851089478, 0.17067986726760864, 0.15229937434196472, 0.3160434365272522, -0.02862032875418663, 0.25623220205307007, 0.37204989790916443, -0.2064376324415207, 0.25408434867858887, -0.22080868482589722 ]
https://github.com/huggingface/datasets/issues/5847
Hi, for the original snippet, the issue is that `streaming` datasets are not countable (they have no len) and therefore `KeyDataset` cannot work with them ( KeyDataset is a dataset and therefore requires a length). I modified slightly the original snippet to make it work: ```python from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs = 1 mt = pipeline( "translation_en_to_fr", model="hf-internal-testing/tiny-random-T5ForConditionalGeneration", batch_size=bs ) def ks(ds): for item in ds: yield item["translation"]["en"] # print(f"{ks}") xx = mt(ks(ds)) for x in xx: print(x) ``` This is what the first example in the docs suggests to use (as it's the most flexible): https://huggingface.co/docs/transformers/v4.29.1/en/pipeline_tutorial#using-pipelines-on-a-dataset `KeyDataset` really exists only to get a `sized` dataset to work nicer with `tqdm` for instance. @sgugger should we update the docs to remove `KeyDataset` entirely ? (We can add a note to pass manually the length of the data to tqdm so that the progress bar option can still be easy to use ?)
Streaming IterableDataset not working with translation pipeline
### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ```
166
Streaming IterableDataset not working with translation pipeline ### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ``` Hi, for the original snippet, the issue is that `streaming` datasets are not countable (they have no len) and therefore `KeyDataset` cannot work with them ( KeyDataset is a dataset and therefore requires a length). I modified slightly the original snippet to make it work: ```python from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs = 1 mt = pipeline( "translation_en_to_fr", model="hf-internal-testing/tiny-random-T5ForConditionalGeneration", batch_size=bs ) def ks(ds): for item in ds: yield item["translation"]["en"] # print(f"{ks}") xx = mt(ks(ds)) for x in xx: print(x) ``` This is what the first example in the docs suggests to use (as it's the most flexible): https://huggingface.co/docs/transformers/v4.29.1/en/pipeline_tutorial#using-pipelines-on-a-dataset `KeyDataset` really exists only to get a `sized` dataset to work nicer with `tqdm` for instance. @sgugger should we update the docs to remove `KeyDataset` entirely ? (We can add a note to pass manually the length of the data to tqdm so that the progress bar option can still be easy to use ?)
[ -0.5097402334213257, -0.1700969636440277, -0.03699735552072525, 0.1410585343837738, 0.32595449686050415, -0.04014071822166443, 0.5023482441902161, 0.08091886341571808, -0.21698808670043945, 0.3707205653190613, 0.11250735074281693, -0.12919551134109497, -0.09642905741930008, -0.056972090154886246, 0.24075904488563538, -0.1401120275259018, 0.14402469992637634, 0.11066155135631561, 0.07620875537395477, 0.025537937879562378, -0.1345769762992859, 0.419960618019104, -0.3393276333808899, -0.13462135195732117, 0.07164821028709412, -0.020041603595018387, 0.07546335458755493, -0.06072026491165161, 0.10995739698410034, -0.0972297340631485, 0.2946396470069885, 0.08511921763420105, 0.3027557134628296, 0.35239145159721375, -0.00012714500189758837, 0.07905419915914536, 0.28028425574302673, -0.18852919340133667, -0.23983651399612427, -0.24718943238258362, 0.06415900588035583, -0.04391658306121826, -0.2632408142089844, -0.1516910344362259, -0.10690533369779587, -0.1233992874622345, -0.0009501222521066666, -0.6041090488433838, 0.27238205075263977, 0.35920193791389465, 0.0669078528881073, 0.1592809408903122, -0.03286817669868469, 0.14321640133857727, -0.24326962232589722, -0.20158545672893524, -0.2896386384963989, -0.040483687072992325, 0.3940836787223816, 0.31063175201416016, 0.23769241571426392, 0.2160363346338272, -0.09335566312074661, 0.039544034749269485, 0.013658847659826279, -0.08215659856796265, -0.18719595670700073, -0.2938418984413147, 0.355713814496994, 0.2636595368385315, 0.1755864918231964, -0.3200145363807678, -0.20304788649082184, -0.34278014302253723, -0.0711405873298645, -0.6014050841331482, 0.07055695354938507, 0.1000886857509613, -0.21229995787143707, -0.007286093197762966, -0.3974710702896118, -0.10858047753572464, -0.35362544655799866, 0.15915684401988983, -0.0850362777709961, 0.326413631439209, -0.08511316031217575, 0.2675486207008362, -0.1415335237979889, 0.012549718841910362, 0.4891425669193268, -0.2344309389591217, -0.19036218523979187, 0.3076048493385315, -0.22657936811447144, -0.024596519768238068, 0.1515607386827469, -0.08294159173965454, 0.04803165793418884, -0.15568676590919495, 0.07480666041374207, 0.13651800155639648, -0.03592266887426376, -0.1607162058353424, 0.20335620641708374, 0.3483774662017822, -0.07834616303443909, 0.16780833899974823, 0.15385472774505615, 0.16383272409439087, 0.024051278829574585, -0.22132831811904907, -0.21857406198978424, -0.22887767851352692, 0.10207559913396835, 0.26342862844467163, 0.31498581171035767, -0.0394933819770813, -0.12510105967521667, -0.04131017625331879, -0.5802354216575623, -0.05286068841814995, 0.12952543795108795, 0.22888964414596558, -0.04450557380914688, 0.2143705189228058, -0.1489899456501007, 0.11406884342432022, -0.15631341934204102, -0.5252845287322998, -0.15230534970760345, -0.04130159690976143, -0.1952512264251709, -0.0504196397960186, 0.20020370185375214, -0.26024043560028076, 0.07499642670154572, -0.4126899242401123, 0.04635615646839142, -0.09593067318201065, -0.062235187739133835, -0.33685359358787537, 0.49023789167404175, 0.06026052311062813, 0.1704496443271637, 0.22255763411521912, -0.026821617037057877, -0.30965301394462585, -0.009809121489524841, 0.19359742105007172, 0.04299314320087433, -0.2842552363872528, 0.2825937867164612, -0.01908278465270996, -0.41798704862594604, 0.02458900585770607, -0.28187859058380127, 0.5110830068588257, 0.28072112798690796, -0.2482677698135376, -0.09234276413917542, -0.11012259125709534, -0.3919673562049866, -0.02711804211139679, 0.3800787627696991, 0.2984222173690796, -0.4647061824798584, -0.13047990202903748, -0.14865444600582123, 0.06488573551177979, 0.4687230587005615, 0.20888984203338623, -0.16553334891796112, 0.13570353388786316, -0.13617652654647827, 0.1485339105129242, 0.37663498520851135, -0.018508493900299072, -0.5099626183509827, 0.40919873118400574, 0.024875901639461517, 0.35645920038223267, -0.061860740184783936, -0.09003415703773499, 0.3700574040412903, -0.1855018436908722, 0.06217982620000839, 0.32021740078926086, -0.36143913865089417, 0.059831373393535614, -0.1008855551481247, -0.042543355375528336, -0.06351915001869202, 0.009736642241477966, 0.2629832327365875, 0.29891377687454224, -0.010900549590587616, 0.5163140892982483, 0.14717401564121246, -0.12125247716903687, 0.3402221202850342, 0.3987255096435547, 0.14896412193775177, -0.24811458587646484, 0.13294312357902527, -0.17207071185112, -0.28794512152671814, 0.12335008382797241, 0.15981341898441315, -0.1589256227016449, 0.11470885574817657, 0.1677647829055786, -0.007817432284355164, 0.17429935932159424, -0.08922751247882843, -0.38155555725097656, 0.01310047134757042, 0.27395081520080566, 0.21945102512836456, 0.08004723489284515, -0.20099705457687378, -0.0020223520696163177, -0.324116051197052, -0.3929927349090576, -0.2253016084432602, 0.18459272384643555, 0.3023614287376404, -0.3261498212814331, -0.031161155551671982, 0.2662419080734253, 0.08309777081012726, -0.10790251195430756, -0.2516555190086365, 0.147996723651886, -0.2230628877878189, 0.3441162705421448, -0.3123112916946411, 0.48378291726112366, 0.20421332120895386, -0.20268231630325317, 0.029003093019127846, 0.2141982614994049, 0.08959848433732986, 0.0038378536701202393, 0.029247021302580833, 0.24680738151073456, -0.3722628951072693, 0.3738165497779846, 0.22064760327339172, 0.06693238765001297, 0.5222475528717041, 0.1722707897424698, -0.2533802092075348, 0.022777721285820007, 0.2827177941799164, -0.3295366168022156, 0.13036280870437622, -0.20388175547122955, -0.1531578004360199, 0.07777111232280731, 0.4700506031513214, 0.2944859266281128, -0.25459691882133484, 0.010294485837221146, -0.34874987602233887, 0.0132361501455307, 0.29047513008117676, 0.3347748816013336, 0.5133265852928162, 0.08286193013191223, 0.4048360586166382, 0.027135225012898445, 0.07283669710159302, -0.18930478394031525, 0.2459898740053177, 0.121004618704319, 0.0422380231320858, 0.23451611399650574, -0.05061178654432297, -0.014471171423792839, -0.30086827278137207, -0.2677822709083557, -0.02701488509774208, 0.34101179242134094, -0.1795780062675476, 0.3285972774028778, -0.1869487166404724, -0.5258563160896301, -0.2493913769721985, -0.42008721828460693, 0.09096720814704895, -0.26039597392082214, -0.24614030122756958, 0.6363250017166138, 0.09580276906490326, 0.25799477100372314, 0.2614666223526001, 0.010100871324539185, 0.03513988107442856, -0.3091830015182495, -0.2604149580001831, -0.030847206711769104, -0.3381432890892029, 0.01218661293387413, 0.22496730089187622, -0.5655850172042847, 0.14965176582336426, 0.05588705837726593, -0.16169637441635132, -0.4472847282886505, -0.25835326313972473, 0.06282490491867065, 0.03442738205194473, 0.1328677386045456, 0.04207587614655495, 0.17169027030467987, 0.032257288694381714, -0.22236527502536774, 0.18904761970043182, -0.10048633813858032, 0.12347210943698883, 0.2570123076438904, -0.1227370947599411, -0.23438559472560883, -0.08149804919958115, -0.15780046582221985, -0.008499113842844963, -0.24298377335071564, 0.2185041606426239, -0.11355282366275787, -0.06133060157299042, 0.29016146063804626, 0.15836748480796814, 0.09765595197677612, 0.36389967799186707, -0.27774399518966675, -0.004409894347190857, -0.011163420975208282, 0.3102588951587677, -0.06170318275690079, -0.37744784355163574, 0.1305561363697052, -0.10305023193359375, 0.5736470222473145, 0.4722553789615631, -0.36675554513931274, 0.4969738721847534, -0.13309672474861145, -0.023624420166015625, 0.1415407657623291, -0.346807599067688, 0.3868023157119751, -0.10289718955755234, 0.21995067596435547, -0.3032906651496887, -0.05935177952051163, -0.03216379135847092, 0.009532969444990158, 0.321751207113266, 0.2923639118671417, 0.6657269597053528, 0.2420278936624527, 0.47865578532218933, 0.4446183443069458, -0.0005874449852854013, 0.4814021587371826, -0.1304384469985962, -0.014948513358831406, -0.1103869378566742, -0.32574570178985596, 0.43386635184288025, 0.012280315160751343, -0.43305301666259766, 0.29366636276245117, -0.026101987808942795, -0.5804478526115417, -0.304279625415802, -0.013165414333343506, 0.019447796046733856, -0.26244598627090454, 0.10254847258329391, -0.4967917203903198, 0.28169047832489014, 0.16246914863586426, 0.07804405689239502, -0.051917605102062225, -0.3575783669948578, -0.22453497350215912, -0.09790784120559692, 0.26826873421669006, 0.09420183300971985, -0.08738338947296143, -0.4789060056209564, -0.6240471005439758, 0.09542933106422424, 0.0259515643119812, 0.8507583141326904, -0.3016420602798462, 0.06684945523738861, 0.13790692389011383, -0.11230231821537018, 0.36936652660369873, -0.3686111867427826, -0.3116148114204407, 0.044050730764865875, -0.1440379023551941, -0.4558681845664978, -0.0267493799328804, -0.1088896244764328, 0.36277857422828674, 0.1317962259054184, 0.1196616142988205, -0.10454361885786057, 0.12356239557266235, 0.11704692989587784, 0.048298802226781845, -0.055353350937366486, 0.1295182853937149, -0.35110852122306824, -0.26264452934265137, -0.2264123558998108, -0.006704673171043396, 0.2354058027267456, 0.25542962551116943, 0.16052186489105225, 0.0024959370493888855, -0.19201456010341644, -0.13521863520145416, 0.1586378812789917, 0.1320643424987793, 0.07402597367763519, 0.09946610778570175, 0.33338940143585205, 0.03057406097650528, 0.11037997901439667, 0.006246449425816536, 0.16217535734176636, 0.45004403591156006, -0.6469939351081848, 0.1418789178133011, 0.1591213345527649, 0.23682163655757904, 0.2832711338996887, -0.3737642467021942, 0.0311543270945549, 0.33048585057258606, 0.041840434074401855, -0.08856377750635147, 0.12949620187282562, 0.24539640545845032, 0.2427753359079361, -0.2580759525299072, -0.4980113208293915, -0.07324159145355225, 0.010365352034568787, 0.15298199653625488, 1.0651347637176514, -0.3188483715057373, -0.2834668755531311, 0.0743548721075058, -0.0008077174425125122, 0.6970158219337463, 0.1164979487657547, -0.260940819978714, 0.3354590833187103, -0.21530231833457947, -0.05213002488017082, -0.2056259959936142, 0.3161839246749878, -0.05351719632744789, -0.38143524527549744, -0.03073643147945404, 0.04525168240070343, 0.08809536695480347, 0.0736406147480011, -0.18265381455421448, 0.15021800994873047, 0.33546823263168335, -0.03630806878209114, 0.07664898037910461, -0.11901270598173141, -0.35014715790748596, -0.21331053972244263, -0.23232728242874146, -0.03147019445896149, -0.15123078227043152, 0.2589576244354248, -0.01778842881321907, 0.015140961855649948, 0.10851715505123138, -0.10917045921087265, -0.5198310017585754, 0.15902847051620483, -0.28374984860420227, -0.26490330696105957, -0.18733857572078705, -0.15330398082733154, 0.058704063296318054, 0.5819187760353088, 0.5288028120994568, -0.0791500136256218, -0.42739132046699524, 0.14896871149539948, -0.07171106338500977, 0.06601816415786743, 0.05448652058839798, -0.027680987492203712, 0.07156626880168915, -0.1966579109430313, -0.15502305328845978, 0.19098447263240814, 0.09106926620006561, -0.13824716210365295, -0.25829678773880005, 0.04875756800174713, 0.5852702260017395, 0.17149463295936584, 0.052848126739263535, 0.210751473903656, -0.2142046093940735, -0.10880020260810852, 0.014164171181619167, -0.14087790250778198, -0.16722248494625092, 0.1469080150127411, -0.3392793536186218, -0.1921525001525879, -0.0557459257543087, 0.4201357364654541, -0.05096374452114105, 0.04706472158432007, 0.5612228512763977, 0.03416723757982254, -0.16820506751537323, -0.05934956669807434, -0.1351885199546814, -0.07012719660997391, -0.42977064847946167, 0.09501009434461594, -0.10564132779836655, 0.15587235987186432, -0.2654730975627899, 0.30117496848106384, -0.07767674326896667, 0.04983878880739212, -0.1742165982723236, -0.20085588097572327, -0.09092190861701965, 0.13721497356891632, -0.13386091589927673, 0.037347909063100815, -0.053436025977134705, 0.07019851356744766, 0.21060582995414734, -0.1085272803902626, -0.13909797370433807, -0.23052692413330078, -0.1029244214296341, -0.017518309876322746, -0.17927587032318115, 0.11383206397294998, 0.11358842253684998, -0.08203466236591339, -0.08665300905704498, 0.13853877782821655, 0.022660281509160995, -0.04187888652086258, -0.16119077801704407, 0.20741517841815948, 0.09688635170459747, -0.14210961759090424, -0.00027925893664360046, -0.19889536499977112, -0.2830061912536621, -0.39699047803878784, 0.2553092837333679, 0.190293550491333, -0.05466294661164284, 0.17581269145011902, 0.485058069229126, 0.2491113841533661, -0.4220195710659027, -0.1723881959915161, 0.07108211517333984, 0.20867975056171417, 0.056530460715293884, 0.32056036591529846, 0.4527581036090851, -0.036353498697280884, -0.543766975402832, -0.014612078666687012, 0.13224977254867554, -0.015123410150408745, 0.32165735960006714, -0.14316719770431519, 0.2803913354873657, 0.05190158262848854, 0.09312538802623749, 0.27040842175483704, -0.18726111948490143, -0.0963691845536232, 0.21131162345409393, -0.004326893016695976, -0.10293255746364594, 0.03930233046412468, 0.013966497033834457, 0.05566101148724556, -0.03642371669411659, 0.28303539752960205, 0.030113771557807922, -0.18932051956653595, 0.47271624207496643, 0.005825497210025787, 0.24205712974071503, -0.7060971856117249, 0.12967118620872498, 0.3432742953300476, 0.061650440096855164, 0.3266792893409729, -0.27359986305236816, -0.013564045540988445, -0.04680752754211426, 0.5956479907035828, -0.2728615999221802, 0.18911457061767578, 0.10747037827968597, 0.10961738228797913, -0.13751909136772156, -0.19431579113006592, -0.3989015519618988, -0.2471207231283188, -0.30182796716690063, 0.29770421981811523, 0.1341850757598877, 0.09745864570140839, 0.16177138686180115, 0.11049339175224304, -0.12215176969766617, 0.006319399923086166, -0.027407115325331688, -0.10729774832725525, -0.3614981770515442, 0.07211209833621979, -0.07649165391921997, -0.10157216340303421, 0.24862423539161682, 0.1590639054775238, 0.09669911861419678, 0.2033318281173706, -0.16958758234977722, -0.16075655817985535, 0.19356533885002136, 0.14461930096149445, 0.15964451432228088, -0.16845087707042694, 0.4067174792289734, 0.1370929628610611, 0.2602723240852356, 0.046857159584760666, 0.06992078572511673, 0.19277554750442505, 0.32983243465423584, 0.25709521770477295, 0.24162349104881287, 0.06905724108219147, -0.05773047357797623, -0.09349443763494492, 0.5506805181503296, 0.15459704399108887, 0.5155318379402161, 0.13955242931842804, -0.07244820147752762, 0.04975445568561554, 0.2017499804496765, 0.15053638815879822, 0.24782022833824158, -0.19300775229930878, 0.4139023721218109, -0.26512765884399414, 0.07221271097660065, -0.29713839292526245, -0.0883868932723999, 0.02066248655319214, 0.28611522912979126, 0.14641493558883667, -0.309806227684021, 0.14287684857845306, -0.1046009361743927, -0.027164779603481293, -0.04068894311785698, 0.18010291457176208, 0.22020690143108368, 0.1832214593887329, -0.1920764297246933, -0.2980017066001892, -0.4625641107559204, 0.09024259448051453, 0.07369155436754227, 0.11706189811229706, 0.13281939923763275, 0.3102108836174011, -0.10108831524848938, 0.027877360582351685, -0.02991851419210434, -0.3623301386833191, 0.0876467376947403, 0.5618104338645935, -0.28569990396499634, -0.5416406393051147, 0.13000144064426422, 0.24649113416671753, -0.01511421799659729, -0.34270280599594116, 0.21287325024604797, -0.17544899880886078, -0.13592606782913208, 0.10361748188734055, -0.2636096179485321, 0.010239727795124054, 0.42691099643707275, 0.010891958139836788, 0.15366333723068237, 0.1841680407524109, -0.02898280695080757, 0.333159476518631, -0.4873127341270447, 0.06524572521448135, -0.1905340552330017, 0.18577799201011658, -0.13104884326457977, 0.18858222663402557, -0.14417950809001923, -0.19125621020793915, -0.15048840641975403, 0.12513606250286102, 0.2964513897895813, -0.091572105884552, -0.2358931601047516, 0.22055473923683167, -0.13149060308933258, 0.6817532777786255, -0.13294877111911774, 0.36386045813560486, 0.00797970686107874, 0.1565515547990799, -0.3677428662776947, -0.2640225291252136, 0.4869004786014557, -0.4265178143978119, -0.43845134973526, 0.1617879867553711, 0.07544254511594772, 0.20788496732711792, -0.18640699982643127, -0.37275180220603943, -0.037394292652606964, 0.3786779046058655, -0.16843055188655853, -0.13043218851089478, 0.17067986726760864, 0.15229937434196472, 0.3160434365272522, -0.02862032875418663, 0.25623220205307007, 0.37204989790916443, -0.2064376324415207, 0.25408434867858887, -0.22080868482589722 ]
https://github.com/huggingface/datasets/issues/5847
Maybe moving `KeyDataset` later on in the guide and specify it's mostly for streaming then? Or is it also necessary for batch_size>1 (which is what the current doc implies)?
Streaming IterableDataset not working with translation pipeline
### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ```
29
Streaming IterableDataset not working with translation pipeline ### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ``` Maybe moving `KeyDataset` later on in the guide and specify it's mostly for streaming then? Or is it also necessary for batch_size>1 (which is what the current doc implies)?
[ -0.5097402334213257, -0.1700969636440277, -0.03699735552072525, 0.1410585343837738, 0.32595449686050415, -0.04014071822166443, 0.5023482441902161, 0.08091886341571808, -0.21698808670043945, 0.3707205653190613, 0.11250735074281693, -0.12919551134109497, -0.09642905741930008, -0.056972090154886246, 0.24075904488563538, -0.1401120275259018, 0.14402469992637634, 0.11066155135631561, 0.07620875537395477, 0.025537937879562378, -0.1345769762992859, 0.419960618019104, -0.3393276333808899, -0.13462135195732117, 0.07164821028709412, -0.020041603595018387, 0.07546335458755493, -0.06072026491165161, 0.10995739698410034, -0.0972297340631485, 0.2946396470069885, 0.08511921763420105, 0.3027557134628296, 0.35239145159721375, -0.00012714500189758837, 0.07905419915914536, 0.28028425574302673, -0.18852919340133667, -0.23983651399612427, -0.24718943238258362, 0.06415900588035583, -0.04391658306121826, -0.2632408142089844, -0.1516910344362259, -0.10690533369779587, -0.1233992874622345, -0.0009501222521066666, -0.6041090488433838, 0.27238205075263977, 0.35920193791389465, 0.0669078528881073, 0.1592809408903122, -0.03286817669868469, 0.14321640133857727, -0.24326962232589722, -0.20158545672893524, -0.2896386384963989, -0.040483687072992325, 0.3940836787223816, 0.31063175201416016, 0.23769241571426392, 0.2160363346338272, -0.09335566312074661, 0.039544034749269485, 0.013658847659826279, -0.08215659856796265, -0.18719595670700073, -0.2938418984413147, 0.355713814496994, 0.2636595368385315, 0.1755864918231964, -0.3200145363807678, -0.20304788649082184, -0.34278014302253723, -0.0711405873298645, -0.6014050841331482, 0.07055695354938507, 0.1000886857509613, -0.21229995787143707, -0.007286093197762966, -0.3974710702896118, -0.10858047753572464, -0.35362544655799866, 0.15915684401988983, -0.0850362777709961, 0.326413631439209, -0.08511316031217575, 0.2675486207008362, -0.1415335237979889, 0.012549718841910362, 0.4891425669193268, -0.2344309389591217, -0.19036218523979187, 0.3076048493385315, -0.22657936811447144, -0.024596519768238068, 0.1515607386827469, -0.08294159173965454, 0.04803165793418884, -0.15568676590919495, 0.07480666041374207, 0.13651800155639648, -0.03592266887426376, -0.1607162058353424, 0.20335620641708374, 0.3483774662017822, -0.07834616303443909, 0.16780833899974823, 0.15385472774505615, 0.16383272409439087, 0.024051278829574585, -0.22132831811904907, -0.21857406198978424, -0.22887767851352692, 0.10207559913396835, 0.26342862844467163, 0.31498581171035767, -0.0394933819770813, -0.12510105967521667, -0.04131017625331879, -0.5802354216575623, -0.05286068841814995, 0.12952543795108795, 0.22888964414596558, -0.04450557380914688, 0.2143705189228058, -0.1489899456501007, 0.11406884342432022, -0.15631341934204102, -0.5252845287322998, -0.15230534970760345, -0.04130159690976143, -0.1952512264251709, -0.0504196397960186, 0.20020370185375214, -0.26024043560028076, 0.07499642670154572, -0.4126899242401123, 0.04635615646839142, -0.09593067318201065, -0.062235187739133835, -0.33685359358787537, 0.49023789167404175, 0.06026052311062813, 0.1704496443271637, 0.22255763411521912, -0.026821617037057877, -0.30965301394462585, -0.009809121489524841, 0.19359742105007172, 0.04299314320087433, -0.2842552363872528, 0.2825937867164612, -0.01908278465270996, -0.41798704862594604, 0.02458900585770607, -0.28187859058380127, 0.5110830068588257, 0.28072112798690796, -0.2482677698135376, -0.09234276413917542, -0.11012259125709534, -0.3919673562049866, -0.02711804211139679, 0.3800787627696991, 0.2984222173690796, -0.4647061824798584, -0.13047990202903748, -0.14865444600582123, 0.06488573551177979, 0.4687230587005615, 0.20888984203338623, -0.16553334891796112, 0.13570353388786316, -0.13617652654647827, 0.1485339105129242, 0.37663498520851135, -0.018508493900299072, -0.5099626183509827, 0.40919873118400574, 0.024875901639461517, 0.35645920038223267, -0.061860740184783936, -0.09003415703773499, 0.3700574040412903, -0.1855018436908722, 0.06217982620000839, 0.32021740078926086, -0.36143913865089417, 0.059831373393535614, -0.1008855551481247, -0.042543355375528336, -0.06351915001869202, 0.009736642241477966, 0.2629832327365875, 0.29891377687454224, -0.010900549590587616, 0.5163140892982483, 0.14717401564121246, -0.12125247716903687, 0.3402221202850342, 0.3987255096435547, 0.14896412193775177, -0.24811458587646484, 0.13294312357902527, -0.17207071185112, -0.28794512152671814, 0.12335008382797241, 0.15981341898441315, -0.1589256227016449, 0.11470885574817657, 0.1677647829055786, -0.007817432284355164, 0.17429935932159424, -0.08922751247882843, -0.38155555725097656, 0.01310047134757042, 0.27395081520080566, 0.21945102512836456, 0.08004723489284515, -0.20099705457687378, -0.0020223520696163177, -0.324116051197052, -0.3929927349090576, -0.2253016084432602, 0.18459272384643555, 0.3023614287376404, -0.3261498212814331, -0.031161155551671982, 0.2662419080734253, 0.08309777081012726, -0.10790251195430756, -0.2516555190086365, 0.147996723651886, -0.2230628877878189, 0.3441162705421448, -0.3123112916946411, 0.48378291726112366, 0.20421332120895386, -0.20268231630325317, 0.029003093019127846, 0.2141982614994049, 0.08959848433732986, 0.0038378536701202393, 0.029247021302580833, 0.24680738151073456, -0.3722628951072693, 0.3738165497779846, 0.22064760327339172, 0.06693238765001297, 0.5222475528717041, 0.1722707897424698, -0.2533802092075348, 0.022777721285820007, 0.2827177941799164, -0.3295366168022156, 0.13036280870437622, -0.20388175547122955, -0.1531578004360199, 0.07777111232280731, 0.4700506031513214, 0.2944859266281128, -0.25459691882133484, 0.010294485837221146, -0.34874987602233887, 0.0132361501455307, 0.29047513008117676, 0.3347748816013336, 0.5133265852928162, 0.08286193013191223, 0.4048360586166382, 0.027135225012898445, 0.07283669710159302, -0.18930478394031525, 0.2459898740053177, 0.121004618704319, 0.0422380231320858, 0.23451611399650574, -0.05061178654432297, -0.014471171423792839, -0.30086827278137207, -0.2677822709083557, -0.02701488509774208, 0.34101179242134094, -0.1795780062675476, 0.3285972774028778, -0.1869487166404724, -0.5258563160896301, -0.2493913769721985, -0.42008721828460693, 0.09096720814704895, -0.26039597392082214, -0.24614030122756958, 0.6363250017166138, 0.09580276906490326, 0.25799477100372314, 0.2614666223526001, 0.010100871324539185, 0.03513988107442856, -0.3091830015182495, -0.2604149580001831, -0.030847206711769104, -0.3381432890892029, 0.01218661293387413, 0.22496730089187622, -0.5655850172042847, 0.14965176582336426, 0.05588705837726593, -0.16169637441635132, -0.4472847282886505, -0.25835326313972473, 0.06282490491867065, 0.03442738205194473, 0.1328677386045456, 0.04207587614655495, 0.17169027030467987, 0.032257288694381714, -0.22236527502536774, 0.18904761970043182, -0.10048633813858032, 0.12347210943698883, 0.2570123076438904, -0.1227370947599411, -0.23438559472560883, -0.08149804919958115, -0.15780046582221985, -0.008499113842844963, -0.24298377335071564, 0.2185041606426239, -0.11355282366275787, -0.06133060157299042, 0.29016146063804626, 0.15836748480796814, 0.09765595197677612, 0.36389967799186707, -0.27774399518966675, -0.004409894347190857, -0.011163420975208282, 0.3102588951587677, -0.06170318275690079, -0.37744784355163574, 0.1305561363697052, -0.10305023193359375, 0.5736470222473145, 0.4722553789615631, -0.36675554513931274, 0.4969738721847534, -0.13309672474861145, -0.023624420166015625, 0.1415407657623291, -0.346807599067688, 0.3868023157119751, -0.10289718955755234, 0.21995067596435547, -0.3032906651496887, -0.05935177952051163, -0.03216379135847092, 0.009532969444990158, 0.321751207113266, 0.2923639118671417, 0.6657269597053528, 0.2420278936624527, 0.47865578532218933, 0.4446183443069458, -0.0005874449852854013, 0.4814021587371826, -0.1304384469985962, -0.014948513358831406, -0.1103869378566742, -0.32574570178985596, 0.43386635184288025, 0.012280315160751343, -0.43305301666259766, 0.29366636276245117, -0.026101987808942795, -0.5804478526115417, -0.304279625415802, -0.013165414333343506, 0.019447796046733856, -0.26244598627090454, 0.10254847258329391, -0.4967917203903198, 0.28169047832489014, 0.16246914863586426, 0.07804405689239502, -0.051917605102062225, -0.3575783669948578, -0.22453497350215912, -0.09790784120559692, 0.26826873421669006, 0.09420183300971985, -0.08738338947296143, -0.4789060056209564, -0.6240471005439758, 0.09542933106422424, 0.0259515643119812, 0.8507583141326904, -0.3016420602798462, 0.06684945523738861, 0.13790692389011383, -0.11230231821537018, 0.36936652660369873, -0.3686111867427826, -0.3116148114204407, 0.044050730764865875, -0.1440379023551941, -0.4558681845664978, -0.0267493799328804, -0.1088896244764328, 0.36277857422828674, 0.1317962259054184, 0.1196616142988205, -0.10454361885786057, 0.12356239557266235, 0.11704692989587784, 0.048298802226781845, -0.055353350937366486, 0.1295182853937149, -0.35110852122306824, -0.26264452934265137, -0.2264123558998108, -0.006704673171043396, 0.2354058027267456, 0.25542962551116943, 0.16052186489105225, 0.0024959370493888855, -0.19201456010341644, -0.13521863520145416, 0.1586378812789917, 0.1320643424987793, 0.07402597367763519, 0.09946610778570175, 0.33338940143585205, 0.03057406097650528, 0.11037997901439667, 0.006246449425816536, 0.16217535734176636, 0.45004403591156006, -0.6469939351081848, 0.1418789178133011, 0.1591213345527649, 0.23682163655757904, 0.2832711338996887, -0.3737642467021942, 0.0311543270945549, 0.33048585057258606, 0.041840434074401855, -0.08856377750635147, 0.12949620187282562, 0.24539640545845032, 0.2427753359079361, -0.2580759525299072, -0.4980113208293915, -0.07324159145355225, 0.010365352034568787, 0.15298199653625488, 1.0651347637176514, -0.3188483715057373, -0.2834668755531311, 0.0743548721075058, -0.0008077174425125122, 0.6970158219337463, 0.1164979487657547, -0.260940819978714, 0.3354590833187103, -0.21530231833457947, -0.05213002488017082, -0.2056259959936142, 0.3161839246749878, -0.05351719632744789, -0.38143524527549744, -0.03073643147945404, 0.04525168240070343, 0.08809536695480347, 0.0736406147480011, -0.18265381455421448, 0.15021800994873047, 0.33546823263168335, -0.03630806878209114, 0.07664898037910461, -0.11901270598173141, -0.35014715790748596, -0.21331053972244263, -0.23232728242874146, -0.03147019445896149, -0.15123078227043152, 0.2589576244354248, -0.01778842881321907, 0.015140961855649948, 0.10851715505123138, -0.10917045921087265, -0.5198310017585754, 0.15902847051620483, -0.28374984860420227, -0.26490330696105957, -0.18733857572078705, -0.15330398082733154, 0.058704063296318054, 0.5819187760353088, 0.5288028120994568, -0.0791500136256218, -0.42739132046699524, 0.14896871149539948, -0.07171106338500977, 0.06601816415786743, 0.05448652058839798, -0.027680987492203712, 0.07156626880168915, -0.1966579109430313, -0.15502305328845978, 0.19098447263240814, 0.09106926620006561, -0.13824716210365295, -0.25829678773880005, 0.04875756800174713, 0.5852702260017395, 0.17149463295936584, 0.052848126739263535, 0.210751473903656, -0.2142046093940735, -0.10880020260810852, 0.014164171181619167, -0.14087790250778198, -0.16722248494625092, 0.1469080150127411, -0.3392793536186218, -0.1921525001525879, -0.0557459257543087, 0.4201357364654541, -0.05096374452114105, 0.04706472158432007, 0.5612228512763977, 0.03416723757982254, -0.16820506751537323, -0.05934956669807434, -0.1351885199546814, -0.07012719660997391, -0.42977064847946167, 0.09501009434461594, -0.10564132779836655, 0.15587235987186432, -0.2654730975627899, 0.30117496848106384, -0.07767674326896667, 0.04983878880739212, -0.1742165982723236, -0.20085588097572327, -0.09092190861701965, 0.13721497356891632, -0.13386091589927673, 0.037347909063100815, -0.053436025977134705, 0.07019851356744766, 0.21060582995414734, -0.1085272803902626, -0.13909797370433807, -0.23052692413330078, -0.1029244214296341, -0.017518309876322746, -0.17927587032318115, 0.11383206397294998, 0.11358842253684998, -0.08203466236591339, -0.08665300905704498, 0.13853877782821655, 0.022660281509160995, -0.04187888652086258, -0.16119077801704407, 0.20741517841815948, 0.09688635170459747, -0.14210961759090424, -0.00027925893664360046, -0.19889536499977112, -0.2830061912536621, -0.39699047803878784, 0.2553092837333679, 0.190293550491333, -0.05466294661164284, 0.17581269145011902, 0.485058069229126, 0.2491113841533661, -0.4220195710659027, -0.1723881959915161, 0.07108211517333984, 0.20867975056171417, 0.056530460715293884, 0.32056036591529846, 0.4527581036090851, -0.036353498697280884, -0.543766975402832, -0.014612078666687012, 0.13224977254867554, -0.015123410150408745, 0.32165735960006714, -0.14316719770431519, 0.2803913354873657, 0.05190158262848854, 0.09312538802623749, 0.27040842175483704, -0.18726111948490143, -0.0963691845536232, 0.21131162345409393, -0.004326893016695976, -0.10293255746364594, 0.03930233046412468, 0.013966497033834457, 0.05566101148724556, -0.03642371669411659, 0.28303539752960205, 0.030113771557807922, -0.18932051956653595, 0.47271624207496643, 0.005825497210025787, 0.24205712974071503, -0.7060971856117249, 0.12967118620872498, 0.3432742953300476, 0.061650440096855164, 0.3266792893409729, -0.27359986305236816, -0.013564045540988445, -0.04680752754211426, 0.5956479907035828, -0.2728615999221802, 0.18911457061767578, 0.10747037827968597, 0.10961738228797913, -0.13751909136772156, -0.19431579113006592, -0.3989015519618988, -0.2471207231283188, -0.30182796716690063, 0.29770421981811523, 0.1341850757598877, 0.09745864570140839, 0.16177138686180115, 0.11049339175224304, -0.12215176969766617, 0.006319399923086166, -0.027407115325331688, -0.10729774832725525, -0.3614981770515442, 0.07211209833621979, -0.07649165391921997, -0.10157216340303421, 0.24862423539161682, 0.1590639054775238, 0.09669911861419678, 0.2033318281173706, -0.16958758234977722, -0.16075655817985535, 0.19356533885002136, 0.14461930096149445, 0.15964451432228088, -0.16845087707042694, 0.4067174792289734, 0.1370929628610611, 0.2602723240852356, 0.046857159584760666, 0.06992078572511673, 0.19277554750442505, 0.32983243465423584, 0.25709521770477295, 0.24162349104881287, 0.06905724108219147, -0.05773047357797623, -0.09349443763494492, 0.5506805181503296, 0.15459704399108887, 0.5155318379402161, 0.13955242931842804, -0.07244820147752762, 0.04975445568561554, 0.2017499804496765, 0.15053638815879822, 0.24782022833824158, -0.19300775229930878, 0.4139023721218109, -0.26512765884399414, 0.07221271097660065, -0.29713839292526245, -0.0883868932723999, 0.02066248655319214, 0.28611522912979126, 0.14641493558883667, -0.309806227684021, 0.14287684857845306, -0.1046009361743927, -0.027164779603481293, -0.04068894311785698, 0.18010291457176208, 0.22020690143108368, 0.1832214593887329, -0.1920764297246933, -0.2980017066001892, -0.4625641107559204, 0.09024259448051453, 0.07369155436754227, 0.11706189811229706, 0.13281939923763275, 0.3102108836174011, -0.10108831524848938, 0.027877360582351685, -0.02991851419210434, -0.3623301386833191, 0.0876467376947403, 0.5618104338645935, -0.28569990396499634, -0.5416406393051147, 0.13000144064426422, 0.24649113416671753, -0.01511421799659729, -0.34270280599594116, 0.21287325024604797, -0.17544899880886078, -0.13592606782913208, 0.10361748188734055, -0.2636096179485321, 0.010239727795124054, 0.42691099643707275, 0.010891958139836788, 0.15366333723068237, 0.1841680407524109, -0.02898280695080757, 0.333159476518631, -0.4873127341270447, 0.06524572521448135, -0.1905340552330017, 0.18577799201011658, -0.13104884326457977, 0.18858222663402557, -0.14417950809001923, -0.19125621020793915, -0.15048840641975403, 0.12513606250286102, 0.2964513897895813, -0.091572105884552, -0.2358931601047516, 0.22055473923683167, -0.13149060308933258, 0.6817532777786255, -0.13294877111911774, 0.36386045813560486, 0.00797970686107874, 0.1565515547990799, -0.3677428662776947, -0.2640225291252136, 0.4869004786014557, -0.4265178143978119, -0.43845134973526, 0.1617879867553711, 0.07544254511594772, 0.20788496732711792, -0.18640699982643127, -0.37275180220603943, -0.037394292652606964, 0.3786779046058655, -0.16843055188655853, -0.13043218851089478, 0.17067986726760864, 0.15229937434196472, 0.3160434365272522, -0.02862032875418663, 0.25623220205307007, 0.37204989790916443, -0.2064376324415207, 0.25408434867858887, -0.22080868482589722 ]
https://github.com/huggingface/datasets/issues/5847
Hmm Iterator (`yield`) : - Not countable - Super flexible - Cannot use `num_workers>1` (threading requires indexing at the correct location, iterators require to iterate in order,so each thread would iterate over the full thing being genuinely a bad idea) - Can batch - tqdm doesn't show a nice progress bar (it has no total) KeyDataset (Or any PyTorch like Dataset returning the correct object for the pipeline): - Countable - Less flexible (not applicable to datasets with streaming), can only work on single keys. But should be easy to read and write your own (like @mariosasko did) - Works with `num_workers > 1` (Every worker can fetch exactly what's needed) - Can batch - tqdm shows a nice progress bar In the docs, if we update all the examples to use iterators, and include an example with ``` for item in tqdm.tqdm(pipe(iterator(), total=len(dataset)))) ``` We can save the biggest feature that doesn't work out of the box with iterators which is the tqdm progress bar. `num_workers>1` we can mention it, but it tends to be an issues only on CPU intensive loads, like image (and maybe audio)
Streaming IterableDataset not working with translation pipeline
### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ```
188
Streaming IterableDataset not working with translation pipeline ### Describe the bug I'm trying to use a streaming dataset for translation inference to avoid downloading the training data. I'm using a pipeline and a dataset, and following the guidance in the tutorial. Instead I get an exception that IterableDataset has no len(). ### Steps to reproduce the bug CODE: ``` from transformers import pipeline from transformers.pipelines.pt_utils import KeyDataset from datasets import load_dataset ds = load_dataset(path="wmt14", name="fr-en", split="test", streaming=True) bs=1 mt = pipeline("translation_en_to_fr", model="t5-base", batch_size=bs) #print(mt("hello")) THIS WORKS ks = KeyDataset(ds, "translation") print(f"{ks}") xx= mt(ks) for x in xx: print(x) ``` RUN: ``` (watnlp) [jlquinn@bertdev01 hf]$ python ende.t5.pipe.py 2023-05-11 16:48:08.817572: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2023-05-11 16:48:08.821388: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-05-11 16:48:08.821407: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. <transformers.pipelines.pt_utils.KeyDataset object at 0x7f61ed5da9d0> Traceback (most recent call last): File "/home/jlquinn/models/hf/ende.t5.pipe.py", line 11, in <module> for x in xx: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 111, in __next__ item = next(self.iterator) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 681, in __next__ data = self._next_data() File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 720, in _next_data index = self._next_index() # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index return next(self._sampler_iter) # may raise StopIteration File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 247, in __iter__ for idx in self.sampler: File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 76, in __iter__ return iter(range(len(self.data_source))) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 13, in __len__ return len(self.dataset) File "/home/jlquinn/miniconda3/envs/watnlp/lib/python3.9/site-packages/transformers/pipelines/pt_utils.py", line 289, in __len__ return len(self.dataset) TypeError: object of type 'IterableDataset' has no len() ``` ### Expected behavior I'm expecting french translations of the english test set to be printed. ### Environment info Run on CPU with no GPU. RHEL 8.7 x86_64 python 3.9.0 transformers 4.17.0 datasets 2.0.0 tokenizers 0.12.1 ``` (watnlp) [jlquinn@bertdev01 hf]$ datasets-cli env Copy-and-paste the text below in your GitHub issue. - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-372.19.1.el8_6.x86_64-x86_64-with-glibc2.28 - Python version: 3.9.0 - PyArrow version: 8.0.0 - Pandas version: 1.4.4 ``` Hmm Iterator (`yield`) : - Not countable - Super flexible - Cannot use `num_workers>1` (threading requires indexing at the correct location, iterators require to iterate in order,so each thread would iterate over the full thing being genuinely a bad idea) - Can batch - tqdm doesn't show a nice progress bar (it has no total) KeyDataset (Or any PyTorch like Dataset returning the correct object for the pipeline): - Countable - Less flexible (not applicable to datasets with streaming), can only work on single keys. But should be easy to read and write your own (like @mariosasko did) - Works with `num_workers > 1` (Every worker can fetch exactly what's needed) - Can batch - tqdm shows a nice progress bar In the docs, if we update all the examples to use iterators, and include an example with ``` for item in tqdm.tqdm(pipe(iterator(), total=len(dataset)))) ``` We can save the biggest feature that doesn't work out of the box with iterators which is the tqdm progress bar. `num_workers>1` we can mention it, but it tends to be an issues only on CPU intensive loads, like image (and maybe audio)
[ -0.5097402334213257, -0.1700969636440277, -0.03699735552072525, 0.1410585343837738, 0.32595449686050415, -0.04014071822166443, 0.5023482441902161, 0.08091886341571808, -0.21698808670043945, 0.3707205653190613, 0.11250735074281693, -0.12919551134109497, -0.09642905741930008, -0.056972090154886246, 0.24075904488563538, -0.1401120275259018, 0.14402469992637634, 0.11066155135631561, 0.07620875537395477, 0.025537937879562378, -0.1345769762992859, 0.419960618019104, -0.3393276333808899, -0.13462135195732117, 0.07164821028709412, -0.020041603595018387, 0.07546335458755493, -0.06072026491165161, 0.10995739698410034, -0.0972297340631485, 0.2946396470069885, 0.08511921763420105, 0.3027557134628296, 0.35239145159721375, -0.00012714500189758837, 0.07905419915914536, 0.28028425574302673, -0.18852919340133667, -0.23983651399612427, -0.24718943238258362, 0.06415900588035583, -0.04391658306121826, -0.2632408142089844, -0.1516910344362259, -0.10690533369779587, -0.1233992874622345, -0.0009501222521066666, -0.6041090488433838, 0.27238205075263977, 0.35920193791389465, 0.0669078528881073, 0.1592809408903122, -0.03286817669868469, 0.14321640133857727, -0.24326962232589722, -0.20158545672893524, -0.2896386384963989, -0.040483687072992325, 0.3940836787223816, 0.31063175201416016, 0.23769241571426392, 0.2160363346338272, -0.09335566312074661, 0.039544034749269485, 0.013658847659826279, -0.08215659856796265, -0.18719595670700073, -0.2938418984413147, 0.355713814496994, 0.2636595368385315, 0.1755864918231964, -0.3200145363807678, -0.20304788649082184, -0.34278014302253723, -0.0711405873298645, -0.6014050841331482, 0.07055695354938507, 0.1000886857509613, -0.21229995787143707, -0.007286093197762966, -0.3974710702896118, -0.10858047753572464, -0.35362544655799866, 0.15915684401988983, -0.0850362777709961, 0.326413631439209, -0.08511316031217575, 0.2675486207008362, -0.1415335237979889, 0.012549718841910362, 0.4891425669193268, -0.2344309389591217, -0.19036218523979187, 0.3076048493385315, -0.22657936811447144, -0.024596519768238068, 0.1515607386827469, -0.08294159173965454, 0.04803165793418884, -0.15568676590919495, 0.07480666041374207, 0.13651800155639648, -0.03592266887426376, -0.1607162058353424, 0.20335620641708374, 0.3483774662017822, -0.07834616303443909, 0.16780833899974823, 0.15385472774505615, 0.16383272409439087, 0.024051278829574585, -0.22132831811904907, -0.21857406198978424, -0.22887767851352692, 0.10207559913396835, 0.26342862844467163, 0.31498581171035767, -0.0394933819770813, -0.12510105967521667, -0.04131017625331879, -0.5802354216575623, -0.05286068841814995, 0.12952543795108795, 0.22888964414596558, -0.04450557380914688, 0.2143705189228058, -0.1489899456501007, 0.11406884342432022, -0.15631341934204102, -0.5252845287322998, -0.15230534970760345, -0.04130159690976143, -0.1952512264251709, -0.0504196397960186, 0.20020370185375214, -0.26024043560028076, 0.07499642670154572, -0.4126899242401123, 0.04635615646839142, -0.09593067318201065, -0.062235187739133835, -0.33685359358787537, 0.49023789167404175, 0.06026052311062813, 0.1704496443271637, 0.22255763411521912, -0.026821617037057877, -0.30965301394462585, -0.009809121489524841, 0.19359742105007172, 0.04299314320087433, -0.2842552363872528, 0.2825937867164612, -0.01908278465270996, -0.41798704862594604, 0.02458900585770607, -0.28187859058380127, 0.5110830068588257, 0.28072112798690796, -0.2482677698135376, -0.09234276413917542, -0.11012259125709534, -0.3919673562049866, -0.02711804211139679, 0.3800787627696991, 0.2984222173690796, -0.4647061824798584, -0.13047990202903748, -0.14865444600582123, 0.06488573551177979, 0.4687230587005615, 0.20888984203338623, -0.16553334891796112, 0.13570353388786316, -0.13617652654647827, 0.1485339105129242, 0.37663498520851135, -0.018508493900299072, -0.5099626183509827, 0.40919873118400574, 0.024875901639461517, 0.35645920038223267, -0.061860740184783936, -0.09003415703773499, 0.3700574040412903, -0.1855018436908722, 0.06217982620000839, 0.32021740078926086, -0.36143913865089417, 0.059831373393535614, -0.1008855551481247, -0.042543355375528336, -0.06351915001869202, 0.009736642241477966, 0.2629832327365875, 0.29891377687454224, -0.010900549590587616, 0.5163140892982483, 0.14717401564121246, -0.12125247716903687, 0.3402221202850342, 0.3987255096435547, 0.14896412193775177, -0.24811458587646484, 0.13294312357902527, -0.17207071185112, -0.28794512152671814, 0.12335008382797241, 0.15981341898441315, -0.1589256227016449, 0.11470885574817657, 0.1677647829055786, -0.007817432284355164, 0.17429935932159424, -0.08922751247882843, -0.38155555725097656, 0.01310047134757042, 0.27395081520080566, 0.21945102512836456, 0.08004723489284515, -0.20099705457687378, -0.0020223520696163177, -0.324116051197052, -0.3929927349090576, -0.2253016084432602, 0.18459272384643555, 0.3023614287376404, -0.3261498212814331, -0.031161155551671982, 0.2662419080734253, 0.08309777081012726, -0.10790251195430756, -0.2516555190086365, 0.147996723651886, -0.2230628877878189, 0.3441162705421448, -0.3123112916946411, 0.48378291726112366, 0.20421332120895386, -0.20268231630325317, 0.029003093019127846, 0.2141982614994049, 0.08959848433732986, 0.0038378536701202393, 0.029247021302580833, 0.24680738151073456, -0.3722628951072693, 0.3738165497779846, 0.22064760327339172, 0.06693238765001297, 0.5222475528717041, 0.1722707897424698, -0.2533802092075348, 0.022777721285820007, 0.2827177941799164, -0.3295366168022156, 0.13036280870437622, -0.20388175547122955, -0.1531578004360199, 0.07777111232280731, 0.4700506031513214, 0.2944859266281128, -0.25459691882133484, 0.010294485837221146, -0.34874987602233887, 0.0132361501455307, 0.29047513008117676, 0.3347748816013336, 0.5133265852928162, 0.08286193013191223, 0.4048360586166382, 0.027135225012898445, 0.07283669710159302, -0.18930478394031525, 0.2459898740053177, 0.121004618704319, 0.0422380231320858, 0.23451611399650574, -0.05061178654432297, -0.014471171423792839, -0.30086827278137207, -0.2677822709083557, -0.02701488509774208, 0.34101179242134094, -0.1795780062675476, 0.3285972774028778, -0.1869487166404724, -0.5258563160896301, -0.2493913769721985, -0.42008721828460693, 0.09096720814704895, -0.26039597392082214, -0.24614030122756958, 0.6363250017166138, 0.09580276906490326, 0.25799477100372314, 0.2614666223526001, 0.010100871324539185, 0.03513988107442856, -0.3091830015182495, -0.2604149580001831, -0.030847206711769104, -0.3381432890892029, 0.01218661293387413, 0.22496730089187622, -0.5655850172042847, 0.14965176582336426, 0.05588705837726593, -0.16169637441635132, -0.4472847282886505, -0.25835326313972473, 0.06282490491867065, 0.03442738205194473, 0.1328677386045456, 0.04207587614655495, 0.17169027030467987, 0.032257288694381714, -0.22236527502536774, 0.18904761970043182, -0.10048633813858032, 0.12347210943698883, 0.2570123076438904, -0.1227370947599411, -0.23438559472560883, -0.08149804919958115, -0.15780046582221985, -0.008499113842844963, -0.24298377335071564, 0.2185041606426239, -0.11355282366275787, -0.06133060157299042, 0.29016146063804626, 0.15836748480796814, 0.09765595197677612, 0.36389967799186707, -0.27774399518966675, -0.004409894347190857, -0.011163420975208282, 0.3102588951587677, -0.06170318275690079, -0.37744784355163574, 0.1305561363697052, -0.10305023193359375, 0.5736470222473145, 0.4722553789615631, -0.36675554513931274, 0.4969738721847534, -0.13309672474861145, -0.023624420166015625, 0.1415407657623291, -0.346807599067688, 0.3868023157119751, -0.10289718955755234, 0.21995067596435547, -0.3032906651496887, -0.05935177952051163, -0.03216379135847092, 0.009532969444990158, 0.321751207113266, 0.2923639118671417, 0.6657269597053528, 0.2420278936624527, 0.47865578532218933, 0.4446183443069458, -0.0005874449852854013, 0.4814021587371826, -0.1304384469985962, -0.014948513358831406, -0.1103869378566742, -0.32574570178985596, 0.43386635184288025, 0.012280315160751343, -0.43305301666259766, 0.29366636276245117, -0.026101987808942795, -0.5804478526115417, -0.304279625415802, -0.013165414333343506, 0.019447796046733856, -0.26244598627090454, 0.10254847258329391, -0.4967917203903198, 0.28169047832489014, 0.16246914863586426, 0.07804405689239502, -0.051917605102062225, -0.3575783669948578, -0.22453497350215912, -0.09790784120559692, 0.26826873421669006, 0.09420183300971985, -0.08738338947296143, -0.4789060056209564, -0.6240471005439758, 0.09542933106422424, 0.0259515643119812, 0.8507583141326904, -0.3016420602798462, 0.06684945523738861, 0.13790692389011383, -0.11230231821537018, 0.36936652660369873, -0.3686111867427826, -0.3116148114204407, 0.044050730764865875, -0.1440379023551941, -0.4558681845664978, -0.0267493799328804, -0.1088896244764328, 0.36277857422828674, 0.1317962259054184, 0.1196616142988205, -0.10454361885786057, 0.12356239557266235, 0.11704692989587784, 0.048298802226781845, -0.055353350937366486, 0.1295182853937149, -0.35110852122306824, -0.26264452934265137, -0.2264123558998108, -0.006704673171043396, 0.2354058027267456, 0.25542962551116943, 0.16052186489105225, 0.0024959370493888855, -0.19201456010341644, -0.13521863520145416, 0.1586378812789917, 0.1320643424987793, 0.07402597367763519, 0.09946610778570175, 0.33338940143585205, 0.03057406097650528, 0.11037997901439667, 0.006246449425816536, 0.16217535734176636, 0.45004403591156006, -0.6469939351081848, 0.1418789178133011, 0.1591213345527649, 0.23682163655757904, 0.2832711338996887, -0.3737642467021942, 0.0311543270945549, 0.33048585057258606, 0.041840434074401855, -0.08856377750635147, 0.12949620187282562, 0.24539640545845032, 0.2427753359079361, -0.2580759525299072, -0.4980113208293915, -0.07324159145355225, 0.010365352034568787, 0.15298199653625488, 1.0651347637176514, -0.3188483715057373, -0.2834668755531311, 0.0743548721075058, -0.0008077174425125122, 0.6970158219337463, 0.1164979487657547, -0.260940819978714, 0.3354590833187103, -0.21530231833457947, -0.05213002488017082, -0.2056259959936142, 0.3161839246749878, -0.05351719632744789, -0.38143524527549744, -0.03073643147945404, 0.04525168240070343, 0.08809536695480347, 0.0736406147480011, -0.18265381455421448, 0.15021800994873047, 0.33546823263168335, -0.03630806878209114, 0.07664898037910461, -0.11901270598173141, -0.35014715790748596, -0.21331053972244263, -0.23232728242874146, -0.03147019445896149, -0.15123078227043152, 0.2589576244354248, -0.01778842881321907, 0.015140961855649948, 0.10851715505123138, -0.10917045921087265, -0.5198310017585754, 0.15902847051620483, -0.28374984860420227, -0.26490330696105957, -0.18733857572078705, -0.15330398082733154, 0.058704063296318054, 0.5819187760353088, 0.5288028120994568, -0.0791500136256218, -0.42739132046699524, 0.14896871149539948, -0.07171106338500977, 0.06601816415786743, 0.05448652058839798, -0.027680987492203712, 0.07156626880168915, -0.1966579109430313, -0.15502305328845978, 0.19098447263240814, 0.09106926620006561, -0.13824716210365295, -0.25829678773880005, 0.04875756800174713, 0.5852702260017395, 0.17149463295936584, 0.052848126739263535, 0.210751473903656, -0.2142046093940735, -0.10880020260810852, 0.014164171181619167, -0.14087790250778198, -0.16722248494625092, 0.1469080150127411, -0.3392793536186218, -0.1921525001525879, -0.0557459257543087, 0.4201357364654541, -0.05096374452114105, 0.04706472158432007, 0.5612228512763977, 0.03416723757982254, -0.16820506751537323, -0.05934956669807434, -0.1351885199546814, -0.07012719660997391, -0.42977064847946167, 0.09501009434461594, -0.10564132779836655, 0.15587235987186432, -0.2654730975627899, 0.30117496848106384, -0.07767674326896667, 0.04983878880739212, -0.1742165982723236, -0.20085588097572327, -0.09092190861701965, 0.13721497356891632, -0.13386091589927673, 0.037347909063100815, -0.053436025977134705, 0.07019851356744766, 0.21060582995414734, -0.1085272803902626, -0.13909797370433807, -0.23052692413330078, -0.1029244214296341, -0.017518309876322746, -0.17927587032318115, 0.11383206397294998, 0.11358842253684998, -0.08203466236591339, -0.08665300905704498, 0.13853877782821655, 0.022660281509160995, -0.04187888652086258, -0.16119077801704407, 0.20741517841815948, 0.09688635170459747, -0.14210961759090424, -0.00027925893664360046, -0.19889536499977112, -0.2830061912536621, -0.39699047803878784, 0.2553092837333679, 0.190293550491333, -0.05466294661164284, 0.17581269145011902, 0.485058069229126, 0.2491113841533661, -0.4220195710659027, -0.1723881959915161, 0.07108211517333984, 0.20867975056171417, 0.056530460715293884, 0.32056036591529846, 0.4527581036090851, -0.036353498697280884, -0.543766975402832, -0.014612078666687012, 0.13224977254867554, -0.015123410150408745, 0.32165735960006714, -0.14316719770431519, 0.2803913354873657, 0.05190158262848854, 0.09312538802623749, 0.27040842175483704, -0.18726111948490143, -0.0963691845536232, 0.21131162345409393, -0.004326893016695976, -0.10293255746364594, 0.03930233046412468, 0.013966497033834457, 0.05566101148724556, -0.03642371669411659, 0.28303539752960205, 0.030113771557807922, -0.18932051956653595, 0.47271624207496643, 0.005825497210025787, 0.24205712974071503, -0.7060971856117249, 0.12967118620872498, 0.3432742953300476, 0.061650440096855164, 0.3266792893409729, -0.27359986305236816, -0.013564045540988445, -0.04680752754211426, 0.5956479907035828, -0.2728615999221802, 0.18911457061767578, 0.10747037827968597, 0.10961738228797913, -0.13751909136772156, -0.19431579113006592, -0.3989015519618988, -0.2471207231283188, -0.30182796716690063, 0.29770421981811523, 0.1341850757598877, 0.09745864570140839, 0.16177138686180115, 0.11049339175224304, -0.12215176969766617, 0.006319399923086166, -0.027407115325331688, -0.10729774832725525, -0.3614981770515442, 0.07211209833621979, -0.07649165391921997, -0.10157216340303421, 0.24862423539161682, 0.1590639054775238, 0.09669911861419678, 0.2033318281173706, -0.16958758234977722, -0.16075655817985535, 0.19356533885002136, 0.14461930096149445, 0.15964451432228088, -0.16845087707042694, 0.4067174792289734, 0.1370929628610611, 0.2602723240852356, 0.046857159584760666, 0.06992078572511673, 0.19277554750442505, 0.32983243465423584, 0.25709521770477295, 0.24162349104881287, 0.06905724108219147, -0.05773047357797623, -0.09349443763494492, 0.5506805181503296, 0.15459704399108887, 0.5155318379402161, 0.13955242931842804, -0.07244820147752762, 0.04975445568561554, 0.2017499804496765, 0.15053638815879822, 0.24782022833824158, -0.19300775229930878, 0.4139023721218109, -0.26512765884399414, 0.07221271097660065, -0.29713839292526245, -0.0883868932723999, 0.02066248655319214, 0.28611522912979126, 0.14641493558883667, -0.309806227684021, 0.14287684857845306, -0.1046009361743927, -0.027164779603481293, -0.04068894311785698, 0.18010291457176208, 0.22020690143108368, 0.1832214593887329, -0.1920764297246933, -0.2980017066001892, -0.4625641107559204, 0.09024259448051453, 0.07369155436754227, 0.11706189811229706, 0.13281939923763275, 0.3102108836174011, -0.10108831524848938, 0.027877360582351685, -0.02991851419210434, -0.3623301386833191, 0.0876467376947403, 0.5618104338645935, -0.28569990396499634, -0.5416406393051147, 0.13000144064426422, 0.24649113416671753, -0.01511421799659729, -0.34270280599594116, 0.21287325024604797, -0.17544899880886078, -0.13592606782913208, 0.10361748188734055, -0.2636096179485321, 0.010239727795124054, 0.42691099643707275, 0.010891958139836788, 0.15366333723068237, 0.1841680407524109, -0.02898280695080757, 0.333159476518631, -0.4873127341270447, 0.06524572521448135, -0.1905340552330017, 0.18577799201011658, -0.13104884326457977, 0.18858222663402557, -0.14417950809001923, -0.19125621020793915, -0.15048840641975403, 0.12513606250286102, 0.2964513897895813, -0.091572105884552, -0.2358931601047516, 0.22055473923683167, -0.13149060308933258, 0.6817532777786255, -0.13294877111911774, 0.36386045813560486, 0.00797970686107874, 0.1565515547990799, -0.3677428662776947, -0.2640225291252136, 0.4869004786014557, -0.4265178143978119, -0.43845134973526, 0.1617879867553711, 0.07544254511594772, 0.20788496732711792, -0.18640699982643127, -0.37275180220603943, -0.037394292652606964, 0.3786779046058655, -0.16843055188655853, -0.13043218851089478, 0.17067986726760864, 0.15229937434196472, 0.3160434365272522, -0.02862032875418663, 0.25623220205307007, 0.37204989790916443, -0.2064376324415207, 0.25408434867858887, -0.22080868482589722 ]
https://github.com/huggingface/datasets/issues/5846
This is due to the slow resolution of the data files: https://github.com/huggingface/datasets/issues/5537. We plan to switch to `huggingface_hub`'s `HfFileSystem` soon to make the resolution faster (will be up to 20x faster once we merge https://github.com/huggingface/huggingface_hub/pull/1443)
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow!
### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
35
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow! ### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 This is due to the slow resolution of the data files: https://github.com/huggingface/datasets/issues/5537. We plan to switch to `huggingface_hub`'s `HfFileSystem` soon to make the resolution faster (will be up to 20x faster once we merge https://github.com/huggingface/huggingface_hub/pull/1443)
[ -0.5835384130477905, -0.4485812187194824, -0.06136574596166611, 0.2794361114501953, 0.23265546560287476, 0.024867437779903412, 0.07487990707159042, 0.212795227766037, 0.10379171371459961, -0.05269263684749603, -0.15228033065795898, 0.2630672752857208, -0.02050098590552807, 0.43237778544425964, -0.07923410832881927, 0.04650593921542168, 0.1792968064546585, 0.14983125030994415, 0.02686469256877899, -0.12264153361320496, -0.027274861931800842, 0.10551846772432327, -0.3042657971382141, -0.3094247579574585, -0.25261467695236206, 0.13771280646324158, -0.010792866349220276, 0.1561083197593689, -0.17618152499198914, -0.3710675835609436, 0.33879852294921875, 0.10724153369665146, -0.14201582968235016, 0.5205185413360596, -0.00011852234456455335, 0.04771875590085983, 0.3105064034461975, 0.11524438858032227, -0.31315258145332336, 0.1468973457813263, -0.17708531022071838, -0.39378947019577026, 0.04065137356519699, 0.17124618589878082, -0.15023042261600494, -0.1891828179359436, 0.03279145807027817, -0.41104722023010254, 0.3312772810459137, 0.18870440125465393, 0.15252168476581573, 0.390165776014328, -0.31106647849082947, -0.03840672969818115, -0.040617600083351135, 0.4723970592021942, -0.01640712097287178, 0.4518496096134186, 0.26073503494262695, 0.03733031451702118, 0.08677025884389877, 0.12085296213626862, -0.19681641459465027, 0.09367156773805618, 0.3209623694419861, 0.11915313452482224, -0.12081626057624817, -0.2097577601671219, -0.012127190828323364, 0.4134385585784912, 0.10567614436149597, -0.12987101078033447, -0.356215238571167, -0.4347577691078186, -0.12097716331481934, -0.42998433113098145, 0.2391119748353958, 0.021647196263074875, -0.004669636487960815, 0.004501885734498501, -0.25893425941467285, 0.0009391829371452332, 0.0701318234205246, -0.02291279286146164, -0.06484207510948181, -0.1748214066028595, -0.1241944432258606, 0.0892191082239151, 0.12445875257253647, 0.07299293577671051, 0.1091746836900711, -0.17244793474674225, 0.09198646247386932, 0.24565522372722626, -0.5266057252883911, 0.08664415776729584, 0.17785172164440155, 0.2876282036304474, 0.15127630531787872, 0.22414416074752808, -0.25514423847198486, 0.014923183247447014, -0.024442218244075775, 0.028263915330171585, 0.06732287257909775, 0.1864311397075653, -0.24131926894187927, -0.29919102787971497, 0.3879478871822357, -0.006040196865797043, 0.12347378581762314, 0.07770600914955139, -0.06548777222633362, -0.11307388544082642, -0.14604559540748596, -0.3009999990463257, 0.2383144646883011, -0.39364564418792725, -0.4269362986087799, 0.05065253749489784, 0.1251154989004135, -0.1448543667793274, 0.15200220048427582, 0.37848955392837524, -0.2668606638908386, 0.3081686496734619, -0.020741112530231476, -0.032799266278743744, -0.27504411339759827, -0.16703668236732483, -0.2890244126319885, -0.04530132934451103, -0.055239032953977585, 0.10262005776166916, 0.11968716233968735, -0.7308007478713989, 0.2175268828868866, 0.2839706242084503, 0.27278974652290344, -0.026706859469413757, -0.30426713824272156, 0.01434813067317009, -0.13326886296272278, 0.13250696659088135, -0.16940145194530487, 0.13482709228992462, 0.17405569553375244, 0.05566953122615814, -0.24376355111598969, -0.02588966116309166, -0.1359850913286209, -0.3863435685634613, -0.10971676558256149, 0.07034291326999664, -0.178992360830307, 0.016000166535377502, -0.5643688440322876, 0.3012901544570923, -0.13757085800170898, 0.227532297372818, -0.2650112509727478, 0.031896430999040604, -0.07528188824653625, -0.043692078441381454, 0.47323206067085266, 0.4142831265926361, -0.267744779586792, -0.04677536338567734, 0.16257160902023315, 0.08424577116966248, 0.43539467453956604, 0.47539499402046204, -0.23991796374320984, 0.1259719431400299, -0.2106741964817047, -0.22812528908252716, 0.23751410841941833, -0.2100132703781128, -0.4243752062320709, 0.3483428359031677, -0.27828341722488403, 0.20061957836151123, 0.20774109661579132, 0.28076428174972534, -0.07954040169715881, 0.025094598531723022, 0.00536745972931385, 0.483537882566452, 0.11462747305631638, 0.19064274430274963, -0.3384096324443817, -0.32032716274261475, 0.032092925161123276, 0.6032393574714661, -0.358901709318161, -0.05751437321305275, 0.023500965908169746, -0.024623319506645203, 0.2616932690143585, -0.038708873093128204, -0.21123984456062317, 0.18006736040115356, 0.2673502564430237, 0.04822314530611038, -0.03593269735574722, 0.29931509494781494, -0.12511800229549408, 0.31280988454818726, 0.13016636669635773, -0.056171026080846786, 0.051604270935058594, -0.2514270544052124, -0.046675316989421844, 0.12496503442525864, -0.13436149060726166, -0.15485316514968872, -0.07679954916238785, 0.0939406305551529, 0.4788362979888916, 0.3146396279335022, -0.2667572796344757, 0.6517146229743958, -0.18862149119377136, 0.15285971760749817, -0.5356466770172119, 0.1627737581729889, 0.26598310470581055, 0.09723597764968872, 0.16097092628479004, -0.013920564204454422, -0.010159973055124283, -0.2614338994026184, -0.15578532218933105, 0.41173815727233887, 0.0152345672249794, 0.3070283830165863, -0.01763700507581234, 0.01756276935338974, 0.22910098731517792, -0.07100260257720947, 0.3408549129962921, 0.0886974185705185, 0.09760230779647827, -0.20317959785461426, -0.1705286055803299, 0.4703682065010071, -0.008905664086341858, 0.3015269935131073, 0.005563102662563324, -0.19691745936870575, 0.10598301142454147, 0.15180757641792297, 0.2022356390953064, 0.19446156919002533, 0.5097765922546387, -0.12780219316482544, 0.39964985847473145, 0.14085380733013153, -0.2363034188747406, 0.07848578691482544, 0.5684576630592346, 0.07487930357456207, -0.37396955490112305, 0.3919101655483246, -0.14207366108894348, -0.18228693306446075, 0.07503673434257507, -0.22132664918899536, 0.5916600227355957, 0.1711745262145996, -0.07710644602775574, 0.12726587057113647, 0.06669539213180542, -0.17046120762825012, 0.3044578731060028, -0.07463009655475616, -0.04212182015180588, -0.14586618542671204, 0.21488206088542938, -0.08709169924259186, -0.4752577245235443, -0.19593468308448792, -0.135563462972641, 0.2714136242866516, -0.10441335290670395, 0.21232694387435913, -0.06160985678434372, -0.15269729495048523, 0.021010320633649826, 0.11333704739809036, -0.20184366405010223, -0.3259772062301636, -0.058544911444187164, 0.20080985128879547, 0.2534075379371643, 0.028451621532440186, -0.004275619983673096, 0.23440173268318176, 0.01521950215101242, -0.21317045390605927, -0.3521040081977844, -0.05725167691707611, -0.22597980499267578, -0.03144235536456108, 0.20318511128425598, -0.06273156404495239, 0.2282509058713913, -0.257139652967453, -0.25675472617149353, -0.013562142848968506, -0.24128109216690063, -0.05428054556250572, -0.24328342080116272, 0.19270631670951843, 0.009761929512023926, 0.25185707211494446, -0.022862300276756287, -0.10019123554229736, 0.2236742377281189, -0.15350788831710815, -0.17566335201263428, 0.04071832448244095, -0.20490409433841705, -0.049801070243120193, 0.0415957048535347, -0.006348170340061188, -0.3092823922634125, -0.3293599486351013, 0.7144861817359924, -0.0708947405219078, -0.1279018521308899, 0.05451657250523567, 0.1484490931034088, 0.200067937374115, -0.09893424808979034, 0.24842937290668488, -0.2478618174791336, -0.5988335609436035, 0.2711181640625, -0.015119768679141998, -0.31350159645080566, -0.18700571358203888, 0.2766389846801758, 0.20704370737075806, -0.20789332687854767, -0.8299635648727417, -0.13015340268611908, -0.5958823561668396, -0.02670522779226303, -0.18033228814601898, 0.1618887335062027, 0.005075432360172272, -0.1401502788066864, -0.04553863778710365, 0.07952414453029633, -0.06230770796537399, -0.11613534390926361, -0.08167652785778046, 0.07598211616277695, -0.011648721061646938, 0.5901526212692261, -0.07840600609779358, 0.4698801040649414, 0.6750319004058838, -0.21629387140274048, 0.14555606245994568, -0.08825425058603287, 0.42369717359542847, -0.2815554141998291, -0.3084813952445984, 0.16087797284126282, 0.043851662427186966, -0.1060798168182373, 0.31948041915893555, 0.05516138672828674, -0.12967893481254578, -0.24580678343772888, -0.1763523519039154, 0.08953016996383667, -0.03687947615981102, -0.13997575640678406, -0.05108107253909111, -0.2638096213340759, -0.04068402573466301, 0.1935732513666153, -0.031449027359485626, -0.2675136923789978, 0.15086664259433746, 0.05209869146347046, 0.042733628302812576, -0.022546501830220222, -0.10102418065071106, 0.014996189624071121, -0.7314639687538147, 0.3448052704334259, -0.15752191841602325, 0.14538045227527618, 0.07279481738805771, -0.10661916434764862, 0.4122718572616577, -0.023828087374567986, 0.6703757047653198, 0.2903488576412201, -0.028621502220630646, -0.016746725887060165, -0.2814341187477112, -0.5444620847702026, -0.022458240389823914, -0.03756863996386528, 0.18728673458099365, 0.28928861021995544, 0.11064691841602325, -0.28632619976997375, -0.17255213856697083, 0.041378337889909744, 0.17455607652664185, 0.09012579917907715, -0.17090708017349243, -0.3602878451347351, -0.22082483768463135, -0.0994792953133583, 0.06722291558980942, 0.05149150639772415, 0.12970274686813354, -0.13432300090789795, -0.06310608983039856, -0.17876411974430084, -0.012487374246120453, 0.3122043013572693, 0.2918418049812317, 0.2085724174976349, -0.0853344202041626, 0.4922058880329132, 0.24401390552520752, 0.05675310268998146, 0.15046493709087372, 0.9647653698921204, 0.09534263610839844, -0.36601755023002625, -0.06345552206039429, 0.3150321841239929, 0.4287547767162323, 0.512466549873352, -0.18284228444099426, 0.08614196628332138, -0.07496374845504761, 0.331693172454834, -0.49020424485206604, 0.3346906900405884, 0.40957480669021606, 0.20459485054016113, -0.30880507826805115, -0.36482176184654236, 0.6533303260803223, 0.19409242272377014, 0.06918250024318695, 0.6634700298309326, 0.17031848430633545, 0.16001054644584656, 0.11281053721904755, -0.18735551834106445, 0.922822117805481, -0.10902580618858337, 0.2722870707511902, 0.14954990148544312, 0.06435567140579224, 0.39526501297950745, -0.2938496768474579, 0.012926105409860611, -0.3666369318962097, -0.38572001457214355, 0.13454580307006836, -0.15229357779026031, 0.0022279443219304085, -0.16158704459667206, 0.04350000619888306, 0.164484903216362, 0.058687299489974976, 0.3131270408630371, -0.2823143005371094, 0.37260866165161133, -0.09725908935070038, -0.19781138002872467, -0.5707182288169861, 0.14623817801475525, -0.004292198456823826, 0.2620634138584137, 0.07218296825885773, 0.004779256880283356, -0.17130355536937714, -0.0704180896282196, -0.17740929126739502, 0.1447952538728714, -0.20240752398967743, 0.19119714200496674, 0.019134895876049995, -0.14014030992984772, -0.018113277852535248, 0.14608150720596313, 0.26902273297309875, 0.172997385263443, -0.19375354051589966, 0.3137958347797394, 0.037689439952373505, 0.13381561636924744, 0.27138271927833557, -0.03114466927945614, -0.13959378004074097, 0.018262922763824463, 0.09043273329734802, 0.02234087698161602, -0.1557239592075348, -0.14093677699565887, 0.01684953272342682, 0.09159980714321136, -0.08731544762849808, -0.05256003513932228, -0.07473225146532059, 0.019840780645608902, 0.38525015115737915, -0.13930775225162506, 0.07845556735992432, 0.40862831473350525, -0.021246373653411865, 0.21090459823608398, 0.04368190839886665, -0.4762183129787445, -0.2855890989303589, 0.5094873905181885, 0.014804061502218246, -0.13191275298595428, 0.23853959143161774, 0.12633895874023438, -0.2876933515071869, -0.019016332924365997, 0.19423580169677734, 0.1339932531118393, -0.38571447134017944, 0.20851176977157593, 0.03904340788722038, 0.07653239369392395, 0.07914815843105316, -0.04776345565915108, -0.10411977767944336, -0.3195874094963074, -0.02435074746608734, -0.10924302786588669, -0.2637443542480469, -0.01707536354660988, -0.13914841413497925, 0.2959902286529541, 0.09867104887962341, -0.1562899798154831, -0.3404238224029541, 0.0852346196770668, -0.24667508900165558, 0.0828309953212738, -0.0033776089549064636, -0.12795484066009521, -0.02762107364833355, -0.04719309136271477, 0.4950646460056305, 0.04971836134791374, 0.08194912225008011, 0.05206923559308052, -0.18044108152389526, -0.16159212589263916, -0.057247936725616455, 0.18211571872234344, -0.13594083487987518, -0.2012767642736435, 0.20148274302482605, -0.07190701365470886, -0.3723668158054352, -0.36735814809799194, 0.4051567316055298, 0.17087548971176147, -0.04378439486026764, -0.39672669768333435, 0.2566870152950287, -0.14326664805412292, -0.02438778430223465, 0.10772566497325897, -0.17409804463386536, 0.12483793497085571, 0.1061495989561081, -0.03618206828832626, -0.0786999836564064, -0.19126135110855103, -0.046365004032850266, 0.180361807346344, 0.26585012674331665, -0.07766538858413696, 0.2886750102043152, -0.22055180370807648, -0.13204726576805115, -0.0675799623131752, 0.32190847396850586, 0.48054420948028564, -0.02704017050564289, -0.08911987394094467, 0.009530041366815567, 0.0612587034702301, -0.2504381835460663, -0.23759233951568604, 0.11035425961017609, 0.20822283625602722, 0.09721698611974716, 0.21505305171012878, 0.3703819811344147, 0.2083805948495865, -0.002665892243385315, -0.04566274210810661, 0.3023378252983093, 0.1514388918876648, 0.07193374633789062, 0.20960670709609985, 0.15118885040283203, -0.10467924922704697, 0.13583897054195404, 0.353065550327301, 0.20299220085144043, 0.5022947192192078, -0.2793857753276825, 0.3790840804576874, -0.4001372158527374, 0.22179202735424042, -0.14142102003097534, -0.3140154480934143, -0.13360221683979034, 0.18719786405563354, -0.3170267939567566, 0.10467364639043808, -0.006252128630876541, 0.28316423296928406, -0.2339506894350052, -0.30803823471069336, -0.40103718638420105, 0.3350437581539154, 0.021860118955373764, -0.09752513468265533, 0.41426438093185425, 0.04072846472263336, -0.24428217113018036, 0.1990927904844284, 0.006844373419880867, -0.21100297570228577, 0.15206244587898254, 0.19637176394462585, 0.06149628385901451, -0.21014684438705444, -0.10766695439815521, -0.00946449302136898, 0.39517149329185486, -0.04337247461080551, 0.11046329140663147, 0.11348675191402435, -0.07843741774559021, 0.16960500180721283, 0.28642940521240234, 0.5130659341812134, 0.17539282143115997, -0.025302331894636154, -0.03451253101229668, 0.020976364612579346, 0.010763905942440033, 0.03216367959976196, 0.44346749782562256, -0.3475472033023834, 0.2504049837589264, 0.18220072984695435, 0.031243354082107544, -0.1245952695608139, -0.32450664043426514, -0.35080990195274353, 0.2516694664955139, -0.29764989018440247, 0.3609252870082855, -0.25054267048835754, 0.09189170598983765, -0.5452854037284851, 0.11189833283424377, -0.4095876216888428, -0.3507838547229767, 0.28730636835098267, -0.07847387343645096, -0.00489262118935585, -0.10825797915458679, 0.05870227888226509, -0.20144326984882355, 0.5900703072547913, 0.38015156984329224, 0.42840442061424255, -0.11816844344139099, -0.21993882954120636, -0.5328553318977356, -0.1240791529417038, -0.2694375813007355, 0.07012128084897995, 0.07611027359962463, 0.09260329604148865, 0.14213180541992188, 0.12276483327150345, -0.05327417701482773, 0.0855344831943512, -0.1821051836013794, -0.1442573368549347, -0.3237687051296234, -0.1013837456703186, -0.3029666841030121, -0.2450437694787979, -0.04924725741147995, -0.20800933241844177, 0.32569289207458496, -0.3525305390357971, -0.04471540451049805, -0.14533965289592743, 0.1993827372789383, -0.12678277492523193, -0.029958762228488922, 0.4620223939418793, 0.10741660743951797, 0.06631012260913849, 0.12866222858428955, -0.2424713671207428, -0.25736677646636963, -0.014456221833825111, -0.09431950747966766, 0.3019726276397705, -0.27083268761634827, 0.25948816537857056, -0.18214726448059082, -0.5602493286132812, -0.101345956325531, 0.4020161032676697, 0.15619352459907532, -0.20472940802574158, -0.13318468630313873, 0.010630562901496887, -0.31157344579696655, 0.4983733594417572, 0.269137978553772, 0.13909253478050232, 0.0042312853038311005, 0.05766764283180237, -0.23956988751888275, -0.18396005034446716, 0.6234109401702881, -0.2781798541545868, -0.01781417801976204, -0.04103471711277962, 0.053843457251787186, 0.3581278920173645, 0.08075448870658875, -0.49891671538352966, 0.13107529282569885, 0.20390614867210388, -0.12988989055156708, -0.033479344099760056, 0.5166987776756287, -0.1673068255186081, -0.04113150015473366, -0.12859795987606049, 0.11518159508705139, -0.14859068393707275, -0.20098876953125, 0.22523227334022522, -0.12598781287670135 ]
https://github.com/huggingface/datasets/issues/5846
You're right, when I try to parse more than 50GB of text data, I also get very slow, usually taking hours or even tens of hours.
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow!
### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
26
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow! ### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 You're right, when I try to parse more than 50GB of text data, I also get very slow, usually taking hours or even tens of hours.
[ -0.6187251806259155, -0.1993492990732193, -0.1015913113951683, 0.25945907831192017, 0.1967843770980835, 0.07397590577602386, 0.15669342875480652, 0.23013529181480408, 0.05619114637374878, -0.0416470468044281, -0.04566510394215584, 0.29201459884643555, 0.07512497901916504, 0.2854866087436676, -0.27679160237312317, 0.17261247336864471, 0.18776607513427734, 0.06291616708040237, 0.08229833841323853, -0.11004167050123215, -0.10654033720493317, -0.019475489854812622, -0.2897040545940399, -0.386821985244751, -0.17346279323101044, 0.05472420156002045, 0.12121468782424927, -0.012949969619512558, -0.1782882809638977, -0.41000741720199585, 0.042368143796920776, -0.03264118731021881, -0.11799295246601105, 0.6662989854812622, -0.00011440656089689583, -0.033155590295791626, 0.32355996966362, 0.11121156066656113, -0.29052266478538513, 0.06532442569732666, -0.2158663123846054, -0.3998357057571411, 0.1260083168745041, -0.01257374882698059, -0.061829112470149994, -0.12316203117370605, -0.039787523448467255, -0.3901526927947998, 0.21493206918239594, 0.3714941143989563, 0.1371922791004181, 0.07811743021011353, -0.2673024535179138, -0.0025292634963989258, 0.10080473124980927, 0.16688215732574463, -0.07585544139146805, 0.27785250544548035, 0.2703103721141815, 0.11687120050191879, 0.05824749544262886, 0.1837490200996399, -0.24958911538124084, 0.2150796800851822, 0.18857064843177795, 0.2076983004808426, 0.05702284723520279, -0.2865264415740967, 0.19723941385746002, 0.47695237398147583, 0.2078176587820053, 0.03979884460568428, -0.2985501289367676, -0.4957294762134552, -0.22204981744289398, -0.36893758177757263, 0.17973212897777557, 0.2119663506746292, -0.0671745166182518, 0.14053067564964294, -0.16408008337020874, -0.024958599358797073, 0.028162546455860138, 0.0024224091321229935, -0.2903258204460144, 0.04151248186826706, -0.05868222564458847, -0.0033395271748304367, 0.1877392828464508, -0.029770245775580406, 0.33049482107162476, -0.2331307977437973, 0.11893883347511292, 0.18480366468429565, -0.4722255766391754, 0.12819284200668335, 0.16828936338424683, -0.04365653172135353, 0.0762287825345993, 0.12890246510505676, -0.13479770720005035, 0.10282398760318756, -0.057527028024196625, 0.1356886774301529, 0.2574835419654846, 0.05881914123892784, -0.3111928105354309, -0.18950650095939636, 0.39530321955680847, -0.3044218420982361, -0.0062785521149635315, 0.06362216174602509, -0.05819873884320259, -0.08811568468809128, -0.06898806244134903, -0.33236008882522583, 0.18765176832675934, -0.39277517795562744, -0.36157530546188354, 0.06036057323217392, 0.0911916047334671, -0.10724709928035736, 0.07836905121803284, 0.3178786039352417, -0.1895526945590973, 0.4348979592323303, -0.23573465645313263, 0.061741601675748825, -0.24833986163139343, -0.34485501050949097, -0.22145341336727142, -0.07612209022045135, -0.061846427619457245, -0.11057790368795395, 0.06863345950841904, -0.4720015227794647, 0.015040569007396698, 0.15323524177074432, 0.03564416617155075, -0.15773192048072815, -0.2594013512134552, -0.23359602689743042, -0.02336845174431801, 0.1257130354642868, -0.126493901014328, 0.19060595333576202, 0.14804750680923462, 0.06996819376945496, -0.24364615976810455, 0.20289987325668335, -0.18119221925735474, -0.4925753176212311, -0.00031976960599422455, 0.13180769979953766, -0.17583277821540833, -0.1451818197965622, -0.502660870552063, 0.4431527853012085, -0.018986128270626068, 0.25194162130355835, -0.34710121154785156, -0.03477681428194046, 0.00889800488948822, -0.08685171604156494, 0.31343016028404236, 0.3045162558555603, -0.44833889603614807, 0.20093154907226562, 0.0236956849694252, 0.22244738042354584, 0.5336673259735107, 0.5956605672836304, -0.243617981672287, 0.14825335144996643, -0.03632069379091263, -0.04319214075803757, 0.29195600748062134, -0.028895478695631027, -0.38238462805747986, 0.4692975580692291, -0.19625866413116455, 0.042825087904930115, 0.17068852484226227, 0.15642890334129333, 0.11885055899620056, -0.02841898985207081, 0.07509004324674606, 0.5632668733596802, 0.21425291895866394, 0.23078489303588867, -0.31055963039398193, -0.1863667368888855, 0.14828917384147644, 0.4843343496322632, -0.15942534804344177, -0.09420314431190491, 0.0925726443529129, -0.0842287689447403, 0.19855865836143494, -0.09900645166635513, -0.23425626754760742, 0.17404259741306305, 0.17977222800254822, 0.16684719920158386, -0.03585130721330643, 0.1902364194393158, 0.1854175329208374, 0.20797380805015564, 0.3238131105899811, -0.08032909035682678, 0.03143448382616043, -0.09173183143138885, -0.009487822651863098, 0.20233726501464844, -0.0538569837808609, -0.0759648010134697, -0.033810362219810486, 0.02216583862900734, 0.31417497992515564, 0.28552988171577454, -0.22873634099960327, 0.46308332681655884, -0.24096538126468658, 0.19835270941257477, -0.19808454811573029, -0.07196948677301407, 0.18503986299037933, -0.006945392116904259, 0.15478083491325378, -0.05500177666544914, -0.1402682363986969, -0.11625008285045624, -0.12899738550186157, 0.33557412028312683, 0.11572946608066559, 0.142422616481781, -0.21485528349876404, -0.03076823800802231, 0.14730288088321686, -0.16656318306922913, 0.2791479229927063, 0.18333293497562408, 0.19102483987808228, -0.28135406970977783, -0.2758425772190094, 0.17535004019737244, 0.13269637525081635, 0.4809657633304596, 0.004562005400657654, -0.27100053429603577, 0.22487258911132812, 0.10885819047689438, 0.3956789970397949, 0.1667492389678955, 0.44294533133506775, -0.1924298256635666, 0.3420434296131134, 0.10968288779258728, -0.16162367165088654, 0.05323700234293938, 0.522703230381012, 0.020774394273757935, -0.2693447768688202, 0.3890187740325928, -0.14453546702861786, -0.23994052410125732, -0.07633501291275024, -0.2568551301956177, 0.3888925015926361, 0.2361917346715927, 0.07613924145698547, 0.011976787820458412, 0.13134120404720306, -0.2568148970603943, 0.3294929265975952, 0.11757135391235352, 0.013035383075475693, -0.10429147630929947, 0.38961341977119446, -0.02323070354759693, -0.4405781626701355, -0.3216533362865448, -0.018305297940969467, 0.3789238929748535, -0.055983953177928925, 0.2659357786178589, -0.053455084562301636, -0.2045031487941742, 0.20765772461891174, 0.2892152965068817, 0.05350617319345474, -0.48300790786743164, -0.04110252857208252, 0.08294675499200821, 0.1819877028465271, -0.14471164345741272, -0.06841003894805908, 0.2201789766550064, 0.11216938495635986, -0.24696531891822815, -0.19948875904083252, -0.19043947756290436, -0.249551460146904, 0.002273149788379669, 0.2598986327648163, -0.10816573351621628, 0.13304182887077332, -0.030332308262586594, -0.21140217781066895, 0.09711943566799164, -0.2780393362045288, 0.009664426557719707, -0.16035902500152588, 0.10781261324882507, -0.21968287229537964, 0.1642484962940216, 0.16050565242767334, -0.06705468147993088, 0.05852425470948219, -0.15935462713241577, -0.18290722370147705, 0.2518567442893982, 0.018517769873142242, -0.11170117557048798, 0.10413049161434174, -0.21252119541168213, -0.27838146686553955, -0.4445553719997406, 0.629716157913208, -0.031666554510593414, -0.04298853129148483, 0.11200722306966782, 0.23624737560749054, 0.13959871232509613, 0.04086349159479141, 0.22872808575630188, -0.11046643555164337, -0.25509005784988403, 0.44121846556663513, 0.044097915291786194, -0.21107549965381622, -0.1565534919500351, 0.30406638979911804, 0.08304072916507721, -0.11363999545574188, -0.7186357975006104, 0.3088563084602356, -0.7640264630317688, -0.08164148777723312, -0.1754087507724762, 0.1471376121044159, 0.029130106791853905, -0.14993175864219666, -0.09098269045352936, 0.12640760838985443, -0.013959605246782303, -0.1926315873861313, 0.05696102976799011, 0.026550844311714172, 0.08540903031826019, 0.6477880477905273, -0.009654529392719269, 0.27155542373657227, 0.48553192615509033, -0.09791679680347443, 0.09503176808357239, -0.053973257541656494, 0.27148517966270447, -0.3017653822898865, -0.1748829334974289, 0.10153853893280029, -0.03599373996257782, -0.2785634994506836, 0.40575966238975525, 0.0538376159965992, -0.43012797832489014, -0.2638302743434906, -0.1943337619304657, -0.06887535005807877, -0.06378104537725449, 0.03881256282329559, -0.16132767498493195, -0.3190644681453705, -0.0485767126083374, 0.23386792838573456, -0.022570785135030746, -0.2890876531600952, 0.023595791310071945, -0.177684485912323, -0.07392829656600952, -0.09740124642848969, -0.05527930706739426, 0.26313138008117676, -0.6228417158126831, 0.3802371323108673, -0.2835661768913269, 0.19115489721298218, 0.20429326593875885, -0.1232430636882782, 0.4031696021556854, -0.14400377869606018, 0.4302619993686676, -0.025843998417258263, 0.012597441673278809, -0.024476371705532074, -0.2119227647781372, -0.4018869996070862, -0.029450353235006332, -0.27665138244628906, 0.1680608093738556, 0.4598926901817322, -0.21317243576049805, -0.327258825302124, -0.05239405483007431, 0.13882651925086975, 0.1390388458967209, 0.17104029655456543, -0.21131451427936554, -0.16024866700172424, -0.19803237915039062, -0.13187333941459656, 0.10268466174602509, 0.1281149685382843, 0.11939004063606262, -0.08053264766931534, -0.03993002325296402, -0.2827954590320587, -0.06143391132354736, 0.5136486291885376, 0.22460727393627167, 0.08984898030757904, -0.27082598209381104, 0.4378276467323303, 0.009974703192710876, -0.14511758089065552, 0.18407242000102997, 0.9147035479545593, 0.2942115068435669, -0.3955061435699463, -0.0169563926756382, 0.18032220005989075, 0.4844508171081543, 0.40601471066474915, -0.11025024205446243, 0.010225687175989151, -0.1637597531080246, 0.40202486515045166, -0.29253023862838745, 0.33467867970466614, 0.2920052111148834, 0.17189782857894897, -0.385673463344574, -0.4962776005268097, 0.6580429077148438, 0.27534329891204834, -0.011168248951435089, 0.5249018669128418, -0.19661596417427063, 0.03708408772945404, 0.3882874548435211, -0.24402886629104614, 0.858527660369873, -0.22543217241764069, 0.18870288133621216, -0.13586100935935974, 0.15973418951034546, 0.3181340992450714, -0.6056818962097168, 0.11848601698875427, -0.27141183614730835, -0.09753982722759247, 0.15963603556156158, -0.11514656245708466, -0.10116548836231232, -0.01215105876326561, 0.024141937494277954, 0.13610342144966125, -0.04489889740943909, 0.3630939722061157, -0.1785971075296402, 0.488564133644104, -0.26036402583122253, -0.15892037749290466, -0.3642953038215637, 0.18219302594661713, -0.052219729870557785, 0.012836700305342674, 0.12128555774688721, 0.03658488392829895, -0.17511552572250366, -0.06287786364555359, -0.4614458680152893, 0.20777162909507751, -0.11300700902938843, 0.27885448932647705, -0.06628303229808807, -0.2568199336528778, 0.06320320069789886, 0.1053844764828682, 0.04125092551112175, 0.3049537241458893, -0.13536043465137482, 0.23625439405441284, 0.028440717607736588, 0.1077764630317688, 0.43153783679008484, -0.12829537689685822, -0.039512522518634796, 0.010355420410633087, 0.05841469764709473, 0.07131385803222656, -0.1749027520418167, -0.2676294445991516, -0.030689671635627747, 0.2299109399318695, -0.07392359524965286, -0.06903521716594696, -0.01611817255616188, 0.17090831696987152, 0.11346288025379181, -0.10053987801074982, 0.10456441342830658, 0.2825697958469391, -0.1046004593372345, 0.3788430392742157, 0.007780996151268482, -0.5751612782478333, -0.32755234837532043, 0.3401581346988678, 0.09098702669143677, -0.028010766953229904, 0.24218422174453735, 0.2553497552871704, -0.3369719684123993, -0.08807498216629028, 0.10984718054533005, -0.031861696392297745, -0.16954514384269714, 0.2566754221916199, -0.24049335718154907, -0.06159032881259918, 0.27155306935310364, -0.1095791757106781, -0.12699216604232788, -0.19805209338665009, -0.1962011158466339, -0.23189455270767212, -0.04471547529101372, -0.026775263249874115, -0.20591706037521362, 0.16121825575828552, -0.009521245956420898, -0.13965056836605072, -0.3115406334400177, 0.05339667946100235, -0.25041794776916504, 0.13083304464817047, 0.06213095039129257, 0.011219697073101997, -0.13813790678977966, -0.18326254189014435, 0.28693845868110657, -0.013003252446651459, 0.09724242985248566, 0.17487850785255432, -0.014854537323117256, -0.18720227479934692, 0.05356407165527344, 0.16493640840053558, -0.038850486278533936, -0.16507349908351898, 0.07599568367004395, -0.17906944453716278, -0.348943293094635, -0.3405470848083496, 0.34579288959503174, 0.1440979242324829, -0.023765727877616882, -0.5152482390403748, 0.26130354404449463, -0.10632827877998352, -0.11271122843027115, 0.211062490940094, -0.3363870680332184, 0.31002911925315857, 0.15369944274425507, 0.06753593683242798, 0.18395936489105225, -0.08157624304294586, -0.11095079034566879, 0.1901487410068512, 0.23058395087718964, 0.0250997357070446, 0.3117053806781769, -0.33230844140052795, 0.06175267696380615, 0.034429244697093964, 0.2585945129394531, 0.6825277805328369, 0.02530362457036972, -0.2720036506652832, 0.06892965734004974, 0.09047137945890427, -0.16610535979270935, -0.23574578762054443, 0.031971681863069534, 0.17521247267723083, 0.0679621696472168, 0.3885725736618042, 0.35505616664886475, 0.15469922125339508, -0.14271482825279236, 0.0010023713111877441, 0.37667128443717957, 0.22614553570747375, 0.04557821899652481, 0.29183724522590637, 0.13660718500614166, -0.2007960081100464, 0.10540501773357391, 0.3333151638507843, 0.30497416853904724, 0.7552297115325928, -0.1261383593082428, 0.3269060552120209, -0.06102759391069412, 0.1808440089225769, -0.2410513013601303, -0.23428112268447876, -0.10255621373653412, 0.21157945692539215, -0.2953653633594513, 0.16770347952842712, -0.0032389461994171143, 0.0028684064745903015, -0.03431776538491249, -0.07864740490913391, -0.46017125248908997, 0.31385883688926697, 0.03368649631738663, -0.08322251588106155, 0.41016846895217896, 0.06889452040195465, -0.18042758107185364, 0.25524812936782837, -0.07453979551792145, -0.1603747010231018, 0.08578357100486755, 0.21421529352664948, 0.045017484575510025, -0.2337765246629715, 0.22114594280719757, -0.27189451456069946, 0.45239830017089844, -0.22194232046604156, 0.1360921710729599, 0.027890589088201523, 0.050363846123218536, 0.17826074361801147, 0.19466057419776917, 0.6197755336761475, 0.32626163959503174, -0.25181445479393005, -0.07322090864181519, -0.16976410150527954, -0.15033361315727234, -0.061897654086351395, 0.438602089881897, -0.2988373637199402, 0.47505536675453186, 0.26939114928245544, 0.02328665554523468, -0.16265133023262024, -0.25767964124679565, -0.239507257938385, 0.14545823633670807, -0.26423269510269165, 0.16231445968151093, 0.15795348584651947, 0.004610568284988403, -0.45103034377098083, -0.06645387411117554, -0.4034510850906372, -0.4586316645145416, 0.42259520292282104, -0.27650201320648193, 0.017300650477409363, 0.09173955768346786, 0.06470762938261032, -0.22450807690620422, 0.5518736243247986, 0.4062957167625427, 0.40548479557037354, -0.04921253025531769, -0.04928673058748245, -0.41880160570144653, -0.15970897674560547, -0.5936610102653503, -0.038372352719306946, 0.03643712028861046, 0.272441029548645, 0.23516800999641418, 0.39680248498916626, -0.17110444605350494, 0.20761355757713318, -0.37115737795829773, -0.03400880843400955, -0.372387558221817, -0.15392036736011505, -0.15694260597229004, -0.20176152884960175, -0.10073153674602509, -0.23868641257286072, 0.3446463644504547, -0.33711692690849304, 0.013043999671936035, -0.11858069151639938, 0.11877762526273727, -0.02542026713490486, -0.13675834238529205, 0.4542384147644043, 0.15141882002353668, 0.13452957570552826, 0.1629657745361328, -0.08660624921321869, -0.2678937613964081, -0.03282306343317032, -0.08585692942142487, 0.5382452607154846, -0.0965438187122345, 0.0954613983631134, -0.1870764195919037, -0.425886332988739, 0.1090778261423111, 0.2834831476211548, -0.03166191652417183, -0.12303674221038818, -0.08720749616622925, -0.11407449841499329, -0.1905694156885147, 0.5626289248466492, 0.24235250055789948, 0.06662224233150482, -0.004511471837759018, -0.0324728786945343, -0.2686028778553009, -0.3964196443557739, 0.2778376340866089, -0.20351901650428772, -0.20065127313137054, -0.14870670437812805, 0.014385387301445007, 0.4949963688850403, 0.3514222204685211, -0.4814116954803467, 0.10238903760910034, 0.26805055141448975, -0.22621631622314453, -0.2624174952507019, 0.33861997723579407, -0.05051407963037491, -0.1397840976715088, -0.17492902278900146, 0.08357486128807068, -0.1418931484222412, -0.23715853691101074, -0.12087788432836533, -0.08958717435598373 ]
https://github.com/huggingface/datasets/issues/5846
> You're right, when I try to parse more than 50GB of text data, I also get very slow, usually taking hours or even tens of hours. That's unrelated to the problem discussed in this issue.
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow!
### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
36
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow! ### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 > You're right, when I try to parse more than 50GB of text data, I also get very slow, usually taking hours or even tens of hours. That's unrelated to the problem discussed in this issue.
[ -0.5950614809989929, -0.1920388787984848, -0.10719016194343567, 0.20276544988155365, 0.20339643955230713, 0.03242965042591095, 0.18380331993103027, 0.25342410802841187, 0.05174969136714935, -0.013370223343372345, -0.057919375598430634, 0.3059339225292206, 0.05831361562013626, 0.3081280589103699, -0.28077512979507446, 0.19597022235393524, 0.15654492378234863, 0.03223707526922226, 0.06949427723884583, -0.09751223027706146, -0.08715563267469406, 0.002165514975786209, -0.27447938919067383, -0.41659224033355713, -0.15928372740745544, 0.07080069184303284, 0.10766877979040146, -0.009972013533115387, -0.1570519506931305, -0.4381691813468933, 0.04827398061752319, -0.010684434324502945, -0.1417301446199417, 0.6159912943840027, -0.00011075696966145188, -0.03745220601558685, 0.29625532031059265, 0.09781717509031296, -0.3009178042411804, 0.018414489924907684, -0.18865051865577698, -0.4021461308002472, 0.10521043092012405, -0.03633395582437515, -0.07347924262285233, -0.13187679648399353, -0.008767690509557724, -0.3490336537361145, 0.25277259945869446, 0.3747779428958893, 0.1736074686050415, 0.07444261014461517, -0.23558518290519714, -0.006009884178638458, 0.09129387885332108, 0.1639261245727539, -0.06091457977890968, 0.2805279791355133, 0.267404168844223, 0.14123594760894775, 0.04387656971812248, 0.19133783876895905, -0.22640401124954224, 0.21057015657424927, 0.1366727352142334, 0.1966523677110672, 0.043713103979825974, -0.27051323652267456, 0.19418475031852722, 0.47597870230674744, 0.19231709837913513, 0.04130307957530022, -0.3266574442386627, -0.4913979768753052, -0.17771275341510773, -0.3412500321865082, 0.16976557672023773, 0.2104787826538086, -0.09405535459518433, 0.14500117301940918, -0.15412868559360504, -0.016532622277736664, 0.026949569582939148, 0.00434773787856102, -0.3264029622077942, 0.01389254629611969, -0.0939222127199173, -0.027462944388389587, 0.14804625511169434, -0.02896217443048954, 0.2911187708377838, -0.20414242148399353, 0.1504356861114502, 0.16326341032981873, -0.4319695830345154, 0.13119500875473022, 0.17505338788032532, -0.06868195533752441, 0.09082166850566864, 0.09957005083560944, -0.11151596158742905, 0.1101217195391655, -0.048080239444971085, 0.1272405982017517, 0.24166427552700043, 0.03905694559216499, -0.30650845170021057, -0.2125270813703537, 0.4248237907886505, -0.28126150369644165, -0.01527354121208191, 0.039088085293769836, -0.0833374559879303, -0.05382867529988289, -0.09783067554235458, -0.3199032247066498, 0.2019110471010208, -0.3804285228252411, -0.35756945610046387, 0.037390973418951035, 0.11234978586435318, -0.10438133031129837, 0.049547791481018066, 0.34533917903900146, -0.16827388107776642, 0.4512600898742676, -0.23353791236877441, 0.04843321815133095, -0.2216697335243225, -0.3349399268627167, -0.23137037456035614, -0.05758502706885338, -0.07897363603115082, -0.12762510776519775, 0.1030062586069107, -0.44680625200271606, 0.036766134202480316, 0.15047484636306763, 0.04615683853626251, -0.14622320234775543, -0.25832483172416687, -0.24500665068626404, 0.01853996329009533, 0.1446339637041092, -0.134551003575325, 0.1762586086988449, 0.099141426384449, 0.056960850954055786, -0.22121202945709229, 0.19901737570762634, -0.16576619446277618, -0.4751622676849365, 0.00841234065592289, 0.1546107679605484, -0.1798778474330902, -0.14287665486335754, -0.5000777244567871, 0.45220980048179626, -0.029437001794576645, 0.24572531878948212, -0.3646397292613983, -0.05865443870425224, 0.004470489919185638, -0.10458134114742279, 0.3393964469432831, 0.28190556168556213, -0.44903647899627686, 0.17223942279815674, 0.03927032649517059, 0.20867452025413513, 0.4805648624897003, 0.6056392192840576, -0.2540135979652405, 0.11663338541984558, -0.03684716671705246, -0.006549425423145294, 0.28173568844795227, -0.06367358565330505, -0.3695870339870453, 0.44950976967811584, -0.17139461636543274, 0.07453109323978424, 0.15011978149414062, 0.10960902273654938, 0.12961968779563904, -0.00974394753575325, 0.061412375420331955, 0.5603839755058289, 0.21367999911308289, 0.24049365520477295, -0.29987284541130066, -0.1787957102060318, 0.11710041016340256, 0.48890525102615356, -0.14249834418296814, -0.12025459855794907, 0.09907759726047516, -0.08885392546653748, 0.2462073266506195, -0.11597898602485657, -0.2016012966632843, 0.20252291858196259, 0.202848419547081, 0.13191264867782593, -0.03867539390921593, 0.16476616263389587, 0.19188101589679718, 0.20368839800357819, 0.2823987603187561, -0.044190045446157455, 0.03110230527818203, -0.12105952203273773, 0.00046531856060028076, 0.19520926475524902, -0.006317809224128723, -0.10512702167034149, 0.015035007148981094, 0.03203370049595833, 0.305096298456192, 0.288932204246521, -0.2389347404241562, 0.4720333218574524, -0.24400010704994202, 0.1979931741952896, -0.1980980485677719, -0.07337655872106552, 0.16371172666549683, -0.02858657017350197, 0.19602204859256744, -0.03693158179521561, -0.17876818776130676, -0.12680602073669434, -0.10733071714639664, 0.3252767324447632, 0.11488564312458038, 0.11901426315307617, -0.2222881019115448, -0.03579844534397125, 0.16957645118236542, -0.1575148105621338, 0.27595168352127075, 0.15206143260002136, 0.20085418224334717, -0.24753469228744507, -0.2950679659843445, 0.21611998975276947, 0.15710635483264923, 0.4363076984882355, 0.045289069414138794, -0.2781648635864258, 0.26340150833129883, 0.07158452272415161, 0.3765748143196106, 0.14828170835971832, 0.4018518030643463, -0.17958493530750275, 0.32927677035331726, 0.10388018190860748, -0.16807754337787628, 0.09161445498466492, 0.5472316145896912, 0.026249021291732788, -0.2506343126296997, 0.3936224579811096, -0.15590456128120422, -0.23920650780200958, -0.06767594814300537, -0.22299620509147644, 0.36190322041511536, 0.24355746805667877, 0.07699193805456161, 0.008592939004302025, 0.13799239695072174, -0.25340595841407776, 0.32399672269821167, 0.1049371063709259, -0.007429692894220352, -0.08717846870422363, 0.40342068672180176, -0.051777854561805725, -0.45945072174072266, -0.2714681327342987, -0.0039027929306030273, 0.3408484160900116, -0.015553146600723267, 0.22876322269439697, -0.07430514693260193, -0.19458827376365662, 0.20939120650291443, 0.3155657649040222, 0.005006071180105209, -0.4791030287742615, -0.018804706633090973, 0.11665269732475281, 0.1440749168395996, -0.1321215182542801, -0.023431330919265747, 0.19379590451717377, 0.08699347823858261, -0.2206699699163437, -0.1916731595993042, -0.2015107423067093, -0.2061876505613327, 0.04430244863033295, 0.23723119497299194, -0.09589357674121857, 0.12105384469032288, -0.02929331362247467, -0.2234257310628891, 0.11395619809627533, -0.2991921007633209, 0.023653343319892883, -0.18141977488994598, 0.087554931640625, -0.21758949756622314, 0.14162951707839966, 0.1502479612827301, -0.06214366480708122, 0.05359699949622154, -0.188035786151886, -0.18061572313308716, 0.22229109704494476, 0.041279833763837814, -0.12027998268604279, 0.05946324020624161, -0.26235613226890564, -0.3067876994609833, -0.4798901379108429, 0.6421472430229187, -0.016148388385772705, -0.06559859216213226, 0.10529740154743195, 0.22316119074821472, 0.15024664998054504, 0.04614507034420967, 0.2359119951725006, -0.13022296130657196, -0.25103527307510376, 0.4225097596645355, 0.010276276618242264, -0.2503547668457031, -0.14058423042297363, 0.29612380266189575, 0.10175064951181412, -0.1120360940694809, -0.6892379522323608, 0.296257346868515, -0.730433464050293, -0.06443679332733154, -0.1490124613046646, 0.13344913721084595, 0.032043635845184326, -0.12649154663085938, -0.1264844387769699, 0.12822794914245605, 0.012087330222129822, -0.1756311058998108, 0.07900319993495941, 0.001147143542766571, 0.054925110191106796, 0.6015113592147827, 0.022782467305660248, 0.28969913721084595, 0.44925907254219055, -0.10551904141902924, 0.07902128249406815, -0.03835989907383919, 0.28764188289642334, -0.28206121921539307, -0.1402263343334198, 0.11796305328607559, -0.029859311878681183, -0.24529050290584564, 0.42252740263938904, 0.07641354948282242, -0.43205446004867554, -0.26053112745285034, -0.1972666084766388, -0.08026724308729172, -0.10470470041036606, 0.06730490177869797, -0.1286490261554718, -0.28647229075431824, -0.02514791116118431, 0.24169450998306274, -0.019305981695652008, -0.29142138361930847, 0.018130801618099213, -0.1897868812084198, -0.06849740445613861, -0.140831857919693, -0.056225404143333435, 0.29597070813179016, -0.6819797158241272, 0.36347496509552, -0.2500150203704834, 0.17322181165218353, 0.19671779870986938, -0.1672123223543167, 0.3711036443710327, -0.17038311064243317, 0.40714895725250244, -0.0060471221804618835, -0.05824541300535202, -0.02752228081226349, -0.2244836986064911, -0.4097135663032532, -0.03734844923019409, -0.3151068389415741, 0.18020185828208923, 0.47388944029808044, -0.20169296860694885, -0.3745790719985962, -0.06300641596317291, 0.12556369602680206, 0.15828445553779602, 0.17121970653533936, -0.19306409358978271, -0.14592194557189941, -0.19145330786705017, -0.17391493916511536, 0.09782736003398895, 0.15978237986564636, 0.1196092739701271, -0.11591318994760513, -0.024703554809093475, -0.2435007393360138, -0.06818515062332153, 0.5089030265808105, 0.21960853040218353, 0.0838639885187149, -0.2622426450252533, 0.4361925721168518, -0.021106475964188576, -0.12327165901660919, 0.21842865645885468, 0.8737943172454834, 0.28694087266921997, -0.3683740496635437, -0.003820374608039856, 0.17017917335033417, 0.4474097192287445, 0.42075690627098083, -0.10580997169017792, 0.012151405215263367, -0.1421254426240921, 0.4079197645187378, -0.2896267771720886, 0.3090481460094452, 0.2681308090686798, 0.18059611320495605, -0.3469553291797638, -0.4477565884590149, 0.6015022397041321, 0.24756774306297302, -0.01718100905418396, 0.5123491287231445, -0.18108390271663666, 0.04367682337760925, 0.41572311520576477, -0.25995248556137085, 0.8327465057373047, -0.22621527314186096, 0.20408722758293152, -0.11557499319314957, 0.170146182179451, 0.3058697283267975, -0.5899547934532166, 0.13949868083000183, -0.27013322710990906, -0.10701771080493927, 0.15870314836502075, -0.08973069489002228, -0.09440254420042038, 0.004159217234700918, 0.014637909829616547, 0.10956171900033951, 0.001025855541229248, 0.356793075799942, -0.18676337599754333, 0.49650049209594727, -0.290304034948349, -0.151464581489563, -0.3623807728290558, 0.21474739909172058, -0.06126278638839722, 0.004110809415578842, 0.12140174210071564, 0.015269234776496887, -0.17530685663223267, -0.04010223224759102, -0.44901758432388306, 0.22186556458473206, -0.11456503719091415, 0.28637436032295227, -0.04989560693502426, -0.2353334128856659, 0.049746088683605194, 0.08529646694660187, 0.07004526257514954, 0.2962219715118408, -0.15457530319690704, 0.2653183937072754, 0.025025684386491776, 0.09991634637117386, 0.43506020307540894, -0.11278828978538513, -0.0028431061655282974, -0.009640678763389587, 0.0490279346704483, 0.08484025299549103, -0.1836424618959427, -0.24511095881462097, -0.014849022030830383, 0.2149951457977295, -0.10774688422679901, -0.11781932413578033, 0.01566343382000923, 0.20273922383785248, 0.07228542864322662, -0.12313059717416763, 0.12587088346481323, 0.2656051516532898, -0.11450663208961487, 0.37671443819999695, 0.012654105201363564, -0.5630754828453064, -0.33422404527664185, 0.37699437141418457, 0.10509812086820602, -0.016605369746685028, 0.23975716531276703, 0.2364484965801239, -0.34199684858322144, -0.11641045659780502, 0.05079181492328644, -0.054062098264694214, -0.15695208311080933, 0.29276156425476074, -0.20304211974143982, -0.05584469437599182, 0.28556621074676514, -0.11508411914110184, -0.14087484776973724, -0.19373488426208496, -0.2068568915128708, -0.20121285319328308, -0.06421946734189987, -0.02860509231686592, -0.19267991185188293, 0.17960575222969055, 0.00017318129539489746, -0.10730676352977753, -0.3129803538322449, 0.025110067799687386, -0.29665201902389526, 0.15260383486747742, 0.018013179302215576, 0.02058597281575203, -0.13869917392730713, -0.20544376969337463, 0.3189726769924164, -0.005239568650722504, 0.13684484362602234, 0.19044455885887146, -0.04090093821287155, -0.21591927111148834, 0.06669610738754272, 0.1442902684211731, -0.03584323078393936, -0.14319086074829102, 0.04607648774981499, -0.15641188621520996, -0.37178218364715576, -0.35301467776298523, 0.3757668733596802, 0.15409903228282928, -0.035013772547245026, -0.504342257976532, 0.2205202281475067, -0.05745343118906021, -0.0732572004199028, 0.21138235926628113, -0.3207036852836609, 0.2909369170665741, 0.1377456784248352, 0.06641492247581482, 0.1278601437807083, -0.09215132892131805, -0.0987166091799736, 0.1633271723985672, 0.1948128342628479, 0.04908611252903938, 0.3224424123764038, -0.2733612060546875, 0.019112691283226013, 0.02358568087220192, 0.2877415418624878, 0.6306007504463196, 0.0059407055377960205, -0.24756966531276703, 0.06668494641780853, 0.1282866895198822, -0.17456325888633728, -0.19387701153755188, 0.036865655332803726, 0.1565377563238144, 0.10737232118844986, 0.37227416038513184, 0.3913634419441223, 0.15528249740600586, -0.08702060580253601, 0.008398987352848053, 0.3411552906036377, 0.2194025218486786, 0.03186826407909393, 0.27486783266067505, 0.1436704397201538, -0.20512929558753967, 0.10360539704561234, 0.3094424307346344, 0.34473881125450134, 0.7548626065254211, -0.16117823123931885, 0.3371323347091675, -0.08898688107728958, 0.18493302166461945, -0.19567419588565826, -0.20933930575847626, -0.10793182253837585, 0.1639787256717682, -0.2705915570259094, 0.18009957671165466, -0.016413025557994843, -0.012581218034029007, -0.044974856078624725, -0.07252280414104462, -0.4752840995788574, 0.3743892312049866, 0.007462062872946262, -0.08104170113801956, 0.40477249026298523, 0.04926303029060364, -0.19499629735946655, 0.24638371169567108, -0.06698893010616302, -0.14596155285835266, 0.09270945191383362, 0.2256348729133606, 0.04974020645022392, -0.24200913310050964, 0.2138817310333252, -0.3269989788532257, 0.48157772421836853, -0.20514307916164398, 0.10852035880088806, 0.0408308282494545, 0.05853990837931633, 0.18199172616004944, 0.2279004007577896, 0.6273443698883057, 0.2965458333492279, -0.25976237654685974, -0.05605142191052437, -0.18564683198928833, -0.14398515224456787, -0.07694444805383682, 0.4448907971382141, -0.2788526117801666, 0.4736683964729309, 0.28991881012916565, 0.053998179733753204, -0.19159942865371704, -0.28924039006233215, -0.2332049161195755, 0.11617743223905563, -0.2641963064670563, 0.14645279943943024, 0.1623493731021881, -0.016544736921787262, -0.4766014814376831, -0.07234999537467957, -0.41816458106040955, -0.4580179750919342, 0.4172396659851074, -0.2814597487449646, 0.02781464159488678, 0.06847069412469864, 0.09528276324272156, -0.23208209872245789, 0.543347179889679, 0.3955991268157959, 0.3712325692176819, -0.024693267419934273, -0.06151719391345978, -0.4226400554180145, -0.15193989872932434, -0.5658858418464661, -0.04513907805085182, 0.020313583314418793, 0.28364020586013794, 0.2517783045768738, 0.3641224801540375, -0.19185703992843628, 0.21275073289871216, -0.36511898040771484, -0.03685678541660309, -0.4108242988586426, -0.1180730015039444, -0.15456265211105347, -0.2343088537454605, -0.07463434338569641, -0.22584132850170135, 0.33028170466423035, -0.33866336941719055, 0.054650381207466125, -0.09668311476707458, 0.10604527592658997, -0.030291534960269928, -0.10413293540477753, 0.451665997505188, 0.15005770325660706, 0.10580568015575409, 0.1358170211315155, -0.1301964521408081, -0.2490842044353485, -0.04342269524931908, -0.08905664831399918, 0.5638744235038757, -0.10478947311639786, 0.10816171020269394, -0.1507554054260254, -0.4342605471611023, 0.09595341980457306, 0.27440953254699707, -0.028958529233932495, -0.10979153215885162, -0.09817923605442047, -0.08524017781019211, -0.19269254803657532, 0.5469509363174438, 0.22907505929470062, 0.11671960353851318, -0.01343909278512001, -0.05184811353683472, -0.2804574966430664, -0.4143352806568146, 0.29703786969184875, -0.2306896448135376, -0.17777782678604126, -0.14940065145492554, 0.0011005550622940063, 0.47641071677207947, 0.32728099822998047, -0.519737720489502, 0.1329168975353241, 0.2576535642147064, -0.19970695674419403, -0.2789764404296875, 0.31167131662368774, -0.06945228576660156, -0.14472946524620056, -0.18270257115364075, 0.09678588062524796, -0.13318435847759247, -0.24772591888904572, -0.16184422373771667, -0.06292439252138138 ]
https://github.com/huggingface/datasets/issues/5846
> > You're right, when I try to parse more than 50GB of text data, I also get very slow, usually taking hours or even tens of hours. > > That's unrelated to the problem discussed in this issue. Sorry, I misunderstood it.
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow!
### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
43
load_dataset('bigcode/the-stack-dedup', streaming=True) very slow! ### Describe the bug Running ``` import datasets ds = datasets.load_dataset('bigcode/the-stack-dedup', streaming=True) ``` takes about 2.5 minutes! I would expect this to be near instantaneous. With other datasets, the runtime is one or two seconds. ### Environment info - `datasets` version: 2.11.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 > > You're right, when I try to parse more than 50GB of text data, I also get very slow, usually taking hours or even tens of hours. > > That's unrelated to the problem discussed in this issue. Sorry, I misunderstood it.
[ -0.5947154760360718, -0.24217668175697327, -0.1078680157661438, 0.22747907042503357, 0.21352587640285492, 0.05493667721748352, 0.16488012671470642, 0.23586004972457886, 0.05870816856622696, -0.010351285338401794, -0.08272765576839447, 0.3045477569103241, 0.06317373365163803, 0.31702950596809387, -0.2761421799659729, 0.1745932400226593, 0.16814954578876495, 0.04209614545106888, 0.08775624632835388, -0.10120874643325806, -0.0813523679971695, 0.008599447086453438, -0.29224705696105957, -0.39072173833847046, -0.15248049795627594, 0.06710945069789886, 0.09237358719110489, -0.013902794569730759, -0.17749296128749847, -0.4400934875011444, 0.05473094433546066, -0.022433586418628693, -0.11376282572746277, 0.6109248399734497, -0.00011155533138662577, -0.039946407079696655, 0.2901306450366974, 0.09571892023086548, -0.30078163743019104, 0.02584635093808174, -0.20126484334468842, -0.4102621078491211, 0.09274648874998093, -0.048113301396369934, -0.0727832242846489, -0.14004679024219513, -0.010815037414431572, -0.36350613832473755, 0.27234721183776855, 0.36389124393463135, 0.16908279061317444, 0.07464468479156494, -0.23753197491168976, 0.010567959398031235, 0.09335401654243469, 0.17706039547920227, -0.044210582971572876, 0.2916035056114197, 0.265607625246048, 0.14564260840415955, 0.06635455042123795, 0.16805246472358704, -0.250754177570343, 0.21105733513832092, 0.13659216463565826, 0.2013723999261856, 0.060512054711580276, -0.28767627477645874, 0.18459391593933105, 0.47999200224876404, 0.2195184975862503, 0.02354598417878151, -0.3175583481788635, -0.4724220931529999, -0.17480990290641785, -0.36048001050949097, 0.16691111028194427, 0.22154968976974487, -0.08039981126785278, 0.14810140430927277, -0.16061002016067505, -0.030653201043605804, 0.023872897028923035, 0.02542158216238022, -0.2987886667251587, 0.008379511535167694, -0.09818561375141144, -0.01067700982093811, 0.12924425303936005, -0.016575993970036507, 0.302942156791687, -0.22345905005931854, 0.15420939028263092, 0.17597010731697083, -0.4416510760784149, 0.12403206527233124, 0.1409340351819992, -0.04925084859132767, 0.10438612103462219, 0.0987759381532669, -0.13634994626045227, 0.09302201867103577, -0.05918880179524422, 0.12909790873527527, 0.22401359677314758, 0.0404353104531765, -0.2920295298099518, -0.20815180242061615, 0.40447908639907837, -0.2900582551956177, -0.017217382788658142, 0.034648001194000244, -0.10061036050319672, -0.053311605006456375, -0.09286318719387054, -0.3264881670475006, 0.19989773631095886, -0.3819487690925598, -0.3531414568424225, 0.021485120058059692, 0.09539090842008591, -0.10691554844379425, 0.05214211717247963, 0.3569348156452179, -0.18672631680965424, 0.4514436721801758, -0.2349035143852234, 0.044441014528274536, -0.2294343113899231, -0.3419722318649292, -0.2312665581703186, -0.05245526134967804, -0.07146979868412018, -0.10276231169700623, 0.07046014070510864, -0.45688652992248535, 0.02488335222005844, 0.15162409842014313, 0.04166863113641739, -0.15801019966602325, -0.25838369131088257, -0.2520310878753662, 0.006119489669799805, 0.1464313268661499, -0.13116709887981415, 0.1818116307258606, 0.10887151211500168, 0.06214117258787155, -0.23316965997219086, 0.2118740677833557, -0.20275244116783142, -0.4904818832874298, 0.005791420117020607, 0.14421990513801575, -0.1676895022392273, -0.12843966484069824, -0.5164122581481934, 0.4448942244052887, -0.028141506016254425, 0.233194500207901, -0.3448313772678375, -0.05826239287853241, 0.0003623664379119873, -0.11221902072429657, 0.34115877747535706, 0.2743757367134094, -0.4530836343765259, 0.16537228226661682, 0.03251068294048309, 0.2018422782421112, 0.4999438226222992, 0.6230058670043945, -0.2565334141254425, 0.12435625493526459, -0.049310509115457535, -0.020566575229167938, 0.30243754386901855, -0.05875106155872345, -0.3643915057182312, 0.4580635726451874, -0.18089470267295837, 0.07723405957221985, 0.15527348220348358, 0.13010543584823608, 0.1258329153060913, 0.0023611709475517273, 0.05205554515123367, 0.5612870454788208, 0.2198413759469986, 0.23710046708583832, -0.28686651587486267, -0.1804194152355194, 0.13336075842380524, 0.47728830575942993, -0.166152685880661, -0.1152476966381073, 0.09175467491149902, -0.09078582376241684, 0.2548970878124237, -0.1221974641084671, -0.2142198085784912, 0.21779081225395203, 0.21320271492004395, 0.14175495505332947, -0.03540700674057007, 0.1579970419406891, 0.1902850866317749, 0.20225553214550018, 0.2815033197402954, -0.05574547499418259, 0.04345317929983139, -0.12011854350566864, -0.021523233503103256, 0.19320398569107056, -0.017505452036857605, -0.0920419692993164, -0.0014365427196025848, 0.031039951369166374, 0.30652230978012085, 0.27915525436401367, -0.2355145961046219, 0.48205921053886414, -0.25068050622940063, 0.19412340223789215, -0.2300802320241928, -0.06745980679988861, 0.17569443583488464, -0.009419510141015053, 0.19454613327980042, -0.05255851522088051, -0.15829378366470337, -0.1336396038532257, -0.11684134602546692, 0.33176320791244507, 0.104610875248909, 0.11777712404727936, -0.23265503346920013, -0.03570565581321716, 0.17189057171344757, -0.170944482088089, 0.29382452368736267, 0.13652466237545013, 0.20975862443447113, -0.25283464789390564, -0.2658011317253113, 0.20735807716846466, 0.1481136977672577, 0.4399318993091583, 0.034946590662002563, -0.2854804992675781, 0.2677142322063446, 0.06303383409976959, 0.3778890371322632, 0.1650860458612442, 0.4177003502845764, -0.17190122604370117, 0.336762011051178, 0.10640627145767212, -0.15728233754634857, 0.08087538182735443, 0.5628359913825989, 0.0175766721367836, -0.24042826890945435, 0.408261239528656, -0.17841991782188416, -0.23768049478530884, -0.058240875601768494, -0.24607671797275543, 0.379742294549942, 0.24913695454597473, 0.06346118450164795, 0.009903095662593842, 0.1615269035100937, -0.24950367212295532, 0.3343450725078583, 0.09365451335906982, 0.01754000037908554, -0.09708057343959808, 0.3868136405944824, -0.058258846402168274, -0.43558070063591003, -0.2879534363746643, 0.00015894323587417603, 0.34833088517189026, -0.030967220664024353, 0.2404884696006775, -0.07333724200725555, -0.19360676407814026, 0.19948095083236694, 0.3122342526912689, 0.00026864558458328247, -0.4529498219490051, -0.02183794602751732, 0.11559608578681946, 0.18477874994277954, -0.11866999417543411, -0.0030027925968170166, 0.19670067727565765, 0.08887545019388199, -0.22851912677288055, -0.19937194883823395, -0.18500275909900665, -0.21288131177425385, 0.036772407591342926, 0.2393619269132614, -0.08338795602321625, 0.11772946268320084, -0.03807128220796585, -0.2232622504234314, 0.10174812376499176, -0.2779737710952759, 0.02475196309387684, -0.19412744045257568, 0.09284239262342453, -0.23208534717559814, 0.16595491766929626, 0.14914411306381226, -0.05945868790149689, 0.053895000368356705, -0.18841171264648438, -0.19674938917160034, 0.22130906581878662, 0.02699241414666176, -0.10782210528850555, 0.08419639617204666, -0.26685968041419983, -0.3268217444419861, -0.4623449742794037, 0.6611453890800476, -0.0170891135931015, -0.04788149520754814, 0.09467478096485138, 0.22732332348823547, 0.1451270878314972, 0.04817701131105423, 0.24767565727233887, -0.14527961611747742, -0.2761235535144806, 0.42471733689308167, 0.016771607100963593, -0.2464054524898529, -0.1506105363368988, 0.30149537324905396, 0.10684381425380707, -0.13176406919956207, -0.7032468318939209, 0.28852853178977966, -0.7317479848861694, -0.07324326038360596, -0.18044865131378174, 0.12801776826381683, 0.03873562812805176, -0.14089901745319366, -0.11390236020088196, 0.13792631030082703, 0.003935202956199646, -0.2022077739238739, 0.08508837968111038, 0.030183151364326477, 0.06948993355035782, 0.6225862503051758, 0.006557546555995941, 0.3009255826473236, 0.4591337740421295, -0.10695349425077438, 0.08424151688814163, -0.04507577419281006, 0.2716306447982788, -0.2856978178024292, -0.15655210614204407, 0.10845398902893066, -0.039003320038318634, -0.2521371841430664, 0.41027307510375977, 0.07196696102619171, -0.42488253116607666, -0.26762330532073975, -0.21311834454536438, -0.07743562757968903, -0.07720869034528732, 0.07241176068782806, -0.12445338815450668, -0.30488353967666626, -0.043125689029693604, 0.20999425649642944, -0.027475938200950623, -0.2980380058288574, 0.023202307522296906, -0.17231905460357666, -0.07045994699001312, -0.1312488168478012, -0.06325550377368927, 0.28326699137687683, -0.6595876812934875, 0.3782821297645569, -0.24976220726966858, 0.16972766816616058, 0.2089288979768753, -0.14636938273906708, 0.38640162348747253, -0.15751239657402039, 0.43534785509109497, 0.007178710773587227, -0.05374828353524208, -0.02522316947579384, -0.21246667206287384, -0.40442824363708496, -0.03398370370268822, -0.31493496894836426, 0.19059664011001587, 0.45653530955314636, -0.1910216212272644, -0.3858058750629425, -0.06014711782336235, 0.12562435865402222, 0.16677439212799072, 0.15895889699459076, -0.23002029955387115, -0.16875067353248596, -0.1971578598022461, -0.19211998581886292, 0.09636007249355316, 0.1466820240020752, 0.12858685851097107, -0.1109524518251419, -0.039184581488370895, -0.24519331753253937, -0.06898761540651321, 0.5028652548789978, 0.2010539323091507, 0.07266352325677872, -0.24970220029354095, 0.4204494059085846, -0.03886593133211136, -0.12191922217607498, 0.20703665912151337, 0.8796706199645996, 0.2948392331600189, -0.3872486650943756, -0.010874100029468536, 0.19527211785316467, 0.4628758430480957, 0.3995245099067688, -0.10797595977783203, 0.03715745359659195, -0.1487084925174713, 0.41243067383766174, -0.28826189041137695, 0.30666548013687134, 0.27989035844802856, 0.19550356268882751, -0.36158621311187744, -0.4582630693912506, 0.6275433301925659, 0.25889724493026733, -0.012209102511405945, 0.5261724591255188, -0.18753187358379364, 0.054168105125427246, 0.397948294878006, -0.25506675243377686, 0.8740571737289429, -0.24308134615421295, 0.2018153965473175, -0.11433961987495422, 0.1744118332862854, 0.3225385844707489, -0.5944070219993591, 0.12470844388008118, -0.2881121337413788, -0.1221097856760025, 0.15403315424919128, -0.10550050437450409, -0.07611474394798279, 0.020354922860860825, 0.011231616139411926, 0.13454605638980865, -0.011414535343647003, 0.34979134798049927, -0.1792917251586914, 0.5004696846008301, -0.2743825316429138, -0.14441713690757751, -0.3753197193145752, 0.20218521356582642, -0.07105188071727753, 0.002837821841239929, 0.11510403454303741, 0.03542042523622513, -0.17504215240478516, -0.04007991403341293, -0.4335559904575348, 0.2086302787065506, -0.13332056999206543, 0.2886051535606384, -0.05356903746724129, -0.23823824524879456, 0.058706365525722504, 0.10758237540721893, 0.06145070493221283, 0.28609487414360046, -0.15124160051345825, 0.2611449360847473, 0.030009973794221878, 0.07741105556488037, 0.4342373013496399, -0.1153368279337883, -0.010619853623211384, -0.007898412644863129, 0.037736356258392334, 0.10443531721830368, -0.18039679527282715, -0.24710658192634583, -0.007201701402664185, 0.2012452334165573, -0.08044719696044922, -0.11760202050209045, -0.01383686438202858, 0.20397642254829407, 0.08233611285686493, -0.10019659996032715, 0.11832550168037415, 0.26689282059669495, -0.12446963787078857, 0.38603299856185913, 0.014287512749433517, -0.5720329880714417, -0.3327324390411377, 0.36983686685562134, 0.11903809010982513, -0.01227916032075882, 0.24941886961460114, 0.24264051020145416, -0.3422095477581024, -0.10624172538518906, 0.07185319066047668, -0.05621733516454697, -0.16448327898979187, 0.27564913034439087, -0.17422576248645782, -0.024023324251174927, 0.2690854072570801, -0.12224103510379791, -0.13208341598510742, -0.16829274594783783, -0.20306769013404846, -0.19888590276241302, -0.07243485003709793, -0.0335443839430809, -0.20196682214736938, 0.166568323969841, 0.026720769703388214, -0.12104786932468414, -0.30348441004753113, 0.0437689945101738, -0.2886618971824646, 0.15308019518852234, 0.010425321757793427, 0.015168625861406326, -0.13653692603111267, -0.18667370080947876, 0.3106367588043213, -0.0012373961508274078, 0.1272146850824356, 0.19102726876735687, -0.04265768826007843, -0.20605012774467468, 0.08176509290933609, 0.15570101141929626, -0.03433433547616005, -0.14061188697814941, 0.04994823783636093, -0.1553657352924347, -0.3763267397880554, -0.340661883354187, 0.35241764783859253, 0.15064427256584167, -0.02191901206970215, -0.5051016211509705, 0.2227271944284439, -0.07742628455162048, -0.11117524653673172, 0.21124421060085297, -0.3366115093231201, 0.28999799489974976, 0.13430359959602356, 0.06237728148698807, 0.13217318058013916, -0.11645155400037766, -0.12295837700366974, 0.15348058938980103, 0.22605858743190765, 0.04743881896138191, 0.3250826597213745, -0.27234765887260437, 0.02192777395248413, 0.018649008125066757, 0.2663173973560333, 0.6251899600028992, -0.004931196570396423, -0.23669233918190002, 0.08400434255599976, 0.12052413821220398, -0.1814042329788208, -0.1865878850221634, 0.03404594585299492, 0.16119979321956635, 0.08470827341079712, 0.37213072180747986, 0.37125471234321594, 0.1763777881860733, -0.07936999201774597, -0.0008167177438735962, 0.3423019051551819, 0.2164129912853241, 0.019013550132513046, 0.2618398368358612, 0.1570403277873993, -0.19498437643051147, 0.12207858264446259, 0.3220955729484558, 0.33864134550094604, 0.735777735710144, -0.17283505201339722, 0.3197563588619232, -0.08576379716396332, 0.19528761506080627, -0.1750117391347885, -0.21265938878059387, -0.1259244829416275, 0.1836315095424652, -0.28459712862968445, 0.16607710719108582, -0.01969197392463684, -0.017702601850032806, -0.029660843312740326, -0.07501412183046341, -0.4576635956764221, 0.38509517908096313, 0.01971261203289032, -0.07228326052427292, 0.39354926347732544, 0.06642752885818481, -0.20679189264774323, 0.23942485451698303, -0.0775132030248642, -0.1646459698677063, 0.09156689047813416, 0.22666630148887634, 0.04676344618201256, -0.2457837611436844, 0.20189958810806274, -0.2949918508529663, 0.47371727228164673, -0.21598994731903076, 0.11047165840864182, 0.039336904883384705, 0.053603656589984894, 0.1755218207836151, 0.21724922955036163, 0.6273580193519592, 0.30287858843803406, -0.24953019618988037, -0.04581142216920853, -0.17767536640167236, -0.13696593046188354, -0.04761756956577301, 0.4373619258403778, -0.280097633600235, 0.47437572479248047, 0.2766133248806, 0.051277194172143936, -0.18512004613876343, -0.2842154800891876, -0.2315252423286438, 0.11797983944416046, -0.28677764534950256, 0.1445346623659134, 0.16134655475616455, -0.015079796314239502, -0.49793121218681335, -0.06775683164596558, -0.4157269597053528, -0.4531971514225006, 0.42452123761177063, -0.288088321685791, 0.021542072296142578, 0.0613626204431057, 0.09116482734680176, -0.24437332153320312, 0.5512130260467529, 0.4065093994140625, 0.39395344257354736, -0.0431370884180069, -0.05333352088928223, -0.4230736196041107, -0.14073443412780762, -0.5603792071342468, -0.05556296557188034, 0.026423506438732147, 0.2765195667743683, 0.24718719720840454, 0.3695426881313324, -0.19515162706375122, 0.2242068350315094, -0.36759743094444275, -0.04661313816905022, -0.40728816390037537, -0.1281646192073822, -0.16181476414203644, -0.210552379488945, -0.0818558931350708, -0.224420428276062, 0.34429582953453064, -0.3377935290336609, 0.03484588861465454, -0.1034311056137085, 0.12082737684249878, -0.017237577587366104, -0.09414973109960556, 0.45698869228363037, 0.13758744299411774, 0.11989817768335342, 0.12869201600551605, -0.10373762249946594, -0.20995156466960907, -0.026962609961628914, -0.08707807213068008, 0.5787645578384399, -0.09719297289848328, 0.09390924125909805, -0.15556806325912476, -0.41866499185562134, 0.09377744793891907, 0.2878744602203369, -0.03353055939078331, -0.1299751251935959, -0.10201995074748993, -0.09759630262851715, -0.17863841354846954, 0.5436702966690063, 0.22934679687023163, 0.10851660370826721, -0.007233262062072754, -0.04837770015001297, -0.2812129855155945, -0.4048272669315338, 0.3106584846973419, -0.21962833404541016, -0.16708046197891235, -0.13432994484901428, 0.010371305048465729, 0.4911895990371704, 0.32472044229507446, -0.5195296406745911, 0.13342607021331787, 0.28566962480545044, -0.1906980574131012, -0.2598912715911865, 0.32523313164711, -0.0692923292517662, -0.12115252763032913, -0.18585814535617828, 0.10042190551757812, -0.1351132094860077, -0.24413424730300903, -0.14683040976524353, -0.09191879630088806 ]
https://github.com/huggingface/datasets/issues/5841
Hi ! You can try to use the [Image](https://huggingface.co/docs/datasets/v2.12.0/en/package_reference/main_classes#datasets.Image) type which [decodes images on-the-fly](https://huggingface.co/docs/datasets/v2.12.0/en/about_dataset_features#image-feature) into pytorch tensors :) ```python ds = Dataset.from_dict({"tensor":a}).with_format("torch") %time sum(1 for _ in ds) # CPU times: user 5.04 s, sys: 96.5 ms, total: 5.14 s # Wall time: 5.14 s # 10000 ``` ```python features = Features({"tensor": Image()}) ds = Dataset.from_dict({"tensor":a}, features=features).with_format("torch") %time sum(1 for _ in ds) # CPU times: user 1.86 s, sys: 49 ms, total: 1.91 s # Wall time: 1.9 s # 10000 ``` -> Speed x2.7 And if you want to keep using arrays of integers, consider using the [Array2D](https://huggingface.co/docs/datasets/v2.12.0/en/package_reference/main_classes#datasets.Array2D) or [Array3D](https://huggingface.co/docs/datasets/v2.12.0/en/package_reference/main_classes#datasets.Array3D) types which are even faster (since it doesn't decode images): ```python features = Features({"tensor": Array2D(shape=(100, 224), dtype="float32")}) ds = Dataset.from_dict({"tensor":a}, features=features).with_format("torch") %time sum(1 for _ in ds) # CPU times: user 828 ms, sys: 68.4 ms, total: 896 ms # Wall time: 897 ms # 10000 ``` -> Speed x5.7 Batching also speeds up a lot ```python from torch.utils.data import DataLoader dl = DataLoader(ds, batch_size=100) %time sum(1 for _ in dl) # CPU times: user 564 ms, sys: 83.5 ms, total: 648 ms # Wall time: 579 ms # 100 ``` -> Speed x8.9 ```python %time sum(1 for _ in ds.iter(batch_size=100)) # CPU times: user 119 ms, sys: 96.8 ms, total: 215 ms # Wall time: 117 ms # 100 ``` -> Speed x46
Abusurdly slow on iteration
### Describe the bug I am attempting to iterate through an image dataset, but I am encountering a significant slowdown in the iteration speed. In order to investigate this issue, I conducted the following experiment: ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` I noticed that the dataset in numpy format performs significantly faster than the one in torch format. My hypothesis is that the dataset undergoes a transformation process of torch->python->numpy(torch) in the background, which might be causing the slowdown. Is there any way to expedite the process by bypassing such transformations? Furthermore, if I increase the size of a to an image shape, like: ```python a=torch.randn(3,224,224) ``` the iteration speed becomes absurdly slow, around 100 iterations per second, whereas the speed with numpy format is approximately 250 iterations per second. This level of speed would be unacceptable for large image datasets, as it could take several hours just to iterate through a single epoch. ### Steps to reproduce the bug ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` ### Expected behavior iteration faster ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.10 - Python version: 3.8.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
226
Abusurdly slow on iteration ### Describe the bug I am attempting to iterate through an image dataset, but I am encountering a significant slowdown in the iteration speed. In order to investigate this issue, I conducted the following experiment: ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` I noticed that the dataset in numpy format performs significantly faster than the one in torch format. My hypothesis is that the dataset undergoes a transformation process of torch->python->numpy(torch) in the background, which might be causing the slowdown. Is there any way to expedite the process by bypassing such transformations? Furthermore, if I increase the size of a to an image shape, like: ```python a=torch.randn(3,224,224) ``` the iteration speed becomes absurdly slow, around 100 iterations per second, whereas the speed with numpy format is approximately 250 iterations per second. This level of speed would be unacceptable for large image datasets, as it could take several hours just to iterate through a single epoch. ### Steps to reproduce the bug ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` ### Expected behavior iteration faster ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.10 - Python version: 3.8.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 Hi ! You can try to use the [Image](https://huggingface.co/docs/datasets/v2.12.0/en/package_reference/main_classes#datasets.Image) type which [decodes images on-the-fly](https://huggingface.co/docs/datasets/v2.12.0/en/about_dataset_features#image-feature) into pytorch tensors :) ```python ds = Dataset.from_dict({"tensor":a}).with_format("torch") %time sum(1 for _ in ds) # CPU times: user 5.04 s, sys: 96.5 ms, total: 5.14 s # Wall time: 5.14 s # 10000 ``` ```python features = Features({"tensor": Image()}) ds = Dataset.from_dict({"tensor":a}, features=features).with_format("torch") %time sum(1 for _ in ds) # CPU times: user 1.86 s, sys: 49 ms, total: 1.91 s # Wall time: 1.9 s # 10000 ``` -> Speed x2.7 And if you want to keep using arrays of integers, consider using the [Array2D](https://huggingface.co/docs/datasets/v2.12.0/en/package_reference/main_classes#datasets.Array2D) or [Array3D](https://huggingface.co/docs/datasets/v2.12.0/en/package_reference/main_classes#datasets.Array3D) types which are even faster (since it doesn't decode images): ```python features = Features({"tensor": Array2D(shape=(100, 224), dtype="float32")}) ds = Dataset.from_dict({"tensor":a}, features=features).with_format("torch") %time sum(1 for _ in ds) # CPU times: user 828 ms, sys: 68.4 ms, total: 896 ms # Wall time: 897 ms # 10000 ``` -> Speed x5.7 Batching also speeds up a lot ```python from torch.utils.data import DataLoader dl = DataLoader(ds, batch_size=100) %time sum(1 for _ in dl) # CPU times: user 564 ms, sys: 83.5 ms, total: 648 ms # Wall time: 579 ms # 100 ``` -> Speed x8.9 ```python %time sum(1 for _ in ds.iter(batch_size=100)) # CPU times: user 119 ms, sys: 96.8 ms, total: 215 ms # Wall time: 117 ms # 100 ``` -> Speed x46
[ -0.1845068335533142, -0.5200334191322327, -0.04702053964138031, 0.2566430866718292, 0.12682995200157166, 0.1570071130990982, 0.481078177690506, 0.219479501247406, -0.2652483582496643, 0.1919068694114685, -0.06385338306427002, 0.5231744050979614, -0.08375862240791321, -0.4237799346446991, -0.30449801683425903, -0.15257632732391357, 0.048421669751405716, -0.2538783550262451, -0.3577803671360016, -0.16129586100578308, -0.29770585894584656, -0.2262297421693802, 0.014456912875175476, -0.13574764132499695, -0.22869931161403656, -0.3462592661380768, 0.02290485054254532, 0.23143532872200012, 0.09737979620695114, -0.08314795792102814, -0.10747753083705902, -0.09758540987968445, -0.1336996853351593, 0.6300845146179199, -0.00012157205492258072, 0.11679111421108246, 0.21561560034751892, 0.16419880092144012, -0.033040888607501984, 0.41467416286468506, 0.410489022731781, -0.18716973066329956, -0.06275424361228943, -0.3683652877807617, 0.16423749923706055, -0.08909842371940613, 0.03964091092348099, -0.42168721556663513, 0.27982038259506226, -0.17173387110233307, 0.10210144519805908, 0.2301226109266281, -0.5086674690246582, 0.21156743168830872, -0.059800438582897186, 0.2605196535587311, -0.17105162143707275, 0.04823669046163559, 0.534172773361206, 0.13588137924671173, -0.28871506452560425, 0.6495189070701599, -0.301554799079895, 0.0897943526506424, 0.1819433569908142, -0.027753932401537895, 0.06182297691702843, -0.36342570185661316, 0.09059938043355942, 0.40774717926979065, 0.18886534869670868, -0.07852964103221893, -0.4917795956134796, -0.22966568171977997, -0.08645614981651306, -0.16281694173812866, -0.07988208532333374, 0.13089105486869812, -0.3415217995643616, -0.07540402561426163, -0.4372415542602539, 0.08790507912635803, 0.07285082340240479, 0.07420113682746887, -0.1790701448917389, -0.208817258477211, 0.3561360239982605, 0.024632560089230537, 0.0840594470500946, -0.060764528810977936, 0.35193783044815063, -0.19874170422554016, 0.4514191746711731, 0.18406733870506287, -0.41584137082099915, 0.05544097721576691, -0.0056813377887010574, -0.08914759755134583, -0.12433724105358124, -0.020745547488331795, 0.1568344384431839, 0.28194478154182434, -0.10804805159568787, 0.07496022433042526, -0.09336724877357483, 0.012041419744491577, -0.5528011918067932, 0.18361803889274597, 0.20081773400306702, -0.18809455633163452, 0.09605857729911804, 0.08472958207130432, -0.034758906811475754, -0.389293372631073, 0.2876204252243042, -0.04255367070436478, 0.14749905467033386, 0.34161704778671265, -0.2788583040237427, -0.1577606499195099, -0.2540484666824341, 0.22136002779006958, -0.051780521869659424, 0.17868298292160034, -0.06266802549362183, 0.12067979574203491, 0.1192161813378334, -0.016971269622445107, -0.34429383277893066, 0.2736664116382599, -0.07232514023780823, -0.04816067963838577, -0.0925893560051918, 0.0034498944878578186, -0.09253467619419098, -0.1219482272863388, -0.07079626619815826, 0.18976107239723206, 0.41721487045288086, 0.34176039695739746, 0.1271076798439026, -0.16684505343437195, 0.4247022271156311, 0.05893576517701149, -0.3586464524269104, 0.1728733479976654, 0.11615689098834991, 0.6134870648384094, -0.20480002462863922, 0.12791043519973755, -0.38616108894348145, -0.03618483990430832, -0.05572718381881714, -0.011154032312333584, 0.07829304784536362, 0.192569762468338, 0.11454249918460846, 0.07499891519546509, 0.1933576762676239, 0.02075883001089096, 0.294731080532074, -0.2644868493080139, -0.15689784288406372, -0.14011067152023315, 0.2118077576160431, 0.30274534225463867, -0.03715644031763077, 0.09993882477283478, 0.1772722750902176, 0.388740599155426, 0.18764075636863708, 0.4305494725704193, -0.08905190229415894, 0.15339040756225586, -0.3839755058288574, -0.36545008420944214, 0.2437203973531723, -0.28721123933792114, -0.33443111181259155, 0.09453444182872772, -0.08328220248222351, 0.41916972398757935, 0.14611053466796875, 0.5173705220222473, 0.02690596505999565, -0.18208497762680054, 0.0021019969135522842, 0.48854830861091614, -0.09083807468414307, 0.21782147884368896, -0.25932231545448303, -0.0259261354804039, 0.34980812668800354, 0.2082962542772293, -0.058370042592287064, 0.1654386967420578, -0.18256595730781555, -0.27075308561325073, 0.25457656383514404, -0.303638756275177, -0.17052331566810608, 0.20736002922058105, -0.27569055557250977, -0.29169121384620667, 0.13422806560993195, 0.0627782940864563, -0.21288630366325378, 0.1516287624835968, 0.2412818968296051, 0.10429584980010986, -0.18488886952400208, 0.001715727150440216, 0.07683856785297394, -0.026436801999807358, -0.14453503489494324, -0.02095862664282322, -0.02984040230512619, 0.06935014575719833, -0.11073428392410278, -0.13431000709533691, 0.11232709884643555, 0.3984880745410919, -0.10619666427373886, 0.0444033183157444, -0.39719337224960327, -0.12575021386146545, 0.28427979350090027, -0.024164967238903046, -0.13603436946868896, 0.05652575567364693, -0.05718227103352547, -0.2514550983905792, -0.05636601895093918, 0.22446328401565552, 0.050545915961265564, 0.4293959438800812, -0.131194069981575, 0.22481580078601837, 0.24703042209148407, -0.15844379365444183, 0.2350296974182129, 0.1357797384262085, 0.06276673078536987, -0.14441391825675964, 0.028154637664556503, 0.6309671998023987, -0.14182265102863312, 0.45994803309440613, -0.015602126717567444, 0.11000996083021164, -0.11095333844423294, 0.11837993562221527, -0.35943135619163513, 0.4095698893070221, 0.40070149302482605, 0.25538307428359985, 0.36682435870170593, 0.03985346853733063, -0.5823836326599121, 0.16074524819850922, 0.23336799442768097, 0.07158026099205017, -0.19901202619075775, 0.14563727378845215, -0.05702933669090271, 0.19690385460853577, 0.055134765803813934, -0.40865805745124817, 0.29909417033195496, 0.10859157145023346, 0.10563486069440842, 0.0928238108754158, -0.09843765944242477, -0.0365508496761322, 0.023661229759454727, 0.3963944911956787, 0.15686732530593872, -0.12477344274520874, 0.496279239654541, 0.07764841616153717, -0.2017214596271515, -0.15578365325927734, -0.19392701983451843, -0.0505492240190506, 0.025976717472076416, 0.6795868873596191, -0.15941855311393738, 0.0815892145037651, -0.17174997925758362, -0.25852710008621216, -0.14794334769248962, -0.2400476336479187, 0.06984452903270721, 0.15156561136245728, 0.008950933814048767, 0.3132169842720032, 0.31171420216560364, 0.03648895025253296, 0.3738652765750885, -0.5060091614723206, -0.39496034383773804, -0.14198517799377441, -0.026171155273914337, -0.09710223972797394, 0.1925058811903, -0.10382027924060822, 0.34675952792167664, -0.1966988742351532, -0.12772519886493683, -0.3007309138774872, -0.2184172421693802, 0.0813586562871933, -0.055962249636650085, 0.12474866956472397, 0.03626086935400963, 0.014123070985078812, -0.24596737325191498, -0.0013972073793411255, 0.1646566241979599, -0.07930424809455872, -0.03640223294496536, 0.15006965398788452, -0.014378160238265991, 0.14008091390132904, 0.15827174484729767, -0.06239071115851402, -0.11390796303749084, -0.14282888174057007, 0.12218763679265976, -0.061651892960071564, 0.199710875749588, 0.16694410145282745, 0.11178769171237946, -0.019556283950805664, 0.24090725183486938, 0.2072761058807373, -0.13664865493774414, -0.4197753071784973, 0.4466388523578644, -0.03292354196310043, -0.19057445228099823, -0.41945722699165344, -0.2390674650669098, 0.16837550699710846, 0.7547339200973511, -0.4643011689186096, -0.3746644854545593, -0.404529869556427, 0.32483696937561035, -0.3847585618495941, -0.03216663748025894, 0.13682937622070312, -0.034892044961452484, -0.05198753997683525, 0.089751236140728, 0.05758067965507507, -0.38049429655075073, -0.038262851536273956, 0.13192862272262573, 0.12453480809926987, 0.3896569311618805, 0.16628524661064148, 0.6349420547485352, 0.08952820301055908, -0.3436696529388428, -0.1269930899143219, -0.1395045518875122, 0.1821439415216446, -0.19845010340213776, -0.4711117744445801, 0.0673714354634285, -0.0963066965341568, -0.4437582492828369, -0.27049684524536133, -0.18763938546180725, -0.04110204428434372, -0.012158989906311035, 0.2880568504333496, 0.05483604967594147, -0.21134763956069946, 0.24332194030284882, -0.4914538860321045, 0.3696002662181854, 0.02769472450017929, 0.47863325476646423, -0.44778144359588623, -0.17129331827163696, 0.2350832223892212, 0.1099277138710022, 0.3762240409851074, -0.08263114839792252, -0.04953480511903763, -0.105656199157238, -0.5614991784095764, 0.31337660551071167, 0.22545970976352692, 0.36966845393180847, 0.16651862859725952, -0.12748977541923523, 0.311137855052948, -0.047866590321063995, 0.732040524482727, 0.10623294115066528, -0.2437330186367035, 0.21797136962413788, -0.6298397779464722, -0.7540130615234375, 0.05099470913410187, -0.015208154916763306, 0.10777055472135544, 0.3781169652938843, 0.4871593415737152, 0.06038902699947357, -0.2604096531867981, 0.07189172506332397, 0.30368107557296753, -0.1444736123085022, -0.034417636692523956, -0.2766624987125397, -0.5008148550987244, -0.07970958948135376, 0.08429887890815735, 0.03287466615438461, -0.0887041836977005, 0.1840519905090332, -0.08737348765134811, -0.41216951608657837, 0.11325573921203613, 0.06614114344120026, 0.040240801870822906, 0.11340858042240143, -0.07203281670808792, 0.2641178369522095, 0.16827979683876038, 0.1637665331363678, 0.21603985130786896, 0.11186613142490387, 0.13177865743637085, -0.08865275979042053, 0.03884866461157799, 0.12089450657367706, 0.0833020731806755, 0.7092302441596985, 0.033803075551986694, -0.10749978572130203, -0.5433777570724487, 0.20436939597129822, -0.31446337699890137, -0.07710293680429459, 0.47604191303253174, 0.12262009084224701, -0.2562497556209564, -0.25718435645103455, 0.36992475390434265, 0.2985992431640625, -0.043635375797748566, 0.5434492230415344, -0.5204727649688721, 0.03063012659549713, 0.14813333749771118, 0.2986645996570587, 1.003055214881897, -0.13325171172618866, 0.27861085534095764, 0.3623732924461365, 0.028666481375694275, -0.0578441247344017, -0.08843345195055008, 0.28070446848869324, -0.059731222689151764, -0.41548246145248413, -0.041242752224206924, -0.3132475018501282, 0.15669003129005432, -0.028259720653295517, 0.1071537509560585, 0.19075429439544678, -0.18644055724143982, 0.007200710475444794, -0.07558149099349976, -0.25375741720199585, -0.24493202567100525, -0.4004133343696594, -0.1330520659685135, 0.024263985455036163, 0.25463438034057617, 0.12389588356018066, 0.007108032703399658, -0.1154598519206047, -0.28837016224861145, 0.117380790412426, -0.1519496738910675, -0.22366100549697876, -0.3305935561656952, 0.13544972240924835, 0.20501430332660675, -0.8528634309768677, 0.12134692072868347, 0.20152293145656586, 0.20910727977752686, -0.04406047612428665, 0.009059889242053032, 0.2631354331970215, 0.18969137966632843, 0.31793299317359924, 0.07854767143726349, -0.3841387927532196, 0.3268326222896576, 0.18177874386310577, 0.16571392118930817, 0.0976596474647522, 0.01588999480009079, -0.0890883132815361, -0.24874815344810486, 0.15319693088531494, 0.0863017588853836, 0.18887430429458618, 0.0732736885547638, -0.07750409841537476, -0.21316537261009216, -0.21753525733947754, 0.05380471795797348, 0.04956286400556564, 0.06919188797473907, 0.7558907270431519, -0.053490735590457916, -0.3480030298233032, 0.07198008894920349, 0.340320885181427, 0.07990595698356628, -0.10217192769050598, 0.4426038861274719, 0.04722782224416733, -0.29295194149017334, -0.022259898483753204, 0.2921852767467499, 0.025037772953510284, -0.3107544183731079, 0.4226572811603546, -0.31105363368988037, 0.15982486307621002, -0.3031797409057617, -0.11647449433803558, -0.18209372460842133, -0.17896130681037903, -0.47103452682495117, -0.06999491155147552, -0.17283113300800323, 0.10848711431026459, 0.03039497509598732, 0.22553157806396484, -0.29293373227119446, 0.2011050283908844, -0.25986406207084656, 0.05900826305150986, -0.20243693888187408, -0.0801653191447258, -0.047150831669569016, 0.08416733145713806, 0.05915170535445213, 0.0763397365808487, -0.060507882386446, 0.03798465058207512, 0.012269344180822372, 0.3438180685043335, -0.08299000561237335, -0.12322571128606796, 0.0985889583826065, 0.18014085292816162, -0.2479163110256195, -0.42766863107681274, 0.3208157420158386, -0.11907704919576645, -0.06305962800979614, -0.26627761125564575, 0.08763885498046875, 0.2620057761669159, 0.012179490178823471, -0.04023344814777374, -0.08534462749958038, 0.04579944908618927, 0.44107311964035034, -0.07368380576372147, -0.1629139482975006, 0.18941698968410492, -0.010401450097560883, 0.06088744476437569, 0.19366542994976044, -0.22699260711669922, -0.06953813135623932, 0.16513298451900482, 0.05021781846880913, -0.06677626073360443, 0.3221137225627899, -0.1148497611284256, 0.10602176189422607, 0.019830256700515747, 0.21315957605838776, 0.35506629943847656, -0.21238312125205994, -0.35898464918136597, 0.10390055179595947, 0.042924799025058746, -0.15356245636940002, -0.19321563839912415, -0.07580830156803131, 0.06316924095153809, 0.06634856015443802, 0.17069731652736664, -0.015320949256420135, 0.35555535554885864, -0.2694492042064667, -0.15480339527130127, 0.09927158057689667, -0.48540642857551575, -0.03283306956291199, 0.4245511293411255, 0.05880773067474365, 0.016508882865309715, 0.32715752720832825, 0.101779043674469, 0.01998170092701912, 0.307266503572464, 0.2176041603088379, 0.49735236167907715, 0.19189412891864777, 0.15247878432273865, -0.010752208530902863, -0.06698362529277802, -0.2680278718471527, -0.04190366715192795, -0.07807360589504242, 0.23841562867164612, 0.08258740603923798, 0.23397286236286163, 0.08125343173742294, -0.3584100902080536, -0.050303470343351364, 0.3425595462322235, -0.006484915968030691, -0.07424844801425934, 0.08552762866020203, 0.04599672555923462, 0.0519481897354126, 0.11592495441436768, -0.1831716001033783, -0.0582774318754673, 0.5287224054336548, 0.18494975566864014, 0.23705518245697021, -0.3262636661529541, 0.0024406742304563522, -0.17526262998580933, 0.18599943816661835, -0.08415492624044418, -0.20555686950683594, 0.1964007467031479, 0.09467759728431702, 0.06790976226329803, 0.3078230619430542, 0.3289530277252197, 0.10499376058578491, -0.34773463010787964, 0.09865702688694, -0.3716215193271637, -0.048112280666828156, 0.1205480545759201, 0.13163773715496063, -0.21153992414474487, -0.103877492249012, 0.22759008407592773, -0.06451071798801422, -0.12490884214639664, -0.04389110580086708, -0.14743584394454956, 0.03947554901242256, -0.4099491834640503, 0.3363114297389984, -0.2796468734741211, -0.041650183498859406, -0.23476210236549377, -0.16845358908176422, -0.042500898241996765, -0.2864949107170105, 0.4487704038619995, -0.3541342318058014, -0.018771406263113022, 0.22194261848926544, 0.015765823423862457, -0.4454546272754669, 0.7320996522903442, 0.24817152321338654, 0.327541321516037, -0.14548026025295258, -0.0838591679930687, -0.1750638335943222, 0.0033024288713932037, -0.19414860010147095, -0.1455651819705963, 0.3839465379714966, 0.1959996074438095, 0.1699649691581726, 0.31028538942337036, 0.5192381739616394, -0.1721847802400589, 0.0793493390083313, 0.549163818359375, -0.35854679346084595, -0.2110459953546524, -0.3923129737377167, -0.03227873891592026, -0.06859062612056732, -0.5513907670974731, 0.22292165458202362, 0.06671635806560516, 0.06951697915792465, -0.012954223901033401, -0.09238593280315399, -0.042858969420194626, 0.5095472931861877, 0.34633585810661316, 0.160577654838562, -0.16956548392772675, -0.1316055804491043, -0.1317279040813446, -0.2544022500514984, -0.22175107896327972, -0.10093031823635101, 0.30632513761520386, 0.0006253458559513092, 0.11506189405918121, 0.0321347638964653, -0.3841327726840973, -0.1116374209523201, 0.511653482913971, 0.08091620355844498, -0.30390864610671997, -0.22494788467884064, 0.3026486039161682, -0.12737874686717987, 0.3192712068557739, -0.17242875695228577, 0.2818687856197357, 0.18408146500587463, 0.35710054636001587, -0.40436026453971863, -0.4154525101184845, 0.6602816581726074, -0.3118371069431305, -0.446837842464447, -0.007697552442550659, -0.0983169823884964, 0.023356696590781212, 0.20609332621097565, -0.2749466598033905, -0.11507879197597504, 0.15626877546310425, -0.007397398352622986, -0.018093422055244446, 0.3438461124897003, 0.1991129219532013, -0.08967399597167969, -0.1062263622879982, 0.27378329634666443, -0.04894993454217911, -0.0698498785495758, -0.17250768840312958, -0.13595277070999146 ]
https://github.com/huggingface/datasets/issues/5841
Anyway, regarding the speed difference between numpy and pytorch, I think the issue is that we first convert numpy sub-arrays to pytorch and then consolidate into one tensor, while we should to the opposite. Indeed converting a numpy array to pytorch has a fix cost that seems to cause a slow down. The current pipeline is ``` arrow -> nested numpy arrays -> lists of torch tensors -> one torch tensor ``` and we should do ``` arrow -> nested numpy arrays -> one numpy array -> one torch tensor ```
Abusurdly slow on iteration
### Describe the bug I am attempting to iterate through an image dataset, but I am encountering a significant slowdown in the iteration speed. In order to investigate this issue, I conducted the following experiment: ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` I noticed that the dataset in numpy format performs significantly faster than the one in torch format. My hypothesis is that the dataset undergoes a transformation process of torch->python->numpy(torch) in the background, which might be causing the slowdown. Is there any way to expedite the process by bypassing such transformations? Furthermore, if I increase the size of a to an image shape, like: ```python a=torch.randn(3,224,224) ``` the iteration speed becomes absurdly slow, around 100 iterations per second, whereas the speed with numpy format is approximately 250 iterations per second. This level of speed would be unacceptable for large image datasets, as it could take several hours just to iterate through a single epoch. ### Steps to reproduce the bug ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` ### Expected behavior iteration faster ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.10 - Python version: 3.8.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
91
Abusurdly slow on iteration ### Describe the bug I am attempting to iterate through an image dataset, but I am encountering a significant slowdown in the iteration speed. In order to investigate this issue, I conducted the following experiment: ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` I noticed that the dataset in numpy format performs significantly faster than the one in torch format. My hypothesis is that the dataset undergoes a transformation process of torch->python->numpy(torch) in the background, which might be causing the slowdown. Is there any way to expedite the process by bypassing such transformations? Furthermore, if I increase the size of a to an image shape, like: ```python a=torch.randn(3,224,224) ``` the iteration speed becomes absurdly slow, around 100 iterations per second, whereas the speed with numpy format is approximately 250 iterations per second. This level of speed would be unacceptable for large image datasets, as it could take several hours just to iterate through a single epoch. ### Steps to reproduce the bug ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` ### Expected behavior iteration faster ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.10 - Python version: 3.8.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 Anyway, regarding the speed difference between numpy and pytorch, I think the issue is that we first convert numpy sub-arrays to pytorch and then consolidate into one tensor, while we should to the opposite. Indeed converting a numpy array to pytorch has a fix cost that seems to cause a slow down. The current pipeline is ``` arrow -> nested numpy arrays -> lists of torch tensors -> one torch tensor ``` and we should do ``` arrow -> nested numpy arrays -> one numpy array -> one torch tensor ```
[ -0.1845068335533142, -0.5200334191322327, -0.04702053964138031, 0.2566430866718292, 0.12682995200157166, 0.1570071130990982, 0.481078177690506, 0.219479501247406, -0.2652483582496643, 0.1919068694114685, -0.06385338306427002, 0.5231744050979614, -0.08375862240791321, -0.4237799346446991, -0.30449801683425903, -0.15257632732391357, 0.048421669751405716, -0.2538783550262451, -0.3577803671360016, -0.16129586100578308, -0.29770585894584656, -0.2262297421693802, 0.014456912875175476, -0.13574764132499695, -0.22869931161403656, -0.3462592661380768, 0.02290485054254532, 0.23143532872200012, 0.09737979620695114, -0.08314795792102814, -0.10747753083705902, -0.09758540987968445, -0.1336996853351593, 0.6300845146179199, -0.00012157205492258072, 0.11679111421108246, 0.21561560034751892, 0.16419880092144012, -0.033040888607501984, 0.41467416286468506, 0.410489022731781, -0.18716973066329956, -0.06275424361228943, -0.3683652877807617, 0.16423749923706055, -0.08909842371940613, 0.03964091092348099, -0.42168721556663513, 0.27982038259506226, -0.17173387110233307, 0.10210144519805908, 0.2301226109266281, -0.5086674690246582, 0.21156743168830872, -0.059800438582897186, 0.2605196535587311, -0.17105162143707275, 0.04823669046163559, 0.534172773361206, 0.13588137924671173, -0.28871506452560425, 0.6495189070701599, -0.301554799079895, 0.0897943526506424, 0.1819433569908142, -0.027753932401537895, 0.06182297691702843, -0.36342570185661316, 0.09059938043355942, 0.40774717926979065, 0.18886534869670868, -0.07852964103221893, -0.4917795956134796, -0.22966568171977997, -0.08645614981651306, -0.16281694173812866, -0.07988208532333374, 0.13089105486869812, -0.3415217995643616, -0.07540402561426163, -0.4372415542602539, 0.08790507912635803, 0.07285082340240479, 0.07420113682746887, -0.1790701448917389, -0.208817258477211, 0.3561360239982605, 0.024632560089230537, 0.0840594470500946, -0.060764528810977936, 0.35193783044815063, -0.19874170422554016, 0.4514191746711731, 0.18406733870506287, -0.41584137082099915, 0.05544097721576691, -0.0056813377887010574, -0.08914759755134583, -0.12433724105358124, -0.020745547488331795, 0.1568344384431839, 0.28194478154182434, -0.10804805159568787, 0.07496022433042526, -0.09336724877357483, 0.012041419744491577, -0.5528011918067932, 0.18361803889274597, 0.20081773400306702, -0.18809455633163452, 0.09605857729911804, 0.08472958207130432, -0.034758906811475754, -0.389293372631073, 0.2876204252243042, -0.04255367070436478, 0.14749905467033386, 0.34161704778671265, -0.2788583040237427, -0.1577606499195099, -0.2540484666824341, 0.22136002779006958, -0.051780521869659424, 0.17868298292160034, -0.06266802549362183, 0.12067979574203491, 0.1192161813378334, -0.016971269622445107, -0.34429383277893066, 0.2736664116382599, -0.07232514023780823, -0.04816067963838577, -0.0925893560051918, 0.0034498944878578186, -0.09253467619419098, -0.1219482272863388, -0.07079626619815826, 0.18976107239723206, 0.41721487045288086, 0.34176039695739746, 0.1271076798439026, -0.16684505343437195, 0.4247022271156311, 0.05893576517701149, -0.3586464524269104, 0.1728733479976654, 0.11615689098834991, 0.6134870648384094, -0.20480002462863922, 0.12791043519973755, -0.38616108894348145, -0.03618483990430832, -0.05572718381881714, -0.011154032312333584, 0.07829304784536362, 0.192569762468338, 0.11454249918460846, 0.07499891519546509, 0.1933576762676239, 0.02075883001089096, 0.294731080532074, -0.2644868493080139, -0.15689784288406372, -0.14011067152023315, 0.2118077576160431, 0.30274534225463867, -0.03715644031763077, 0.09993882477283478, 0.1772722750902176, 0.388740599155426, 0.18764075636863708, 0.4305494725704193, -0.08905190229415894, 0.15339040756225586, -0.3839755058288574, -0.36545008420944214, 0.2437203973531723, -0.28721123933792114, -0.33443111181259155, 0.09453444182872772, -0.08328220248222351, 0.41916972398757935, 0.14611053466796875, 0.5173705220222473, 0.02690596505999565, -0.18208497762680054, 0.0021019969135522842, 0.48854830861091614, -0.09083807468414307, 0.21782147884368896, -0.25932231545448303, -0.0259261354804039, 0.34980812668800354, 0.2082962542772293, -0.058370042592287064, 0.1654386967420578, -0.18256595730781555, -0.27075308561325073, 0.25457656383514404, -0.303638756275177, -0.17052331566810608, 0.20736002922058105, -0.27569055557250977, -0.29169121384620667, 0.13422806560993195, 0.0627782940864563, -0.21288630366325378, 0.1516287624835968, 0.2412818968296051, 0.10429584980010986, -0.18488886952400208, 0.001715727150440216, 0.07683856785297394, -0.026436801999807358, -0.14453503489494324, -0.02095862664282322, -0.02984040230512619, 0.06935014575719833, -0.11073428392410278, -0.13431000709533691, 0.11232709884643555, 0.3984880745410919, -0.10619666427373886, 0.0444033183157444, -0.39719337224960327, -0.12575021386146545, 0.28427979350090027, -0.024164967238903046, -0.13603436946868896, 0.05652575567364693, -0.05718227103352547, -0.2514550983905792, -0.05636601895093918, 0.22446328401565552, 0.050545915961265564, 0.4293959438800812, -0.131194069981575, 0.22481580078601837, 0.24703042209148407, -0.15844379365444183, 0.2350296974182129, 0.1357797384262085, 0.06276673078536987, -0.14441391825675964, 0.028154637664556503, 0.6309671998023987, -0.14182265102863312, 0.45994803309440613, -0.015602126717567444, 0.11000996083021164, -0.11095333844423294, 0.11837993562221527, -0.35943135619163513, 0.4095698893070221, 0.40070149302482605, 0.25538307428359985, 0.36682435870170593, 0.03985346853733063, -0.5823836326599121, 0.16074524819850922, 0.23336799442768097, 0.07158026099205017, -0.19901202619075775, 0.14563727378845215, -0.05702933669090271, 0.19690385460853577, 0.055134765803813934, -0.40865805745124817, 0.29909417033195496, 0.10859157145023346, 0.10563486069440842, 0.0928238108754158, -0.09843765944242477, -0.0365508496761322, 0.023661229759454727, 0.3963944911956787, 0.15686732530593872, -0.12477344274520874, 0.496279239654541, 0.07764841616153717, -0.2017214596271515, -0.15578365325927734, -0.19392701983451843, -0.0505492240190506, 0.025976717472076416, 0.6795868873596191, -0.15941855311393738, 0.0815892145037651, -0.17174997925758362, -0.25852710008621216, -0.14794334769248962, -0.2400476336479187, 0.06984452903270721, 0.15156561136245728, 0.008950933814048767, 0.3132169842720032, 0.31171420216560364, 0.03648895025253296, 0.3738652765750885, -0.5060091614723206, -0.39496034383773804, -0.14198517799377441, -0.026171155273914337, -0.09710223972797394, 0.1925058811903, -0.10382027924060822, 0.34675952792167664, -0.1966988742351532, -0.12772519886493683, -0.3007309138774872, -0.2184172421693802, 0.0813586562871933, -0.055962249636650085, 0.12474866956472397, 0.03626086935400963, 0.014123070985078812, -0.24596737325191498, -0.0013972073793411255, 0.1646566241979599, -0.07930424809455872, -0.03640223294496536, 0.15006965398788452, -0.014378160238265991, 0.14008091390132904, 0.15827174484729767, -0.06239071115851402, -0.11390796303749084, -0.14282888174057007, 0.12218763679265976, -0.061651892960071564, 0.199710875749588, 0.16694410145282745, 0.11178769171237946, -0.019556283950805664, 0.24090725183486938, 0.2072761058807373, -0.13664865493774414, -0.4197753071784973, 0.4466388523578644, -0.03292354196310043, -0.19057445228099823, -0.41945722699165344, -0.2390674650669098, 0.16837550699710846, 0.7547339200973511, -0.4643011689186096, -0.3746644854545593, -0.404529869556427, 0.32483696937561035, -0.3847585618495941, -0.03216663748025894, 0.13682937622070312, -0.034892044961452484, -0.05198753997683525, 0.089751236140728, 0.05758067965507507, -0.38049429655075073, -0.038262851536273956, 0.13192862272262573, 0.12453480809926987, 0.3896569311618805, 0.16628524661064148, 0.6349420547485352, 0.08952820301055908, -0.3436696529388428, -0.1269930899143219, -0.1395045518875122, 0.1821439415216446, -0.19845010340213776, -0.4711117744445801, 0.0673714354634285, -0.0963066965341568, -0.4437582492828369, -0.27049684524536133, -0.18763938546180725, -0.04110204428434372, -0.012158989906311035, 0.2880568504333496, 0.05483604967594147, -0.21134763956069946, 0.24332194030284882, -0.4914538860321045, 0.3696002662181854, 0.02769472450017929, 0.47863325476646423, -0.44778144359588623, -0.17129331827163696, 0.2350832223892212, 0.1099277138710022, 0.3762240409851074, -0.08263114839792252, -0.04953480511903763, -0.105656199157238, -0.5614991784095764, 0.31337660551071167, 0.22545970976352692, 0.36966845393180847, 0.16651862859725952, -0.12748977541923523, 0.311137855052948, -0.047866590321063995, 0.732040524482727, 0.10623294115066528, -0.2437330186367035, 0.21797136962413788, -0.6298397779464722, -0.7540130615234375, 0.05099470913410187, -0.015208154916763306, 0.10777055472135544, 0.3781169652938843, 0.4871593415737152, 0.06038902699947357, -0.2604096531867981, 0.07189172506332397, 0.30368107557296753, -0.1444736123085022, -0.034417636692523956, -0.2766624987125397, -0.5008148550987244, -0.07970958948135376, 0.08429887890815735, 0.03287466615438461, -0.0887041836977005, 0.1840519905090332, -0.08737348765134811, -0.41216951608657837, 0.11325573921203613, 0.06614114344120026, 0.040240801870822906, 0.11340858042240143, -0.07203281670808792, 0.2641178369522095, 0.16827979683876038, 0.1637665331363678, 0.21603985130786896, 0.11186613142490387, 0.13177865743637085, -0.08865275979042053, 0.03884866461157799, 0.12089450657367706, 0.0833020731806755, 0.7092302441596985, 0.033803075551986694, -0.10749978572130203, -0.5433777570724487, 0.20436939597129822, -0.31446337699890137, -0.07710293680429459, 0.47604191303253174, 0.12262009084224701, -0.2562497556209564, -0.25718435645103455, 0.36992475390434265, 0.2985992431640625, -0.043635375797748566, 0.5434492230415344, -0.5204727649688721, 0.03063012659549713, 0.14813333749771118, 0.2986645996570587, 1.003055214881897, -0.13325171172618866, 0.27861085534095764, 0.3623732924461365, 0.028666481375694275, -0.0578441247344017, -0.08843345195055008, 0.28070446848869324, -0.059731222689151764, -0.41548246145248413, -0.041242752224206924, -0.3132475018501282, 0.15669003129005432, -0.028259720653295517, 0.1071537509560585, 0.19075429439544678, -0.18644055724143982, 0.007200710475444794, -0.07558149099349976, -0.25375741720199585, -0.24493202567100525, -0.4004133343696594, -0.1330520659685135, 0.024263985455036163, 0.25463438034057617, 0.12389588356018066, 0.007108032703399658, -0.1154598519206047, -0.28837016224861145, 0.117380790412426, -0.1519496738910675, -0.22366100549697876, -0.3305935561656952, 0.13544972240924835, 0.20501430332660675, -0.8528634309768677, 0.12134692072868347, 0.20152293145656586, 0.20910727977752686, -0.04406047612428665, 0.009059889242053032, 0.2631354331970215, 0.18969137966632843, 0.31793299317359924, 0.07854767143726349, -0.3841387927532196, 0.3268326222896576, 0.18177874386310577, 0.16571392118930817, 0.0976596474647522, 0.01588999480009079, -0.0890883132815361, -0.24874815344810486, 0.15319693088531494, 0.0863017588853836, 0.18887430429458618, 0.0732736885547638, -0.07750409841537476, -0.21316537261009216, -0.21753525733947754, 0.05380471795797348, 0.04956286400556564, 0.06919188797473907, 0.7558907270431519, -0.053490735590457916, -0.3480030298233032, 0.07198008894920349, 0.340320885181427, 0.07990595698356628, -0.10217192769050598, 0.4426038861274719, 0.04722782224416733, -0.29295194149017334, -0.022259898483753204, 0.2921852767467499, 0.025037772953510284, -0.3107544183731079, 0.4226572811603546, -0.31105363368988037, 0.15982486307621002, -0.3031797409057617, -0.11647449433803558, -0.18209372460842133, -0.17896130681037903, -0.47103452682495117, -0.06999491155147552, -0.17283113300800323, 0.10848711431026459, 0.03039497509598732, 0.22553157806396484, -0.29293373227119446, 0.2011050283908844, -0.25986406207084656, 0.05900826305150986, -0.20243693888187408, -0.0801653191447258, -0.047150831669569016, 0.08416733145713806, 0.05915170535445213, 0.0763397365808487, -0.060507882386446, 0.03798465058207512, 0.012269344180822372, 0.3438180685043335, -0.08299000561237335, -0.12322571128606796, 0.0985889583826065, 0.18014085292816162, -0.2479163110256195, -0.42766863107681274, 0.3208157420158386, -0.11907704919576645, -0.06305962800979614, -0.26627761125564575, 0.08763885498046875, 0.2620057761669159, 0.012179490178823471, -0.04023344814777374, -0.08534462749958038, 0.04579944908618927, 0.44107311964035034, -0.07368380576372147, -0.1629139482975006, 0.18941698968410492, -0.010401450097560883, 0.06088744476437569, 0.19366542994976044, -0.22699260711669922, -0.06953813135623932, 0.16513298451900482, 0.05021781846880913, -0.06677626073360443, 0.3221137225627899, -0.1148497611284256, 0.10602176189422607, 0.019830256700515747, 0.21315957605838776, 0.35506629943847656, -0.21238312125205994, -0.35898464918136597, 0.10390055179595947, 0.042924799025058746, -0.15356245636940002, -0.19321563839912415, -0.07580830156803131, 0.06316924095153809, 0.06634856015443802, 0.17069731652736664, -0.015320949256420135, 0.35555535554885864, -0.2694492042064667, -0.15480339527130127, 0.09927158057689667, -0.48540642857551575, -0.03283306956291199, 0.4245511293411255, 0.05880773067474365, 0.016508882865309715, 0.32715752720832825, 0.101779043674469, 0.01998170092701912, 0.307266503572464, 0.2176041603088379, 0.49735236167907715, 0.19189412891864777, 0.15247878432273865, -0.010752208530902863, -0.06698362529277802, -0.2680278718471527, -0.04190366715192795, -0.07807360589504242, 0.23841562867164612, 0.08258740603923798, 0.23397286236286163, 0.08125343173742294, -0.3584100902080536, -0.050303470343351364, 0.3425595462322235, -0.006484915968030691, -0.07424844801425934, 0.08552762866020203, 0.04599672555923462, 0.0519481897354126, 0.11592495441436768, -0.1831716001033783, -0.0582774318754673, 0.5287224054336548, 0.18494975566864014, 0.23705518245697021, -0.3262636661529541, 0.0024406742304563522, -0.17526262998580933, 0.18599943816661835, -0.08415492624044418, -0.20555686950683594, 0.1964007467031479, 0.09467759728431702, 0.06790976226329803, 0.3078230619430542, 0.3289530277252197, 0.10499376058578491, -0.34773463010787964, 0.09865702688694, -0.3716215193271637, -0.048112280666828156, 0.1205480545759201, 0.13163773715496063, -0.21153992414474487, -0.103877492249012, 0.22759008407592773, -0.06451071798801422, -0.12490884214639664, -0.04389110580086708, -0.14743584394454956, 0.03947554901242256, -0.4099491834640503, 0.3363114297389984, -0.2796468734741211, -0.041650183498859406, -0.23476210236549377, -0.16845358908176422, -0.042500898241996765, -0.2864949107170105, 0.4487704038619995, -0.3541342318058014, -0.018771406263113022, 0.22194261848926544, 0.015765823423862457, -0.4454546272754669, 0.7320996522903442, 0.24817152321338654, 0.327541321516037, -0.14548026025295258, -0.0838591679930687, -0.1750638335943222, 0.0033024288713932037, -0.19414860010147095, -0.1455651819705963, 0.3839465379714966, 0.1959996074438095, 0.1699649691581726, 0.31028538942337036, 0.5192381739616394, -0.1721847802400589, 0.0793493390083313, 0.549163818359375, -0.35854679346084595, -0.2110459953546524, -0.3923129737377167, -0.03227873891592026, -0.06859062612056732, -0.5513907670974731, 0.22292165458202362, 0.06671635806560516, 0.06951697915792465, -0.012954223901033401, -0.09238593280315399, -0.042858969420194626, 0.5095472931861877, 0.34633585810661316, 0.160577654838562, -0.16956548392772675, -0.1316055804491043, -0.1317279040813446, -0.2544022500514984, -0.22175107896327972, -0.10093031823635101, 0.30632513761520386, 0.0006253458559513092, 0.11506189405918121, 0.0321347638964653, -0.3841327726840973, -0.1116374209523201, 0.511653482913971, 0.08091620355844498, -0.30390864610671997, -0.22494788467884064, 0.3026486039161682, -0.12737874686717987, 0.3192712068557739, -0.17242875695228577, 0.2818687856197357, 0.18408146500587463, 0.35710054636001587, -0.40436026453971863, -0.4154525101184845, 0.6602816581726074, -0.3118371069431305, -0.446837842464447, -0.007697552442550659, -0.0983169823884964, 0.023356696590781212, 0.20609332621097565, -0.2749466598033905, -0.11507879197597504, 0.15626877546310425, -0.007397398352622986, -0.018093422055244446, 0.3438461124897003, 0.1991129219532013, -0.08967399597167969, -0.1062263622879982, 0.27378329634666443, -0.04894993454217911, -0.0698498785495758, -0.17250768840312958, -0.13595277070999146 ]
https://github.com/huggingface/datasets/issues/5841
I have a similar issue: iterating over a dataset takes 5s without applying any transform, but takes ~30s after applying a transform. Here is the minimum code to reproduce the problem ```python import numpy as np from datasets import Dataset, DatasetDict, load_dataset, Array3D, Image, Features from torch.utils.data import DataLoader from tqdm import tqdm import torchvision from torchvision.transforms import ToTensor, Normalize ################################# # Without transform ################################# train_dataset = load_dataset( 'cifar100', split='train', use_auth_token=True, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data, no transform"): pass ################################# # With transform ################################# transform_func = torchvision.transforms.Compose([ ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std= [0.229, 0.224, 0.225]),] ) train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"img": transform_func(x["img"])}, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data after transform"): pass ``` I have also tried converting the Image column to an Array3D ```python img_shape = train_dataset[0]["img"].shape features = train_dataset.features.copy() features["x"] = Array3D(shape=img_shape, dtype="float32") train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"x": np.array(x["img"], dtype=np.uint8)}, features=features, ) train_dataset.cast_column("x", Array3D(shape=img_shape, dtype="float32")) train_dataset.set_format(type="numpy", columns=["x", "fine_label"]) ``` but to no avail. Any clue?
Abusurdly slow on iteration
### Describe the bug I am attempting to iterate through an image dataset, but I am encountering a significant slowdown in the iteration speed. In order to investigate this issue, I conducted the following experiment: ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` I noticed that the dataset in numpy format performs significantly faster than the one in torch format. My hypothesis is that the dataset undergoes a transformation process of torch->python->numpy(torch) in the background, which might be causing the slowdown. Is there any way to expedite the process by bypassing such transformations? Furthermore, if I increase the size of a to an image shape, like: ```python a=torch.randn(3,224,224) ``` the iteration speed becomes absurdly slow, around 100 iterations per second, whereas the speed with numpy format is approximately 250 iterations per second. This level of speed would be unacceptable for large image datasets, as it could take several hours just to iterate through a single epoch. ### Steps to reproduce the bug ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` ### Expected behavior iteration faster ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.10 - Python version: 3.8.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
187
Abusurdly slow on iteration ### Describe the bug I am attempting to iterate through an image dataset, but I am encountering a significant slowdown in the iteration speed. In order to investigate this issue, I conducted the following experiment: ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` I noticed that the dataset in numpy format performs significantly faster than the one in torch format. My hypothesis is that the dataset undergoes a transformation process of torch->python->numpy(torch) in the background, which might be causing the slowdown. Is there any way to expedite the process by bypassing such transformations? Furthermore, if I increase the size of a to an image shape, like: ```python a=torch.randn(3,224,224) ``` the iteration speed becomes absurdly slow, around 100 iterations per second, whereas the speed with numpy format is approximately 250 iterations per second. This level of speed would be unacceptable for large image datasets, as it could take several hours just to iterate through a single epoch. ### Steps to reproduce the bug ```python a=torch.randn(100,224) a=torch.stack([a] * 10000) a.shape # %% ds=Dataset.from_dict({"tensor":a}) for i in tqdm(ds.with_format("numpy")): pass for i in tqdm(ds.with_format("torch")): pass ``` ### Expected behavior iteration faster ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.0-148-generic-x86_64-with-glibc2.10 - Python version: 3.8.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 I have a similar issue: iterating over a dataset takes 5s without applying any transform, but takes ~30s after applying a transform. Here is the minimum code to reproduce the problem ```python import numpy as np from datasets import Dataset, DatasetDict, load_dataset, Array3D, Image, Features from torch.utils.data import DataLoader from tqdm import tqdm import torchvision from torchvision.transforms import ToTensor, Normalize ################################# # Without transform ################################# train_dataset = load_dataset( 'cifar100', split='train', use_auth_token=True, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data, no transform"): pass ################################# # With transform ################################# transform_func = torchvision.transforms.Compose([ ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std= [0.229, 0.224, 0.225]),] ) train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"img": transform_func(x["img"])}, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data after transform"): pass ``` I have also tried converting the Image column to an Array3D ```python img_shape = train_dataset[0]["img"].shape features = train_dataset.features.copy() features["x"] = Array3D(shape=img_shape, dtype="float32") train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"x": np.array(x["img"], dtype=np.uint8)}, features=features, ) train_dataset.cast_column("x", Array3D(shape=img_shape, dtype="float32")) train_dataset.set_format(type="numpy", columns=["x", "fine_label"]) ``` but to no avail. Any clue?
[ -0.1845068335533142, -0.5200334191322327, -0.04702053964138031, 0.2566430866718292, 0.12682995200157166, 0.1570071130990982, 0.481078177690506, 0.219479501247406, -0.2652483582496643, 0.1919068694114685, -0.06385338306427002, 0.5231744050979614, -0.08375862240791321, -0.4237799346446991, -0.30449801683425903, -0.15257632732391357, 0.048421669751405716, -0.2538783550262451, -0.3577803671360016, -0.16129586100578308, -0.29770585894584656, -0.2262297421693802, 0.014456912875175476, -0.13574764132499695, -0.22869931161403656, -0.3462592661380768, 0.02290485054254532, 0.23143532872200012, 0.09737979620695114, -0.08314795792102814, -0.10747753083705902, -0.09758540987968445, -0.1336996853351593, 0.6300845146179199, -0.00012157205492258072, 0.11679111421108246, 0.21561560034751892, 0.16419880092144012, -0.033040888607501984, 0.41467416286468506, 0.410489022731781, -0.18716973066329956, -0.06275424361228943, -0.3683652877807617, 0.16423749923706055, -0.08909842371940613, 0.03964091092348099, -0.42168721556663513, 0.27982038259506226, -0.17173387110233307, 0.10210144519805908, 0.2301226109266281, -0.5086674690246582, 0.21156743168830872, -0.059800438582897186, 0.2605196535587311, -0.17105162143707275, 0.04823669046163559, 0.534172773361206, 0.13588137924671173, -0.28871506452560425, 0.6495189070701599, -0.301554799079895, 0.0897943526506424, 0.1819433569908142, -0.027753932401537895, 0.06182297691702843, -0.36342570185661316, 0.09059938043355942, 0.40774717926979065, 0.18886534869670868, -0.07852964103221893, -0.4917795956134796, -0.22966568171977997, -0.08645614981651306, -0.16281694173812866, -0.07988208532333374, 0.13089105486869812, -0.3415217995643616, -0.07540402561426163, -0.4372415542602539, 0.08790507912635803, 0.07285082340240479, 0.07420113682746887, -0.1790701448917389, -0.208817258477211, 0.3561360239982605, 0.024632560089230537, 0.0840594470500946, -0.060764528810977936, 0.35193783044815063, -0.19874170422554016, 0.4514191746711731, 0.18406733870506287, -0.41584137082099915, 0.05544097721576691, -0.0056813377887010574, -0.08914759755134583, -0.12433724105358124, -0.020745547488331795, 0.1568344384431839, 0.28194478154182434, -0.10804805159568787, 0.07496022433042526, -0.09336724877357483, 0.012041419744491577, -0.5528011918067932, 0.18361803889274597, 0.20081773400306702, -0.18809455633163452, 0.09605857729911804, 0.08472958207130432, -0.034758906811475754, -0.389293372631073, 0.2876204252243042, -0.04255367070436478, 0.14749905467033386, 0.34161704778671265, -0.2788583040237427, -0.1577606499195099, -0.2540484666824341, 0.22136002779006958, -0.051780521869659424, 0.17868298292160034, -0.06266802549362183, 0.12067979574203491, 0.1192161813378334, -0.016971269622445107, -0.34429383277893066, 0.2736664116382599, -0.07232514023780823, -0.04816067963838577, -0.0925893560051918, 0.0034498944878578186, -0.09253467619419098, -0.1219482272863388, -0.07079626619815826, 0.18976107239723206, 0.41721487045288086, 0.34176039695739746, 0.1271076798439026, -0.16684505343437195, 0.4247022271156311, 0.05893576517701149, -0.3586464524269104, 0.1728733479976654, 0.11615689098834991, 0.6134870648384094, -0.20480002462863922, 0.12791043519973755, -0.38616108894348145, -0.03618483990430832, -0.05572718381881714, -0.011154032312333584, 0.07829304784536362, 0.192569762468338, 0.11454249918460846, 0.07499891519546509, 0.1933576762676239, 0.02075883001089096, 0.294731080532074, -0.2644868493080139, -0.15689784288406372, -0.14011067152023315, 0.2118077576160431, 0.30274534225463867, -0.03715644031763077, 0.09993882477283478, 0.1772722750902176, 0.388740599155426, 0.18764075636863708, 0.4305494725704193, -0.08905190229415894, 0.15339040756225586, -0.3839755058288574, -0.36545008420944214, 0.2437203973531723, -0.28721123933792114, -0.33443111181259155, 0.09453444182872772, -0.08328220248222351, 0.41916972398757935, 0.14611053466796875, 0.5173705220222473, 0.02690596505999565, -0.18208497762680054, 0.0021019969135522842, 0.48854830861091614, -0.09083807468414307, 0.21782147884368896, -0.25932231545448303, -0.0259261354804039, 0.34980812668800354, 0.2082962542772293, -0.058370042592287064, 0.1654386967420578, -0.18256595730781555, -0.27075308561325073, 0.25457656383514404, -0.303638756275177, -0.17052331566810608, 0.20736002922058105, -0.27569055557250977, -0.29169121384620667, 0.13422806560993195, 0.0627782940864563, -0.21288630366325378, 0.1516287624835968, 0.2412818968296051, 0.10429584980010986, -0.18488886952400208, 0.001715727150440216, 0.07683856785297394, -0.026436801999807358, -0.14453503489494324, -0.02095862664282322, -0.02984040230512619, 0.06935014575719833, -0.11073428392410278, -0.13431000709533691, 0.11232709884643555, 0.3984880745410919, -0.10619666427373886, 0.0444033183157444, -0.39719337224960327, -0.12575021386146545, 0.28427979350090027, -0.024164967238903046, -0.13603436946868896, 0.05652575567364693, -0.05718227103352547, -0.2514550983905792, -0.05636601895093918, 0.22446328401565552, 0.050545915961265564, 0.4293959438800812, -0.131194069981575, 0.22481580078601837, 0.24703042209148407, -0.15844379365444183, 0.2350296974182129, 0.1357797384262085, 0.06276673078536987, -0.14441391825675964, 0.028154637664556503, 0.6309671998023987, -0.14182265102863312, 0.45994803309440613, -0.015602126717567444, 0.11000996083021164, -0.11095333844423294, 0.11837993562221527, -0.35943135619163513, 0.4095698893070221, 0.40070149302482605, 0.25538307428359985, 0.36682435870170593, 0.03985346853733063, -0.5823836326599121, 0.16074524819850922, 0.23336799442768097, 0.07158026099205017, -0.19901202619075775, 0.14563727378845215, -0.05702933669090271, 0.19690385460853577, 0.055134765803813934, -0.40865805745124817, 0.29909417033195496, 0.10859157145023346, 0.10563486069440842, 0.0928238108754158, -0.09843765944242477, -0.0365508496761322, 0.023661229759454727, 0.3963944911956787, 0.15686732530593872, -0.12477344274520874, 0.496279239654541, 0.07764841616153717, -0.2017214596271515, -0.15578365325927734, -0.19392701983451843, -0.0505492240190506, 0.025976717472076416, 0.6795868873596191, -0.15941855311393738, 0.0815892145037651, -0.17174997925758362, -0.25852710008621216, -0.14794334769248962, -0.2400476336479187, 0.06984452903270721, 0.15156561136245728, 0.008950933814048767, 0.3132169842720032, 0.31171420216560364, 0.03648895025253296, 0.3738652765750885, -0.5060091614723206, -0.39496034383773804, -0.14198517799377441, -0.026171155273914337, -0.09710223972797394, 0.1925058811903, -0.10382027924060822, 0.34675952792167664, -0.1966988742351532, -0.12772519886493683, -0.3007309138774872, -0.2184172421693802, 0.0813586562871933, -0.055962249636650085, 0.12474866956472397, 0.03626086935400963, 0.014123070985078812, -0.24596737325191498, -0.0013972073793411255, 0.1646566241979599, -0.07930424809455872, -0.03640223294496536, 0.15006965398788452, -0.014378160238265991, 0.14008091390132904, 0.15827174484729767, -0.06239071115851402, -0.11390796303749084, -0.14282888174057007, 0.12218763679265976, -0.061651892960071564, 0.199710875749588, 0.16694410145282745, 0.11178769171237946, -0.019556283950805664, 0.24090725183486938, 0.2072761058807373, -0.13664865493774414, -0.4197753071784973, 0.4466388523578644, -0.03292354196310043, -0.19057445228099823, -0.41945722699165344, -0.2390674650669098, 0.16837550699710846, 0.7547339200973511, -0.4643011689186096, -0.3746644854545593, -0.404529869556427, 0.32483696937561035, -0.3847585618495941, -0.03216663748025894, 0.13682937622070312, -0.034892044961452484, -0.05198753997683525, 0.089751236140728, 0.05758067965507507, -0.38049429655075073, -0.038262851536273956, 0.13192862272262573, 0.12453480809926987, 0.3896569311618805, 0.16628524661064148, 0.6349420547485352, 0.08952820301055908, -0.3436696529388428, -0.1269930899143219, -0.1395045518875122, 0.1821439415216446, -0.19845010340213776, -0.4711117744445801, 0.0673714354634285, -0.0963066965341568, -0.4437582492828369, -0.27049684524536133, -0.18763938546180725, -0.04110204428434372, -0.012158989906311035, 0.2880568504333496, 0.05483604967594147, -0.21134763956069946, 0.24332194030284882, -0.4914538860321045, 0.3696002662181854, 0.02769472450017929, 0.47863325476646423, -0.44778144359588623, -0.17129331827163696, 0.2350832223892212, 0.1099277138710022, 0.3762240409851074, -0.08263114839792252, -0.04953480511903763, -0.105656199157238, -0.5614991784095764, 0.31337660551071167, 0.22545970976352692, 0.36966845393180847, 0.16651862859725952, -0.12748977541923523, 0.311137855052948, -0.047866590321063995, 0.732040524482727, 0.10623294115066528, -0.2437330186367035, 0.21797136962413788, -0.6298397779464722, -0.7540130615234375, 0.05099470913410187, -0.015208154916763306, 0.10777055472135544, 0.3781169652938843, 0.4871593415737152, 0.06038902699947357, -0.2604096531867981, 0.07189172506332397, 0.30368107557296753, -0.1444736123085022, -0.034417636692523956, -0.2766624987125397, -0.5008148550987244, -0.07970958948135376, 0.08429887890815735, 0.03287466615438461, -0.0887041836977005, 0.1840519905090332, -0.08737348765134811, -0.41216951608657837, 0.11325573921203613, 0.06614114344120026, 0.040240801870822906, 0.11340858042240143, -0.07203281670808792, 0.2641178369522095, 0.16827979683876038, 0.1637665331363678, 0.21603985130786896, 0.11186613142490387, 0.13177865743637085, -0.08865275979042053, 0.03884866461157799, 0.12089450657367706, 0.0833020731806755, 0.7092302441596985, 0.033803075551986694, -0.10749978572130203, -0.5433777570724487, 0.20436939597129822, -0.31446337699890137, -0.07710293680429459, 0.47604191303253174, 0.12262009084224701, -0.2562497556209564, -0.25718435645103455, 0.36992475390434265, 0.2985992431640625, -0.043635375797748566, 0.5434492230415344, -0.5204727649688721, 0.03063012659549713, 0.14813333749771118, 0.2986645996570587, 1.003055214881897, -0.13325171172618866, 0.27861085534095764, 0.3623732924461365, 0.028666481375694275, -0.0578441247344017, -0.08843345195055008, 0.28070446848869324, -0.059731222689151764, -0.41548246145248413, -0.041242752224206924, -0.3132475018501282, 0.15669003129005432, -0.028259720653295517, 0.1071537509560585, 0.19075429439544678, -0.18644055724143982, 0.007200710475444794, -0.07558149099349976, -0.25375741720199585, -0.24493202567100525, -0.4004133343696594, -0.1330520659685135, 0.024263985455036163, 0.25463438034057617, 0.12389588356018066, 0.007108032703399658, -0.1154598519206047, -0.28837016224861145, 0.117380790412426, -0.1519496738910675, -0.22366100549697876, -0.3305935561656952, 0.13544972240924835, 0.20501430332660675, -0.8528634309768677, 0.12134692072868347, 0.20152293145656586, 0.20910727977752686, -0.04406047612428665, 0.009059889242053032, 0.2631354331970215, 0.18969137966632843, 0.31793299317359924, 0.07854767143726349, -0.3841387927532196, 0.3268326222896576, 0.18177874386310577, 0.16571392118930817, 0.0976596474647522, 0.01588999480009079, -0.0890883132815361, -0.24874815344810486, 0.15319693088531494, 0.0863017588853836, 0.18887430429458618, 0.0732736885547638, -0.07750409841537476, -0.21316537261009216, -0.21753525733947754, 0.05380471795797348, 0.04956286400556564, 0.06919188797473907, 0.7558907270431519, -0.053490735590457916, -0.3480030298233032, 0.07198008894920349, 0.340320885181427, 0.07990595698356628, -0.10217192769050598, 0.4426038861274719, 0.04722782224416733, -0.29295194149017334, -0.022259898483753204, 0.2921852767467499, 0.025037772953510284, -0.3107544183731079, 0.4226572811603546, -0.31105363368988037, 0.15982486307621002, -0.3031797409057617, -0.11647449433803558, -0.18209372460842133, -0.17896130681037903, -0.47103452682495117, -0.06999491155147552, -0.17283113300800323, 0.10848711431026459, 0.03039497509598732, 0.22553157806396484, -0.29293373227119446, 0.2011050283908844, -0.25986406207084656, 0.05900826305150986, -0.20243693888187408, -0.0801653191447258, -0.047150831669569016, 0.08416733145713806, 0.05915170535445213, 0.0763397365808487, -0.060507882386446, 0.03798465058207512, 0.012269344180822372, 0.3438180685043335, -0.08299000561237335, -0.12322571128606796, 0.0985889583826065, 0.18014085292816162, -0.2479163110256195, -0.42766863107681274, 0.3208157420158386, -0.11907704919576645, -0.06305962800979614, -0.26627761125564575, 0.08763885498046875, 0.2620057761669159, 0.012179490178823471, -0.04023344814777374, -0.08534462749958038, 0.04579944908618927, 0.44107311964035034, -0.07368380576372147, -0.1629139482975006, 0.18941698968410492, -0.010401450097560883, 0.06088744476437569, 0.19366542994976044, -0.22699260711669922, -0.06953813135623932, 0.16513298451900482, 0.05021781846880913, -0.06677626073360443, 0.3221137225627899, -0.1148497611284256, 0.10602176189422607, 0.019830256700515747, 0.21315957605838776, 0.35506629943847656, -0.21238312125205994, -0.35898464918136597, 0.10390055179595947, 0.042924799025058746, -0.15356245636940002, -0.19321563839912415, -0.07580830156803131, 0.06316924095153809, 0.06634856015443802, 0.17069731652736664, -0.015320949256420135, 0.35555535554885864, -0.2694492042064667, -0.15480339527130127, 0.09927158057689667, -0.48540642857551575, -0.03283306956291199, 0.4245511293411255, 0.05880773067474365, 0.016508882865309715, 0.32715752720832825, 0.101779043674469, 0.01998170092701912, 0.307266503572464, 0.2176041603088379, 0.49735236167907715, 0.19189412891864777, 0.15247878432273865, -0.010752208530902863, -0.06698362529277802, -0.2680278718471527, -0.04190366715192795, -0.07807360589504242, 0.23841562867164612, 0.08258740603923798, 0.23397286236286163, 0.08125343173742294, -0.3584100902080536, -0.050303470343351364, 0.3425595462322235, -0.006484915968030691, -0.07424844801425934, 0.08552762866020203, 0.04599672555923462, 0.0519481897354126, 0.11592495441436768, -0.1831716001033783, -0.0582774318754673, 0.5287224054336548, 0.18494975566864014, 0.23705518245697021, -0.3262636661529541, 0.0024406742304563522, -0.17526262998580933, 0.18599943816661835, -0.08415492624044418, -0.20555686950683594, 0.1964007467031479, 0.09467759728431702, 0.06790976226329803, 0.3078230619430542, 0.3289530277252197, 0.10499376058578491, -0.34773463010787964, 0.09865702688694, -0.3716215193271637, -0.048112280666828156, 0.1205480545759201, 0.13163773715496063, -0.21153992414474487, -0.103877492249012, 0.22759008407592773, -0.06451071798801422, -0.12490884214639664, -0.04389110580086708, -0.14743584394454956, 0.03947554901242256, -0.4099491834640503, 0.3363114297389984, -0.2796468734741211, -0.041650183498859406, -0.23476210236549377, -0.16845358908176422, -0.042500898241996765, -0.2864949107170105, 0.4487704038619995, -0.3541342318058014, -0.018771406263113022, 0.22194261848926544, 0.015765823423862457, -0.4454546272754669, 0.7320996522903442, 0.24817152321338654, 0.327541321516037, -0.14548026025295258, -0.0838591679930687, -0.1750638335943222, 0.0033024288713932037, -0.19414860010147095, -0.1455651819705963, 0.3839465379714966, 0.1959996074438095, 0.1699649691581726, 0.31028538942337036, 0.5192381739616394, -0.1721847802400589, 0.0793493390083313, 0.549163818359375, -0.35854679346084595, -0.2110459953546524, -0.3923129737377167, -0.03227873891592026, -0.06859062612056732, -0.5513907670974731, 0.22292165458202362, 0.06671635806560516, 0.06951697915792465, -0.012954223901033401, -0.09238593280315399, -0.042858969420194626, 0.5095472931861877, 0.34633585810661316, 0.160577654838562, -0.16956548392772675, -0.1316055804491043, -0.1317279040813446, -0.2544022500514984, -0.22175107896327972, -0.10093031823635101, 0.30632513761520386, 0.0006253458559513092, 0.11506189405918121, 0.0321347638964653, -0.3841327726840973, -0.1116374209523201, 0.511653482913971, 0.08091620355844498, -0.30390864610671997, -0.22494788467884064, 0.3026486039161682, -0.12737874686717987, 0.3192712068557739, -0.17242875695228577, 0.2818687856197357, 0.18408146500587463, 0.35710054636001587, -0.40436026453971863, -0.4154525101184845, 0.6602816581726074, -0.3118371069431305, -0.446837842464447, -0.007697552442550659, -0.0983169823884964, 0.023356696590781212, 0.20609332621097565, -0.2749466598033905, -0.11507879197597504, 0.15626877546310425, -0.007397398352622986, -0.018093422055244446, 0.3438461124897003, 0.1991129219532013, -0.08967399597167969, -0.1062263622879982, 0.27378329634666443, -0.04894993454217911, -0.0698498785495758, -0.17250768840312958, -0.13595277070999146 ]
https://github.com/huggingface/datasets/issues/5842
This method has been recently added to the `IterableDataset`, so you need to update the `datasets`' installation (`pip install -U datasets`) to use it.
Remove columns in interable dataset
### Feature request Right now, remove_columns() produces a NotImplementedError for iterable style datasets ### Motivation It would be great to have the same functionality irrespective of whether one is using an iterable or a map-style dataset ### Your contribution hope and courage.
24
Remove columns in interable dataset ### Feature request Right now, remove_columns() produces a NotImplementedError for iterable style datasets ### Motivation It would be great to have the same functionality irrespective of whether one is using an iterable or a map-style dataset ### Your contribution hope and courage. This method has been recently added to the `IterableDataset`, so you need to update the `datasets`' installation (`pip install -U datasets`) to use it.
[ -0.1692637801170349, -0.11372427642345428, -0.22988520562648773, 0.10435251891613007, 0.3636786937713623, 0.12261197715997696, 0.3428803086280823, 0.3954080641269684, 0.1778421252965927, 0.3825918436050415, -0.41839078068733215, 0.6086258888244629, -0.04357260465621948, 0.09833016991615295, -0.4599338173866272, -0.13810259103775024, -0.00019073486328125, 0.40642133355140686, -0.30717700719833374, 0.04669921100139618, -0.19025474786758423, 0.006246671080589294, -0.2819196879863739, -0.04511137679219246, 0.42531052231788635, -0.23016850650310516, 0.02449657768011093, -0.11371413618326187, -0.11131340265274048, -0.13843673467636108, 0.12044953554868698, 0.30872851610183716, -0.16593393683433533, -0.09899280220270157, -0.00010445637599332258, -0.06105003133416176, -0.002754043787717819, 0.07994341850280762, -0.3134326934814453, -0.07983916997909546, -0.3349977433681488, -0.3568161427974701, 0.25702136754989624, -0.2625467777252197, -0.05325200781226158, -0.21287773549556732, -0.2430657297372818, 0.1204296350479126, 0.19377361238002777, 0.20399369299411774, 0.3205735683441162, 0.20141953229904175, -0.03285975009202957, 0.20483273267745972, 0.3971204459667206, -0.0028961002826690674, -0.20660436153411865, -0.2424847036600113, 0.19168248772621155, -0.16973233222961426, 0.24778585135936737, 0.5000364184379578, -0.4247727394104004, 0.06207605451345444, 0.024034427478909492, -0.20086133480072021, 0.09561137855052948, -0.2909443974494934, 0.04773624241352081, 0.4328678548336029, 0.5199877619743347, -0.2707681655883789, -0.07610434293746948, -0.18513840436935425, 0.01561831682920456, -0.19470125436782837, 0.145165354013443, 0.04169780761003494, 0.0935530811548233, 0.1908159703016281, -0.22617822885513306, -0.01580824702978134, -0.15798375010490417, 0.032811522483825684, 0.14839395880699158, 0.20791174471378326, -0.03242969512939453, 0.06679816544055939, 0.40469059348106384, -0.04845111817121506, 0.05707264319062233, 0.02679377794265747, -0.033694762736558914, 0.23527422547340393, -0.3485434055328369, -0.4637979567050934, -0.08727268129587173, 0.18829341232776642, 0.10118144005537033, 0.3518965244293213, 0.06544371694326401, 0.0637851431965828, 0.30770143866539, 0.1792013943195343, 0.4812640845775604, -0.046925127506256104, -0.19662997126579285, 0.19541272521018982, 0.06313586235046387, -0.03242787346243858, 0.13049232959747314, -0.06431551277637482, 0.32472094893455505, -0.020870419219136238, 0.24517983198165894, -0.05188783258199692, 0.21160638332366943, 0.0033774450421333313, -0.6534720659255981, 0.083846814930439, -0.027211107313632965, -0.07318583130836487, 0.20943237841129303, 0.04949662834405899, 0.07055733352899551, 0.1841384917497635, -0.3094448745250702, 0.14752596616744995, -0.1383703052997589, 0.057466790080070496, -0.1045975387096405, 0.27648991346359253, 0.07119235396385193, -0.4195774793624878, 0.20268942415714264, -0.10403996706008911, 0.07626748085021973, 0.29361599683761597, -0.06309909373521805, 0.1129598617553711, 0.2632392942905426, -0.3019977807998657, 0.46564429998397827, 0.3939080536365509, -0.1377604454755783, -0.15893077850341797, 0.26864197850227356, -0.2251112312078476, -0.3047698140144348, 0.16394375264644623, -0.19154632091522217, -0.07928089052438736, -0.4209050238132477, 0.3075065612792969, -0.035126712173223495, 0.15995889902114868, -0.025971345603466034, -0.021914293989539146, -0.0020336247980594635, -0.16469134390354156, 0.4142722487449646, -0.19106942415237427, 0.20946845412254333, -0.13385814428329468, -0.046441249549388885, 0.08791299909353256, -0.26002267003059387, -0.020075887441635132, -0.018876628950238228, -0.5039645433425903, 0.0870169848203659, 0.08198289573192596, 0.06196516752243042, 0.08607211709022522, -0.1636713147163391, -0.17934003472328186, 0.20878010988235474, -0.2529359459877014, -0.21349728107452393, 0.5064840912818909, 0.02004113793373108, 0.3399394750595093, -0.09854772686958313, 0.2195771038532257, 0.18770045042037964, -0.0008964762091636658, -0.04651937633752823, -0.04763038456439972, 0.015583982691168785, -0.008954882621765137, -0.1971047967672348, -0.21640130877494812, -0.018016435205936432, 0.0668385773897171, -0.0845588892698288, 0.08307500183582306, 0.04470741003751755, -0.2724911868572235, 0.2707081735134125, -0.061261702328920364, 0.07377401739358902, 0.3020212948322296, 0.5228856205940247, 0.15025906264781952, -0.0985834151506424, -0.44412076473236084, -0.3209914565086365, -0.02020454779267311, 0.23610597848892212, -0.06741654872894287, -0.0799088329076767, -0.3730591833591461, 0.07273872196674347, 0.15453463792800903, -0.21220406889915466, 0.2358623594045639, 0.27099958062171936, -0.31252068281173706, -0.05116238445043564, -0.28596097230911255, -0.4721919298171997, 0.16332325339317322, -0.20120900869369507, 0.17716829478740692, -0.33924034237861633, 0.10284464806318283, 0.1887395828962326, 0.09785228967666626, -0.00665697455406189, 0.4118497669696808, -0.031355906277894974, -0.1300799697637558, 0.13562802970409393, 0.33381974697113037, -0.019212452694773674, 0.18061751127243042, -0.2888771891593933, 0.32990583777427673, -0.011444208212196827, -0.07292965054512024, -0.06961549818515778, -0.0653504729270935, 0.05828709527850151, 0.10241611301898956, -0.12338846921920776, 0.35459238290786743, -0.1553223580121994, 0.42963624000549316, 0.10346673429012299, 0.12553969025611877, 0.17889580130577087, -0.2804538607597351, -0.33956262469291687, -0.5239695906639099, 0.12447057664394379, 0.20009544491767883, -0.15572531521320343, 0.002226712182164192, -0.1593942493200302, 0.2045612931251526, -0.023345818743109703, 0.08373945206403732, -0.0040421877056360245, 0.08358359336853027, -0.07415886223316193, -0.045442454516887665, 0.04163471609354019, 0.04194260388612747, 0.237138032913208, 0.1901877522468567, 0.14699453115463257, 0.1181938648223877, 0.24405422806739807, -0.010955814272165298, 0.2306162267923355, 0.3537431061267853, 0.1050107479095459, 0.2458401471376419, 0.23225438594818115, 0.01713261753320694, -0.4605206251144409, 0.02591807395219803, -0.3508211076259613, 0.28874388337135315, -0.044047266244888306, 0.12162770330905914, -0.34982216358184814, -0.14782723784446716, 0.3721525967121124, -0.24161869287490845, -0.003349808044731617, -0.30856743454933167, 0.23194223642349243, 0.4717472493648529, -0.2978465259075165, 0.3523522615432739, -0.13218076527118683, 0.19821575284004211, -0.10611598193645477, -0.03677313029766083, -0.2190859466791153, -0.20818471908569336, 0.16600094735622406, 0.29452160000801086, -0.020353693515062332, 0.01704883575439453, 0.38313478231430054, -0.08173035830259323, -0.024108417332172394, -0.35672974586486816, -0.2660025954246521, 0.1662936508655548, -0.24765749275684357, 0.17753493785858154, 0.6491714715957642, 0.1506929099559784, -0.017196066677570343, 0.052895624190568924, 0.02521081641316414, -0.16255906224250793, -0.03611132502555847, 0.1441565901041031, -0.20317259430885315, 0.14057108759880066, -0.03662722185254097, -0.0723942220211029, -0.06408048421144485, -0.3052457571029663, 0.33221539855003357, -0.007855504751205444, 0.1523638218641281, -0.15781523287296295, -0.02596336416900158, -0.054657090455293655, 0.07006770372390747, 0.01775190606713295, -0.17951925098896027, -0.06562279164791107, -0.1120239645242691, 0.013066798448562622, 0.07328172028064728, 0.07507340610027313, -0.089305579662323, 0.35663101077079773, 0.06980422139167786, -0.23654325306415558, -0.3654461205005646, -0.20844632387161255, 0.03710092604160309, -0.23070406913757324, 0.015585159882903099, 0.3159199655056, 0.2653789222240448, -0.17299342155456543, 0.014763370156288147, 0.3292016386985779, -0.16097688674926758, 0.1180608719587326, -0.19508737325668335, 0.06805731356143951, 0.46596184372901917, 0.007938183844089508, 0.10854929685592651, 0.28574442863464355, 0.42626723647117615, 0.1758223921060562, -0.05586507171392441, 0.48492226004600525, -0.23509113490581512, -0.37327370047569275, 0.0719723254442215, 0.06127874180674553, -0.07408886402845383, 0.2609693706035614, -0.11411149054765701, -0.3416999578475952, -0.01081731915473938, 0.1544031947851181, 0.06683999300003052, -0.20145365595817566, 0.2837245464324951, -0.007755720987915993, 0.2575988471508026, 0.18295209109783173, -0.010698974132537842, -0.25462374091148376, -0.3621212840080261, -0.07964545488357544, -0.043306995183229446, 0.13845793902873993, -0.46181347966194153, -0.3394308090209961, -0.3494088053703308, -0.17993782460689545, 0.29325902462005615, 0.23505602777004242, -0.0015549734234809875, 0.060991913080215454, -0.4235896170139313, 0.055192094296216965, 0.08209240436553955, 0.25714972615242004, -0.31890207529067993, -0.5954820513725281, 0.07667792588472366, 0.20284226536750793, -0.40429654717445374, -0.050236087292432785, -0.26260730624198914, 0.07992027699947357, 0.16683128476142883, 0.5150036215782166, -0.23457807302474976, -0.43492117524147034, 0.6307114362716675, 0.34647494554519653, -0.026220135390758514, -0.05582362413406372, -0.1922086775302887, -0.30425965785980225, -0.28158849477767944, 0.2825510799884796, 0.049696676433086395, -0.060952700674533844, -0.10344378650188446, -0.10129578411579132, -0.10352836549282074, -0.05775678902864456, 0.22877275943756104, 0.034264449030160904, 0.0903962254524231, -0.2839493155479431, 0.09285106509923935, -0.07558804750442505, -0.0731641948223114, 0.0081032644957304, 0.32654815912246704, -0.3779768645763397, -0.03623349219560623, -0.19193099439144135, -0.3743739128112793, 0.39577025175094604, -0.06085728108882904, 0.04953346028923988, 0.16320368647575378, -0.37019655108451843, 0.3147229850292206, -0.2955217957496643, -0.4473539888858795, 0.11544816195964813, -0.12540604174137115, -0.17456698417663574, -0.32560601830482483, 0.14169728755950928, 0.1753312200307846, -0.17232002317905426, 0.30649900436401367, 0.24437345564365387, -0.10371008515357971, 0.21519789099693298, 0.22267594933509827, 0.7936338782310486, 0.08656299859285355, -0.1908646672964096, 0.16101035475730896, 0.15323993563652039, 0.1724223792552948, -0.20771482586860657, 0.2665862739086151, -0.24822893738746643, -0.4344062805175781, -0.18822386860847473, 0.15233857929706573, 0.2566549479961395, 0.2632858455181122, 0.04962492734193802, 0.2866407632827759, -0.08174046874046326, 0.437875896692276, 0.002108639106154442, -0.32218366861343384, -0.29642030596733093, -0.1873835027217865, -0.05066066235303879, 0.1896657794713974, -0.03308551758527756, -0.19059781730175018, 0.0049680620431900024, 0.17672118544578552, 0.5463765859603882, -0.1729099452495575, 0.17626765370368958, -0.1220657080411911, -0.18965262174606323, 0.24751082062721252, -0.007997051812708378, -0.27021580934524536, -0.19790935516357422, 0.0914703756570816, 0.2619178295135498, -0.20074622333049774, 0.09080570936203003, 0.11447291076183319, 0.44439297914505005, 0.17687106132507324, -0.20063263177871704, 0.3458395302295685, 0.030038507655262947, -0.14297708868980408, -0.13385383784770966, -0.07188233733177185, 0.1019459068775177, -0.20488151907920837, 0.1754312366247177, 0.07361695170402527, 0.29042020440101624, -0.3655610978603363, -0.1175120621919632, -0.08142809569835663, 0.10511010885238647, -0.2201756238937378, 0.16445212066173553, -0.050284646451473236, 0.10141261667013168, 0.3415420949459076, -0.03718939796090126, -0.284278929233551, -0.11795857548713684, 0.058263614773750305, 0.21697890758514404, -0.11706346273422241, 0.30404651165008545, -0.1590040922164917, -0.5019363164901733, -0.4988875389099121, -0.014244690537452698, -0.08419226855039597, -0.0795452892780304, 0.13333724439144135, -0.027638154104351997, 0.1146523654460907, 0.06999421119689941, 0.21416497230529785, -0.27426546812057495, 0.06999486684799194, -0.10610561072826385, -0.13661301136016846, -0.25225645303726196, 0.2654273509979248, 0.25371429324150085, 0.29487866163253784, -0.12016275525093079, -0.43202850222587585, -0.2790868580341339, -0.12549400329589844, -0.430149644613266, -0.06431247293949127, -0.20226708054542542, -0.008343953639268875, 0.35223323106765747, 0.12207507342100143, -0.022959144786000252, -0.14443783462047577, 0.29895153641700745, -0.013681014068424702, 0.006324969232082367, -0.4138089120388031, -0.12990686297416687, 0.09289330244064331, -0.10978852212429047, -0.15685290098190308, -0.06108879670500755, 0.16241636872291565, -0.16758450865745544, -0.30984947085380554, 0.30703651905059814, -0.01938323676586151, 0.05151095986366272, 0.29431548714637756, -0.3625859320163727, -0.09081265330314636, 0.019211389124393463, 0.011940158903598785, 0.06061697378754616, -0.01603703573346138, 0.016801025718450546, -0.02725556492805481, -0.13324593007564545, -0.04450266808271408, 0.08029864728450775, 0.38859155774116516, 0.4847770929336548, -0.15604618191719055, 0.05498208850622177, -0.005115151405334473, -0.1303442418575287, 0.10302235186100006, 0.11984369158744812, 0.06289584189653397, -0.2049514502286911, -0.0889744684100151, 0.08785618841648102, 0.3690812289714813, -0.3402060866355896, 0.04996469244360924, 0.3294500708580017, 0.015248700976371765, 0.4284026622772217, 0.3385998606681824, 0.30632010102272034, -0.05556951463222504, 0.2585182189941406, 0.028378739953041077, 0.2862677574157715, -0.688788115978241, -0.05103769153356552, 0.4597719609737396, 0.03938914090394974, -0.26265186071395874, 0.12998181581497192, 0.08431036025285721, 0.12566471099853516, 0.1385325789451599, -0.029191147536039352, 0.4552266001701355, 0.11373305320739746, 0.09086592495441437, 0.07991261035203934, -0.31881579756736755, 0.13465088605880737, 0.04140784218907356, -0.08379004895687103, 0.05215234309434891, 0.375841349363327, 0.13373464345932007, 0.013677626848220825, -0.2167280614376068, -0.3180781602859497, 0.32549747824668884, -0.05634255334734917, -0.14705875515937805, -0.08166488260030746, -0.20844025909900665, -0.010480649769306183, -0.02936135232448578, 0.013458163477480412, 0.07464276254177094, 0.431795209646225, 0.030214903876185417, 0.31817764043807983, -0.3947688341140747, 0.16067248582839966, 0.04654073715209961, 0.34637153148651123, -0.233865424990654, -0.3169107735157013, 0.13054844737052917, 0.19673947989940643, -0.18883447349071503, 0.19819632172584534, 0.08556699752807617, -0.14568832516670227, -0.013055837713181973, -0.09240853786468506, -0.4428575336933136, -0.21365943551063538, -0.1732742339372635, 0.40696337819099426, -0.29491475224494934, 0.2907164394855499, 0.02315128967165947, 0.22097614407539368, -0.23107664287090302, 0.22134390473365784, 0.0859636664390564, 0.2200990617275238, -0.44437023997306824, 0.17057622969150543, 0.18668118119239807, -0.41394340991973877, 0.10660995543003082, -0.1848115772008896, -0.008589319884777069, -0.054468996822834015, 0.20287136733531952, 0.056586094200611115, 0.1803891807794571, -0.07542464137077332, 0.1539822816848755, 0.046935465186834335, -0.05554322525858879, 0.2599446773529053, -0.2535760700702667, -0.08335380256175995, -0.24711337685585022, -0.41313838958740234, -0.022885292768478394, -0.44209542870521545, 0.09305976331233978, 0.35627076029777527, 0.13949841260910034, 0.20678149163722992, 0.30339881777763367, 0.010284818708896637, -0.2817932963371277, 0.04717731475830078, 0.04566030576825142, -0.089859239757061, -0.09320110082626343, 0.18700799345970154, 0.018326105549931526, 0.029507189989089966, -0.3069987893104553, -0.04218402877449989, 0.12234750390052795, 0.17316675186157227, -0.2583059072494507, 0.28272223472595215, 0.08269533514976501, -0.13533848524093628, 0.09127047657966614, 0.20808959007263184, 0.01954900473356247, -0.11235861480236053, -0.09885348379611969, 0.08118436485528946, -0.12147285044193268, -0.08327164500951767, 0.20806585252285004, 0.1187310665845871, 0.11065271496772766, 0.013212941586971283, -0.0095757357776165, 0.06149231642484665, -0.04843093082308769, 0.06558853387832642, 0.32070857286453247, -0.29065632820129395, 0.02028477191925049, 0.1624075472354889, 0.34259796142578125, -0.283477246761322, 0.12046916782855988, 0.13139715790748596, 0.11049594730138779, -0.11822168529033661, -0.41334211826324463, 0.23280468583106995, -0.2513410747051239, -0.5007691383361816, -0.028259363025426865, 0.1695910096168518, 0.0017808526754379272, -0.24178893864154816, -0.31256067752838135, 0.007208675146102905, 0.2657577097415924, -0.3069007992744446, 0.020232193171977997, 0.33842694759368896, -0.05754796043038368, 0.17036595940589905, 0.055596232414245605, 0.10717172920703888, 0.2543220818042755, 0.1502809077501297, -0.07839509844779968, -0.12607309222221375 ]
https://github.com/huggingface/datasets/issues/5838
As the name says, `load_from_disk` load the data from your disk. If the data is hosted on S3, it is first downloaded locally and then loaded from your disk. There is a discussion on streaming data from S3 here though: #5281
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
41
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. As the name says, `load_from_disk` load the data from your disk. If the data is hosted on S3, it is first downloaded locally and then loaded from your disk. There is a discussion on streaming data from S3 here though: #5281
[ -0.19136852025985718, -0.42585277557373047, -0.1447661966085434, 0.17709669470787048, -0.05689805746078491, -0.22552555799484253, -0.010217159986495972, -0.014616171829402447, 0.27002018690109253, 0.0845087319612503, 0.007977951318025589, 0.35091349482536316, -0.015262658707797527, 0.4365050196647644, 0.16912809014320374, -0.062048595398664474, 0.1817837655544281, 0.16400417685508728, 0.1687239706516266, 0.04281741380691528, -0.19496585428714752, 0.05479692667722702, 0.02750353515148163, -0.2419375479221344, 0.17022594809532166, 0.06630111485719681, -0.06254483014345169, 0.11428113281726837, -0.2761509120464325, -0.23304186761379242, 0.21063780784606934, 0.25875768065452576, 0.3787601888179779, 0.20851388573646545, -0.00010598036897135898, -0.37115582823753357, 0.10730354487895966, -0.20964808762073517, -0.31768083572387695, -0.2203586995601654, -0.12840841710567474, -0.10535964369773865, 0.2512848675251007, 0.08555929362773895, -0.15440571308135986, 0.09833487868309021, -0.04463464021682739, -0.3719284236431122, 0.1943749189376831, 0.04931384325027466, 0.1977260559797287, 0.2663866877555847, -0.3640688359737396, -0.12111057341098785, 0.21463707089424133, 0.2787213623523712, -0.21322086453437805, 0.315472811460495, 0.5013733506202698, 0.12409243732690811, 0.19433507323265076, 0.372417688369751, -0.4544965624809265, 0.16746780276298523, 0.5280995965003967, -0.10782499611377716, -0.09945578873157501, -0.23457364737987518, -0.11869829893112183, 0.032200463116168976, 0.7178921103477478, -0.19571498036384583, -0.3024294078350067, -0.2182823270559311, 0.0364215150475502, -0.1776091605424881, 0.09192076325416565, -0.12375009059906006, -0.12471018731594086, 0.1774083375930786, -0.4581200182437897, -0.732024610042572, -0.2784784138202667, 0.2448912262916565, -0.16559697687625885, 0.13059064745903015, -0.2603262662887573, -0.12395695596933365, 0.2925032377243042, 0.307343065738678, 0.5467453598976135, -0.1581142693758011, 0.09736353158950806, 0.07207996398210526, -0.1705109179019928, -0.19724062085151672, 0.14159329235553741, 0.10704310983419418, 0.006913304328918457, 0.42184025049209595, 0.4254140853881836, 0.1609744280576706, 0.011996373534202576, 0.27199020981788635, 0.1741783618927002, 0.05758550763130188, 0.03901207819581032, -0.39989903569221497, 0.16494859755039215, 0.29748356342315674, 0.1612917184829712, -0.41286155581474304, -0.19433587789535522, 0.22214728593826294, -0.22358737885951996, -0.21124222874641418, 0.15277664363384247, -0.11368587613105774, -0.06481541693210602, -0.15354233980178833, 0.2507530152797699, -0.08031114935874939, 0.1511753648519516, 0.13349103927612305, -0.05921589210629463, 0.35065704584121704, -0.019299857318401337, 0.1271931529045105, 0.12054132670164108, -0.3231346011161804, -0.12187716364860535, -0.12955772876739502, -0.11883544921875, 0.31049931049346924, 0.08569617569446564, -0.38091525435447693, 0.05999354273080826, -0.25279587507247925, 0.16637328267097473, 0.08532790839672089, -0.017865438014268875, -0.0033424459397792816, 0.20034998655319214, 0.08004677295684814, 0.03515182435512543, 0.011886350810527802, 0.15546225011348724, 0.23000943660736084, -0.30137354135513306, 0.1810663640499115, -0.20684278011322021, -0.5005463361740112, -0.44855815172195435, 0.20859970152378082, -0.4395315945148468, -0.06637586653232574, -0.6094045042991638, 0.2644982933998108, -0.5411285758018494, -0.2743713855743408, 0.10893668234348297, 0.326599657535553, -0.0919383093714714, -0.2891143560409546, 0.16965214908123016, 0.06063304468989372, -0.3624419569969177, -0.09241928160190582, -0.49706724286079407, -0.11091390252113342, 0.2883473038673401, -0.22816050052642822, -0.26228979229927063, -0.045731816440820694, -0.03852447122335434, 0.15247605741024017, 0.10208999365568161, -0.3489815592765808, -0.2476021945476532, 0.639704167842865, -0.00641787052154541, 0.03698889911174774, 0.3190871775150299, 0.25443142652511597, 0.3016047477722168, 0.15441662073135376, -0.19722698628902435, 0.8372142314910889, 0.1039721816778183, 0.02120228111743927, 0.03541813790798187, -0.11465832591056824, -0.15421734750270844, 0.43105000257492065, -0.2114417850971222, 0.2827640175819397, 0.324783593416214, 0.2508195638656616, 0.043338656425476074, 0.11474287509918213, 0.057215332984924316, 0.03864482790231705, 0.5743612051010132, 0.11614950001239777, -0.2885199189186096, -0.09728479385375977, -0.4019673764705658, 0.08661933243274689, 0.2932431399822235, -0.3166854679584503, 0.017269473522901535, -0.004068419337272644, -0.06943506002426147, 0.05419544875621796, -0.044474560767412186, 0.09955881536006927, 0.08668884634971619, 0.30665352940559387, 0.17598792910575867, -0.23880386352539062, -0.30705511569976807, 0.11862672865390778, -0.061091914772987366, -0.06175452470779419, -0.07052046805620193, 0.5153892040252686, 0.2083628624677658, -0.006401782855391502, -0.08004201203584671, -0.3433295786380768, 0.07851964980363846, 0.05612505227327347, -0.02001117169857025, 0.5550251603126526, -0.014160698279738426, 0.5171882510185242, 0.11163870245218277, 0.34145382046699524, 0.19609159231185913, 0.15079271793365479, 0.43904268741607666, -0.02880885824561119, 0.16926339268684387, 0.07326838374137878, -0.220929816365242, 0.28179776668548584, -0.14754876494407654, -0.09875135868787766, 0.041680365800857544, -0.08460395038127899, 0.06431639939546585, 0.048083506524562836, -0.10324715822935104, -0.04503351449966431, -0.036915283650159836, -0.09615682065486908, -0.10799678415060043, -0.19848592579364777, -0.2959429621696472, -0.053173888474702835, 0.22123703360557556, -0.08214395493268967, 0.04828320071101189, 0.08904470503330231, -0.15344871580600739, -0.2777836322784424, 0.334382563829422, 0.3630857765674591, 0.5084049701690674, 0.1998313069343567, 0.2924443483352661, -0.02486124262213707, 0.4094145596027374, -0.11382691562175751, 0.25281792879104614, 0.033164724707603455, 0.18124274909496307, 0.2478352189064026, -0.15745872259140015, -0.1830645203590393, -0.0835295170545578, -0.29658275842666626, 0.07382398843765259, -0.041975412517786026, 0.05687558650970459, -0.1321585327386856, -0.024254463613033295, -0.25981810688972473, 0.0005870088934898376, -0.24903440475463867, -0.08568306267261505, -0.042726997286081314, 0.011367756873369217, 0.8336607813835144, 0.04857973754405975, -0.1909700632095337, 0.13694390654563904, 0.5282325744628906, -0.27491098642349243, -0.22402264177799225, -0.20029103755950928, -0.006979893893003464, 0.15001904964447021, 0.16762593388557434, -0.07187590003013611, -0.15155139565467834, 0.28754353523254395, 0.15355896949768066, 0.361031174659729, -0.40609776973724365, 0.07448270171880722, 0.08437800407409668, 0.03445463255047798, 0.11024687439203262, -0.03948831185698509, 0.1304730623960495, -0.1450599879026413, -0.1148633062839508, -0.1006513386964798, -0.43077993392944336, -0.13138723373413086, -0.11832251399755478, 0.07882773876190186, 0.2124994695186615, -0.15872541069984436, 0.0701514407992363, -0.2842118442058563, -0.5168425440788269, 0.05383466184139252, -0.05296744033694267, 0.04603508114814758, -0.40058284997940063, 0.015928223729133606, 0.10831005126237869, 0.379272997379303, 0.03136292099952698, -0.20199449360370636, -0.7632882595062256, 0.10415990650653839, -0.15217112004756927, -0.176375150680542, 0.21855245530605316, 0.3800286650657654, -0.07989154756069183, 0.19155891239643097, -0.4944975674152374, -0.3528510332107544, 0.32681000232696533, 0.003141649067401886, -0.28250831365585327, 0.04564394801855087, 0.32050880789756775, -0.045305512845516205, -0.07584866881370544, -0.17038314044475555, -0.2040615826845169, -0.43180203437805176, 0.44643181562423706, 0.2620846629142761, 0.20958465337753296, 0.18782752752304077, 0.08469168096780777, 0.3071366548538208, -0.20414239168167114, 0.04575616866350174, 0.4661865830421448, 0.4585675001144409, 0.2445390522480011, -0.06882956624031067, -0.010550640523433685, -0.1872239112854004, -0.22804972529411316, -0.30420342087745667, 0.3281179666519165, 0.0737362802028656, -0.2632059156894684, -0.5187565088272095, -0.1755213439464569, -0.33813539147377014, 0.20168176293373108, 0.0021665263921022415, -0.18463467061519623, 0.22440499067306519, -0.3337516188621521, -0.03172699362039566, -0.032741695642471313, -0.029262591153383255, 0.02736327424645424, -0.01942402496933937, 0.5859750509262085, -0.019442787393927574, -0.08992967754602432, -0.12366579473018646, -0.24969609081745148, 0.21281930804252625, -0.1299886405467987, -0.23524481058120728, -0.217399001121521, -0.2929947078227997, 0.16532938182353973, -0.05403025448322296, 0.5099180936813354, -0.30571186542510986, -0.007195699028670788, -0.09792318195104599, -0.3519468307495117, -0.0887107104063034, -0.004345342516899109, -0.09770435094833374, -0.07533429563045502, -0.3344654142856598, 0.4922601580619812, -0.0038219839334487915, -0.08234138786792755, -0.28676870465278625, -0.18357577919960022, -0.16911408305168152, -0.21202945709228516, -0.058785151690244675, -0.16843801736831665, -0.3804920017719269, -0.11814393848180771, 0.019103065133094788, 0.18846191465854645, -0.09559303522109985, 0.05120745301246643, 0.14765101671218872, 0.35597366094589233, 0.07213722169399261, -0.02499845251441002, 0.14296025037765503, 0.19889844954013824, -0.12861257791519165, 0.2198038250207901, 0.13527098298072815, 0.24780414998531342, 0.4397847056388855, 0.4042900800704956, -0.14516445994377136, 0.2424868494272232, 0.2888156473636627, 0.30685847997665405, 0.33053460717201233, 0.46630826592445374, 0.14002272486686707, 0.09753343462944031, 0.02262379229068756, -0.3523678779602051, -0.13918966054916382, -0.042239509522914886, -0.21010875701904297, 0.2393566519021988, -0.33454859256744385, 0.41141122579574585, -0.09876901656389236, -0.06164175271987915, 0.050010986626148224, -0.1335926502943039, -0.16265103220939636, 0.30260658264160156, 0.23755177855491638, 1.1185941696166992, -0.003937365487217903, -0.0010122377425432205, -0.030527647584676743, -0.24850639700889587, 0.21762190759181976, -0.4663909077644348, -0.07747673243284225, -0.1328575164079666, -0.21676591038703918, -0.3180660605430603, -0.009022444486618042, 0.0635010227560997, 0.08680932223796844, -0.31434422731399536, -0.05130729824304581, 0.07189956307411194, 0.28532615303993225, -0.07375293970108032, 0.3233407139778137, -0.19210278987884521, -0.2915436327457428, -0.5149046778678894, 0.14755681157112122, -0.3503212034702301, 0.20978984236717224, -0.09684740006923676, -0.18947578966617584, 0.3906526267528534, 0.0880180224776268, -0.027265936136245728, 0.12707874178886414, 0.440025269985199, 0.004680352285504341, -0.3382042348384857, -0.22972160577774048, -0.15399348735809326, 0.18401183187961578, -0.139377623796463, -0.09483101963996887, -0.25682333111763, 0.12610438466072083, 0.20692896842956543, 0.010152027010917664, -0.1093754768371582, -0.13989228010177612, 0.22185906767845154, -0.24789854884147644, -0.1924366056919098, 0.4199962317943573, 0.16047650575637817, -0.7357504367828369, 0.1476888358592987, -0.013770699501037598, 0.3762606382369995, -0.03268302232027054, -0.3343084156513214, 0.13156607747077942, 0.05158670246601105, -0.14026406407356262, 0.19217467308044434, 0.12006747722625732, -0.2743036150932312, -0.1516682505607605, -0.07585539668798447, 0.007525414228439331, -0.32676994800567627, 0.5437651872634888, -0.09529364854097366, -0.112679123878479, -0.22507843375205994, 0.22438696026802063, -0.2781315743923187, -0.19266951084136963, 0.04166167974472046, 0.03680869936943054, 0.039084888994693756, -0.057656869292259216, 0.034604426473379135, -0.03322093188762665, -0.09661233425140381, 0.08770878612995148, 0.3140655755996704, 0.10752969980239868, -0.12190829962491989, -0.29616785049438477, 0.14372406899929047, 0.2780243456363678, 0.0023619187995791435, 0.20700785517692566, 0.11402588337659836, -0.524360179901123, 0.11887884885072708, -0.04439537972211838, -0.3585635721683502, 0.14532005786895752, 0.060681432485580444, 0.0267484150826931, 0.13426318764686584, 0.10689913481473923, 0.0908467099070549, -0.10781365633010864, 0.0878763347864151, -0.27984917163848877, -0.3081655502319336, -0.18537095189094543, 0.10881758481264114, 0.1627727448940277, 0.22179313004016876, 0.04923732578754425, -0.24804449081420898, -0.4051377475261688, -0.23232658207416534, -0.0100724957883358, 0.3059791922569275, 0.0013106167316436768, -0.09170655906200409, 0.18613843619823456, 0.27880391478538513, 0.17311105132102966, -0.267245888710022, 0.05837887153029442, 0.28163203597068787, 0.3783467710018158, -0.23290400207042694, 0.003414122387766838, 0.008843936026096344, -0.17044520378112793, -0.2070266604423523, 0.13812007009983063, 0.2863271236419678, 0.1638452559709549, 0.49484989047050476, 0.046284448355436325, 0.11956118047237396, -0.09174644947052002, 0.5104102492332458, -0.013581626117229462, 0.026844333857297897, -0.09118692576885223, 0.1879836767911911, 0.26679354906082153, 0.12906834483146667, -0.3837909698486328, -0.39069443941116333, -0.12366057932376862, -0.08543787896633148, -0.08137324452400208, 0.1911388337612152, 0.1554703414440155, -0.10423889756202698, 0.03972620889544487, 0.39884960651397705, 0.32094067335128784, 0.09271715581417084, 0.16784623265266418, 0.05178074538707733, 0.032491669058799744, 0.06813541799783707, 0.10385292023420334, 0.11015443503856659, 0.08213049173355103, -0.07824032008647919, 0.13607846200466156, 0.13934217393398285, 0.30422601103782654, -0.0011848583817481995, -0.3143259286880493, -0.05373070389032364, -0.07710068672895432, -0.27074307203292847, 0.19467496871948242, -0.11066172271966934, 0.00035733357071876526, -0.2191673070192337, 0.06034364178776741, -0.3238213062286377, 0.1286746710538864, 0.16535261273384094, 0.09135930985212326, -0.3110317885875702, -0.13236910104751587, 0.17804333567619324, 0.3851151168346405, 0.12718403339385986, -0.23539209365844727, 0.40680748224258423, 0.053641270846128464, 0.15082426369190216, 0.1357458531856537, 0.0747474730014801, 0.07060417532920837, 0.03415677323937416, -0.21178236603736877, -0.10145554691553116, -0.09358563274145126, 0.17170169949531555, 0.3323158025741577, -0.18718981742858887, -0.06495216488838196, 0.1177336797118187, -0.05365332216024399, 0.06912878900766373, -0.0999041348695755, -0.19822263717651367, 0.05671922490000725, 0.2898540496826172, 0.23748350143432617, 0.1576915681362152, 0.17381379008293152, 0.2937018871307373, -0.14681708812713623, 0.2668941020965576, -0.1858311891555786, 0.16645611822605133, -0.1614415943622589, 0.24074393510818481, 0.22600886225700378, -0.0051864683628082275, -0.05464841425418854, 0.02854015864431858, -0.3826884627342224, -0.2778686285018921, 0.2521243691444397, -0.01398836076259613, -0.08314257115125656, 0.048567406833171844, 0.11580218374729156, 0.005808373913168907, 0.3243574798107147, 0.1694929301738739, -0.01775464601814747, -0.15075001120567322, -0.334125280380249, -0.30771884322166443, 0.08848032355308533, 0.4566502571105957, -0.15572500228881836, 0.10799293965101242, 0.3433705270290375, 0.21644467115402222, 0.289074182510376, -0.5870147943496704, -0.10663579404354095, -0.11164829134941101, 0.20671899616718292, -0.05933827906847, -0.04651738703250885, 0.19178321957588196, 0.33392778038978577, -0.18300870060920715, -0.11941827833652496, 0.19701403379440308, -0.040092624723911285, 0.0667528286576271, -0.12775015830993652, -0.02304922044277191, 0.023556791245937347, 0.2630513310432434, 0.570861279964447, -0.27375176548957825, 0.10617505013942719, -0.18945302069187164, 0.022581666707992554, 0.10234002768993378, -0.06693368405103683, -0.027777431532740593, 0.09064169228076935, -0.3552858829498291, 0.33376508951187134, 0.06705166399478912, 0.332793653011322, -0.313037246465683, 0.32106125354766846, -0.12632408738136292, -0.21009673178195953, -0.1044091135263443, -0.3002716302871704, -0.34589093923568726, 0.03298620879650116, 0.22083443403244019, 0.1270994246006012, -0.01215951144695282, -0.07295352220535278, -0.3607539236545563, -0.10450710356235504, 0.33339232206344604, -0.2822237014770508, -0.1283850222826004, 0.17648658156394958, 0.21092219650745392, 0.199055477976799, -0.07850722223520279, -0.4974293112754822, 0.24062466621398926, 0.1861455887556076, -0.09938544034957886, 0.14859341084957123, 0.4683986306190491, -0.08180481195449829, 0.016611717641353607, -0.11073100566864014, 0.2475484162569046, 0.02211114391684532, -0.21829956769943237, -0.22459538280963898, -0.3430939316749573 ]
https://github.com/huggingface/datasets/issues/5838
@lhoestq Thanks for your comment. I have checked out the discussion before and attempted at replicating the mentioned changes in the main branch (#5580). What I found was that if a dataset is saved using `save_to_disk`, it cannot be read by `load_dataset`. The error message asks me to to use `load_from_disk` instead. What would be the correct way of saving the data in this scenario?
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
65
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. @lhoestq Thanks for your comment. I have checked out the discussion before and attempted at replicating the mentioned changes in the main branch (#5580). What I found was that if a dataset is saved using `save_to_disk`, it cannot be read by `load_dataset`. The error message asks me to to use `load_from_disk` instead. What would be the correct way of saving the data in this scenario?
[ -0.21534283459186554, -0.13543955981731415, -0.10849569737911224, 0.0045851487666368484, 0.05231412127614021, -0.1832382082939148, -0.017614327371120453, 0.03951312601566315, 0.18168671429157257, 0.08003409206867218, -0.10446079075336456, 0.31715551018714905, -0.14613616466522217, 0.3981487452983856, 0.14394128322601318, -0.0411219596862793, 0.3087484836578369, 0.11563867330551147, 0.019778257235884666, 0.12604771554470062, -0.30834251642227173, 0.10597638785839081, 0.0766780823469162, -0.3264382481575012, 0.12465210258960724, -0.03498709574341774, -0.03534456342458725, 0.04009570553898811, -0.24570301175117493, -0.27439090609550476, 0.10821700841188431, 0.3872968852519989, 0.3350512683391571, 0.19661159813404083, -0.00010901111818384379, -0.2742972671985626, 0.08796455711126328, -0.3003399074077606, -0.31540635228157043, -0.1391826570034027, -0.23757797479629517, -0.11187916994094849, 0.17784973978996277, 0.04906105995178223, -0.029618442058563232, 0.025524917989969254, 0.036121152341365814, -0.4355272054672241, 0.12715300917625427, 0.09809835255146027, 0.1937168836593628, 0.19087156653404236, -0.08854081481695175, 0.018447015434503555, 0.16102631390094757, 0.359586626291275, -0.28127723932266235, 0.17676624655723572, 0.41230884194374084, 0.12795814871788025, 0.005892004817724228, 0.34704455733299255, -0.30182498693466187, -0.09746071696281433, 0.5743542313575745, -0.16008873283863068, -0.23378245532512665, -0.3233600854873657, -0.22364890575408936, -0.10656321048736572, 0.8508352637290955, -0.30296164751052856, -0.48661813139915466, -0.2106827199459076, -0.11533020436763763, -0.25381532311439514, 0.07922424376010895, -0.21477721631526947, -0.04846048355102539, 0.20919224619865417, -0.45337510108947754, -0.8442581295967102, -0.413166880607605, 0.16117331385612488, -0.032055243849754333, -0.040702935308218, -0.2104005217552185, -0.1302628219127655, 0.2262004315853119, 0.17336077988147736, 0.43461981415748596, -0.20885613560676575, 0.09036814421415329, -0.08444774150848389, -0.24275416135787964, -0.3025529980659485, 0.03481486067175865, 0.09001021087169647, 0.013031035661697388, 0.46006670594215393, 0.500784158706665, 0.13679496943950653, 0.003207676112651825, 0.1730532944202423, 0.18621793389320374, 0.19632142782211304, 0.15217745304107666, -0.3987106680870056, 0.33267441391944885, 0.26078805327415466, 0.21292732656002045, -0.3613037168979645, 0.026055466383695602, 0.18345409631729126, -0.09136420488357544, -0.17620696127414703, 0.27701398730278015, -0.17807558178901672, 0.050235308706760406, -0.04927799105644226, 0.29877763986587524, -0.09925886988639832, -0.010397741571068764, 0.19540339708328247, 0.03725385665893555, 0.4219380021095276, -0.027048125863075256, 0.3756771683692932, 0.13568192720413208, -0.2435615360736847, -0.11217570304870605, -0.14305563271045685, -0.061351481825113297, 0.30329811573028564, 0.18123392760753632, -0.3571109175682068, 0.09457408636808395, -0.19399693608283997, 0.06881727278232574, 0.18158718943595886, -0.06413014233112335, -0.07041996717453003, 0.30095577239990234, 0.12861157953739166, 0.07364414632320404, -0.0065292008221149445, -0.022596709430217743, 0.20180758833885193, -0.21237027645111084, 0.37166327238082886, -0.007374921813607216, -0.7133793234825134, -0.26767656207084656, 0.1408565789461136, -0.42258524894714355, -0.14542290568351746, -0.6946312189102173, 0.4418281614780426, -0.33158591389656067, -0.2967498302459717, 0.024888865649700165, 0.16511650383472443, -0.1167895495891571, -0.39643386006355286, 0.07921972870826721, 0.058379244059324265, -0.41354405879974365, 0.1452171951532364, -0.46328896284103394, -0.12869347631931305, 0.31557977199554443, -0.08756649494171143, -0.30666476488113403, -0.10479319095611572, 0.025970272719860077, 0.10545890033245087, 0.24086779356002808, -0.40950602293014526, -0.41162869334220886, 0.5482720732688904, 0.13025401532649994, 0.04525197297334671, 0.2800281047821045, 0.21026360988616943, 0.4739103317260742, -0.06650123745203018, -0.18364477157592773, 0.4991587698459625, 0.07161948829889297, 0.1184791624546051, -0.13600477576255798, -0.12406422197818756, 0.0721198320388794, 0.2593107223510742, -0.15401789546012878, 0.2588123381137848, 0.2861289381980896, 0.2833980321884155, 0.06613337993621826, 0.12914207577705383, 0.17896971106529236, 0.0549887977540493, 0.6442295908927917, 0.030920185148715973, -0.2718578279018402, 0.000005893409252166748, -0.6000046730041504, -0.0004927515983581543, 0.3052111268043518, -0.27313458919525146, 0.14768239855766296, -0.08891971409320831, 0.013883333653211594, -0.03093695640563965, -0.022348135709762573, 0.05406137555837631, 0.05609096586704254, 0.234578475356102, 0.07332241535186768, -0.1650160849094391, -0.3705136775970459, 0.26534658670425415, -0.18948638439178467, -0.01131846010684967, -0.13286536931991577, 0.5051990151405334, 0.1304316520690918, -0.16579243540763855, -0.0303034707903862, -0.26582929491996765, 0.05545929819345474, 0.010742995887994766, -0.16145527362823486, 0.6136119961738586, 0.019987571984529495, 0.5199382305145264, -0.06401554495096207, 0.3446173667907715, 0.27616339921951294, 0.08485215157270432, 0.42138901352882385, -0.0414445661008358, 0.16894523799419403, 0.1334778070449829, -0.36950382590293884, 0.25575780868530273, -0.16380533576011658, -0.09060029685497284, 0.05205206573009491, -0.2043934464454651, 0.10629847645759583, 0.09687583148479462, -0.1491236537694931, -0.02228391170501709, -0.21770918369293213, -0.10653108358383179, -0.10327176004648209, -0.1831360012292862, -0.34660211205482483, 0.11805139482021332, 0.3031105697154999, -0.01824372634291649, -0.023590605705976486, 0.19796186685562134, -0.034820374101400375, -0.4097936451435089, 0.4200948476791382, 0.3979116380214691, 0.5606893301010132, 0.127919003367424, 0.24619929492473602, -0.11802885681390762, 0.31790485978126526, -0.1612381637096405, 0.3251451849937439, 0.1233719140291214, 0.22202973067760468, 0.3584216833114624, 0.025437571108341217, -0.1514134407043457, -0.11418069899082184, -0.11932569742202759, 0.09945203363895416, -0.02076585590839386, -0.1448030024766922, -0.25168049335479736, -0.00028511136770248413, -0.14812986552715302, -0.006576426327228546, -0.2710019648075104, -0.178423210978508, -0.20154036581516266, 0.019395405426621437, 0.9411059617996216, -0.15850093960762024, -0.1428939253091812, 0.14776787161827087, 0.536109209060669, -0.3288314640522003, -0.08444695919752121, -0.29367807507514954, 0.13810288906097412, 0.16817648708820343, 0.12861944735050201, -0.023271329700946808, -0.15947547554969788, 0.25907063484191895, 0.28179216384887695, 0.23849940299987793, -0.47635069489479065, -0.13561008870601654, 0.0095293577760458, -0.09873494505882263, 0.16430681943893433, -0.06745120137929916, 0.11814677715301514, -0.005669407546520233, -0.2118459939956665, -0.18623003363609314, -0.4377034604549408, -0.09345664083957672, -0.19481045007705688, 0.028839796781539917, 0.24049434065818787, -0.10871537029743195, -0.15671931207180023, -0.35241642594337463, -0.6436597108840942, 0.17533522844314575, -0.08239106088876724, -0.037074167281389236, -0.35907498002052307, 0.09047003835439682, -0.015568111091852188, 0.42329999804496765, -0.10521196573972702, -0.18620486557483673, -0.7201792597770691, 0.2013920098543167, -0.28889137506484985, -0.21055912971496582, 0.27640342712402344, 0.37852075695991516, -0.09033752977848053, 0.2719299793243408, -0.30776065587997437, -0.2333742380142212, 0.21399995684623718, -0.04780614748597145, -0.07358083128929138, -0.036404840648174286, 0.30943647027015686, 0.011827819049358368, -0.046703435480594635, -0.08497051149606705, -0.28835543990135193, -0.24521276354789734, 0.5704163908958435, 0.3964077830314636, 0.155452162027359, 0.24999916553497314, 0.11713939905166626, 0.2675403952598572, -0.05166462063789368, 0.1638106107711792, 0.49394673109054565, 0.4577377736568451, 0.3706868290901184, -0.20528271794319153, -0.032514430582523346, -0.03648891672492027, -0.29361778497695923, -0.30451488494873047, 0.22987449169158936, 0.08104819804430008, -0.24372349679470062, -0.29094406962394714, -0.2581367492675781, -0.17104339599609375, -0.04402971267700195, 0.10918992012739182, -0.08911846578121185, 0.2663179934024811, -0.1951952576637268, -0.07116474211215973, -0.08593261241912842, -0.1299726366996765, -0.06839335709810257, 0.2077721357345581, 0.582477331161499, -0.019244132563471794, -0.2592118978500366, -0.03719435632228851, -0.5897128582000732, 0.21425247192382812, -0.09478280693292618, -0.04344714805483818, -0.18045225739479065, -0.33272331953048706, 0.040543295443058014, -0.034527406096458435, 0.4032323658466339, -0.3853500783443451, -0.17264750599861145, -0.06993700563907623, -0.23668627440929413, -0.049173638224601746, 0.012675464153289795, 0.00998503714799881, 0.043169040232896805, -0.2489536553621292, 0.47465112805366516, -0.032894812524318695, -0.1292235553264618, -0.23237329721450806, -0.17833425104618073, -0.20655393600463867, -0.12830954790115356, -0.0003392323851585388, -0.14597946405410767, -0.4163528084754944, -0.03460809588432312, 0.09177922457456589, 0.07966629415750504, -0.17485901713371277, -0.020017176866531372, 0.15767300128936768, 0.14344140887260437, 0.10019777715206146, -0.12818825244903564, 0.30337512493133545, 0.18186572194099426, -0.08862347900867462, 0.13549074530601501, 0.09412999451160431, 0.4846673011779785, 0.4138679802417755, 0.14996224641799927, -0.17346657812595367, 0.2138868123292923, 0.21125870943069458, 0.3877325654029846, 0.45880192518234253, 0.2694464325904846, -0.011408105492591858, 0.12228606641292572, -0.09132043272256851, -0.29285648465156555, -0.10410062223672867, -0.07010883092880249, -0.23377633094787598, 0.05435091629624367, -0.367958664894104, 0.3312743008136749, -0.12609833478927612, -0.0299115851521492, 0.1291791945695877, 0.03811752051115036, -0.19190216064453125, 0.38708803057670593, 0.2450079619884491, 1.1232190132141113, 0.10149452090263367, 0.10305941104888916, 0.10975288599729538, -0.3903310000896454, 0.1983678638935089, -0.45610010623931885, 0.0350462980568409, -0.17888841032981873, -0.1802280694246292, -0.22489985823631287, 0.022169269621372223, 0.09519468247890472, 0.10675311088562012, -0.3530734181404114, 0.012723851948976517, 0.18558333814144135, 0.2157191038131714, -0.1747715175151825, 0.36612826585769653, -0.3408712148666382, -0.2712458670139313, -0.4234572649002075, 0.11982452869415283, -0.3051639199256897, 0.0762874037027359, -0.00797249749302864, -0.27212193608283997, 0.2675355076789856, 0.06111646443605423, -0.08963016420602798, 0.05731523036956787, 0.3257737457752228, 0.094337597489357, -0.36593368649482727, -0.2790045142173767, 0.09557462483644485, 0.29938897490501404, -0.0004975795745849609, -0.18714120984077454, -0.28430864214897156, 0.01592257060110569, 0.12285405397415161, 0.14444974064826965, -0.09695332497358322, -0.21713821589946747, 0.36686214804649353, -0.274580180644989, -0.13794401288032532, 0.15425270795822144, 0.03094477206468582, -0.7508974075317383, -0.07207150757312775, -0.2177107334136963, 0.3781726062297821, -0.313540518283844, -0.25945034623146057, 0.18887023627758026, -0.08243497461080551, -0.24861390888690948, 0.1615104079246521, 0.12724721431732178, -0.10787948966026306, 0.1037897914648056, -0.3252188265323639, 0.12083247303962708, -0.27624088525772095, 0.5263947248458862, -0.01949409767985344, -0.1580103039741516, -0.15151239931583405, 0.09173604100942612, -0.326549232006073, -0.20670954883098602, 0.1250019520521164, 0.14456802606582642, 0.017723001539707184, 0.15472406148910522, -0.17826929688453674, -0.05662328004837036, -0.015314780175685883, 0.1941617876291275, 0.30991554260253906, 0.08204621076583862, 0.017854027450084686, -0.0909227579832077, -0.1889863908290863, 0.2685176134109497, 0.02547655813395977, 0.341871440410614, 0.06035597622394562, -0.479734867811203, 0.029621124267578125, -0.0011984221637248993, -0.33172643184661865, 0.10353296995162964, 0.21942609548568726, 0.02583758533000946, 0.28489258885383606, 0.009453347884118557, 0.13015440106391907, -0.24491223692893982, -0.0009685978293418884, -0.13678912818431854, -0.24273669719696045, -0.12655523419380188, 0.04142194986343384, 0.2000495344400406, 0.24084539711475372, -0.03934672102332115, -0.18456174433231354, -0.37763065099716187, -0.1875162571668625, 0.059632424265146255, 0.29074856638908386, 0.013730920851230621, -0.03436319902539253, 0.1710038185119629, 0.3398761451244354, 0.1626194715499878, -0.07963313907384872, 0.025657523423433304, 0.3088808059692383, 0.37899455428123474, -0.1401374638080597, 0.13425487279891968, 0.0035196729004383087, -0.23632752895355225, -0.2551376223564148, 0.05710242688655853, 0.21251463890075684, 0.37549611926078796, 0.3886719346046448, -0.028156720101833344, -0.05000412464141846, -0.0063451118767261505, 0.5333992838859558, -0.007269399240612984, 0.06290889531373978, -0.04107123613357544, 0.15652789175510406, 0.19303809106349945, 0.17470821738243103, -0.374901682138443, -0.2373330295085907, -0.11744870245456696, -0.16210103034973145, -0.19612185657024384, 0.35900381207466125, 0.12660522758960724, 0.027063854038715363, 0.12883800268173218, 0.3838758170604706, 0.16672712564468384, 0.18740689754486084, 0.10748675465583801, -0.07308520376682281, 0.09625101834535599, 0.09522354602813721, 0.11861182749271393, 0.13063369691371918, 0.16849789023399353, -0.04656742885708809, 0.31340456008911133, 0.27323102951049805, 0.3410322070121765, 0.08868783712387085, -0.34034740924835205, -0.013189797289669514, -0.11320696771144867, -0.23239263892173767, 0.2200271189212799, 0.12192937731742859, 0.07688480615615845, -0.1619669497013092, -0.05575408786535263, -0.20023253560066223, 0.20575693249702454, 0.009987594559788704, 0.016237687319517136, -0.15776455402374268, -0.2311714142560959, 0.2672867476940155, 0.35496851801872253, -0.11526940762996674, -0.23248445987701416, 0.3938262462615967, 0.14459441602230072, 0.22176998853683472, 0.0573158860206604, 0.19868531823158264, -0.04679132252931595, 0.1519014835357666, -0.10005754977464676, -0.008549628779292107, 0.014394797384738922, -0.049025241285562515, 0.285908579826355, -0.04974977299571037, 0.03489506244659424, 0.04164046421647072, 0.16581927239894867, 0.17020489275455475, 0.0128566212952137, -0.11747337877750397, 0.13431261479854584, 0.22240141034126282, 0.281059592962265, 0.18143028020858765, 0.2481713593006134, 0.16860678791999817, -0.06263766437768936, 0.20592713356018066, -0.10110883414745331, 0.02731705829501152, -0.11433891206979752, 0.2964761555194855, 0.3792067766189575, -0.10836118459701538, -0.020905883982777596, -0.04647354781627655, -0.24657851457595825, -0.32185161113739014, 0.34768685698509216, -0.021435551345348358, -0.0048523955047130585, -0.04006771743297577, 0.10805327445268631, 0.052104536443948746, 0.3319244384765625, 0.07140277326107025, -0.22856734693050385, -0.2101091593503952, -0.2808677852153778, -0.3441813290119171, 0.09451611340045929, 0.5166582465171814, 0.19275204837322235, 0.057800449430942535, 0.35424521565437317, 0.1120167225599289, 0.26986265182495117, -0.40180081129074097, -0.23985865712165833, -0.03892892599105835, 0.27288898825645447, -0.12771587073802948, 0.07062452286481857, 0.33317506313323975, 0.28926846385002136, -0.093562051653862, -0.08041363954544067, 0.25883492827415466, 0.2098543494939804, -0.0006530359387397766, -0.21321409940719604, 0.06160920858383179, 0.04306478798389435, 0.3514414429664612, 0.4792756736278534, -0.13660064339637756, 0.019192855805158615, -0.19548356533050537, -0.07678579539060593, 0.09651276469230652, -0.05650116503238678, -0.10259279608726501, -0.021430667489767075, -0.31766775250434875, 0.58761066198349, -0.07025335729122162, 0.24423816800117493, -0.37319204211235046, 0.11510846018791199, -0.21216434240341187, -0.2403946816921234, -0.2778187692165375, -0.07039051502943039, -0.20758891105651855, -0.006874110549688339, 0.21213440597057343, 0.24460510909557343, -0.02340931072831154, 0.05076581984758377, -0.5181721448898315, -0.20366111397743225, 0.3616410493850708, -0.21607241034507751, -0.12483339756727219, 0.1294538974761963, 0.18280281126499176, 0.3783758580684662, 0.003849569708108902, -0.6298014521598816, 0.07732534408569336, 0.20159557461738586, -0.16582010686397552, 0.16786234080791473, 0.5279408097267151, -0.006042202934622765, -0.0017023533582687378, -0.09824919700622559, 0.27276983857154846, 0.07740750908851624, -0.2521689534187317, -0.2415357530117035, -0.3773110508918762 ]
https://github.com/huggingface/datasets/issues/5838
Using `push_to_hub` you can save the dataset on the HF Hub as parquet files, and reload it / stream it using `load_dataset` :) If you want to save your dataset somewhere else you can use `.to_parquet` to get a parquet file. If your dataset is big it's usually recommended to shard it into multi parquet files (around 1GB each).
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
59
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. Using `push_to_hub` you can save the dataset on the HF Hub as parquet files, and reload it / stream it using `load_dataset` :) If you want to save your dataset somewhere else you can use `.to_parquet` to get a parquet file. If your dataset is big it's usually recommended to shard it into multi parquet files (around 1GB each).
[ -0.4376581907272339, -0.3938426971435547, -0.08103150129318237, 0.10626921057701111, -0.11427478492259979, -0.12265785783529282, -0.11332442611455917, 0.1117803156375885, 0.2856537699699402, 0.0019084811210632324, -0.309587299823761, 0.2367701232433319, -0.0507931187748909, 0.526698112487793, 0.2613198459148407, 0.011019592173397541, 0.17646090686321259, 0.31014272570610046, 0.027066132053732872, -0.04645779728889465, -0.13356052339076996, -0.0021584443747997284, 0.1603773832321167, -0.24160175025463104, 0.0459260530769825, 0.0059197936207056046, -0.22887185215950012, 0.19581979513168335, -0.1801251471042633, -0.24542275071144104, 0.08846984803676605, 0.46335369348526, 0.44607505202293396, 0.17791064083576202, -0.00011216255370527506, -0.20591922104358673, -0.0029886364936828613, -0.24670186638832092, -0.4027504324913025, -0.08421891927719116, -0.2465774118900299, -0.004558198153972626, 0.06418856233358383, 0.051657989621162415, -0.058101579546928406, 0.025309965014457703, -0.01696547120809555, -0.12765249609947205, 0.18794822692871094, 0.10149194300174713, 0.14838629961013794, 0.28266680240631104, -0.3503544330596924, -0.0970858782529831, 0.40353789925575256, 0.44578227400779724, -0.23887959122657776, 0.08265811204910278, 0.34993311762809753, 0.08884076774120331, 0.014042697846889496, 0.31675997376441956, -0.21558748185634613, 0.015100229531526566, 0.5704925656318665, -0.1262090504169464, -0.2164747416973114, -0.08954951167106628, -0.10533276200294495, 0.18351346254348755, 0.4993201792240143, -0.3452512323856354, -0.37394434213638306, -0.20744720101356506, -0.07190962880849838, -0.1989104449748993, -0.0022061895579099655, 0.02180478721857071, 0.02219388633966446, 0.12563759088516235, -0.2792396545410156, -0.8742908835411072, -0.314468115568161, 0.09989409148693085, -0.04366663843393326, 0.10079692304134369, -0.10823309421539307, -0.11810453236103058, 0.16941718757152557, 0.1724136620759964, 0.5360165238380432, -0.3546402156352997, -0.12494383752346039, -0.007761158049106598, -0.29600557684898376, -0.24909231066703796, 0.0011750198900699615, 0.1668301522731781, 0.20356103777885437, 0.14967145025730133, 0.2582586109638214, 0.23457953333854675, -0.08227002620697021, 0.20925280451774597, 0.23118022084236145, -0.06664413213729858, 0.009643573313951492, -0.26135706901550293, 0.24449828267097473, 0.26805803179740906, 0.023497529327869415, -0.3035598397254944, -0.11925572156906128, 0.3520060181617737, -0.20752406120300293, -0.3835492730140686, -0.03729822859168053, -0.2546495199203491, 0.029394611716270447, -0.04570087045431137, 0.36654001474380493, 0.03968795761466026, 0.10787730664014816, 0.32020846009254456, 0.017829328775405884, 0.34751394391059875, -0.12924912571907043, 0.24460799992084503, 0.035917699337005615, -0.37266623973846436, -0.14311730861663818, -0.059982139617204666, -0.08854802697896957, 0.39601069688796997, 0.10142449289560318, -0.47644051909446716, 0.0027501285076141357, -0.17163804173469543, 0.3275092542171478, 0.19525344669818878, -0.023950014263391495, -0.12177229672670364, 0.16252733767032623, 0.103474922478199, 0.10382576286792755, -0.021090146154165268, 0.11370682716369629, 0.14667142927646637, -0.2973977327346802, 0.06442342698574066, -0.2871892750263214, -0.539276659488678, -0.2594243586063385, 0.1284611076116562, -0.273252010345459, -0.035112056881189346, -0.7929461598396301, 0.35110607743263245, -0.498154878616333, -0.20528489351272583, -0.04318307340145111, 0.11344406008720398, -0.11088450253009796, -0.2480153888463974, 0.06973274052143097, 0.09491334855556488, -0.37013423442840576, -0.04915482550859451, -0.2958773970603943, 0.08990073204040527, 0.11949235200881958, -0.1298082321882248, -0.28645557165145874, 0.01920214854180813, -0.08350290358066559, 0.2435155063867569, 0.24893052875995636, -0.43575650453567505, -0.23878638446331024, 0.531902015209198, 0.18699224293231964, -0.005502887070178986, 0.15887704491615295, 0.16599255800247192, 0.5808591842651367, 0.026064299046993256, -0.21904785931110382, 0.549146831035614, 0.0966215506196022, 0.08529709279537201, -0.0586136132478714, -0.1994819939136505, -0.16687536239624023, 0.4756353795528412, 0.025695599615573883, 0.24004721641540527, 0.36427146196365356, 0.3655809462070465, 0.16195902228355408, 0.02005534991621971, 0.2885039150714874, 0.1651301383972168, 0.5432432293891907, 0.2019294947385788, -0.24223966896533966, -0.12878218293190002, -0.3690003454685211, 0.04622674733400345, 0.055153973400592804, -0.2431919425725937, 0.24874530732631683, -0.10823798179626465, 0.05645335465669632, -0.008510813117027283, -0.03598319739103317, -0.015440273098647594, 0.06645792722702026, 0.17892175912857056, 0.06448297202587128, -0.21081939339637756, -0.373692125082016, 0.4566086232662201, -0.08291511982679367, -0.06155380606651306, -0.02654961869120598, 0.8224698901176453, 0.18838362395763397, -0.05814675614237785, 0.10868054628372192, -0.2639792263507843, 0.1291833370923996, 0.008523542433977127, 0.016161393374204636, 0.47979873418807983, 0.0346984937787056, 0.4322547912597656, 0.3309839069843292, 0.35813796520233154, 0.20869025588035583, 0.10915331542491913, 0.4377279579639435, -0.20521114766597748, 0.10832290351390839, 0.09571777284145355, -0.29016631841659546, 0.33499985933303833, 0.012947801500558853, -0.015374474227428436, 0.05677388608455658, -0.1642073541879654, 0.045030660927295685, 0.04879271239042282, -0.004050452262163162, 0.08965513110160828, -0.10411766171455383, -0.1190529391169548, -0.11244745552539825, -0.2552616596221924, -0.25306838750839233, 0.19267119467258453, 0.4349784553050995, 0.03875799477100372, 0.006073403172194958, 0.24417392909526825, -0.16713333129882812, -0.3001377284526825, 0.4504134953022003, 0.15626268088817596, 0.40300318598747253, 0.19901449978351593, 0.13985587656497955, 0.05303945392370224, 0.20336680114269257, 0.01889004558324814, 0.10253965854644775, -0.0455525778234005, 0.17987921833992004, 0.3061518669128418, -0.007606916129589081, -0.19917690753936768, -0.28555428981781006, -0.2742173671722412, 0.11282514780759811, -0.018793988972902298, 0.010118037462234497, -0.13555249571800232, -0.028602048754692078, 0.06986856460571289, 0.06362061947584152, -0.03789157420396805, -0.26744356751441956, -0.15438032150268555, 0.1760759800672531, 0.9253680109977722, 0.1418394297361374, -0.20711232721805573, 0.06448118388652802, 0.6075799465179443, -0.2687608003616333, -0.03130023553967476, -0.32702794671058655, -0.06971589475870132, 0.07216791808605194, 0.08975233137607574, -0.09469817578792572, 0.06915958225727081, 0.22815623879432678, 0.31080496311187744, 0.25179216265678406, -0.5923449397087097, 0.1364748179912567, 0.15229769051074982, -0.027080927044153214, 0.007064497098326683, -0.07499514520168304, 0.21416319906711578, -0.18599918484687805, -0.13380230963230133, -0.13463154435157776, -0.3424942195415497, -0.04500441253185272, -0.07073647528886795, -0.0620637983083725, 0.142310231924057, 0.08679832518100739, 0.16389892995357513, -0.30148783326148987, -0.5589823722839355, 0.012340118177235126, -0.0818963274359703, -0.013736024498939514, -0.434526264667511, -0.009341087192296982, 0.029163315892219543, 0.20607182383537292, -0.2508392930030823, -0.2620396614074707, -0.7311763763427734, 0.15509575605392456, -0.28845342993736267, -0.18376736342906952, 0.20209194719791412, 0.3383031487464905, -0.1293054074048996, 0.24136564135551453, -0.6228418350219727, -0.31335920095443726, 0.24299626052379608, -0.03221959248185158, -0.34731796383857727, 0.05541898310184479, 0.2522137761116028, -0.07967887073755264, -0.011793714016675949, -0.1608041524887085, -0.1522485464811325, -0.24078182876110077, 0.6622467637062073, 0.27374139428138733, 0.008336992934346199, 0.16697120666503906, 0.027679599821567535, 0.3111008107662201, -0.04209436476230621, 0.09846243262290955, 0.6504835486412048, 0.42507511377334595, 0.2759067416191101, -0.23664027452468872, 0.10536649078130722, -0.0067528411746025085, -0.3115848898887634, -0.20718348026275635, 0.38769301772117615, 0.06498773396015167, -0.1392761766910553, -0.2611558139324188, -0.2913302183151245, -0.11838818341493607, -0.01808781921863556, 0.047195546329021454, -0.10022993385791779, 0.13787318766117096, -0.17117570340633392, -0.06881146132946014, -0.16133087873458862, -0.13113117218017578, 0.21351364254951477, 0.07737978547811508, 0.4880741238594055, 0.11330501735210419, -0.11805593222379684, -0.10965029150247574, -0.23217913508415222, 0.11976182460784912, -0.14356637001037598, -0.13321338593959808, -0.22201023995876312, -0.00888727605342865, 0.10206949710845947, -0.18431857228279114, 0.6399752497673035, -0.519266664981842, 0.10692363977432251, -0.04848097264766693, -0.31819671392440796, -0.06972106546163559, -0.0610569603741169, -0.12262395769357681, -0.1156645268201828, -0.40513095259666443, 0.6504420638084412, -0.16659271717071533, -0.16821524500846863, -0.36006245017051697, -0.23902368545532227, -0.24916866421699524, -0.12194342911243439, 0.068793386220932, 0.001063719391822815, -0.3920065760612488, -0.04649493843317032, -0.10775391757488251, 0.05983998253941536, -0.12136416882276535, 0.04643926024436951, 0.08818624913692474, 0.30280598998069763, 0.025747399777173996, 0.02060483768582344, 0.25261950492858887, 0.2675987482070923, -0.12155362963676453, 0.1449647694826126, 0.19300104677677155, 0.4275639057159424, 0.4523248076438904, 0.2858639061450958, -0.11933121085166931, 0.2964056432247162, 0.2334531545639038, 0.20575256645679474, 0.3833197355270386, 0.4485812187194824, 0.276579350233078, 0.12549835443496704, 0.15450042486190796, -0.40645167231559753, 0.039301544427871704, -0.055721819400787354, -0.24884819984436035, -0.07438427209854126, -0.258247047662735, 0.4486558139324188, -0.22434373199939728, 0.030051514506340027, 0.11836259067058563, 0.2864209711551666, -0.15922072529792786, 0.5775412321090698, 0.2149263620376587, 1.1206560134887695, -0.03714046627283096, 0.17753735184669495, -0.04222241789102554, -0.5225895643234253, 0.15372171998023987, -0.8782976865768433, -0.14040949940681458, -0.262755811214447, -0.2347407341003418, -0.28492066264152527, 0.07322272658348083, 0.057366643100976944, 0.1630774289369583, -0.28263765573501587, 0.02531328797340393, 0.28818368911743164, 0.3572121858596802, -0.13380439579486847, 0.3702350854873657, -0.255971223115921, -0.34178003668785095, -0.49471360445022583, 0.16838157176971436, -0.30083343386650085, -0.0053717102855443954, -0.15656566619873047, -0.25090041756629944, 0.36269015073776245, 0.12131784111261368, -0.12539781630039215, 0.08693847060203552, 0.44960519671440125, 0.044021125882864, -0.30394846200942993, -0.08116194605827332, 0.008967526257038116, -0.10092178732156754, 0.11130551993846893, -0.0715632289648056, -0.3381956219673157, 0.17533689737319946, 0.11220736801624298, 0.06500029563903809, -0.20938535034656525, -0.12168075144290924, 0.23099525272846222, -0.28542080521583557, -0.27886056900024414, 0.330128014087677, 0.10007116198539734, -0.7371132969856262, 0.0721699446439743, -0.1795804351568222, 0.32030147314071655, -0.09875048696994781, -0.08632979542016983, 0.18800216913223267, -0.05988511070609093, -0.19494831562042236, 0.1050838977098465, -0.006749782711267471, -0.22169478237628937, -0.04323171079158783, -0.0301646888256073, 0.09170456230640411, -0.3520757257938385, 0.4928979277610779, -0.022690938785672188, -0.023297231644392014, -0.179199680685997, 0.25280606746673584, -0.3321773409843445, -0.19649101793766022, 0.07612238824367523, 0.26059117913246155, -0.016793005168437958, -0.005507141351699829, -0.17510703206062317, -0.17704735696315765, 0.038430314511060715, 0.06816691905260086, 0.20660388469696045, -0.038680970668792725, -0.13923954963684082, -0.20948079228401184, -0.011042986065149307, 0.23332244157791138, -0.09398720413446426, 0.2957736849784851, 0.21637332439422607, -0.3800410032272339, -0.009696491062641144, 0.11748310923576355, -0.3221812844276428, 0.08346796780824661, 0.05902385711669922, 0.09709081053733826, -0.15422075986862183, 0.03465678542852402, 0.11564856022596359, -0.2525763511657715, -0.006596330553293228, -0.15320464968681335, -0.3694829046726227, -0.13259261846542358, -0.10884474217891693, 0.1701573133468628, 0.2702113687992096, 0.13497823476791382, -0.3046136498451233, -0.2567954659461975, -0.23162582516670227, -0.007917284965515137, 0.4023221433162689, 0.054704904556274414, -0.08197124302387238, 0.060605693608522415, 0.758510947227478, -0.10933799296617508, -0.28182467818260193, 0.07608354091644287, 0.4817582964897156, 0.2564679980278015, -0.23215430974960327, 0.021178364753723145, -0.0547819584608078, -0.15593364834785461, -0.20493482053279877, 0.2945925295352936, 0.5160765051841736, 0.10980475693941116, 0.4674372673034668, -0.07586629688739777, 0.028272554278373718, -0.08720085769891739, 0.5751689672470093, 0.00293523445725441, 0.16187886893749237, -0.17988674342632294, 0.24976055324077606, 0.1557428389787674, 0.0612138956785202, -0.4541459381580353, -0.10616351664066315, -0.1718849539756775, 0.03388968110084534, -0.06687817722558975, 0.2647498846054077, 0.17673730850219727, -0.12856103479862213, 0.10652279853820801, 0.3790014386177063, 0.1466391235589981, -0.047198113054037094, 0.10592225193977356, 0.013678386807441711, 0.10488748550415039, -0.041937269270420074, 0.1455102264881134, 0.059493716806173325, 0.22589096426963806, 0.09048836678266525, 0.20892003178596497, 0.2728557288646698, 0.22270715236663818, 0.15279635787010193, -0.3706091642379761, -0.2094707041978836, -0.06116552650928497, 0.015225913375616074, 0.1641133576631546, -0.12806202471256256, -0.04058274254202843, 0.14994272589683533, -0.3016466498374939, -0.2804543375968933, 0.18067386746406555, 0.0931972861289978, 0.057001594454050064, -0.038626424968242645, -0.10863441228866577, 0.03424432873725891, 0.41170233488082886, 0.06998911499977112, -0.21307095885276794, 0.3460461497306824, 0.14642022550106049, 0.340328574180603, 0.10512126237154007, 0.1452741175889969, 0.10869017988443375, 0.06372611224651337, -0.06992162764072418, 0.020592359825968742, -0.04335109144449234, 0.045942433178424835, 0.27143555879592896, -0.17589819431304932, -0.00014824047684669495, 0.0225929394364357, -0.10197542607784271, 0.1453450322151184, 0.13629522919654846, -0.03766337037086487, 0.19391240179538727, -0.002376912161707878, 0.11048467457294464, 0.09497133642435074, 0.3356281518936157, 0.19847483932971954, -0.06438501179218292, 0.07586535811424255, -0.27770552039146423, 0.027443528175354004, -0.06499228626489639, 0.23861901462078094, 0.41234952211380005, -0.004789248108863831, 0.024725016206502914, -0.05762656033039093, -0.31930485367774963, -0.21833106875419617, 0.3014061450958252, -0.11082382500171661, 0.03381902351975441, 0.06346485018730164, 0.07317999005317688, -0.12535375356674194, 0.4500803053379059, 0.1938469111919403, -0.2062804400920868, -0.23172171413898468, -0.29409539699554443, -0.2164772003889084, 0.04248905926942825, 0.10345731675624847, -0.04725754261016846, 0.17919094860553741, 0.37501224875450134, 0.2824544608592987, 0.14073240756988525, -0.3940677046775818, -0.07853151112794876, -0.09792068600654602, 0.3411208987236023, -0.19286945462226868, 0.03784935548901558, 0.08288509398698807, 0.36204794049263, -0.11449014395475388, -0.18151012063026428, 0.3053882420063019, 0.3494255542755127, -0.030432865023612976, 0.05193108692765236, 0.07340342551469803, 0.09289257228374481, -0.21869516372680664, 0.40143096446990967, -0.3467327952384949, 0.04015662148594856, -0.2770022749900818, -0.020400770008563995, 0.036591894924640656, -0.18104824423789978, -0.09618283808231354, -0.18967542052268982, -0.35393115878105164, 0.4442266523838043, 0.04461297392845154, -0.015864212065935135, -0.2623038589954376, 0.1389256715774536, -0.066322460770607, -0.0789170041680336, -0.15317495167255402, -0.03611007705330849, -0.2709317207336426, 0.18976886570453644, 0.15407611429691315, 0.17901815474033356, 0.0552193820476532, -0.0768103078007698, -0.2930833697319031, -0.08670052886009216, 0.4671938717365265, -0.18701334297657013, -0.26140397787094116, 0.14869028329849243, 0.21229568123817444, 0.21973475813865662, -0.20055373013019562, -0.6001171469688416, 0.11370056867599487, 0.11189483106136322, -0.10113693028688431, 0.19139142334461212, 0.3861304819583893, 0.03820428252220154, 0.03202080726623535, -0.09830121695995331, 0.03979659453034401, 0.08756814897060394, -0.2394486665725708, -0.16397961974143982, -0.3370567560195923 ]
https://github.com/huggingface/datasets/issues/5838
@lhoestq I tried the method you mentioned. This the current scenario I'm facing: - The parquet file can be read from disk and streaming can be enabled. - The parquet file can be read from `s3` (local MinIO). - When `streaming=True` is enabled for `s3`, I get the error mentioned below: ``` File ~/.../lib/python3.8/site-packages/s3fs/core.py:502, in S3FileSystem.set_session(self, refresh, kwargs) 500 conf = AioConfig(**config_kwargs) 501 if self.session is None: --> 502 self.session = aiobotocore.session.AioSession(**self.kwargs) 504 for parameters in (config_kwargs, self.kwargs, init_kwargs, client_kwargs): 505 for option in ("region_name", "endpoint_url"): TypeError: __init__() got an unexpected keyword argument 'headers' ``` Does this mean there is a bug in the main branch?
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
106
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. @lhoestq I tried the method you mentioned. This the current scenario I'm facing: - The parquet file can be read from disk and streaming can be enabled. - The parquet file can be read from `s3` (local MinIO). - When `streaming=True` is enabled for `s3`, I get the error mentioned below: ``` File ~/.../lib/python3.8/site-packages/s3fs/core.py:502, in S3FileSystem.set_session(self, refresh, kwargs) 500 conf = AioConfig(**config_kwargs) 501 if self.session is None: --> 502 self.session = aiobotocore.session.AioSession(**self.kwargs) 504 for parameters in (config_kwargs, self.kwargs, init_kwargs, client_kwargs): 505 for option in ("region_name", "endpoint_url"): TypeError: __init__() got an unexpected keyword argument 'headers' ``` Does this mean there is a bug in the main branch?
[ -0.18137714266777039, -0.354874849319458, 0.02730192244052887, 0.2140737622976303, -0.07594193518161774, -0.16613176465034485, 0.1421043574810028, 0.024777110666036606, 0.29747745394706726, -0.005054458975791931, -0.0833112895488739, 0.3988795876502991, 0.07521635293960571, 0.5150984525680542, -0.011458830907940865, 0.038148071616888046, 0.2701529562473297, 0.288066029548645, 0.17891542613506317, 0.055016107857227325, -0.19383400678634644, 0.17565006017684937, -0.06770140677690506, -0.18018998205661774, 0.2728298306465149, 0.05961844325065613, -0.2123306840658188, 0.2917211055755615, -0.3644646406173706, -0.30148234963417053, 0.18113349378108978, 0.15982984006404877, 0.356894850730896, 0.28130650520324707, -0.00012150157272117212, -0.1517300009727478, 0.21698206663131714, -0.27555134892463684, -0.31735292077064514, -0.26089656352996826, -0.16841474175453186, -0.05306896194815636, 0.32882925868034363, -0.15668398141860962, -0.13927175104618073, 0.1362253874540329, 0.03160715848207474, -0.4158078730106354, 0.4293974041938782, 0.35354506969451904, 0.017523953691124916, 0.30038589239120483, -0.28271764516830444, 0.10114599764347076, 0.3260650634765625, 0.2721880376338959, -0.20830774307250977, 0.013278547674417496, 0.4469490647315979, 0.001263987272977829, 0.11816640943288803, 0.3663129210472107, -0.3466533422470093, 0.15193049609661102, 0.34852084517478943, 0.049148961901664734, 0.07249416410923004, -0.13822361826896667, -0.08091074228286743, -0.015826653689146042, 0.48958343267440796, -0.23431983590126038, -0.6271486878395081, -0.41526687145233154, -0.07955873012542725, -0.5542247891426086, 0.14916938543319702, 0.11748707294464111, -0.049053434282541275, 0.09343187510967255, -0.05006270110607147, -0.5467318296432495, -0.32373619079589844, 0.15408273041248322, -0.08794936537742615, 0.311058908700943, -0.17065036296844482, -0.06785324215888977, 0.033418916165828705, 0.08888979256153107, 0.3863410949707031, -0.07180551439523697, 0.14046360552310944, 0.12134993076324463, -0.3322136700153351, -0.12224352359771729, 0.10333335399627686, 0.1907390058040619, 0.030118316411972046, 0.3341096341609955, 0.3572175204753876, 0.029478061944246292, 0.1818905770778656, 0.3606272339820862, 0.39285922050476074, -0.08287819474935532, -0.12975431978702545, -0.07739817351102829, 0.05640070512890816, 0.49009811878204346, 0.03303952515125275, -0.40691515803337097, -0.042494796216487885, 0.05973394587635994, -0.14234736561775208, -0.2974777817726135, 0.30281728506088257, -0.2921831011772156, -0.010816030204296112, -0.11918715387582779, 0.10671533644199371, -0.08778875321149826, 0.11652085185050964, 0.10714787244796753, -0.08814780414104462, 0.2926182150840759, -0.028318330645561218, 0.5234362483024597, -0.23314009606838226, -0.30158892273902893, -0.12404951453208923, 0.045427754521369934, -0.05881054326891899, 0.25945040583610535, 0.054407671093940735, -0.40735384821891785, 0.08007607609033585, -0.03916788846254349, 0.2535537779331207, 0.25368764996528625, 0.03214454650878906, -0.08130000531673431, 0.12942886352539062, 0.1054694652557373, 0.22611738741397858, -0.04362432658672333, 0.24064984917640686, 0.026828840374946594, -0.3802555203437805, -0.015291817486286163, -0.18466097116470337, -0.5714931488037109, -0.24117398262023926, -0.001182112842798233, -0.36529460549354553, -0.11596320569515228, -0.5775960087776184, 0.258072167634964, -0.18943166732788086, -0.3385153114795685, -0.14355456829071045, 0.1561153531074524, -0.22260218858718872, -0.1618708074092865, 0.22641582787036896, 0.2223430573940277, -0.09094081073999405, -0.166201651096344, -0.3511669337749481, 0.11794485151767731, 0.3201792240142822, 0.09594566375017166, -0.2116563469171524, -0.350862592458725, -0.0385192409157753, 0.2691505551338196, 0.3095703125, -0.33249974250793457, -0.37152063846588135, 0.5485993027687073, 0.11345501989126205, 0.12454638630151749, 0.6381372213363647, -0.09832430630922318, 0.564019501209259, 0.006430353969335556, -0.07052481174468994, 0.6037696599960327, 0.034079410135746, 0.0334816575050354, -0.21569067239761353, -0.18336184322834015, -0.0797559842467308, 0.5272518396377563, -0.10882854461669922, 0.13731619715690613, 0.163832888007164, -0.09125260263681412, 0.11665120720863342, 0.015250750817358494, 0.162753164768219, 0.010905571281909943, 0.5197323560714722, 0.3479956090450287, -0.23067674040794373, 0.016499735414981842, -0.24122865498065948, 0.08781100809574127, 0.2944510579109192, -0.055328305810689926, -0.16016747057437897, -0.02384665608406067, 0.04796764254570007, -0.07628213614225388, -0.1308201253414154, 0.057631246745586395, 0.02748352661728859, 0.2816907465457916, 0.2668435871601105, -0.11004835367202759, -0.27455824613571167, 0.35748809576034546, -0.00416111946105957, 0.061337992548942566, -0.1774747371673584, 0.6640371084213257, 0.11815883964300156, -0.2274368405342102, 0.08814981579780579, -0.26734089851379395, 0.23786169290542603, 0.10300739109516144, 0.05269740894436836, 0.42857033014297485, 0.13443590700626373, 0.5396658182144165, 0.02197740599513054, 0.4168351888656616, 0.14463278651237488, 0.21247375011444092, 0.34657546877861023, -0.1348404437303543, 0.07591562718153, 0.18178702890872955, -0.08896642923355103, 0.3433974087238312, 0.0747111588716507, 0.14203296601772308, 0.05821101367473602, -0.053286775946617126, 0.19573891162872314, 0.032348327338695526, -0.3911478519439697, -0.026975080370903015, -0.04352852702140808, -0.1366671323776245, -0.2661225199699402, -0.24198046326637268, -0.4912431836128235, -0.07426141202449799, 0.3013599216938019, 0.13096487522125244, -0.050120361149311066, 0.006619742605835199, 0.026181552559137344, -0.36480629444122314, 0.32880499958992004, 0.21371373534202576, 0.6014759540557861, 0.14800459146499634, 0.20358847081661224, -0.09020330756902695, 0.12798911333084106, 0.03339532017707825, 0.2641105651855469, 0.22586104273796082, 0.21966278553009033, 0.14716778695583344, 0.012574288994073868, -0.09009057283401489, -0.10210424661636353, -0.24436181783676147, 0.058060020208358765, -0.07161881774663925, -0.212058424949646, 0.06275343149900436, 0.015679381787776947, -0.12577524781227112, -0.06210797280073166, 0.030897710472345352, -0.06037157028913498, -0.14302515983581543, -0.0077152615413069725, 0.7679150104522705, 0.009398125112056732, -0.16629299521446228, -0.021247468888759613, 0.4986158013343811, -0.220199316740036, -0.27018803358078003, -0.27734827995300293, -0.118715301156044, 0.006431944668292999, -0.02688555233180523, 0.024441968649625778, -0.08373990654945374, 0.16262711584568024, 0.17344975471496582, 0.03243599086999893, -0.4578878879547119, -0.03488929569721222, 0.09775739908218384, -0.06568299233913422, 0.25434064865112305, -0.11422385275363922, 0.13248638808727264, -0.05761776864528656, -0.15446904301643372, 0.11739975959062576, -0.33686113357543945, 0.015592165291309357, 0.001789383590221405, 0.07532383501529694, 0.16773340106010437, 0.08029568195343018, 0.02267661690711975, -0.31814369559288025, -0.48156705498695374, 0.050742823630571365, 0.10772408545017242, 0.01703893579542637, -0.4555230140686035, -0.028255820274353027, -0.12896212935447693, 0.34015771746635437, 0.1953682005405426, -0.19373860955238342, -0.7328542470932007, 0.2784416675567627, -0.13836295902729034, -0.209311380982399, 0.2606266736984253, 0.1321050375699997, 0.1895039677619934, 0.3647184371948242, -0.39491862058639526, -0.261788934469223, 0.21577495336532593, -0.27228236198425293, -0.427726149559021, 0.14990141987800598, 0.4044422507286072, -0.1099649965763092, 0.08635671436786652, -0.14377501606941223, -0.18898484110832214, -0.21386802196502686, 0.6651821732521057, 0.26521405577659607, 0.13063783943653107, 0.5536275506019592, 0.1780221313238144, 0.5023192763328552, -0.01921052858233452, 0.15781240165233612, 0.7657132744789124, 0.21223217248916626, 0.22779938578605652, 0.041622012853622437, -0.0568743571639061, -0.19306685030460358, -0.2631400227546692, -0.46453940868377686, 0.29313042759895325, 0.008984453976154327, -0.3559145927429199, -0.571446418762207, -0.10732119530439377, -0.5879819989204407, -0.10287725180387497, -0.08995044231414795, -0.011654475703835487, 0.3678502142429352, -0.26994791626930237, 0.01776856929063797, -0.11095505952835083, 0.16797076165676117, 0.07891207188367844, 0.23219533264636993, 0.49317237734794617, 0.0885048657655716, -0.010408326983451843, -0.11593536287546158, -0.36233484745025635, 0.11681029200553894, -0.2805704176425934, -0.06445527076721191, -0.13140994310379028, -0.36195141077041626, 0.23250681161880493, -0.19787797331809998, 0.6748017072677612, -0.3647560775279999, 0.010678932070732117, 0.04333189129829407, -0.3658430576324463, -0.3420863151550293, -0.11778915673494339, -0.21735432744026184, -0.07969046384096146, 0.028214018791913986, 0.6767072677612305, -0.321882039308548, 0.03588464856147766, -0.3958924114704132, -0.4278962016105652, -0.07968922704458237, -0.08651453256607056, -0.20156586170196533, -0.04708818718791008, -0.4265432357788086, 0.030125834047794342, 0.13759461045265198, 0.296060174703598, 0.0917552262544632, 0.3500481843948364, 0.03890572488307953, 0.1988556981086731, 0.06045963615179062, 0.14806625247001648, 0.28629451990127563, 0.10270597040653229, 0.13431546092033386, 0.17797361314296722, 0.26941412687301636, 0.3425799012184143, 0.717898964881897, 0.4190874695777893, -0.4447985887527466, 0.05388904735445976, 0.29481810331344604, 0.37976735830307007, 0.34074878692626953, 0.33588719367980957, 0.04250626638531685, 0.012784730643033981, 0.05741884559392929, -0.3439951539039612, -0.13837982714176178, 0.10612769424915314, -0.228939026594162, 0.16003838181495667, -0.39776378870010376, 0.4128727316856384, 0.0196952223777771, -0.10122337937355042, 0.03425212576985359, 0.1554931253194809, -0.18795910477638245, 0.6744749546051025, 0.31529566645622253, 1.0494439601898193, -0.0026920773088932037, 0.20714277029037476, 0.21716246008872986, -0.6247251629829407, 0.32705071568489075, -0.4170130789279938, -0.031852684915065765, -0.18915505707263947, -0.13142623007297516, -0.2081005871295929, -0.1320747435092926, 0.12990665435791016, 0.10304572433233261, -0.3697577118873596, 0.023780249059200287, 0.13175740838050842, 0.18959501385688782, -0.12589643895626068, 0.265995591878891, -0.3378039598464966, -0.26528629660606384, -0.8610568642616272, 0.008336260914802551, -0.18400359153747559, 0.038281846791505814, 0.08598856627941132, -0.317063570022583, 0.03164363652467728, 0.015367992222309113, -0.06425195187330246, 0.22801591455936432, 0.25325343012809753, -0.055733174085617065, -0.3020974397659302, -0.25516247749328613, 0.13459430634975433, 0.18942826986312866, -0.11412025988101959, -0.2964164614677429, -0.12208718806505203, 0.04889582842588425, 0.19218960404396057, -0.13008743524551392, -0.11522310227155685, -0.11366115510463715, 0.23779042065143585, -0.19918793439865112, 0.026910334825515747, 0.1686408370733261, 0.03857894986867905, -0.5394922494888306, 0.09385509788990021, -0.18316395580768585, 0.6132965683937073, -0.2156132608652115, -0.33754247426986694, 0.016416801139712334, 0.09486551582813263, -0.10900365561246872, 0.024100439622998238, 0.02984377183020115, -0.22445711493492126, -0.14821076393127441, -0.4336337149143219, 0.12964887917041779, -0.2703576385974884, 0.7301180362701416, -0.11585478484630585, 0.12736520171165466, 0.04731941968202591, 0.2599093019962311, -0.1831294447183609, -0.07659735530614853, -0.18339720368385315, 0.01226094365119934, 0.2019253820180893, 0.051961205899715424, 0.06544260680675507, -0.19053570926189423, 0.015208333730697632, -0.07846513390541077, 0.24783606827259064, 0.006087852641940117, -0.03330983221530914, -0.3872511684894562, 0.1143319383263588, 0.2650005519390106, -0.1402997374534607, 0.24496278166770935, 0.3149058222770691, -0.44025349617004395, 0.006891310214996338, -0.13706009089946747, -0.229418084025383, 0.161370649933815, 0.10249175876379013, 0.16321897506713867, 0.36820492148399353, -0.04775926098227501, 0.19256938993930817, -0.11440201103687286, 0.0141582190990448, -0.20919637382030487, -0.20519962906837463, -0.024304300546646118, 0.050687067210674286, 0.20959477126598358, 0.37690019607543945, -0.04081392660737038, -0.1151006668806076, -0.4308456480503082, -0.3596256971359253, -0.007293377071619034, 0.2891087532043457, 0.15109865367412567, -0.09705168008804321, 0.05560268834233284, 0.5621371269226074, 0.0010876469314098358, -0.3765164613723755, -0.06687639653682709, 0.014590362086892128, -0.0005249455571174622, -0.19908380508422852, 0.19940495491027832, -0.07132384926080704, -0.1417447179555893, -0.18236380815505981, 0.13725721836090088, 0.22758327424526215, 0.23410454392433167, 0.48566991090774536, -0.16755466163158417, -0.02375456690788269, 0.15027150511741638, 0.5354645252227783, 0.15328840911388397, 0.09764771163463593, -0.11924771964550018, 0.2580009400844574, 0.12648601830005646, 0.01012209802865982, -0.3541870713233948, -0.2644651234149933, -0.15938377380371094, 0.0012080147862434387, 0.015128683298826218, 0.23202219605445862, 0.14818644523620605, -0.15597639977931976, 0.07924415171146393, 0.37674054503440857, 0.30014270544052124, 0.23160628974437714, 0.16624702513217926, -0.04905454441905022, 0.06411400437355042, -0.0848565623164177, 0.14056164026260376, 0.17079854011535645, 0.2136879861354828, 0.05506061017513275, 0.12454523891210556, 0.16317731142044067, 0.35192427039146423, -0.11092808097600937, -0.37987762689590454, -0.20602315664291382, -0.1785830855369568, -0.03069412335753441, 0.15475863218307495, -0.07133249938488007, 0.12370593845844269, 0.13074171543121338, -0.0063384585082530975, -0.36541301012039185, 0.20479601621627808, 0.13848091661930084, -0.0689074844121933, -0.09958754479885101, -0.1693178117275238, 0.04386705160140991, 0.349211722612381, 0.0027922168374061584, -0.09575849771499634, 0.10551491379737854, 0.16869649291038513, 0.24974459409713745, 0.16361913084983826, -0.13712529838085175, 0.1490413099527359, 0.15765346586704254, -0.2676122784614563, 0.0499965101480484, -0.15090805292129517, 0.0044312383979558945, 0.18008579313755035, -0.1947331726551056, 0.31006938219070435, 0.06194884702563286, -0.12137659639120102, -0.04213179275393486, 0.20668771862983704, -0.12413404881954193, 0.1523992270231247, -0.0480252280831337, 0.20732101798057556, 0.31507354974746704, 0.2412177324295044, 0.10303747653961182, -0.09585335850715637, -0.04696020856499672, -0.25694015622138977, 0.09888105094432831, -0.16996869444847107, 0.15579921007156372, 0.1669599413871765, -0.00972740352153778, -0.0439135804772377, 0.01018025353550911, -0.48967984318733215, -0.39879024028778076, 0.024728085845708847, 0.0745248794555664, -0.04794136434793472, 0.14279092848300934, 0.0077745504677295685, -0.03917364776134491, 0.35133832693099976, 0.2699618935585022, -0.2171812206506729, -0.2872031033039093, -0.2910386621952057, -0.36230984330177307, -0.017735358327627182, 0.16074728965759277, -0.36953839659690857, 0.19209717214107513, 0.6078433990478516, 0.2609190344810486, 0.15010535717010498, -0.5107752680778503, 0.1476847529411316, -0.1803576648235321, 0.3120279610157013, -0.14998787641525269, -0.17790183424949646, 0.09657178819179535, 0.04627108573913574, -0.029032837599515915, -0.041461698710918427, 0.06260053813457489, 0.04056320711970329, -0.00566401332616806, -0.007060099393129349, -0.07803510129451752, -0.2574016749858856, -0.16440865397453308, 0.5368149280548096, -0.10401009023189545, 0.1220168024301529, -0.14454570412635803, -0.12088051438331604, -0.10335293412208557, -0.12501008808612823, -0.29234251379966736, 0.11290955543518066, -0.4104006588459015, 0.6227152347564697, -0.23874711990356445, 0.08637623488903046, -0.3731192350387573, 0.09566611051559448, -0.11109406501054764, -0.4415721595287323, 0.008543550968170166, 0.09495081752538681, 0.024853810667991638, 0.16342464089393616, -0.0016008131206035614, 0.14510667324066162, -0.03527286276221275, -0.000609077513217926, -0.31581053137779236, -0.20713670551776886, 0.4646950364112854, -0.5809201598167419, -0.12221479415893555, -0.018748827278614044, 0.30483779311180115, 0.14576902985572815, 0.0038765575736761093, -0.4499276578426361, 0.19998404383659363, 0.06278247386217117, -0.08765050768852234, 0.021759696304798126, 0.3324459195137024, 0.20656540989875793, -0.0681762546300888, -0.17132997512817383, -0.018194768577814102, 0.11682505905628204, -0.1127973198890686, -0.17966371774673462, -0.3113064169883728 ]
https://github.com/huggingface/datasets/issues/5838
Streaming from S3 is still experimental, there might be a few bugs unfortunately. Can you share the full stack trace ?
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
21
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. Streaming from S3 is still experimental, there might be a few bugs unfortunately. Can you share the full stack trace ?
[ -0.23841492831707, -0.394839882850647, -0.1468847393989563, 0.1194128692150116, -0.00791324581950903, -0.2820230722427368, -0.0357992984354496, 0.03679409250617027, 0.18196415901184082, 0.06367497146129608, -0.009758085012435913, 0.36067014932632446, -0.07663559913635254, 0.46908891201019287, 0.11065619438886642, -0.06644951552152634, 0.2006477415561676, 0.16878680884838104, 0.1232118085026741, 0.08625701069831848, -0.203743577003479, 0.11184940487146378, 0.003592953085899353, -0.36608070135116577, 0.19062155485153198, 0.10275351256132126, -0.026215646415948868, 0.008771518245339394, -0.36008697748184204, -0.18881675601005554, 0.13171400129795074, 0.2520822584629059, 0.39633724093437195, 0.27155426144599915, -0.00010677315731300041, -0.34704551100730896, 0.1502891182899475, -0.19497030973434448, -0.35882437229156494, -0.16422498226165771, -0.2691904306411743, 0.021994277834892273, 0.19432660937309265, 0.09124025702476501, -0.10600875318050385, 0.12127097696065903, -0.09734530001878738, -0.38574519753456116, 0.24006211757659912, 0.04396849870681763, 0.18760620057582855, 0.3577013611793518, -0.4006309509277344, -0.11934834718704224, 0.2697979211807251, 0.3249581754207611, -0.26506924629211426, 0.22597752511501312, 0.5822524428367615, 0.09196305274963379, 0.16448943316936493, 0.4656861126422882, -0.38602036237716675, 0.08119495213031769, 0.4628139138221741, -0.20076130330562592, -0.22216708958148956, -0.2468225061893463, -0.15902839601039886, 0.098712258040905, 0.7175326347351074, -0.19614127278327942, -0.4466618299484253, -0.17304928600788116, -0.012159492820501328, -0.23197907209396362, -0.002537056803703308, -0.12063820660114288, -0.06686578691005707, 0.15187671780586243, -0.5500590205192566, -0.6848664879798889, -0.32041966915130615, 0.2064591944217682, -0.11430537700653076, 0.16776441037654877, -0.23033156991004944, -0.16316016018390656, 0.2305326610803604, 0.2593376040458679, 0.5383345484733582, -0.17130142450332642, 0.008872750215232372, -0.013191960752010345, -0.3392733335494995, -0.2538907825946808, 0.07562659680843353, 0.09711423516273499, 0.018567875027656555, 0.40133655071258545, 0.4382762014865875, 0.16818362474441528, 0.028335649520158768, 0.19674240052700043, 0.12453939020633698, 0.08655017614364624, 0.011261571198701859, -0.3419792652130127, 0.19325944781303406, 0.30968382954597473, 0.13845008611679077, -0.3771800994873047, -0.18306702375411987, 0.19338232278823853, -0.2734440267086029, -0.1845419704914093, 0.08130395412445068, -0.14436759054660797, 0.04528772830963135, -0.15523724257946014, 0.18192140758037567, -0.07797660678625107, 0.07493764162063599, 0.12835876643657684, 0.027807433158159256, 0.3590213358402252, -0.03750012814998627, 0.20400592684745789, 0.11190721392631531, -0.35951942205429077, -0.11831517517566681, -0.10192792117595673, -0.18174925446510315, 0.2502444386482239, 0.07174012809991837, -0.3922121822834015, 0.0054918378591537476, -0.2316281944513321, 0.21822474896907806, 0.20811963081359863, 0.040406107902526855, 0.021522395312786102, 0.20155201852321625, 0.019779689610004425, 0.015068210661411285, 0.051446445286273956, 0.10876612365245819, 0.3028824031352997, -0.22209560871124268, 0.09967601299285889, -0.10065571963787079, -0.5530522465705872, -0.4265885651111603, 0.19153064489364624, -0.440437376499176, -0.09768699109554291, -0.5543924570083618, 0.28831303119659424, -0.5010975003242493, -0.27893128991127014, 0.09877398610115051, 0.22660398483276367, -0.08736418932676315, -0.2609446346759796, 0.0769958645105362, -0.006257176399230957, -0.34326618909835815, -0.0022293031215667725, -0.5053229331970215, -0.017777245491743088, 0.2961265444755554, -0.1235552728176117, -0.24293796718120575, -0.22000284492969513, -0.013452921062707901, 0.14509117603302002, 0.12102413922548294, -0.4061737656593323, -0.23501978814601898, 0.6796137094497681, 0.027813121676445007, 0.044231437146663666, 0.3535664975643158, 0.2562564015388489, 0.374015212059021, 0.09957341104745865, -0.19405704736709595, 0.7633446455001831, 0.11986440420150757, 0.07617394626140594, 0.005280740559101105, -0.1452225148677826, -0.12974074482917786, 0.4452729821205139, -0.18570230901241302, 0.23348814249038696, 0.2696138322353363, 0.19849266111850739, 0.07776111364364624, 0.015665650367736816, 0.13976174592971802, 0.05710370093584061, 0.6748414039611816, 0.10919708013534546, -0.2775213420391083, -0.14093178510665894, -0.36343950033187866, 0.04360393434762955, 0.28783151507377625, -0.17670461535453796, 0.11988425254821777, -0.025190196931362152, 0.038457367569208145, 0.004501260817050934, 0.09900707006454468, -0.0034380173310637474, 0.07998159527778625, 0.29649174213409424, 0.09667636454105377, -0.20738057792186737, -0.28963035345077515, 0.08715669810771942, -0.03322809934616089, -0.0968116745352745, -0.10429564118385315, 0.5017213821411133, 0.15699851512908936, -0.05378635972738266, 0.06331641972064972, -0.3497471809387207, 0.060523562133312225, 0.07039199769496918, -0.015338141471147537, 0.3730650246143341, -0.026518916711211205, 0.5418180227279663, 0.15578731894493103, 0.3995269536972046, 0.17705662548542023, 0.1415383517742157, 0.4141080379486084, -0.09494256973266602, 0.0989023894071579, 0.06607586145401001, -0.20150338113307953, 0.30582308769226074, -0.09864471852779388, -0.02968113124370575, 0.03352630138397217, -0.07502998411655426, 0.06027599424123764, 0.010212935507297516, -0.11506344377994537, 0.03213062882423401, -0.04300720617175102, -0.14014586806297302, -0.19121426343917847, -0.1722842901945114, -0.30751290917396545, -0.03910645470023155, 0.21204222738742828, -0.009328864514827728, -0.002117505297064781, 0.12565837800502777, -0.16169655323028564, -0.311493843793869, 0.4107450246810913, 0.3834143280982971, 0.46837225556373596, 0.20627638697624207, 0.3013756573200226, -0.114445261657238, 0.42731350660324097, -0.1302521526813507, 0.3051297068595886, 0.0069503262639045715, 0.15175354480743408, 0.269214928150177, -0.05423082038760185, -0.1721922755241394, -0.073135606944561, -0.33486464619636536, 0.04961065948009491, -0.1250937134027481, 0.02598799765110016, -0.12548963725566864, -0.004420749843120575, -0.26950934529304504, 0.051051538437604904, -0.2542911171913147, -0.049995072185993195, -0.10007971525192261, 0.047541894018650055, 0.8663744926452637, 0.014481760561466217, -0.12723128497600555, 0.15437577664852142, 0.5420065522193909, -0.23674288392066956, -0.11286277323961258, -0.3057744801044464, 0.0006591640412807465, 0.21366724371910095, 0.1926218718290329, -0.11171641945838928, -0.23420152068138123, 0.21781863272190094, 0.2523764967918396, 0.3062039017677307, -0.47909876704216003, -0.03753466159105301, 0.055586494505405426, -0.0385933592915535, 0.12290678918361664, 0.021184559911489487, 0.09567740559577942, -0.07233588397502899, -0.15038363635540009, -0.10260277986526489, -0.4324600100517273, -0.14278355240821838, -0.1472621113061905, 0.020182602107524872, 0.17447274923324585, -0.11044476926326752, 0.10437063872814178, -0.24386200308799744, -0.579321026802063, 0.10736222565174103, -0.1327025592327118, -0.0707690417766571, -0.35470062494277954, 0.0910705178976059, 0.010202892124652863, 0.3033442199230194, -0.0216093510389328, -0.19384068250656128, -0.7534604668617249, 0.14221565425395966, -0.2029792070388794, -0.20076805353164673, 0.18440015614032745, 0.3628324270248413, -0.039539944380521774, 0.2658866047859192, -0.4821005165576935, -0.33423730731010437, 0.2741808593273163, -0.04399385675787926, -0.27288302779197693, 0.04977214336395264, 0.22536733746528625, -0.013661088421940804, -0.12312297523021698, -0.22686073184013367, -0.2215069979429245, -0.5188153386116028, 0.4273345172405243, 0.28641343116760254, 0.14465370774269104, 0.19889310002326965, 0.1336647868156433, 0.3489232659339905, -0.10625117272138596, -0.003891285043209791, 0.5102183222770691, 0.4481745660305023, 0.25760987401008606, -0.020927563309669495, -0.10081775486469269, -0.12740828096866608, -0.2320658266544342, -0.3033553957939148, 0.2774050235748291, 0.021605446934700012, -0.2861013114452362, -0.45899054408073425, -0.11521631479263306, -0.2733284831047058, 0.16390183568000793, 0.05414818227291107, -0.16332906484603882, 0.20336326956748962, -0.30074843764305115, -0.041319191455841064, -0.09363411366939545, -0.02013075351715088, 0.013145975768566132, -0.06226850301027298, 0.5472676753997803, -0.032447390258312225, -0.05182582512497902, -0.06394117325544357, -0.2820412516593933, 0.19582074880599976, -0.09858755767345428, -0.188312828540802, -0.2611158490180969, -0.18486689031124115, 0.10921989381313324, -0.00684753805398941, 0.5543415546417236, -0.48490485548973083, -0.0355822890996933, -0.027291111648082733, -0.4153481721878052, -0.10273067653179169, 0.05229048430919647, -0.17603296041488647, -0.06644155830144882, -0.2578335702419281, 0.4415309727191925, 0.03194126486778259, -0.03026818484067917, -0.25414472818374634, -0.3049802780151367, -0.08472812175750732, -0.21022392809391022, -0.033556945621967316, -0.04334767907857895, -0.34215983748435974, -0.12692628800868988, 0.09133759886026382, 0.08105337619781494, -0.22315621376037598, -0.05721099674701691, 0.13853025436401367, 0.3328007757663727, 0.10505885630846024, -0.03623750060796738, 0.14595943689346313, 0.18577821552753448, -0.10841532796621323, 0.1561736911535263, 0.10379236191511154, 0.3273409605026245, 0.39850735664367676, 0.39750832319259644, -0.19446848332881927, 0.22355280816555023, 0.3221804201602936, 0.3373100161552429, 0.4009140133857727, 0.45675450563430786, 0.1731443703174591, 0.0898667722940445, 0.09131500124931335, -0.2959061861038208, -0.13931550085544586, 0.08900978416204453, -0.1266753226518631, 0.1257094144821167, -0.33986639976501465, 0.32288214564323425, -0.08599619567394257, -0.038694776594638824, 0.13066354393959045, -0.12263339757919312, -0.1589357703924179, 0.3221018314361572, 0.24904793500900269, 1.1567058563232422, 0.059380535036325455, 0.08670403063297272, 0.045881714671850204, -0.33200645446777344, 0.2849961221218109, -0.44670724868774414, -0.03618020936846733, -0.20699387788772583, -0.2525917887687683, -0.2706453204154968, -0.04994608834385872, -0.04716695472598076, 0.06994900107383728, -0.34736961126327515, -0.0817202478647232, 0.1339942216873169, 0.301498144865036, -0.05229286849498749, 0.39296823740005493, -0.2753733694553375, -0.22793550789356232, -0.4721369743347168, 0.15000542998313904, -0.29995378851890564, 0.12822577357292175, -0.1532452255487442, -0.3148879408836365, 0.36517709493637085, 0.07408174127340317, -0.16448256373405457, 0.13109391927719116, 0.4106111526489258, 0.026661697775125504, -0.3376542329788208, -0.17775338888168335, 0.06948722898960114, 0.2350798398256302, -0.1623801290988922, -0.07890685647726059, -0.27058982849121094, 0.1288996934890747, 0.2002600133419037, 0.03934186324477196, -0.08567091822624207, -0.15700092911720276, 0.17476920783519745, -0.27165859937667847, -0.24242466688156128, 0.3961430490016937, 0.20789259672164917, -0.7456753253936768, 0.06353120505809784, -0.0676286369562149, 0.34790894389152527, -0.1380266547203064, -0.23171836137771606, 0.14383473992347717, -0.07037366926670074, -0.15825536847114563, 0.18664366006851196, 0.059364330023527145, -0.21792124211788177, -0.028744705021381378, -0.08631370961666107, 0.05764305591583252, -0.324190616607666, 0.6057641506195068, -0.134874626994133, -0.11078164726495743, -0.19573913514614105, 0.2755752205848694, -0.32933059334754944, -0.21191003918647766, 0.011018455028533936, 0.019056465476751328, 0.03319384157657623, 0.013922128826379776, -0.020723693072795868, -0.12420845031738281, -0.025006532669067383, 0.07847626507282257, 0.34786292910575867, 0.13023635745048523, -0.0707731544971466, -0.22369228303432465, 0.1643698513507843, 0.276579886674881, -0.085812509059906, 0.2781497836112976, -0.01442253589630127, -0.5430761575698853, 0.10715527832508087, -0.04456843435764313, -0.3716772794723511, 0.12975627183914185, 0.13509106636047363, 0.07151420414447784, 0.0951443761587143, -0.014706935733556747, 0.10772891342639923, -0.13079732656478882, 0.06830842792987823, -0.20755618810653687, -0.28561827540397644, -0.16627559065818787, 0.13500896096229553, 0.17274516820907593, 0.24880921840667725, 0.051938027143478394, -0.14578048884868622, -0.2944501042366028, -0.25071248412132263, -0.0038583707064390182, 0.300706684589386, 0.053722038865089417, -0.07644201815128326, 0.19531455636024475, 0.34777557849884033, 0.11282816529273987, -0.19193187355995178, 0.10570719838142395, 0.32955312728881836, 0.3622516095638275, -0.2434236705303192, 0.016699163243174553, 0.14310351014137268, -0.21948499977588654, -0.1434880644083023, 0.09961572289466858, 0.28854885697364807, 0.2447521835565567, 0.5276635885238647, 0.03773612529039383, 0.055800773203372955, -0.05941084027290344, 0.6070102453231812, -0.0613885372877121, 0.0093306265771389, -0.023792259395122528, 0.11677216738462448, 0.28018471598625183, 0.14752747118473053, -0.37715545296669006, -0.40724319219589233, -0.06970866769552231, -0.0832231193780899, -0.15018901228904724, 0.1924535185098648, 0.12980598211288452, -0.045435257256031036, 0.023739445954561234, 0.39625293016433716, 0.3339460492134094, 0.14588886499404907, 0.009147647768259048, 0.003690846264362335, -0.03179722651839256, 0.029800081625580788, 0.08593806624412537, 0.10598274320363998, 0.06686021387577057, -0.010755825787782669, 0.2029893547296524, 0.12545111775398254, 0.2999010980129242, 0.05522960424423218, -0.24571296572685242, -0.09009143710136414, -0.09730193018913269, -0.2050567865371704, 0.22957450151443481, -0.07277344912290573, 0.04286368936300278, -0.15114273130893707, 0.11057998985052109, -0.3445753753185272, 0.1393381655216217, 0.1725808084011078, 0.12061022222042084, -0.3010817766189575, -0.09367166459560394, 0.16531050205230713, 0.4011416435241699, 0.097959965467453, -0.13383813202381134, 0.4134036600589752, 0.1899891495704651, 0.22182025015354156, 0.03909783065319061, 0.14392848312854767, 0.08524852246046066, 0.17530718445777893, -0.23830001056194305, -0.09370506554841995, -0.024073299020528793, 0.16927991807460785, 0.32177236676216125, -0.06269693374633789, 0.12249788641929626, 0.13849499821662903, -0.009086059406399727, 0.051416970789432526, -0.10201477259397507, -0.14624431729316711, 0.09460680931806564, 0.2887531518936157, 0.2601463198661804, 0.1156204417347908, 0.2194499969482422, 0.26994943618774414, -0.16090723872184753, 0.1917538046836853, -0.21106469631195068, 0.12838034331798553, -0.09096349030733109, 0.21163734793663025, 0.27384501695632935, -0.004988230764865875, -0.09901272505521774, 0.018678219988942146, -0.39851558208465576, -0.1944107562303543, 0.29031136631965637, -0.06393428891897202, -0.08060996979475021, 0.006832528859376907, 0.12256274372339249, 0.00676010362803936, 0.35057058930397034, 0.1690332293510437, -0.03222350776195526, -0.17597010731697083, -0.3158179521560669, -0.2361324280500412, 0.138154536485672, 0.4489862322807312, -0.12678050994873047, -0.001660611480474472, 0.38445985317230225, 0.22393321990966797, 0.24389518797397614, -0.53829026222229, -0.08837693929672241, -0.16624808311462402, 0.27841222286224365, -0.215902179479599, 0.03620373085141182, 0.2539645731449127, 0.24173343181610107, -0.07614117115736008, -0.05050697177648544, 0.2059512436389923, 0.009196706116199493, 0.07652265578508377, -0.16990670561790466, -0.016535736620426178, 0.03166971355676651, 0.24144905805587769, 0.542228639125824, -0.25870421528816223, 0.16484561562538147, -0.2078058123588562, -0.05963820591568947, 0.08471008390188217, -0.1668420135974884, -0.00829443708062172, 0.054724112153053284, -0.29549479484558105, 0.37732070684432983, 0.05746718496084213, 0.29000869393348694, -0.33993959426879883, 0.3212971091270447, -0.17382600903511047, -0.19565507769584656, -0.1891295313835144, -0.21925538778305054, -0.31869572401046753, 0.09868621826171875, 0.0761689692735672, 0.11986346542835236, -0.030473675578832626, -0.045040976256132126, -0.3965004086494446, -0.2504590153694153, 0.3820642828941345, -0.3650423586368561, -0.161956325173378, 0.14380963146686554, 0.18809789419174194, 0.20992852747440338, -0.047533683478832245, -0.4971456527709961, 0.25666543841362, 0.1492154598236084, -0.09364759922027588, 0.2533206045627594, 0.5274515151977539, 0.031269900500774384, 0.04262611269950867, -0.10342637449502945, 0.18123069405555725, 0.04184676706790924, -0.206818625330925, -0.200119748711586, -0.28793925046920776 ]
https://github.com/huggingface/datasets/issues/5838
@lhoestq Sure, here you go: ```python TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset = load_dataset("parquet", data_files=["s3://<bucket name>/<data folder>/data-parquet"], storage_options=fs.storage_options, streaming=True) File ~/.../datasets/src/datasets/load.py:1790, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 # Return iterable dataset in case of streaming 1789 if streaming: -> 1790 return builder_instance.as_streaming_dataset(split=split) 1792 # Some datasets are already processed on the HF google storage 1793 # Don't try downloading from Google storage for the packaged datasets as text, json, csv or pandas 1794 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES File ~/.../datasets/src/datasets/builder.py:1264, in DatasetBuilder.as_streaming_dataset(self, split, base_path) 1257 dl_manager = StreamingDownloadManager( 1258 base_path=base_path or self.base_path, 1259 download_config=DownloadConfig(use_auth_token=self.use_auth_token, storage_options=self.storage_options), 1260 dataset_name=self.name, 1261 data_dir=self.config.data_dir, 1262 ) 1263 self._check_manual_download(dl_manager) -> 1264 splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} 1265 # By default, return all splits 1266 if split is None: File ~/.../datasets/src/datasets/packaged_modules/parquet/parquet.py:34, in Parquet._split_generators(self, dl_manager) 32 if not self.config.data_files: 33 raise ValueError(f"At least one data file must be specified, but got data_files={self.config.data_files}") ---> 34 data_files = dl_manager.download_and_extract(self.config.data_files) 35 if isinstance(data_files, (str, list, tuple)): 36 files = data_files File ~/.../datasets/src/datasets/download/streaming_download_manager.py:1087, in StreamingDownloadManager.download_and_extract(self, url_or_urls) 1069 def download_and_extract(self, url_or_urls): 1070 """Prepare given `url_or_urls` for streaming (add extraction protocol). 1071 1072 This is the lazy version of `DownloadManager.download_and_extract` for streaming. (...) 1085 url(s): (`str` or `list` or `dict`), URL(s) to stream data from matching the given input `url_or_urls`. 1086 """ -> 1087 return self.extract(self.download(url_or_urls)) File ~/.../datasets/src/datasets/download/streaming_download_manager.py:1039, in StreamingDownloadManager.extract(self, url_or_urls) 1020 def extract(self, url_or_urls): 1021 """Add extraction protocol for given url(s) for streaming. 1022 1023 This is the lazy version of `DownloadManager.extract` for streaming. (...) 1037 ``` 1038 """ -> 1039 urlpaths = map_nested(self._extract, url_or_urls, map_tuple=True) 1040 return urlpaths File ~/.../datasets/src/datasets/utils/py_utils.py:443, in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, parallel_min_length, types, disable_tqdm, desc) 441 num_proc = 1 442 if num_proc <= 1 or len(iterable) < parallel_min_length: --> 443 mapped = [ 444 _single_map_nested((function, obj, types, None, True, None)) 445 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 446 ] 447 else: 448 num_proc = num_proc if num_proc <= len(iterable) else len(iterable) File ~/.../datasets/src/datasets/utils/py_utils.py:444, in <listcomp>(.0) 441 num_proc = 1 442 if num_proc <= 1 or len(iterable) < parallel_min_length: 443 mapped = [ --> 444 _single_map_nested((function, obj, types, None, True, None)) 445 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 446 ] 447 else: 448 num_proc = num_proc if num_proc <= len(iterable) else len(iterable) File ~/.../datasets/src/datasets/utils/py_utils.py:363, in _single_map_nested(args) 361 return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} 362 else: --> 363 mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] 364 if isinstance(data_struct, list): 365 return mapped File ~/.../datasets/src/datasets/utils/py_utils.py:363, in <listcomp>(.0) 361 return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} 362 else: --> 363 mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] 364 if isinstance(data_struct, list): 365 return mapped File ~/.../datasets/src/datasets/utils/py_utils.py:346, in _single_map_nested(args) 344 # Singleton first to spare some computation 345 if not isinstance(data_struct, dict) and not isinstance(data_struct, types): --> 346 return function(data_struct) 348 # Reduce logging to keep things readable in multiprocessing with tqdm 349 if rank is not None and logging.get_verbosity() < logging.WARNING: File ~/.../datasets/src/datasets/download/streaming_download_manager.py:1044, in StreamingDownloadManager._extract(self, urlpath) 1042 def _extract(self, urlpath: str) -> str: 1043 urlpath = str(urlpath) -> 1044 protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token) 1045 # get inner file: zip://train-00000.json.gz::https://foo.bar/data.zip -> zip://train-00000.json.gz 1046 path = urlpath.split("::")[0] File ~/.../datasets/src/datasets/download/streaming_download_manager.py:433, in _get_extraction_protocol(urlpath, use_auth_token) 431 else: 432 urlpath, kwargs = urlpath, {} --> 433 with fsspec.open(urlpath, **kwargs) as f: 434 return _get_extraction_protocol_with_magic_number(f) File ~/.../lib/python3.8/site-packages/fsspec/core.py:102, in OpenFile.__enter__(self) 99 def __enter__(self): 100 mode = self.mode.replace("t", "").replace("b", "") + "b" --> 102 f = self.fs.open(self.path, mode=mode) 104 self.fobjects = [f] 106 if self.compression is not None: File ~/.../lib/python3.8/site-packages/fsspec/spec.py:1199, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs) 1197 else: 1198 ac = kwargs.pop("autocommit", not self._intrans) -> 1199 f = self._open( 1200 path, 1201 mode=mode, 1202 block_size=block_size, 1203 autocommit=ac, 1204 cache_options=cache_options, 1205 **kwargs, 1206 ) 1207 if compression is not None: 1208 from fsspec.compression import compr File ~/.../lib/python3.8/site-packages/s3fs/core.py:659, in S3FileSystem._open(self, path, mode, block_size, acl, version_id, fill_cache, cache_type, autocommit, requester_pays, cache_options, **kwargs) 656 if cache_type is None: 657 cache_type = self.default_cache_type --> 659 return S3File( 660 self, 661 path, 662 mode, 663 block_size=block_size, 664 acl=acl, 665 version_id=version_id, 666 fill_cache=fill_cache, 667 s3_additional_kwargs=kw, 668 cache_type=cache_type, 669 autocommit=autocommit, 670 requester_pays=requester_pays, 671 cache_options=cache_options, 672 ) File ~/.../lib/python3.8/site-packages/s3fs/core.py:2043, in S3File.__init__(self, s3, path, mode, block_size, acl, version_id, fill_cache, s3_additional_kwargs, autocommit, cache_type, requester_pays, cache_options) 2041 self.details = s3.info(path) 2042 self.version_id = self.details.get("VersionId") -> 2043 super().__init__( 2044 s3, 2045 path, 2046 mode, 2047 block_size, 2048 autocommit=autocommit, 2049 cache_type=cache_type, 2050 cache_options=cache_options, 2051 ) 2052 self.s3 = self.fs # compatibility 2054 # when not using autocommit we want to have transactional state to manage File ~/.../lib/python3.8/site-packages/fsspec/spec.py:1555, in AbstractBufferedFile.__init__(self, fs, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs) 1553 self.size = size 1554 else: -> 1555 self.size = self.details["size"] 1556 self.cache = caches[cache_type]( 1557 self.blocksize, self._fetch_range, self.size, **cache_options 1558 ) 1559 else: File ~/.../lib/python3.8/site-packages/fsspec/spec.py:1568, in AbstractBufferedFile.details(self) 1565 @property 1566 def details(self): 1567 if self._details is None: -> 1568 self._details = self.fs.info(self.path) 1569 return self._details File ~/.../lib/python3.8/site-packages/fsspec/asyn.py:115, in sync_wrapper.<locals>.wrapper(*args, **kwargs) 112 @functools.wraps(func) 113 def wrapper(*args, **kwargs): 114 self = obj or args[0] --> 115 return sync(self.loop, func, *args, **kwargs) File ~/.../lib/python3.8/site-packages/fsspec/asyn.py:100, in sync(loop, func, timeout, *args, **kwargs) 98 raise FSTimeoutError from return_result 99 elif isinstance(return_result, BaseException): --> 100 raise return_result 101 else: 102 return return_result File ~/.../lib/python3.8/site-packages/fsspec/asyn.py:55, in _runner(event, coro, result, timeout) 53 coro = asyncio.wait_for(coro, timeout=timeout) 54 try: ---> 55 result[0] = await coro 56 except Exception as ex: 57 result[0] = ex File ~/.../lib/python3.8/site-packages/s3fs/core.py:1248, in S3FileSystem._info(self, path, bucket, key, refresh, version_id) 1246 if key: 1247 try: -> 1248 out = await self._call_s3( 1249 "head_object", 1250 self.kwargs, 1251 Bucket=bucket, 1252 Key=key, 1253 **version_id_kw(version_id), 1254 **self.req_kw, 1255 ) 1256 return { 1257 "ETag": out.get("ETag", ""), 1258 "LastModified": out["LastModified"], (...) 1264 "ContentType": out.get("ContentType"), 1265 } 1266 except FileNotFoundError: File ~/.../lib/python3.8/site-packages/s3fs/core.py:341, in S3FileSystem._call_s3(self, method, *akwarglist, **kwargs) 340 async def _call_s3(self, method, *akwarglist, **kwargs): --> 341 await self.set_session() 342 s3 = await self.get_s3(kwargs.get("Bucket")) 343 method = getattr(s3, method) File ~/.../lib/python3.8/site-packages/s3fs/core.py:502, in S3FileSystem.set_session(self, refresh, kwargs) 500 conf = AioConfig(**config_kwargs) 501 if self.session is None: --> 502 self.session = aiobotocore.session.AioSession(**self.kwargs) 504 for parameters in (config_kwargs, self.kwargs, init_kwargs, client_kwargs): 505 for option in ("region_name", "endpoint_url"): TypeError: __init__() got an unexpected keyword argument 'headers' ```
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
1,037
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. @lhoestq Sure, here you go: ```python TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset = load_dataset("parquet", data_files=["s3://<bucket name>/<data folder>/data-parquet"], storage_options=fs.storage_options, streaming=True) File ~/.../datasets/src/datasets/load.py:1790, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 # Return iterable dataset in case of streaming 1789 if streaming: -> 1790 return builder_instance.as_streaming_dataset(split=split) 1792 # Some datasets are already processed on the HF google storage 1793 # Don't try downloading from Google storage for the packaged datasets as text, json, csv or pandas 1794 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES File ~/.../datasets/src/datasets/builder.py:1264, in DatasetBuilder.as_streaming_dataset(self, split, base_path) 1257 dl_manager = StreamingDownloadManager( 1258 base_path=base_path or self.base_path, 1259 download_config=DownloadConfig(use_auth_token=self.use_auth_token, storage_options=self.storage_options), 1260 dataset_name=self.name, 1261 data_dir=self.config.data_dir, 1262 ) 1263 self._check_manual_download(dl_manager) -> 1264 splits_generators = {sg.name: sg for sg in self._split_generators(dl_manager)} 1265 # By default, return all splits 1266 if split is None: File ~/.../datasets/src/datasets/packaged_modules/parquet/parquet.py:34, in Parquet._split_generators(self, dl_manager) 32 if not self.config.data_files: 33 raise ValueError(f"At least one data file must be specified, but got data_files={self.config.data_files}") ---> 34 data_files = dl_manager.download_and_extract(self.config.data_files) 35 if isinstance(data_files, (str, list, tuple)): 36 files = data_files File ~/.../datasets/src/datasets/download/streaming_download_manager.py:1087, in StreamingDownloadManager.download_and_extract(self, url_or_urls) 1069 def download_and_extract(self, url_or_urls): 1070 """Prepare given `url_or_urls` for streaming (add extraction protocol). 1071 1072 This is the lazy version of `DownloadManager.download_and_extract` for streaming. (...) 1085 url(s): (`str` or `list` or `dict`), URL(s) to stream data from matching the given input `url_or_urls`. 1086 """ -> 1087 return self.extract(self.download(url_or_urls)) File ~/.../datasets/src/datasets/download/streaming_download_manager.py:1039, in StreamingDownloadManager.extract(self, url_or_urls) 1020 def extract(self, url_or_urls): 1021 """Add extraction protocol for given url(s) for streaming. 1022 1023 This is the lazy version of `DownloadManager.extract` for streaming. (...) 1037 ``` 1038 """ -> 1039 urlpaths = map_nested(self._extract, url_or_urls, map_tuple=True) 1040 return urlpaths File ~/.../datasets/src/datasets/utils/py_utils.py:443, in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, parallel_min_length, types, disable_tqdm, desc) 441 num_proc = 1 442 if num_proc <= 1 or len(iterable) < parallel_min_length: --> 443 mapped = [ 444 _single_map_nested((function, obj, types, None, True, None)) 445 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 446 ] 447 else: 448 num_proc = num_proc if num_proc <= len(iterable) else len(iterable) File ~/.../datasets/src/datasets/utils/py_utils.py:444, in <listcomp>(.0) 441 num_proc = 1 442 if num_proc <= 1 or len(iterable) < parallel_min_length: 443 mapped = [ --> 444 _single_map_nested((function, obj, types, None, True, None)) 445 for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) 446 ] 447 else: 448 num_proc = num_proc if num_proc <= len(iterable) else len(iterable) File ~/.../datasets/src/datasets/utils/py_utils.py:363, in _single_map_nested(args) 361 return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} 362 else: --> 363 mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] 364 if isinstance(data_struct, list): 365 return mapped File ~/.../datasets/src/datasets/utils/py_utils.py:363, in <listcomp>(.0) 361 return {k: _single_map_nested((function, v, types, None, True, None)) for k, v in pbar} 362 else: --> 363 mapped = [_single_map_nested((function, v, types, None, True, None)) for v in pbar] 364 if isinstance(data_struct, list): 365 return mapped File ~/.../datasets/src/datasets/utils/py_utils.py:346, in _single_map_nested(args) 344 # Singleton first to spare some computation 345 if not isinstance(data_struct, dict) and not isinstance(data_struct, types): --> 346 return function(data_struct) 348 # Reduce logging to keep things readable in multiprocessing with tqdm 349 if rank is not None and logging.get_verbosity() < logging.WARNING: File ~/.../datasets/src/datasets/download/streaming_download_manager.py:1044, in StreamingDownloadManager._extract(self, urlpath) 1042 def _extract(self, urlpath: str) -> str: 1043 urlpath = str(urlpath) -> 1044 protocol = _get_extraction_protocol(urlpath, use_auth_token=self.download_config.use_auth_token) 1045 # get inner file: zip://train-00000.json.gz::https://foo.bar/data.zip -> zip://train-00000.json.gz 1046 path = urlpath.split("::")[0] File ~/.../datasets/src/datasets/download/streaming_download_manager.py:433, in _get_extraction_protocol(urlpath, use_auth_token) 431 else: 432 urlpath, kwargs = urlpath, {} --> 433 with fsspec.open(urlpath, **kwargs) as f: 434 return _get_extraction_protocol_with_magic_number(f) File ~/.../lib/python3.8/site-packages/fsspec/core.py:102, in OpenFile.__enter__(self) 99 def __enter__(self): 100 mode = self.mode.replace("t", "").replace("b", "") + "b" --> 102 f = self.fs.open(self.path, mode=mode) 104 self.fobjects = [f] 106 if self.compression is not None: File ~/.../lib/python3.8/site-packages/fsspec/spec.py:1199, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs) 1197 else: 1198 ac = kwargs.pop("autocommit", not self._intrans) -> 1199 f = self._open( 1200 path, 1201 mode=mode, 1202 block_size=block_size, 1203 autocommit=ac, 1204 cache_options=cache_options, 1205 **kwargs, 1206 ) 1207 if compression is not None: 1208 from fsspec.compression import compr File ~/.../lib/python3.8/site-packages/s3fs/core.py:659, in S3FileSystem._open(self, path, mode, block_size, acl, version_id, fill_cache, cache_type, autocommit, requester_pays, cache_options, **kwargs) 656 if cache_type is None: 657 cache_type = self.default_cache_type --> 659 return S3File( 660 self, 661 path, 662 mode, 663 block_size=block_size, 664 acl=acl, 665 version_id=version_id, 666 fill_cache=fill_cache, 667 s3_additional_kwargs=kw, 668 cache_type=cache_type, 669 autocommit=autocommit, 670 requester_pays=requester_pays, 671 cache_options=cache_options, 672 ) File ~/.../lib/python3.8/site-packages/s3fs/core.py:2043, in S3File.__init__(self, s3, path, mode, block_size, acl, version_id, fill_cache, s3_additional_kwargs, autocommit, cache_type, requester_pays, cache_options) 2041 self.details = s3.info(path) 2042 self.version_id = self.details.get("VersionId") -> 2043 super().__init__( 2044 s3, 2045 path, 2046 mode, 2047 block_size, 2048 autocommit=autocommit, 2049 cache_type=cache_type, 2050 cache_options=cache_options, 2051 ) 2052 self.s3 = self.fs # compatibility 2054 # when not using autocommit we want to have transactional state to manage File ~/.../lib/python3.8/site-packages/fsspec/spec.py:1555, in AbstractBufferedFile.__init__(self, fs, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs) 1553 self.size = size 1554 else: -> 1555 self.size = self.details["size"] 1556 self.cache = caches[cache_type]( 1557 self.blocksize, self._fetch_range, self.size, **cache_options 1558 ) 1559 else: File ~/.../lib/python3.8/site-packages/fsspec/spec.py:1568, in AbstractBufferedFile.details(self) 1565 @property 1566 def details(self): 1567 if self._details is None: -> 1568 self._details = self.fs.info(self.path) 1569 return self._details File ~/.../lib/python3.8/site-packages/fsspec/asyn.py:115, in sync_wrapper.<locals>.wrapper(*args, **kwargs) 112 @functools.wraps(func) 113 def wrapper(*args, **kwargs): 114 self = obj or args[0] --> 115 return sync(self.loop, func, *args, **kwargs) File ~/.../lib/python3.8/site-packages/fsspec/asyn.py:100, in sync(loop, func, timeout, *args, **kwargs) 98 raise FSTimeoutError from return_result 99 elif isinstance(return_result, BaseException): --> 100 raise return_result 101 else: 102 return return_result File ~/.../lib/python3.8/site-packages/fsspec/asyn.py:55, in _runner(event, coro, result, timeout) 53 coro = asyncio.wait_for(coro, timeout=timeout) 54 try: ---> 55 result[0] = await coro 56 except Exception as ex: 57 result[0] = ex File ~/.../lib/python3.8/site-packages/s3fs/core.py:1248, in S3FileSystem._info(self, path, bucket, key, refresh, version_id) 1246 if key: 1247 try: -> 1248 out = await self._call_s3( 1249 "head_object", 1250 self.kwargs, 1251 Bucket=bucket, 1252 Key=key, 1253 **version_id_kw(version_id), 1254 **self.req_kw, 1255 ) 1256 return { 1257 "ETag": out.get("ETag", ""), 1258 "LastModified": out["LastModified"], (...) 1264 "ContentType": out.get("ContentType"), 1265 } 1266 except FileNotFoundError: File ~/.../lib/python3.8/site-packages/s3fs/core.py:341, in S3FileSystem._call_s3(self, method, *akwarglist, **kwargs) 340 async def _call_s3(self, method, *akwarglist, **kwargs): --> 341 await self.set_session() 342 s3 = await self.get_s3(kwargs.get("Bucket")) 343 method = getattr(s3, method) File ~/.../lib/python3.8/site-packages/s3fs/core.py:502, in S3FileSystem.set_session(self, refresh, kwargs) 500 conf = AioConfig(**config_kwargs) 501 if self.session is None: --> 502 self.session = aiobotocore.session.AioSession(**self.kwargs) 504 for parameters in (config_kwargs, self.kwargs, init_kwargs, client_kwargs): 505 for option in ("region_name", "endpoint_url"): TypeError: __init__() got an unexpected keyword argument 'headers' ```
[ -0.34546247124671936, -0.24966630339622498, -0.13603632152080536, 0.11836671829223633, 0.07666708528995514, -0.06216322258114815, 0.1502552330493927, 0.13144414126873016, 0.30351272225379944, 0.00011910498142242432, -0.09259092807769775, 0.3016706705093384, -0.1856059581041336, 0.4966016113758087, 0.05183785781264305, -0.08532928675413132, 0.1110185831785202, 0.17874665558338165, 0.13807186484336853, 0.09495620429515839, -0.2309400737285614, 0.14028693735599518, 0.035970889031887054, -0.2450949102640152, 0.24532629549503326, 0.028929030522704124, -0.10510625690221786, 0.11930494010448456, -0.25639694929122925, -0.3241463303565979, 0.14970506727695465, 0.20392857491970062, 0.3796928822994232, 0.3323931396007538, -0.00010395522258477286, -0.1294206976890564, 0.10680918395519257, -0.23904187977313995, -0.5391521453857422, -0.21100661158561707, -0.11516720056533813, -0.16946256160736084, 0.17535290122032166, -0.07948868721723557, -0.12862539291381836, -0.08026443421840668, -0.08564220368862152, -0.38782548904418945, 0.22405143082141876, 0.23932623863220215, 0.24200601875782013, 0.4067739248275757, -0.23825544118881226, -0.05734056979417801, 0.2737712264060974, 0.10750275105237961, -0.1651848703622818, 0.18426617980003357, 0.4068130850791931, 0.05993343144655228, 0.04498967155814171, 0.40675032138824463, -0.34915781021118164, 0.1440245360136032, 0.29877257347106934, -0.014877192676067352, 0.03648006543517113, -0.13118895888328552, -0.13716328144073486, 0.0003028595820069313, 0.5482280850410461, -0.29620176553726196, -0.49944499135017395, -0.38728874921798706, -0.07302023470401764, -0.4042220711708069, -0.003238249570131302, 0.1722068190574646, -0.09566622972488403, 0.0877356305718422, -0.3718282878398895, -0.5249465703964233, -0.21820132434368134, 0.08594872057437897, -0.09921301156282425, 0.17530778050422668, -0.16859498620033264, -0.08776600658893585, 0.12441466748714447, 0.16131079196929932, 0.3595971465110779, -0.23183059692382812, 0.0844205915927887, 0.005576971918344498, -0.3247533440589905, -0.2653766870498657, 0.15590734779834747, 0.030628811568021774, 0.10555791854858398, 0.3268597722053528, 0.3497864902019501, 0.04511592909693718, 0.17294688522815704, 0.23373660445213318, 0.20876118540763855, -0.03715968132019043, -0.188311368227005, -0.16935540735721588, 0.18137192726135254, 0.4993342459201813, 0.06850872933864594, -0.3363662362098694, -0.07221049815416336, 0.05973939970135689, -0.1339072734117508, -0.13803094625473022, 0.1730378270149231, -0.09293394535779953, -0.14182043075561523, 0.04573744907975197, 0.11189310252666473, 0.021517712622880936, 0.14472344517707825, 0.23735862970352173, -0.02800760790705681, 0.2438323050737381, 0.06365001201629639, 0.2528344392776489, -0.008536707609891891, -0.3059536814689636, -0.22559520602226257, 0.042108651250600815, -0.10287970304489136, 0.2347358763217926, 0.10723365843296051, -0.3305593729019165, 0.08562877029180527, -0.132571741938591, 0.05902079865336418, 0.2365831434726715, 0.027814410626888275, -0.14528301358222961, 0.07659433782100677, 0.09477408230304718, 0.08458732068538666, 0.0019495189189910889, 0.2449977993965149, 0.03212268650531769, -0.24701333045959473, 0.022011805325746536, -0.0835314393043518, -0.4966270923614502, -0.33498644828796387, 0.2552832365036011, -0.2889862656593323, -0.07320184260606766, -0.7469047904014587, 0.2883039712905884, -0.29175370931625366, -0.2957123816013336, -0.09111958742141724, 0.08194462954998016, -0.12867113947868347, -0.23949575424194336, 0.14112478494644165, 0.2221313863992691, -0.3400951325893402, -0.10568636655807495, -0.4438777565956116, 0.005458034574985504, 0.39972028136253357, -0.06928188353776932, -0.1991586685180664, -0.09453429281711578, -0.21975374221801758, 0.11113542318344116, 0.21973779797554016, -0.2860032021999359, -0.2914566993713379, 0.5445736646652222, -0.046672023832798004, 0.15990003943443298, 0.339245468378067, 0.06653136014938354, 0.5276647210121155, -0.011702094227075577, -0.13876846432685852, 0.6622632145881653, -0.053486064076423645, 0.111580990254879, -0.1455497443675995, -0.15019351243972778, -0.048854611814022064, 0.35774606466293335, -0.03767230361700058, 0.1628631055355072, 0.19925493001937866, 0.11532538384199142, 0.13532283902168274, -0.05349990725517273, 0.17594367265701294, 0.17167679965496063, 0.5536691546440125, 0.22324326634407043, -0.2637808620929718, -0.221330925822258, -0.4918127954006195, 0.20140543580055237, 0.26824817061424255, -0.11036236584186554, -0.18917116522789001, -0.006767407059669495, -0.10541440546512604, -0.042617082595825195, -0.06017950549721718, -0.16256263852119446, 0.20398591458797455, 0.3756008744239807, 0.14760816097259521, -0.20838548243045807, -0.18737170100212097, 0.32062509655952454, -0.1093626469373703, 0.020839307457208633, -0.12159828841686249, 0.6841068863868713, 0.06838731467723846, -0.2427344173192978, 0.1492336392402649, -0.2581459879875183, 0.1325501799583435, 0.08062726259231567, 0.036834921687841415, 0.5210593938827515, 0.07548333704471588, 0.48501721024513245, 0.12646318972110748, 0.25445234775543213, 0.1346050500869751, 0.11714480817317963, 0.2771676778793335, -0.06209980696439743, 0.18643823266029358, 0.15237528085708618, -0.21127037703990936, 0.36466801166534424, 0.020037615671753883, -0.011066406965255737, 0.193766251206398, -0.07459037750959396, 0.18182475864887238, 0.09952118992805481, -0.1008618175983429, -0.04837450385093689, -0.040717966854572296, -0.10031536966562271, -0.058174554258584976, -0.25454065203666687, -0.40231794118881226, -0.03248456120491028, 0.2563158869743347, 0.07756427675485611, -0.0035978946834802628, 0.08722155541181564, -0.13472260534763336, -0.2672378718852997, 0.35499414801597595, 0.39301469922065735, 0.5428276658058167, 0.2997494637966156, 0.24473842978477478, -0.07453042268753052, 0.16377200186252594, -0.010219749063253403, 0.28021156787872314, 0.007667623460292816, 0.06909776479005814, 0.3133893311023712, 0.11589714884757996, -0.22803530097007751, -0.2410927563905716, -0.35747265815734863, 0.10511396080255508, 0.05743970721960068, -0.10779664665460587, -0.010320939123630524, -0.0735272765159607, -0.12452635914087296, -0.0398976095020771, -0.017586935311555862, 0.014157889410853386, -0.23132741451263428, -0.00178422499448061, 0.8100329637527466, -0.07536850869655609, -0.07421475648880005, -0.004817306995391846, 0.32685476541519165, -0.06926168501377106, -0.21815547347068787, -0.27753785252571106, -0.06747570633888245, 0.14423416554927826, 0.19530627131462097, -0.03139299154281616, -0.09309102594852448, 0.3785880208015442, 0.21416732668876648, 0.09225411713123322, -0.6571468710899353, -0.00742562860250473, 0.06630420684814453, -0.13286715745925903, 0.19321560859680176, 0.09627121686935425, 0.28677019476890564, -0.008553124964237213, -0.1757231056690216, 0.08699390292167664, -0.3893952965736389, -0.08834517002105713, -0.041783999651670456, 0.12071796506643295, 0.18214958906173706, -0.08891444653272629, 0.006155114620923996, -0.32960638403892517, -0.5863673090934753, -0.010069895535707474, 0.061015911400318146, -0.0202699713408947, -0.3245195746421814, 0.03431570902466774, 0.0022678598761558533, 0.4492773711681366, 0.07436895370483398, -0.2537093460559845, -0.5589144825935364, 0.20422637462615967, -0.1848829984664917, -0.14731968939304352, 0.12502092123031616, 0.11429291218519211, -0.04942137002944946, 0.3195922076702118, -0.47616779804229736, -0.23386570811271667, 0.07222756743431091, -0.07017828524112701, -0.23054087162017822, 0.06093665957450867, 0.31059905886650085, 0.055498432368040085, -0.10967676341533661, -0.18330015242099762, -0.2194308191537857, -0.37401625514030457, 0.45350465178489685, 0.2418515384197235, 0.02819809690117836, 0.4408036768436432, 0.11104096472263336, 0.4141920208930969, -0.08181218802928925, 0.054353393614292145, 0.6585533618927002, 0.18191033601760864, 0.27902132272720337, -0.12007152289152145, -0.15049386024475098, -0.09887558221817017, -0.2422368973493576, -0.39785218238830566, 0.2363400012254715, -0.061691634356975555, -0.28847768902778625, -0.3821703791618347, 0.02050318568944931, -0.38412749767303467, -0.07052751630544662, -0.06952469050884247, 0.013011722825467587, 0.2766648530960083, -0.26391398906707764, -0.044158440083265305, -0.14974917471408844, 0.07110734283924103, 0.00430084764957428, 0.061504267156124115, 0.45214295387268066, 0.019820578396320343, 0.03589051961898804, 0.09515801072120667, -0.3540441691875458, 0.21029560267925262, -0.11768288910388947, -0.08112047612667084, -0.12622906267642975, -0.1989019811153412, 0.032004326581954956, -0.10729652643203735, 0.5875430703163147, -0.35925617814064026, 0.10284161567687988, 0.02787265181541443, -0.33519572019577026, -0.17747165262699127, -0.16018420457839966, -0.3093288540840149, -0.12371720373630524, -0.25281834602355957, 0.5845440030097961, -0.24011874198913574, -0.057412948459386826, -0.10677529871463776, -0.11830909550189972, -0.12157853692770004, -0.05894666165113449, -0.09427674114704132, -0.130790576338768, -0.41148683428764343, -0.007414862513542175, 0.11381378024816513, 0.30164414644241333, -0.14483776688575745, 0.10714405030012131, 0.07721509039402008, 0.15719550848007202, 0.10382301360368729, -0.033527228981256485, 0.30984312295913696, 0.09655861556529999, 0.052144214510917664, 0.03878774493932724, 0.2113688886165619, 0.4019363224506378, 0.5921049118041992, 0.2812887132167816, -0.23584839701652527, 0.23427727818489075, 0.3224506974220276, 0.28025996685028076, 0.31524917483329773, 0.25420713424682617, 0.052764736115932465, -0.060904648154973984, 0.2551342844963074, -0.3513752818107605, 0.009097471833229065, 0.16614794731140137, -0.172880619764328, 0.03338262438774109, -0.4165782034397125, 0.3552062213420868, 0.024234674870967865, 0.008014306426048279, 0.032263681292533875, 0.057081613689661026, -0.2850988507270813, 0.44343122839927673, 0.20540496706962585, 0.9507665038108826, -0.0045094601809978485, 0.0998731404542923, 0.2720169126987457, -0.4555884599685669, 0.25861409306526184, -0.44582778215408325, 0.030904382467269897, -0.24604566395282745, -0.271505743265152, -0.2225979119539261, -0.1100464016199112, 0.06461452692747116, 0.1367228478193283, -0.3302156329154968, 0.1474963128566742, 0.06231740117073059, 0.2510836720466614, -0.14277306199073792, 0.3704661428928375, -0.3581126034259796, -0.20414310693740845, -0.6462268233299255, 0.21244460344314575, -0.2590377926826477, 0.015936125069856644, -0.1390601545572281, -0.2372925728559494, 0.25044453144073486, -0.0900215283036232, -0.2482822835445404, 0.08208329975605011, 0.25923940539360046, 0.08508913218975067, -0.36244624853134155, -0.2582243084907532, -0.0020225346088409424, 0.2233169674873352, -0.18728072941303253, -0.11405407637357712, -0.16283385455608368, 0.03783946484327316, 0.040920108556747437, 0.005036827176809311, -0.18463429808616638, -0.010444987565279007, 0.3061615824699402, -0.16155654191970825, -0.05630596727132797, 0.27300864458084106, 0.08040009438991547, -0.6216849088668823, 0.08330298960208893, -0.10974209010601044, 0.3305162489414215, -0.22452549636363983, -0.26183274388313293, -0.058106228709220886, -0.11566682159900665, -0.2086641788482666, 0.2016109973192215, -0.06853549182415009, -0.15287816524505615, -0.12497423589229584, -0.21950119733810425, 0.05943095684051514, -0.38423341512680054, 0.5166228413581848, -0.07668671011924744, 0.12063471972942352, 0.1047498881816864, 0.26441001892089844, -0.4056018590927124, -0.2676801383495331, -0.1227545365691185, 0.046981461346149445, 0.0922364592552185, 0.2670532464981079, -0.03330191224813461, -0.10325887799263, 0.06211050599813461, 0.08464108407497406, 0.2625558078289032, 0.10164785385131836, -0.03134545311331749, -0.3787057101726532, 0.04289258271455765, 0.23407743871212006, -0.21478483080863953, 0.33481040596961975, 0.10008785873651505, -0.30878815054893494, -0.050159208476543427, -0.17772245407104492, -0.44180572032928467, 0.1242620050907135, -0.08500243723392487, 0.10757547616958618, 0.13512298464775085, -0.01636919192969799, 0.20984132587909698, -0.06410504877567291, 0.2330108880996704, -0.14188718795776367, -0.27354007959365845, -0.24267719686031342, 0.08890996873378754, 0.12010045349597931, 0.22395288944244385, 0.04885313659906387, -0.12465383112430573, -0.22843465209007263, -0.2692742645740509, -0.0666964203119278, 0.34421056509017944, 0.16678813099861145, -0.04166579991579056, 0.18747681379318237, 0.5390768647193909, 0.01886233687400818, -0.19863344728946686, -0.08019041270017624, 0.09366270899772644, 0.22533376514911652, -0.14153364300727844, 0.05430440604686737, 0.05744011700153351, -0.1395866572856903, -0.18231067061424255, 0.11340006440877914, 0.2858470380306244, 0.25964903831481934, 0.5985710620880127, -0.12103544175624847, -0.13400578498840332, 0.06918050348758698, 0.6695712208747864, 0.14723260700702667, 0.017883628606796265, -0.12929511070251465, 0.19974717497825623, 0.30689486861228943, -0.04200384020805359, -0.3173147439956665, -0.20913976430892944, -0.127478688955307, 0.12458167225122452, -0.025012090802192688, 0.08988067507743835, 0.056395336985588074, -0.20771335065364838, 0.15066906809806824, 0.4473032057285309, 0.23411542177200317, 0.1426229327917099, 0.21366460621356964, 0.05703096091747284, 0.026287775486707687, 0.0007744971662759781, 0.1650152951478958, 0.1763756424188614, 0.08530579507350922, -0.07674449682235718, 0.057125307619571686, 0.10442665219306946, 0.18727882206439972, 0.018539095297455788, -0.3137742578983307, -0.09568607807159424, 0.024340391159057617, -0.10241150110960007, 0.14788927137851715, -0.13088887929916382, -0.009784441441297531, -0.046441029757261276, 0.06641422212123871, -0.3260538876056671, 0.24645790457725525, 0.022687768563628197, 0.02843198925256729, -0.017753176391124725, -0.10994111001491547, -0.04669097065925598, 0.35185807943344116, 0.07164479792118073, -0.1990789920091629, 0.10738436877727509, 0.07664547860622406, 0.2726789116859436, -0.019517239183187485, 0.07612760365009308, 0.06570686399936676, 0.11387258768081665, -0.3165256381034851, -0.04083956778049469, 0.004509083926677704, 0.056965406984090805, 0.19542637467384338, -0.09636462479829788, 0.2522476613521576, 0.15485939383506775, -0.12790659070014954, -0.06138545274734497, 0.009464282542467117, -0.15942123532295227, 0.1120084747672081, 0.12577416002750397, 0.1176345944404602, 0.08634575456380844, 0.3409857153892517, 0.3076593279838562, -0.21833814680576324, 0.06372028589248657, -0.04178347438573837, 0.014392800629138947, -0.14062446355819702, 0.229678675532341, 0.20879018306732178, 0.02780831605195999, -0.05119476839900017, -0.08742935955524445, -0.3992955684661865, -0.3630944788455963, 0.173981174826622, 0.009867198765277863, 0.0836183950304985, 0.17940068244934082, 0.14004439115524292, -0.010225260630249977, 0.2595154643058777, 0.2784738540649414, -0.14155203104019165, -0.28115150332450867, -0.26897549629211426, -0.3570314645767212, -0.026323936879634857, 0.20761922001838684, -0.29484349489212036, -0.016912536695599556, 0.505966067314148, 0.20352591574192047, 0.1796102076768875, -0.42645275592803955, 0.0700395256280899, -0.19276289641857147, 0.3661370277404785, -0.1748073697090149, -0.16807448863983154, 0.10940161347389221, 0.06057445704936981, -0.06011238321661949, -0.18014392256736755, 0.09466588497161865, -0.002981610596179962, 0.2038036584854126, -0.10024569928646088, 0.04650337994098663, -0.0770258903503418, 0.030034009367227554, 0.424639493227005, -0.2298871874809265, 0.20527693629264832, -0.26519447565078735, -0.08298224210739136, -0.013912057504057884, -0.13326674699783325, -0.13541576266288757, 0.06854747980833054, -0.29378366470336914, 0.5939962267875671, -0.01125938817858696, 0.2114114612340927, -0.3616858422756195, 0.33959996700286865, 0.013505876064300537, -0.2645148038864136, -0.14005404710769653, 0.00040851160883903503, -0.1167835146188736, 0.17679846286773682, 0.015156794339418411, 0.11577171087265015, -0.03768184781074524, 0.10191468149423599, -0.24691079556941986, -0.4000864028930664, 0.4923020005226135, -0.35047775506973267, -0.23500698804855347, 0.10166044533252716, 0.2724685072898865, 0.24371841549873352, 0.005849149078130722, -0.5108839273452759, 0.2741067409515381, 0.19806674122810364, -0.0997668132185936, 0.06455911695957184, 0.36556100845336914, 0.1006203442811966, 0.011681124567985535, -0.05990854278206825, 0.0377219095826149, 0.011791598051786423, -0.08052996546030045, -0.19977807998657227, -0.2679727077484131 ]
https://github.com/huggingface/datasets/issues/5838
Is `"data-parquet"` a file ? In `data_files` you should pass the paths to the parquet files (not to a directory). Glob patterns are not supported yet for S3 URLs. The bug seems to happen because your provided data file has no extension. Because of that it tries to infer it from the file content, but fails because `_get_extraction_protocol` doesn't support S3 URLs yet.
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
63
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. Is `"data-parquet"` a file ? In `data_files` you should pass the paths to the parquet files (not to a directory). Glob patterns are not supported yet for S3 URLs. The bug seems to happen because your provided data file has no extension. Because of that it tries to infer it from the file content, but fails because `_get_extraction_protocol` doesn't support S3 URLs yet.
[ -0.12845727801322937, -0.3317633867263794, 0.01568622887134552, 0.48633962869644165, 0.08161306381225586, -0.41716980934143066, -0.05320350453257561, 0.0006679370999336243, 0.014363624155521393, 0.1316562443971634, 0.08848384022712708, 0.4564896821975708, -0.10532784461975098, 0.47039783000946045, 0.056321144104003906, -0.03189269080758095, 0.0086548812687397, 0.09038181602954865, 0.30605095624923706, 0.004317983984947205, -0.229264497756958, 0.31537511944770813, 0.09055177867412567, -0.2481732815504074, 0.18958601355552673, 0.191811665892601, -0.1040387898683548, 0.23314879834651947, -0.4536111354827881, -0.2307257354259491, 0.2563346326351166, 0.02158934250473976, 0.4098186492919922, 0.17725907266139984, -0.00011040634853998199, -0.25091850757598877, 0.2519630789756775, -0.2987710237503052, -0.22616121172904968, -0.2376387119293213, -0.127221941947937, 0.02745770663022995, 0.22182542085647583, -0.1757652312517166, -0.1113678514957428, 0.03912551701068878, -0.1547103077173233, -0.3219691216945648, 0.33466073870658875, 0.3545337915420532, 0.1755814254283905, 0.2931404709815979, -0.2692745327949524, -0.10956345498561859, 0.523417592048645, 0.22410641610622406, -0.1340150535106659, 0.09115748107433319, 0.5782056450843811, 0.13004550337791443, 0.2056574821472168, 0.32370051741600037, -0.41383492946624756, -0.03061714582145214, 0.3450016379356384, 0.17806822061538696, -0.06584476679563522, -0.2668977975845337, -0.06919598579406738, 0.15147529542446136, 0.4128926396369934, -0.0023867222480475903, -0.3281747102737427, -0.2090148776769638, -0.11221762746572495, -0.43697285652160645, 0.22056882083415985, 0.06888634711503983, 0.0794023722410202, 0.1423051804304123, -0.1271090805530548, -0.32077065110206604, -0.3196794390678406, 0.08440764248371124, -0.1495668739080429, 0.13833245635032654, -0.1770952343940735, 0.0029797647148370743, 0.12215294688940048, 0.14702287316322327, 0.4105885624885559, -0.179032564163208, -0.05273173749446869, -0.09876947849988937, -0.11186404526233673, -0.14491280913352966, 0.1379842758178711, 0.10910327732563019, 0.06738120317459106, 0.5406213402748108, 0.3242802023887634, 0.06706789135932922, 0.11347796022891998, 0.2576984167098999, 0.1963914930820465, -0.20723916590213776, -0.059761084616184235, -0.2637016773223877, 0.08670411258935928, 0.4182153344154358, 0.01570770889520645, -0.39120182394981384, -0.04805607721209526, 0.14195452630519867, -0.23730626702308655, -0.1302737146615982, 0.31638622283935547, -0.21755290031433105, 0.0013444498181343079, 0.05059326812624931, 0.07803058624267578, 0.12126926332712173, 0.1059407889842987, 0.16238678991794586, 0.12224479764699936, 0.20813800394535065, 0.007475242018699646, 0.3440842628479004, 0.12422415614128113, -0.47548744082450867, -0.2459028959274292, 0.10018439590930939, -0.11492384225130081, 0.1411597728729248, 0.12193019688129425, -0.18357105553150177, 0.01806134730577469, -0.12880301475524902, 0.0289410799741745, 0.07539895176887512, -0.0702349990606308, -0.04703103005886078, 0.28165847063064575, 0.07997684180736542, 0.050100043416023254, -0.052489735186100006, 0.14881619811058044, -0.06317250430583954, -0.21532860398292542, 0.0660896897315979, -0.4642318785190582, -0.47144126892089844, -0.35566234588623047, 0.17526116967201233, -0.3844863176345825, 0.05347146838903427, -0.5923941731452942, 0.14415760338306427, -0.2981264889240265, -0.2362632304430008, -0.11593757569789886, -0.029450375586748123, -0.047027282416820526, -0.22103869915008545, 0.14094099402427673, 0.066441111266613, -0.32292506098747253, 0.14052711427211761, -0.3905903697013855, -0.013413000851869583, 0.6738940477371216, -0.11493055522441864, -0.30292025208473206, -0.25501754879951477, -0.2462390959262848, 0.5726571679115295, 0.3378603756427765, -0.1463325172662735, -0.26670607924461365, 0.5309531092643738, -0.1699412614107132, 0.13960248231887817, 0.3963279724121094, -0.0694476068019867, 0.4758340120315552, 0.0977325588464737, -0.16345496475696564, 0.6420125961303711, 0.045527517795562744, -0.03490680083632469, -0.1462450474500656, -0.09961273521184921, 0.016306519508361816, 0.13676901161670685, -0.0793536901473999, 0.21829108893871307, 0.24889962375164032, 0.0311749130487442, 0.1132429838180542, 0.009011860936880112, 0.17866529524326324, 0.11333823204040527, 0.6623243689537048, 0.22954285144805908, 0.0030346959829330444, -0.16144528985023499, -0.3425292670726776, 0.21258562803268433, 0.042938634753227234, -0.11992886662483215, -0.25911033153533936, -0.13551121950149536, -0.0252782441675663, -0.005274992436170578, -0.057126373052597046, -0.14088883996009827, 0.13352608680725098, 0.29417604207992554, 0.09275926649570465, -0.22505098581314087, -0.21939429640769958, 0.09485514461994171, -0.033092956990003586, -0.022549036890268326, -0.23701196908950806, 0.7397916913032532, 0.05112433433532715, -0.26515576243400574, 0.14477308094501495, -0.3487645983695984, 0.27704671025276184, 0.01239340752363205, -0.06758376210927963, 0.37605687975883484, 0.33478301763534546, 0.3903925120830536, 0.08358652889728546, 0.28172197937965393, 0.04516211897134781, 0.012464538216590881, 0.06279759854078293, 0.014171816408634186, 0.1309545934200287, 0.1040937602519989, 0.054330140352249146, 0.24662338197231293, 0.04662147909402847, -0.01388595998287201, 0.035863205790519714, -0.026561159640550613, 0.30160748958587646, -0.0415409654378891, -0.059513241052627563, 0.0036383047699928284, -0.11876560747623444, -0.13881492614746094, -0.2979379892349243, -0.24549265205860138, -0.32119280099868774, -0.08117745071649551, 0.4511612057685852, 0.07999356091022491, -0.14668510854244232, 0.13540086150169373, 0.012069463729858398, -0.32142752408981323, 0.3527040481567383, 0.4132304787635803, 0.6075578331947327, 0.15972256660461426, 0.21680298447608948, 0.05250044912099838, 0.3628728687763214, -0.13777495920658112, 0.36784932017326355, 0.12390418350696564, 0.07956936955451965, 0.11828657984733582, -0.039595670998096466, 0.07294478267431259, -0.19532179832458496, -0.3595898151397705, -0.00504639744758606, 0.12738865613937378, -0.13832037150859833, 0.09701216965913773, -0.3672429323196411, -0.1410154402256012, -0.03227585554122925, 0.06193926930427551, -0.2127162218093872, -0.07947450876235962, 0.009221715852618217, 0.5519952178001404, -0.234544038772583, -0.23491129279136658, 0.15702563524246216, 0.42053085565567017, 0.014630615711212158, -0.16469250619411469, -0.3835354149341583, -0.0854479968547821, -0.07473030686378479, 0.07229488343000412, -0.05277905985713005, -0.025691000744700432, 0.24054016172885895, 0.23039403557777405, 0.1618267148733139, -0.5615957975387573, -0.1544966995716095, 0.2801365852355957, 0.04174971953034401, 0.08683504164218903, 0.2137387990951538, 0.12033598124980927, -0.11074353754520416, -0.272344172000885, 0.09988531470298767, -0.32382676005363464, -0.12581302225589752, 0.25282108783721924, 0.08118895441293716, 0.061803124845027924, -0.2648797929286957, -0.07438494265079498, -0.22455473244190216, -0.4542235732078552, 0.0275760255753994, 0.04928547143936157, -0.0583815760910511, -0.2793719172477722, -0.07899168878793716, 0.02874550223350525, 0.15739558637142181, 0.054742343723773956, -0.35218483209609985, -0.6576074957847595, 0.14449810981750488, -0.21774986386299133, -0.3888769745826721, 0.16495352983474731, 0.2200421392917633, -0.08736403286457062, 0.4469092786312103, -0.5122073888778687, -0.4155871868133545, 0.19739504158496857, -0.3442589342594147, -0.24948370456695557, -0.09585791081190109, 0.43958473205566406, -0.0796814113855362, -0.08166515827178955, -0.2826921045780182, -0.11201505362987518, -0.0929475650191307, 0.5396623611450195, 0.3654877245426178, 0.11733625084161758, 0.27857986092567444, 0.2364814132452011, 0.14453862607479095, -0.09088169783353806, -0.004995247349143028, 0.71522057056427, 0.1514357030391693, 0.27740609645843506, -0.012651082128286362, 0.08963676542043686, -0.08715178817510605, -0.1958332359790802, -0.39070481061935425, 0.4031912088394165, -0.1761203408241272, -0.23081254959106445, -0.44160938262939453, -0.03132208064198494, -0.3187253177165985, -0.11855651438236237, -0.062244221568107605, 0.023548012599349022, 0.11204405874013901, -0.17232978343963623, -0.0171421617269516, 0.04051957279443741, 0.10880033671855927, 0.1989666223526001, 0.020768968388438225, 0.4283722937107086, 0.11628975719213486, -0.08322681486606598, -0.07385244965553284, -0.16416175663471222, 0.32491427659988403, -0.14376488327980042, -0.06749668717384338, -0.15481004118919373, -0.07496096193790436, 0.21077194809913635, -0.11659171432256699, 0.6346614956855774, -0.5014334321022034, 0.1534803956747055, -0.015374299138784409, -0.2513223886489868, -0.0979011207818985, -0.16720698773860931, -0.3546218276023865, -0.12809427082538605, -0.20583471655845642, 0.6120182275772095, -0.2169223576784134, -0.004587888717651367, -0.24939514696598053, -0.2584717869758606, -0.10758350789546967, -0.05028289183974266, -0.048553142696619034, -0.0984523594379425, -0.30920499563217163, -0.024358291178941727, 0.24271036684513092, 0.4024459421634674, -0.13002139329910278, 0.035830408334732056, 0.1892460435628891, 0.2349046766757965, 0.08940765261650085, -0.004502881318330765, 0.4041414260864258, -0.03257208690047264, -0.05393122136592865, 0.05766275152564049, 0.38398635387420654, 0.3244500458240509, 0.5841993689537048, 0.24042481184005737, -0.4262882173061371, 0.38766875863075256, 0.14230026304721832, 0.38786688446998596, 0.3997090756893158, 0.1919841468334198, 0.08109383285045624, 0.09172709286212921, 0.09835639595985413, -0.3583999276161194, 0.016498427838087082, 0.22712627053260803, -0.5238884687423706, 0.1274736523628235, -0.29295337200164795, 0.2931978404521942, -0.029164660722017288, 0.041366010904312134, 0.14738106727600098, 0.16890870034694672, -0.26608046889305115, 0.5887985229492188, 0.1860264092683792, 1.204925775527954, 0.15379297733306885, -0.04374425858259201, 0.3050305247306824, -0.4128282964229584, 0.4122081696987152, -0.46438974142074585, -0.12753477692604065, -0.23601894080638885, -0.23131267726421356, -0.2861543893814087, -0.1559554934501648, 0.016042567789554596, 0.2646857500076294, -0.31677308678627014, -0.08323456346988678, 0.10491381585597992, 0.3758500814437866, -0.015313452109694481, 0.33950841426849365, -0.1038002073764801, -0.1833483725786209, -0.4937167763710022, 0.1285380721092224, -0.25096485018730164, 0.03881122171878815, -0.047504764050245285, -0.4428863525390625, 0.11871864646673203, -0.21889270842075348, -0.1349978744983673, 0.2660987377166748, 0.16260777413845062, 0.02657988667488098, -0.22626972198486328, -0.4384572207927704, -0.07297123223543167, 0.1170090064406395, -0.269613116979599, -0.13150537014007568, -0.35629433393478394, 0.12567394971847534, 0.012984497472643852, -0.10090908408164978, -0.08977906405925751, -0.14725400507450104, 0.24660374224185944, -0.24891360104084015, 0.07367020845413208, 0.0988866537809372, 0.05905897915363312, -0.5508155822753906, 0.24944303929805756, 0.015907280147075653, 0.2960576117038727, -0.030983980745077133, -0.370251327753067, -0.1169845312833786, -0.008994169533252716, -0.10251552611589432, 0.18029604852199554, 0.13135087490081787, -0.3635336756706238, -0.1088762879371643, -0.1470424085855484, 0.11762210726737976, -0.27408313751220703, 0.5566954612731934, -0.12130969762802124, -0.03982039913535118, -0.046371977776288986, 0.15156833827495575, -0.35880619287490845, -0.17405608296394348, -0.0905219167470932, 0.06658202409744263, 0.028021380305290222, 0.09214818477630615, -0.06659573316574097, -0.13712231814861298, 0.10324253141880035, -0.023937765508890152, 0.2334129959344864, -0.001973658800125122, 0.021575532853603363, -0.43399667739868164, 0.24113290011882782, 0.18534274399280548, -0.31580933928489685, 0.24229006469249725, 0.21897871792316437, -0.2781676948070526, -0.06383275985717773, -0.20124980807304382, -0.3604293763637543, 0.26478010416030884, 0.08737684786319733, 0.13408106565475464, 0.1233462542295456, 0.014103123918175697, 0.15836472809314728, -0.21369965374469757, 0.04838314279913902, 0.13288894295692444, -0.22158408164978027, -0.11302798986434937, -0.08706770837306976, 0.19646450877189636, 0.20702850818634033, 0.16788195073604584, -0.17055730521678925, -0.3340033292770386, -0.43247199058532715, 0.04005976393818855, 0.2845769226551056, 0.07440792769193649, -0.02654137834906578, 0.06306381523609161, 0.5024662613868713, 0.0762079507112503, -0.35389673709869385, 0.005698982626199722, -0.03350592404603958, 0.4359598159790039, -0.1788760870695114, 0.02830468863248825, -0.17666657269001007, -0.17935167253017426, -0.09037765860557556, 0.01766236312687397, 0.1915924996137619, 0.25360220670700073, 0.6875336766242981, -0.07666489481925964, -0.11996929347515106, -0.02614055573940277, 0.632457435131073, 0.18389123678207397, -0.0833711326122284, -0.1669420301914215, 0.2859863042831421, 0.20040103793144226, 0.05550709366798401, -0.29348114132881165, -0.03672787547111511, -0.020266970619559288, -0.2454873025417328, -0.09985928237438202, 0.27484679222106934, 0.0800274908542633, -0.16734589636325836, 0.09916550666093826, 0.5289928913116455, 0.21406398713588715, 0.19490554928779602, 0.09581533074378967, -0.11534378677606583, 0.16486942768096924, -0.05829814076423645, 0.06596200168132782, 0.26983553171157837, 0.18321111798286438, -0.09957072138786316, 0.20674684643745422, 0.2604021430015564, 0.1314803659915924, 0.1041659414768219, -0.34945493936538696, -0.29823973774909973, -0.08383134007453918, -0.038195960223674774, 0.24668505787849426, -0.09237031638622284, 0.16862669587135315, -0.12093289196491241, 0.06994029879570007, -0.42267918586730957, 0.23848125338554382, 0.07627186179161072, 0.3039511442184448, -0.07441458106040955, -0.10091392695903778, -0.07971886545419693, 0.22883784770965576, 0.05095350742340088, 0.057444702833890915, 0.08856981247663498, 0.2030142843723297, 0.16087186336517334, 0.2177574783563614, -0.21047505736351013, -0.1707625687122345, 0.13152995705604553, -0.3518407344818115, 0.03325800597667694, -0.08838845789432526, 0.0065172333270311356, 0.2366257905960083, -0.3469046354293823, 0.24233292043209076, 0.23324835300445557, -0.013600176200270653, -0.16862893104553223, 0.10220283269882202, -0.1271313577890396, -0.05283358693122864, 0.19228769838809967, 0.3095713257789612, 0.12318933010101318, 0.4311855733394623, 0.19112366437911987, -0.14265985786914825, -0.16533976793289185, 0.09898191690444946, 0.3361947536468506, -0.06441767513751984, 0.10641640424728394, 0.25823771953582764, 0.03991895169019699, -0.19203749299049377, -0.21344788372516632, -0.39230382442474365, -0.38348376750946045, 0.0672634169459343, 0.1757938414812088, 0.055150166153907776, 0.10627561807632446, 0.09788666665554047, -0.008507069200277328, 0.26941385865211487, 0.2062702775001526, -0.2170933187007904, -0.22627684473991394, -0.3713691234588623, -0.4591594338417053, 0.2507988214492798, 0.24606268107891083, -0.21879982948303223, 0.19845762848854065, 0.51186203956604, 0.15112435817718506, 0.12093496322631836, -0.4822044372558594, -0.013644993305206299, -0.14213159680366516, 0.22844362258911133, -0.2896249294281006, -0.2504838705062866, 0.2596220374107361, -0.02825331874191761, -0.0020630955696105957, 0.013127274811267853, 0.09468668699264526, -0.047114357352256775, 0.08086739480495453, -0.1645471155643463, -0.18584918975830078, -0.20034663379192352, 0.2545904219150543, 0.5744853019714355, -0.015544816851615906, 0.24019679427146912, -0.17228683829307556, 0.04068923741579056, -0.13676932454109192, -0.11467589437961578, 0.04808809235692024, 0.18018588423728943, -0.3616136908531189, 0.37988463044166565, -0.03568392992019653, 0.14956267178058624, -0.5066826343536377, 0.21197493374347687, -0.26418083906173706, -0.19038720428943634, -0.45364290475845337, 0.0893789604306221, -0.19448095560073853, 0.25638332962989807, 0.03944597765803337, 0.02122524566948414, -0.07459744065999985, -0.05491397902369499, -0.2249445915222168, -0.4101575016975403, 0.6125006079673767, -0.33535081148147583, -0.2901266813278198, 0.19594861567020416, 0.32224103808403015, 0.09969262778759003, 0.06172381341457367, -0.471327006816864, 0.10852694511413574, 0.14545050263404846, -0.1673530638217926, 0.04595980793237686, 0.25609636306762695, 0.07656315714120865, 0.018642589449882507, -0.0023059844970703125, 0.1080256998538971, 0.2945844233036041, -0.24640461802482605, 0.042215749621391296, -0.2640719413757324 ]
https://github.com/huggingface/datasets/issues/5838
@lhoestq Thank you for your answer. Saving the file with `.parquet` extension solved the issue! This is really great! Really appreciate all the help! Let me know if I should close the issue or feel free to close it if you want.
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
42
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. @lhoestq Thank you for your answer. Saving the file with `.parquet` extension solved the issue! This is really great! Really appreciate all the help! Let me know if I should close the issue or feel free to close it if you want.
[ -0.20789626240730286, -0.30446773767471313, -0.10579246282577515, 0.19229444861412048, 0.19193899631500244, -0.22231219708919525, 0.05201942101120949, 0.08504946529865265, 0.19627942144870758, 0.0800582766532898, 0.08831930160522461, 0.37090200185775757, -0.04738371819257736, 0.45688819885253906, 0.08596277981996536, 0.00030700769275426865, 0.12130573391914368, 0.2210734337568283, 0.12664109468460083, 0.10525712370872498, -0.23171238601207733, 0.27738574147224426, 0.05486410856246948, -0.16681848466396332, 0.2046326994895935, 0.007574871182441711, -0.03533969447016716, 0.1554950475692749, -0.24527786672115326, -0.22590675950050354, 0.15139779448509216, 0.04721493273973465, 0.22223791480064392, 0.20576974749565125, -0.00010145533451577649, -0.1349751502275467, 0.22456249594688416, -0.2601030468940735, -0.31652796268463135, -0.18495546281337738, -0.08379951119422913, -0.037445731461048126, 0.18965476751327515, -0.08617570996284485, -0.14531147480010986, 0.03564268350601196, -0.04125257581472397, -0.38704025745391846, 0.25770503282546997, 0.19862079620361328, 0.29099565744400024, 0.32184314727783203, -0.3016110956668854, -0.11456356942653656, 0.33762794733047485, 0.10825460404157639, -0.15011541545391083, 0.0826779156923294, 0.5899524092674255, 0.10582185536623001, 0.013084489852190018, 0.49048107862472534, -0.2593538165092468, -0.05457815155386925, 0.35089772939682007, -0.10882812738418579, -0.00026957690715789795, -0.08347658812999725, 0.05191162973642349, -0.07071956992149353, 0.5106494426727295, -0.2027287483215332, -0.25058940052986145, -0.23747141659259796, -0.04227551072835922, -0.2912018895149231, 0.2059631049633026, 0.05970728397369385, 0.07022249698638916, 0.1293075680732727, -0.3052002489566803, -0.5484925508499146, -0.34194105863571167, 0.08299797773361206, -0.0895310640335083, 0.12573134899139404, -0.2466728389263153, -0.11353808641433716, 0.08391550183296204, 0.007214332930743694, 0.26821982860565186, -0.050745606422424316, -0.0976485162973404, -0.149337500333786, -0.1990053802728653, -0.23094260692596436, 0.08903490006923676, 0.13922442495822906, 0.08664292097091675, 0.3672461211681366, 0.37297847867012024, 0.13296982645988464, 0.23015239834785461, 0.22840942442417145, 0.22854670882225037, -0.017732281237840652, 0.01396351121366024, -0.36286216974258423, 0.16594438254833221, 0.3882409930229187, -0.02473974972963333, -0.3335365056991577, -0.0936170145869255, 0.14230883121490479, -0.20312221348285675, -0.19505950808525085, 0.2039455622434616, -0.15525557100772858, 0.004865050315856934, 0.030012615025043488, 0.2549857497215271, 0.12362173199653625, 0.05202357843518257, 0.28972262144088745, 0.04676453769207001, 0.20876343548297882, -0.004957281053066254, 0.2708851993083954, -0.04098828136920929, -0.441026508808136, -0.18388129770755768, 0.005767768248915672, -0.22850202023983002, 0.05591196566820145, 0.12402935326099396, -0.25373825430870056, 0.12947490811347961, -0.16402120888233185, 0.2304554283618927, 0.12429169565439224, 0.058159299194812775, -0.058229587972164154, 0.16177570819854736, 0.11996197700500488, 0.13516192138195038, -0.020176809281110764, 0.16378545761108398, 0.024740688502788544, -0.11737196147441864, 0.06907757371664047, -0.25416669249534607, -0.5133328437805176, -0.42676979303359985, 0.2662138342857361, -0.18697211146354675, -0.023008424788713455, -0.5732035636901855, 0.21044760942459106, -0.30772754549980164, -0.3865047097206116, -0.12750595808029175, 0.056258425116539, -0.09582363814115524, -0.27537673711776733, 0.05062926560640335, 0.020352542400360107, -0.37711331248283386, 0.021412625908851624, -0.41599488258361816, 0.0008659418672323227, 0.5196118950843811, -0.0011440431699156761, -0.3465120792388916, -0.2061775028705597, -0.18374085426330566, 0.29255443811416626, 0.2348979115486145, -0.23469002544879913, -0.27556878328323364, 0.6183581352233887, -0.13445651531219482, 0.08450735360383987, 0.3017725944519043, 0.07098419964313507, 0.5469323992729187, 0.06840688735246658, -0.12113255262374878, 0.5253307819366455, 0.10082762688398361, 0.13100335001945496, -0.11246558278799057, -0.09214086830615997, -0.012547863647341728, 0.28542041778564453, -0.13824304938316345, 0.08753354847431183, 0.251542329788208, 0.1847173273563385, 0.1054597795009613, -0.04215844348073006, 0.19248872995376587, 0.17395555973052979, 0.5359435677528381, 0.25890618562698364, -0.13831710815429688, -0.1624561846256256, -0.4087594747543335, 0.08431929349899292, 0.14453597366809845, -0.18567852675914764, -0.04884173721075058, -0.06376304477453232, -0.11985230445861816, 0.015192881226539612, -0.007803754881024361, -0.1162724494934082, 0.2460004687309265, 0.29117411375045776, -0.0398080088198185, -0.2551514208316803, -0.22537508606910706, 0.19195851683616638, -0.14438395202159882, -0.12041609734296799, -0.12260546535253525, 0.5103661417961121, 0.02064448595046997, -0.3007246255874634, 0.14438772201538086, -0.3409154415130615, 0.19054841995239258, 0.01719541847705841, -0.07028909027576447, 0.49593615531921387, 0.12577706575393677, 0.42752665281295776, 0.19678206741809845, 0.2346111238002777, 0.01683785580098629, 0.10912129282951355, 0.2232542484998703, 0.04190957173705101, 0.12565134465694427, 0.12197403609752655, -0.16786819696426392, 0.2909260392189026, 0.06397935748100281, -0.009649526327848434, 0.08094566315412521, -0.06309740245342255, 0.2654469907283783, 0.00927232950925827, -0.08726150542497635, 0.030591264367103577, 0.0010353079997003078, -0.1252339631319046, -0.22046907246112823, -0.26844727993011475, -0.4103040099143982, -0.01854989305138588, 0.3551786243915558, 0.045699864625930786, 0.051970914006233215, 0.2035503387451172, -0.06187364459037781, -0.31656938791275024, 0.3264918923377991, 0.35802847146987915, 0.44106805324554443, 0.2652730345726013, 0.25917890667915344, -0.05632278323173523, 0.2743757665157318, -0.12776309251785278, 0.31339114904403687, 0.018465150147676468, 0.10582980513572693, 0.3197381794452667, 0.1327052116394043, -0.279714971780777, -0.37478867173194885, -0.2347356528043747, 0.02721693366765976, 0.01823490671813488, -0.12339925765991211, 0.01846250891685486, -0.16488680243492126, -0.10551566630601883, 0.07361026108264923, 0.05287512391805649, -0.1714898645877838, -0.1372109055519104, 0.10332196205854416, 0.7139250636100769, -0.14551995694637299, -0.055979132652282715, 0.16572588682174683, 0.5054800510406494, -0.03215129300951958, -0.11309351027011871, -0.30990052223205566, -0.1296338438987732, -0.005396857857704163, 0.21892429888248444, -0.07154497504234314, -0.18515123426914215, 0.2730121612548828, 0.16298241913318634, 0.19618664681911469, -0.5785827040672302, -0.14109662175178528, 0.043120577931404114, 0.024520158767700195, 0.18691296875476837, 0.10070410370826721, 0.23902557790279388, -0.12318459898233414, -0.11575525999069214, 0.04920956492424011, -0.3935503363609314, -0.10652658343315125, -0.01507672667503357, 0.08189120143651962, 0.1437741070985794, -0.22212670743465424, -0.047443926334381104, -0.09284956008195877, -0.5526055097579956, 0.07651786506175995, -0.02055489271879196, -0.04669904708862305, -0.4071870446205139, 0.02923651784658432, -0.02926168031990528, 0.29176437854766846, 0.06841125339269638, -0.318116694688797, -0.6665727496147156, 0.16037441790103912, -0.24362516403198242, -0.3346406817436218, 0.25030893087387085, 0.3390915095806122, -0.005431718658655882, 0.25003090500831604, -0.45763617753982544, -0.1884608268737793, 0.23544368147850037, -0.23224377632141113, -0.301384299993515, 0.024318506941199303, 0.3244816064834595, -0.01926576904952526, -0.15775300562381744, -0.26931607723236084, -0.27319854497909546, -0.284864604473114, 0.4482438564300537, 0.22500237822532654, -0.02968273125588894, 0.3833483159542084, 0.13455800712108612, 0.26914727687835693, -0.22532311081886292, 0.05893255025148392, 0.6068165898323059, 0.18723361194133759, 0.3999292850494385, -0.14151056110858917, -0.07246442139148712, -0.040997233241796494, -0.19663144648075104, -0.39777618646621704, 0.3117610812187195, 0.03010035678744316, -0.3037000894546509, -0.3551374673843384, -0.08686032146215439, -0.30514901876449585, 0.014568649232387543, 0.008225971832871437, 0.08038055896759033, 0.17958500981330872, -0.19222129881381989, -0.054962679743766785, -0.13344305753707886, 0.030418064445257187, 0.15163885056972504, 0.002668660134077072, 0.37557098269462585, 0.023052629083395004, -0.053074415773153305, 0.08338864892721176, -0.21936354041099548, 0.23445755243301392, -0.18452709913253784, -0.12915122509002686, -0.34034085273742676, -0.20488139986991882, 0.13684973120689392, -0.25302398204803467, 0.6962424516677856, -0.3634311258792877, 0.17214688658714294, -0.010196037590503693, -0.3376513123512268, -0.20036718249320984, -0.043606847524642944, -0.26393312215805054, -0.001085028052330017, -0.11978107690811157, 0.6103464365005493, -0.10532615333795547, 0.03472841531038284, -0.31513968110084534, -0.2571825385093689, -0.18555273115634918, -0.07722289860248566, -0.20576593279838562, -0.008084692060947418, -0.42863044142723083, 0.06647050380706787, 0.1447603702545166, 0.21326251327991486, -0.03662069886922836, 0.05136370658874512, 0.06533609330654144, 0.11168700456619263, -0.00852987915277481, -0.02268875390291214, 0.3774922788143158, 0.0832962691783905, -0.15591582655906677, -0.006251031998544931, 0.32996949553489685, 0.26378190517425537, 0.45578762888908386, 0.3331897556781769, -0.27714064717292786, 0.36451053619384766, 0.22602781653404236, 0.31604960560798645, 0.3397359251976013, 0.2794162333011627, 0.012065863236784935, 0.07060392200946808, 0.13510967791080475, -0.26659929752349854, -0.0036352723836898804, 0.17963072657585144, -0.2560771107673645, 0.17704129219055176, -0.21399544179439545, 0.2322435826063156, -0.16661766171455383, 0.0144968181848526, 0.05612107738852501, 0.07070357352495193, -0.20510897040367126, 0.4661651849746704, 0.14326642453670502, 1.1098709106445312, 0.07567356526851654, 0.0489329919219017, 0.1749943196773529, -0.5038624405860901, 0.22587718069553375, -0.5346603393554688, 0.03676312416791916, -0.2137005776166916, -0.2384692132472992, -0.19826003909111023, -0.09050285071134567, 0.013136694207787514, 0.1984427273273468, -0.2749735713005066, -0.07070420682430267, 0.164298415184021, 0.22424575686454773, -0.18906888365745544, 0.24853675067424774, -0.11593903601169586, -0.18354743719100952, -0.5415471792221069, 0.23442286252975464, -0.228742778301239, -0.015117809176445007, -0.14679262042045593, -0.29356318712234497, 0.29878726601600647, -0.0788070484995842, -0.08602606505155563, 0.25764650106430054, 0.2979576587677002, 0.051495302468538284, -0.2822606563568115, -0.20368686318397522, 0.022132769227027893, 0.16059675812721252, -0.21897822618484497, 0.0006066323257982731, -0.2677675485610962, 0.23241235315799713, 0.12104716897010803, -0.060323018580675125, -0.24561664462089539, 0.011073615401983261, 0.101981520652771, -0.2704608142375946, -0.03343091905117035, 0.18298211693763733, 0.049986593425273895, -0.5899651050567627, 0.03245237469673157, -0.032647475600242615, 0.41654226183891296, -0.14774338901042938, -0.2803918719291687, -0.09414614737033844, 0.03338225185871124, -0.27403080463409424, 0.22423627972602844, -0.07397577911615372, -0.14523422718048096, -0.2278471291065216, -0.0977172702550888, 0.042308151721954346, -0.33411210775375366, 0.5187547206878662, -0.09572459012269974, 0.053282126784324646, -0.05253942683339119, 0.26052194833755493, -0.43571048974990845, -0.30346888303756714, -0.07445402443408966, -0.015486232936382294, 0.03829792141914368, 0.19303348660469055, -0.028546588495373726, -0.2087186574935913, 0.12183193862438202, 0.05089788883924484, 0.24272547662258148, 0.09969480335712433, 0.03322252631187439, -0.2729586958885193, 0.06027460843324661, 0.09639373421669006, -0.15091952681541443, 0.23215316236019135, 0.25573793053627014, -0.4516162574291229, 0.11368892341852188, -0.1712089627981186, -0.45410341024398804, 0.1676795482635498, -0.039999380707740784, 0.1507437378168106, 0.1955529749393463, -0.06772922724485397, 0.18803620338439941, -0.027349909767508507, 0.15511691570281982, -0.10517092049121857, -0.2853834629058838, -0.2522272765636444, 0.1084827184677124, 0.12561142444610596, 0.1745842844247818, 0.2957497835159302, -0.22658583521842957, -0.28414252400398254, -0.293724924325943, -0.01200234517455101, 0.3447690010070801, -0.033656369894742966, -0.05162939801812172, 0.09148511290550232, 0.5219456553459167, -0.014356665313243866, -0.2126118242740631, -0.10621926188468933, 0.12298738211393356, 0.2758696377277374, -0.22763648629188538, -0.0948733538389206, -0.021248387172818184, -0.20225772261619568, -0.19387736916542053, 0.09503132104873657, 0.29560399055480957, 0.33836889266967773, 0.5517373085021973, -0.15699809789657593, -0.05918501317501068, 0.10631191730499268, 0.5540540218353271, 0.003821796737611294, -0.05902422219514847, -0.2510840594768524, 0.26226702332496643, 0.3157590627670288, -0.02764073759317398, -0.3529479205608368, -0.1975947618484497, -0.12706978619098663, -0.05976199731230736, -0.17343972623348236, 0.13023243844509125, 0.007415950298309326, -0.12277721613645554, 0.2253255844116211, 0.4275282025337219, 0.11711138486862183, 0.0895797461271286, 0.03664225712418556, -0.08942706882953644, -0.04133065789937973, -0.02147475630044937, 0.11441624164581299, 0.1429975926876068, 0.30937886238098145, 0.033207960426807404, 0.19944822788238525, 0.2761904001235962, 0.24066682159900665, -0.048330459743738174, -0.28074827790260315, -0.10809037834405899, 0.05127502605319023, -0.0006177462637424469, 0.18731367588043213, -0.005582105368375778, 0.022773446515202522, -0.007424112409353256, -0.028819553554058075, -0.33893680572509766, 0.21930453181266785, -0.11386437714099884, 0.11839266121387482, -0.11323845386505127, -0.07989989221096039, 0.09999996423721313, 0.44210946559906006, 0.007490652147680521, 0.11204789578914642, 0.21445612609386444, 0.15355956554412842, 0.29692399501800537, 0.014670008793473244, -0.07273080199956894, -0.12127940356731415, 0.10225587338209152, -0.2618175446987152, 0.05365423113107681, -0.0746292918920517, 0.07620792090892792, 0.24499353766441345, -0.11746884137392044, 0.2496120184659958, 0.18241454660892487, 0.0020276419818401337, -0.07989616692066193, 0.06768779456615448, -0.11683337390422821, 0.016813017427921295, 0.17730490863323212, 0.26311931014060974, 0.2385462522506714, 0.41109737753868103, 0.27763831615448, -0.23962116241455078, 0.056905172765254974, 0.011027672328054905, 0.06365011632442474, 0.008507568389177322, 0.034898653626441956, 0.19045722484588623, 0.014579840004444122, -0.24182425439357758, -0.13689422607421875, -0.5025299787521362, -0.3479683995246887, 0.16696475446224213, 0.1194942444562912, 0.03740304708480835, -0.009935252368450165, 0.1777224838733673, 0.04962589591741562, 0.4291173815727234, 0.1157422810792923, -0.31419041752815247, -0.22746232151985168, -0.3795661926269531, -0.3492385745048523, 0.3098658621311188, 0.17872242629528046, -0.177198126912117, 0.036548033356666565, 0.4602813422679901, 0.21004799008369446, 0.06029174104332924, -0.4649353623390198, 0.03415030613541603, -0.2051265388727188, 0.11754007637500763, -0.3167523145675659, -0.0024860056582838297, 0.33456385135650635, 0.027872344478964806, 0.050367437303066254, -0.04303579032421112, 0.17268992960453033, 0.06727160513401031, 0.19141438603401184, -0.04801151156425476, -0.059099096804857254, -0.3080670237541199, 0.2548285722732544, 0.5005396604537964, -0.17968086898326874, 0.10635115206241608, -0.27662962675094604, -0.08407112210988998, -0.012803519144654274, -0.22265508770942688, 0.022458411753177643, 0.22249320149421692, -0.1765337586402893, 0.4123111963272095, -0.035736434161663055, 0.22697558999061584, -0.38033559918403625, 0.16394805908203125, -0.14088213443756104, -0.19699551165103912, -0.26415735483169556, 0.020295821130275726, -0.08089229464530945, 0.24290010333061218, -0.10827787965536118, 0.09659138321876526, -0.05655284225940704, -0.06073989346623421, -0.2799387574195862, -0.3813290596008301, 0.5528050661087036, -0.3648504316806793, -0.44928914308547974, 0.2666383981704712, 0.2820500135421753, 0.2022220492362976, -0.10927268862724304, -0.5033005475997925, 0.2582782506942749, 0.1407880336046219, -0.044889241456985474, 0.13417647778987885, 0.3192930817604065, -0.09100311994552612, 0.002484723925590515, -0.029414720833301544, 0.11346350610256195, 0.25228145718574524, -0.19961382448673248, -0.01849702000617981, -0.27721107006073 ]
https://github.com/huggingface/datasets/issues/5838
Cool ! I'm glad it worked out :) Sure feel free to close the issue, since the original question about streaming with load_from_disk has been answered anyway
Streaming support for `load_from_disk`
### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so.
27
Streaming support for `load_from_disk` ### Feature request Support for streaming datasets stored in object stores in `load_from_disk`. ### Motivation The `load_from_disk` function supports fetching datasets stored in object stores such as `s3`. In many cases, the datasets that are stored in object stores are very large and being able to stream the data from the buckets becomes essential. ### Your contribution I'd be happy to contribute this feature if I could get the guidance on how to do so. Cool ! I'm glad it worked out :) Sure feel free to close the issue, since the original question about streaming with load_from_disk has been answered anyway
[ -0.16210711002349854, -0.34814807772636414, -0.19091832637786865, 0.09209589660167694, 0.08707378804683685, -0.3386496305465698, 0.03595179691910744, 0.10286790877580643, 0.17164400219917297, 0.07638229429721832, 0.0013486891984939575, 0.3652254045009613, -0.061528172343969345, 0.4554402530193329, 0.06101875379681587, -0.04491525515913963, 0.12569908797740936, 0.11423271149396896, 0.07412219792604446, 0.10634185373783112, -0.2031743824481964, 0.11328265070915222, 0.043057069182395935, -0.34318041801452637, 0.19799219071865082, 0.10767849534749985, -0.0029355883598327637, 0.0994434505701065, -0.3296758234500885, -0.1812155842781067, 0.14421434700489044, 0.21757283806800842, 0.21062690019607544, 0.20797370374202728, -0.0001025588862830773, -0.23422932624816895, 0.22438006103038788, -0.196934312582016, -0.3882830739021301, -0.0433337464928627, -0.20592248439788818, -0.0561758391559124, 0.0607294961810112, 0.026583954691886902, -0.07748696208000183, 0.0397561639547348, -0.04763307422399521, -0.39244961738586426, 0.11866074800491333, 0.010815277695655823, 0.2726608216762543, 0.3188517093658447, -0.29323503375053406, -0.13207867741584778, 0.22166462242603302, 0.30737146735191345, -0.2710043787956238, 0.16796931624412537, 0.6115736961364746, 0.05484526604413986, 0.013489551842212677, 0.5191704034805298, -0.35178083181381226, 0.04776228591799736, 0.4693846106529236, -0.14350612461566925, -0.1442878246307373, -0.15368089079856873, -0.09958003461360931, 0.05654845014214516, 0.6564582586288452, -0.14778044819831848, -0.3838493525981903, -0.22022438049316406, -0.08889143168926239, -0.17809869349002838, 0.024822423234581947, -0.18518657982349396, -0.08609592169523239, 0.1710912585258484, -0.5589050054550171, -0.640702486038208, -0.2806418538093567, 0.13441520929336548, -0.1681365817785263, 0.20161569118499756, -0.17874261736869812, -0.13545000553131104, 0.13942581415176392, 0.27080997824668884, 0.39809370040893555, -0.10130879282951355, -0.033029116690158844, -0.03443830832839012, -0.2596210241317749, -0.24723058938980103, 0.14154531061649323, 0.2015828937292099, 0.06730771064758301, 0.41706687211990356, 0.47984710335731506, 0.13915562629699707, -0.04110322147607803, 0.16209550201892853, 0.14171180129051208, 0.1994805485010147, -0.013166625052690506, -0.4578644633293152, 0.23198890686035156, 0.2798604369163513, 0.1261254847049713, -0.3067178428173065, -0.03259009122848511, 0.1875215768814087, -0.2671249508857727, -0.1469908356666565, 0.23822785913944244, -0.12996935844421387, 0.00254049152135849, -0.08240926265716553, 0.15494297444820404, 0.0027770698070526123, 0.0001345127820968628, 0.1911894530057907, -0.0033694133162498474, 0.3890429139137268, -0.005889706313610077, 0.14063630998134613, 0.10914240032434464, -0.25452902913093567, -0.15005040168762207, -0.07718244194984436, -0.20158658921718597, 0.15500271320343018, 0.05788007378578186, -0.29236018657684326, 0.04245962202548981, -0.22115780413150787, 0.2978561818599701, 0.19388356804847717, 0.08573010563850403, 0.03836566582322121, 0.23185724020004272, 0.06880120933055878, 0.037606604397296906, 0.0801965594291687, 0.12494351714849472, 0.2009713500738144, -0.19258332252502441, 0.20125417411327362, -0.15518197417259216, -0.5861518383026123, -0.3783744275569916, 0.2680099308490753, -0.4007739722728729, -0.10294441878795624, -0.48466792702674866, 0.261261910200119, -0.4554692208766937, -0.27965807914733887, 0.10226154327392578, 0.20929963886737823, -0.07071396708488464, -0.2353668510913849, 0.04102623462677002, -0.08760149776935577, -0.4034074544906616, 0.026534155011177063, -0.541404128074646, -0.07854760438203812, 0.33677077293395996, -0.09870553016662598, -0.32348212599754333, -0.17731833457946777, -0.09128256142139435, 0.15775689482688904, 0.13358409702777863, -0.4273577928543091, -0.3069522976875305, 0.6475111842155457, -0.09123779088258743, 0.11907057464122772, 0.3433794677257538, 0.1903858780860901, 0.35445886850357056, 0.06860049813985825, -0.08445645868778229, 0.6775386929512024, 0.074795663356781, 0.06684748828411102, -0.11096107959747314, -0.21969762444496155, -0.1000521183013916, 0.34565240144729614, -0.13186034560203552, 0.20373135805130005, 0.24529528617858887, 0.21258869767189026, 0.1505657434463501, 0.06041044741868973, 0.15186312794685364, 0.03128870949149132, 0.6031215786933899, 0.050867702811956406, -0.1630348414182663, -0.078483447432518, -0.4077416956424713, 0.1094551533460617, 0.2419186532497406, -0.05840880051255226, 0.07499171793460846, -0.08547615259885788, -0.05082898586988449, -0.02242462709546089, 0.1342264860868454, -0.11974053084850311, 0.1980147361755371, 0.2787531316280365, -0.007411211729049683, -0.2529703974723816, -0.2574489712715149, 0.19346950948238373, -0.04685680568218231, -0.1670578122138977, -0.09142282605171204, 0.4262135922908783, 0.11382211744785309, -0.05046793073415756, 0.03811316192150116, -0.33520275354385376, 0.0744486004114151, 0.07555349171161652, 0.002599954605102539, 0.35283154249191284, -0.11332780122756958, 0.5384718179702759, 0.1429990977048874, 0.3045746088027954, 0.17144708335399628, 0.139455646276474, 0.3445645868778229, -0.04237494245171547, 0.14469757676124573, 0.03560657799243927, -0.1270754635334015, 0.3528495132923126, -0.1169465035200119, 0.05062473937869072, 0.05059732496738434, -0.05418859422206879, 0.16034916043281555, -0.03249542787671089, -0.17248064279556274, 0.0774054080247879, 0.009328789077699184, -0.12503981590270996, -0.17546197772026062, -0.1489962339401245, -0.2926023006439209, 0.05797858163714409, 0.29831087589263916, 0.023835115134716034, -0.05119403079152107, 0.10045976936817169, -0.13877668976783752, -0.2499580830335617, 0.4249572455883026, 0.37060800194740295, 0.5441011786460876, 0.2675331234931946, 0.22511228919029236, -0.06327864527702332, 0.3600301444530487, -0.12607543170452118, 0.3575162887573242, 0.050906144082546234, 0.1428377330303192, 0.3504781723022461, 0.046326346695423126, -0.20629242062568665, -0.15882419049739838, -0.34543871879577637, 0.06955299526453018, -0.059927426278591156, -0.04281102493405342, -0.14980077743530273, -0.022449150681495667, -0.20736423134803772, 0.07243499159812927, -0.23497866094112396, -0.0429760180413723, -0.15460024774074554, 0.13090960681438446, 0.7697402238845825, -0.18061591684818268, -0.008635276928544044, 0.13479465246200562, 0.5437525510787964, -0.2638983130455017, -0.08209798485040665, -0.3286009430885315, -0.04156748950481415, 0.23277948796749115, 0.27662521600723267, -0.07555456459522247, -0.2795315682888031, 0.2571203112602234, 0.26721638441085815, 0.2055046558380127, -0.5554002523422241, -0.1022353246808052, 0.04019402712583542, -0.0879288762807846, 0.127339169383049, 0.03338626027107239, 0.14072541892528534, -0.041030775755643845, -0.2237539291381836, -0.0866369903087616, -0.35706910490989685, -0.1391575187444687, -0.21117132902145386, 0.07590554654598236, 0.20911145210266113, -0.23405617475509644, 0.013502232730388641, -0.17140601575374603, -0.6060329079627991, 0.1694066822528839, -0.1422247290611267, -0.05177648738026619, -0.30281439423561096, 0.07989609241485596, -0.0026931017637252808, 0.4005451798439026, -0.08327062427997589, -0.2616909146308899, -0.6960891485214233, 0.10960941761732101, -0.19328466057777405, -0.16200140118598938, 0.12357529997825623, 0.37224704027175903, -0.06275111436843872, 0.21464726328849792, -0.41046249866485596, -0.3220815062522888, 0.23487024009227753, -0.05033101513981819, -0.22095730900764465, -0.03406817838549614, 0.27083298563957214, 0.032346565276384354, -0.20349067449569702, -0.21714992821216583, -0.2060643434524536, -0.4659261405467987, 0.3648626208305359, 0.2530949115753174, 0.12196066975593567, 0.16850388050079346, 0.13629072904586792, 0.3724718987941742, -0.20343956351280212, 0.06973820924758911, 0.4771538972854614, 0.43051081895828247, 0.2894856035709381, -0.1307511329650879, -0.11216001212596893, -0.10400723665952682, -0.21897482872009277, -0.36554190516471863, 0.2430439293384552, 0.04272138699889183, -0.3111434578895569, -0.4095696210861206, -0.07234830409288406, -0.20610806345939636, 0.10446849465370178, 0.08635018020868301, -0.1313011348247528, 0.09922420233488083, -0.1781402826309204, -0.03328072279691696, -0.05764370784163475, 0.01319960132241249, 0.01784869283437729, -0.08003729581832886, 0.5070641040802002, -0.08057913184165955, -0.05299428477883339, 0.024989042431116104, -0.3182922601699829, 0.21558167040348053, -0.08812719583511353, -0.23717565834522247, -0.2788465619087219, -0.23241159319877625, 0.10123790055513382, -0.09106788039207458, 0.5642396807670593, -0.41023877263069153, -0.027044322341680527, -0.0005672052502632141, -0.2915879487991333, -0.029071103781461716, -0.007760860025882721, -0.15862780809402466, 0.026865500956773758, -0.21034514904022217, 0.44541996717453003, 0.026010751724243164, 0.019523005932569504, -0.2022007703781128, -0.3214186131954193, -0.0995098352432251, -0.1378684937953949, -0.09739530831575394, -0.10472455620765686, -0.4162796139717102, -0.04656395688652992, 0.1860276609659195, 0.05670814588665962, -0.26159927248954773, -0.09585270285606384, 0.13830892741680145, 0.256553590297699, 0.10160255432128906, -0.11361275613307953, 0.13957315683364868, 0.14257493615150452, -0.11243298649787903, 0.09756506979465485, 0.243416428565979, 0.2805430293083191, 0.3979417383670807, 0.34469348192214966, -0.11216024309396744, 0.26550644636154175, 0.24127815663814545, 0.2874296307563782, 0.47108638286590576, 0.3781129717826843, 0.15902048349380493, 0.1301916539669037, 0.1012754887342453, -0.3298570513725281, -0.1681177318096161, 0.051879048347473145, -0.19060780107975006, 0.12374226748943329, -0.2976108193397522, 0.2822195291519165, -0.12205544859170914, -0.09971301257610321, 0.21861621737480164, -0.012700051069259644, -0.24902555346488953, 0.28406384587287903, 0.12774617969989777, 1.2298994064331055, 0.1804041564464569, 0.07424759864807129, 0.03956872224807739, -0.3859386444091797, 0.30388525128364563, -0.47226959466934204, 0.022790778428316116, -0.14351457357406616, -0.2754914164543152, -0.24439072608947754, -0.07160328328609467, -0.045766230672597885, 0.0048701525665819645, -0.34983161091804504, -0.10259774327278137, 0.10796044766902924, 0.31360042095184326, -0.12353069335222244, 0.3002045154571533, -0.28574737906455994, -0.23027168214321136, -0.511269211769104, 0.22194500267505646, -0.2364203780889511, 0.111182801425457, -0.22074022889137268, -0.2776506543159485, 0.24802589416503906, 0.05354422330856323, -0.215701162815094, 0.11333051323890686, 0.3517117500305176, 0.043096259236335754, -0.3524010479450226, -0.22432522475719452, -0.022461187094449997, 0.19036130607128143, -0.14987815916538239, -0.04932169243693352, -0.30712223052978516, 0.1883884221315384, 0.18018025159835815, 0.1798831671476364, -0.06373284757137299, -0.2151559293270111, 0.25596582889556885, -0.28838270902633667, -0.22854027152061462, 0.34171146154403687, 0.09360665082931519, -0.7619370222091675, -0.04924874007701874, -0.00261138379573822, 0.33743616938591003, -0.1062815710902214, -0.20105136930942535, 0.09978561103343964, -0.06750524044036865, -0.2238759845495224, 0.24483884871006012, 0.03036516159772873, -0.2170991599559784, -0.06658001989126205, -0.04415348544716835, 0.0070657879114151, -0.29113245010375977, 0.6044486165046692, -0.034733619540929794, -0.1428610384464264, -0.13140830397605896, 0.09762653708457947, -0.36300885677337646, -0.25719985365867615, -0.006712906062602997, 0.07682076096534729, -0.017534002661705017, 0.060551535338163376, -0.04205374792218208, -0.1731419861316681, -0.053325094282627106, 0.09003037214279175, 0.327485591173172, 0.23945429921150208, -0.09910642355680466, -0.22803980112075806, 0.07384996116161346, 0.2580072581768036, -0.15943290293216705, 0.2719433903694153, -0.023983173072338104, -0.45141512155532837, 0.10450003296136856, -0.1312902867794037, -0.4534154236316681, 0.05881895869970322, 0.10014603286981583, 0.07750976085662842, 0.1353420466184616, -0.007507766596972942, 0.13252456486225128, -0.13089735805988312, 0.1415320485830307, -0.06251630932092667, -0.2533237934112549, -0.2506367564201355, 0.13280551135540009, 0.15459918975830078, 0.2338670939207077, 0.13558070361614227, -0.0977424755692482, -0.27819085121154785, -0.22523653507232666, 0.06582410633563995, 0.37755483388900757, 0.0650927871465683, -0.03539096564054489, 0.11083158850669861, 0.3503066897392273, 0.1328987330198288, -0.15469875931739807, 0.04420724883675575, 0.3219117522239685, 0.43975526094436646, -0.20190919935703278, -0.016413774341344833, 0.03933039680123329, -0.2112429440021515, -0.037630289793014526, 0.08999132364988327, 0.2010701596736908, 0.42412057518959045, 0.5110505819320679, 0.09109051525592804, -0.0032460764050483704, -0.00012199953198432922, 0.6049605011940002, -0.04765348881483078, -0.016498854383826256, -0.10343195497989655, 0.11030535399913788, 0.33993852138519287, 0.09736600518226624, -0.3649316132068634, -0.33531123399734497, -0.11629942059516907, -0.08869307488203049, -0.18459954857826233, 0.18052470684051514, 0.07742835581302643, 0.02117200940847397, 0.09361407160758972, 0.3819783329963684, 0.22229857742786407, 0.07796734571456909, -0.002262636087834835, -0.09601098299026489, 0.004197990521788597, 0.009516343474388123, -0.005502593703567982, 0.17051489651203156, 0.19169674813747406, -0.03785565122961998, 0.2616114020347595, 0.16813890635967255, 0.34182751178741455, 0.04257126897573471, -0.1539764702320099, -0.032469742000103, -0.12226904928684235, -0.22304889559745789, 0.24234938621520996, 0.03149379789829254, 0.015767358243465424, -0.15575365722179413, 0.0877416804432869, -0.28526103496551514, 0.11529706418514252, 0.04226626083254814, 0.09586456418037415, -0.2597223222255707, -0.2089725136756897, 0.10711653530597687, 0.35678261518478394, 0.04582878202199936, 0.011424969881772995, 0.4463539719581604, 0.11675562709569931, 0.1641920655965805, 0.07148642838001251, 0.11078253388404846, -0.017415596172213554, 0.22819241881370544, -0.24592691659927368, -0.13773350417613983, 0.02769039012491703, 0.11518866568803787, 0.3134933412075043, 0.023696294054389, 0.17057983577251434, 0.15913334488868713, 0.03725836053490639, 0.03192563354969025, -0.0528615340590477, -0.10493585467338562, -0.08455321192741394, 0.27700912952423096, 0.33698371052742004, 0.06864005327224731, 0.2313866913318634, 0.31750965118408203, -0.24018698930740356, 0.19631516933441162, -0.051910147070884705, 0.09830223023891449, -0.14573398232460022, 0.2135489583015442, 0.2299422174692154, -0.041760362684726715, -0.0784057080745697, 0.004507288336753845, -0.3555034399032593, -0.2428913563489914, 0.25165173411369324, -0.00772123783826828, -0.012600529938936234, -0.03473526984453201, 0.15558114647865295, 0.01248425617814064, 0.4076075851917267, 0.058448947966098785, -0.12979991734027863, -0.17058522999286652, -0.27652835845947266, -0.3708350658416748, 0.1870788335800171, 0.4206078052520752, -0.027514439076185226, -0.034539103507995605, 0.3599610924720764, 0.25117355585098267, 0.17116011679172516, -0.4582524299621582, -0.13489371538162231, -0.08874744176864624, 0.18330393731594086, -0.24352900683879852, 0.01664232462644577, 0.34892964363098145, 0.13953427970409393, -0.01421717181801796, -0.1478661298751831, 0.19464349746704102, 0.06275445222854614, 0.15083444118499756, -0.1842169463634491, -0.09660688042640686, 0.044642843306064606, 0.3283001482486725, 0.49738678336143494, -0.19610387086868286, 0.15839265286922455, -0.22312384843826294, -0.06893190741539001, -0.010952921584248543, -0.1728525459766388, 0.0021822303533554077, 0.046493709087371826, -0.2509564757347107, 0.36179929971694946, 0.058344870805740356, 0.20962807536125183, -0.31873831152915955, 0.32642608880996704, -0.2115279734134674, -0.1751943826675415, -0.3016514778137207, -0.12198980897665024, -0.31878662109375, 0.11337092518806458, -0.05438334867358208, 0.15419647097587585, -0.029575269669294357, -0.07139065861701965, -0.4261869490146637, -0.3057374656200409, 0.445654958486557, -0.22039274871349335, -0.251675546169281, 0.1602574586868286, 0.23170588910579681, 0.22945813834667206, -0.00026312656700611115, -0.5124311447143555, 0.15844866633415222, 0.16732406616210938, -0.08373276889324188, 0.20175327360630035, 0.4210360050201416, 0.016244027763605118, 0.02008746564388275, -0.14057981967926025, 0.11952409148216248, 0.06993277370929718, -0.14195820689201355, -0.14013506472110748, -0.2847813665866852 ]
https://github.com/huggingface/datasets/issues/5837
Hi ! Doing `load_dataset("path/to/data.csv")` is not supported yet, but you can do ```python ds = load_dataset("csv", data_files=["path/to/data.csv"]) ```
Use DeepSpeed load myself " .csv " dataset.
### Describe the bug When I use DeepSpeed train a model with my own " XXX.csv" dataset I got the follow question: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1498, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1217, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /home/fm001/hzl/Data/qa.csv/qa.csv.py or any data file in the same directory. ### Steps to reproduce the bug my code is : from datasets import load_dataset mydata = load_dataset("/home/fm001/hzl/Data/qa.csv") ### Expected behavior 。。。 ### Environment info 。。。
18
Use DeepSpeed load myself " .csv " dataset. ### Describe the bug When I use DeepSpeed train a model with my own " XXX.csv" dataset I got the follow question: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1498, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1217, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /home/fm001/hzl/Data/qa.csv/qa.csv.py or any data file in the same directory. ### Steps to reproduce the bug my code is : from datasets import load_dataset mydata = load_dataset("/home/fm001/hzl/Data/qa.csv") ### Expected behavior 。。。 ### Environment info 。。。 Hi ! Doing `load_dataset("path/to/data.csv")` is not supported yet, but you can do ```python ds = load_dataset("csv", data_files=["path/to/data.csv"]) ```
[ -0.25815436244010925, -0.10589193552732468, -0.02953505702316761, 0.3224860429763794, 0.14691399037837982, 0.2572140395641327, 0.5154327154159546, 0.1292022317647934, 0.23117075860500336, 0.2553311586380005, 0.03211133927106857, 0.17823092639446259, -0.12606866657733917, 0.3205708861351013, 0.361081063747406, 0.45955896377563477, 0.07577230781316757, -0.07441449910402298, -0.23574677109718323, -0.03201707452535629, -0.3510930836200714, -0.09752070158720016, -0.040594346821308136, 0.022051723673939705, -0.2829129695892334, 0.06395307928323746, 0.13774684071540833, 0.38469013571739197, 0.3024238646030426, -0.28329232335090637, 0.4568718373775482, -0.013804243877530098, 0.39582937955856323, 0.6243805885314941, -0.00011135816748719662, 0.327606737613678, 0.29504674673080444, -0.14188890159130096, -0.1420200765132904, -0.18389537930488586, -0.41043221950531006, -0.09190776944160461, 0.14947792887687683, -0.3531433343887329, -0.16217303276062012, -0.06441596150398254, -0.10524239391088486, -0.41717275977134705, 0.07737170904874802, 0.3802376985549927, 0.2549316883087158, 0.27092838287353516, -0.23984158039093018, -0.2991107106208801, 0.24439245462417603, -0.17336539924144745, -0.028181102126836777, 0.24733641743659973, -0.21444302797317505, -0.30813178420066833, -0.1310732215642929, 0.1718568354845047, -0.045846126973629, -0.038387857377529144, 0.5479888916015625, 0.11381272226572037, 0.11708201467990875, -0.4405554533004761, 0.0030797719955444336, 0.2054654359817505, 0.2513217329978943, -0.2361667901277542, -0.26510128378868103, -0.30204370617866516, -0.12349995970726013, -0.4315141439437866, 0.00245087593793869, 0.16726121306419373, 0.12697342038154602, 0.2511183023452759, 0.07431740313768387, 0.27842462062835693, -0.1098681390285492, -0.2326865792274475, 0.03696829080581665, 0.17293071746826172, -0.05134795978665352, 0.02931423857808113, 0.026176124811172485, 0.12094087898731232, 0.16973933577537537, -0.2315005660057068, -0.08470971882343292, -0.08094148337841034, -0.3271496891975403, -0.03333060443401337, 0.11481476575136185, -0.06590420007705688, 0.1575358510017395, 0.09495793282985687, 0.4832306206226349, -0.11138539016246796, -0.14065366983413696, 0.15775686502456665, 0.12692993879318237, 0.22826600074768066, -0.12698014080524445, 0.060627419501543045, 0.3073437809944153, 0.17047379910945892, -0.05404767394065857, -0.07948581874370575, 0.06285039335489273, -0.12106417119503021, 0.10905247926712036, 0.05494626238942146, 0.20120775699615479, 0.012569628655910492, -0.3954850733280182, 0.05238179862499237, -0.07437723875045776, -0.04719552770256996, -0.05277245491743088, 0.45050835609436035, -0.18373435735702515, 0.08999364078044891, -0.047508589923381805, 0.205892875790596, -0.1759457290172577, -0.19992640614509583, -0.28426849842071533, 0.10007096827030182, -0.10146809369325638, -0.04955342411994934, -0.018934808671474457, 0.1631525605916977, 0.3469245135784149, 0.04641322046518326, -0.14636370539665222, -0.18803945183753967, 0.023401424288749695, 0.032123006880283356, -0.13643689453601837, 0.3069888949394226, 0.19115754961967468, 0.06489995121955872, 0.046920061111450195, -0.000954359769821167, -0.02823764830827713, 0.29169976711273193, -0.5598960518836975, -0.4560568928718567, 0.14897257089614868, 0.25986355543136597, -0.1844939887523651, -0.24045196175575256, -0.1260995715856552, 0.0978589653968811, 0.06323118507862091, -0.10284233838319778, -0.0009055323898792267, -0.06659664213657379, -0.4791319668292999, -0.3007875382900238, 0.207492858171463, 0.5737829208374023, -0.6411256790161133, 0.037371546030044556, -0.4589075446128845, 0.06395018100738525, 0.1711304485797882, 0.17783892154693604, -0.3318902552127838, 0.49738216400146484, -0.3633192479610443, 0.027125731110572815, 0.2939184010028839, -0.22190386056900024, -0.36681774258613586, 0.04399963468313217, -0.34373602271080017, 0.23270325362682343, 0.3169296383857727, 0.07229431718587875, 0.21744859218597412, -0.2591777443885803, 0.35351258516311646, 0.24948030710220337, -0.014813764952123165, -0.10134603083133698, -0.18762508034706116, -0.25685182213783264, 0.1454995572566986, 0.06764890253543854, 0.06700348854064941, 0.14003896713256836, 0.3711130917072296, -0.4242717921733856, 0.22778967022895813, -0.14745643734931946, -0.04898387938737869, 0.24605880677700043, 0.06769631803035736, 0.29840290546417236, -0.10921952873468399, 0.08153768628835678, -0.404544860124588, 0.39325496554374695, -0.1383039653301239, -0.11236037313938141, 0.12436211854219437, -0.12176048755645752, -0.35905975103378296, -0.030642535537481308, -0.31062063574790955, -0.29087311029434204, 0.07164265960454941, 0.19391170144081116, -0.10716375708580017, 0.09630263596773148, -0.06800975650548935, 0.29974740743637085, -0.18587946891784668, -0.05861813575029373, -0.4738471806049347, 0.1664377897977829, 0.009486820548772812, 0.04776918888092041, -0.004904724657535553, 0.18896299600601196, 0.1576174795627594, -0.0741284191608429, -0.08976444602012634, 0.4170883595943451, 0.00531386211514473, 0.09586171805858612, -0.2460704743862152, 0.2025662213563919, 0.16706784069538116, -0.2945477366447449, 0.06148383766412735, 0.0857405737042427, 0.37878286838531494, -0.011915110051631927, 0.01015700027346611, 0.5929943323135376, -0.20532268285751343, 0.09228041768074036, 0.08042043447494507, -0.26749172806739807, 0.17800627648830414, -0.15859238803386688, -0.0352642685174942, 0.00926954299211502, 0.03561267629265785, 0.06674306839704514, 0.3580372929573059, 0.23430293798446655, -0.23698675632476807, 0.00902589038014412, 0.28879839181900024, -0.09538166224956512, -0.022178974002599716, 0.15811830759048462, -0.19632819294929504, -0.05784449353814125, -0.12450623512268066, 0.5004808902740479, 0.4921337962150574, 0.35252854228019714, -0.08229392766952515, 0.009406829252839088, -0.04038508981466293, -0.2828245759010315, 0.1718609631061554, -0.05881793424487114, 0.48870769143104553, 0.211917906999588, 0.12187060713768005, 0.11736276745796204, -0.12027321010828018, -0.22926002740859985, 0.029458612203598022, -0.0567786768078804, -0.41604796051979065, 0.21177414059638977, -0.2905309796333313, -0.04211747646331787, -0.1871451437473297, -0.03264174982905388, 0.19255733489990234, 0.021532267332077026, -0.14741003513336182, 0.12276884913444519, -0.245540052652359, 0.12673044204711914, -0.17975017428398132, 0.20952725410461426, 0.06523992866277695, -0.10352110862731934, -0.0011387094855308533, 0.025051824748516083, -0.2664047181606293, 0.011565208435058594, 0.17709922790527344, -0.13409097492694855, 0.2213417887687683, 0.11053028702735901, -0.21780303120613098, -0.11970267444849014, -0.023084305226802826, -0.10302922874689102, 0.08508127927780151, 0.4048333168029785, 0.0423438586294651, 0.05006854981184006, 0.44061124324798584, -0.06753547489643097, 0.12738728523254395, 0.05982505530118942, 0.053386032581329346, 0.020857371389865875, 0.14836639165878296, 0.09694071114063263, -0.1289317011833191, -0.41337814927101135, -0.3484872579574585, -0.3424724340438843, -0.0653160884976387, -0.01676444709300995, 0.02270570397377014, 0.2408263385295868, 0.10560078918933868, 0.021396130323410034, 0.257645845413208, -0.05987858772277832, 0.02498823031783104, -0.043187469244003296, 0.42508500814437866, -0.06635075062513351, -0.3299953043460846, 0.009850144386291504, -0.3148918151855469, -0.08011864125728607, -0.15913034975528717, -0.5830999612808228, 0.14572742581367493, -0.3559602200984955, 0.38048869371414185, -0.011220665648579597, 0.0948091521859169, 0.3441375195980072, -0.1627681702375412, -0.05416063964366913, -0.2919061779975891, -0.4247925877571106, 0.17561504244804382, -0.19725356996059418, 0.04371960833668709, 0.25427407026290894, 0.6633390188217163, -0.24083247780799866, 0.5510603189468384, 0.06650590896606445, -0.13885283470153809, 0.38516199588775635, -0.2977200448513031, 0.41805699467658997, -0.2809419631958008, -0.22451789677143097, -0.24374867975711823, -0.04578247666358948, -0.4012327194213867, 0.29724550247192383, -0.2609890103340149, 0.022456036880612373, -0.07843932509422302, -0.15540102124214172, -0.2515503466129303, 0.043156951665878296, 0.03885190188884735, -0.2851499319076538, -0.04732483625411987, 0.19041964411735535, 0.021916627883911133, 0.0030689314007759094, 0.028250597417354584, -0.05160972476005554, 0.11860232055187225, 0.18932023644447327, -0.0991954505443573, -0.07119407504796982, 0.08589059114456177, -0.2905689477920532, 0.15526452660560608, -0.09719805419445038, 0.34511521458625793, 0.026736915111541748, -0.18863143026828766, -0.030855540186166763, -0.09297338128089905, 0.8649448156356812, -0.298015832901001, 0.3198912441730499, -0.014153148978948593, -0.034931622445583344, -0.14647532999515533, -0.2704453766345978, -0.04145706444978714, -0.1283242553472519, 0.12528562545776367, 0.33259543776512146, 0.050065964460372925, -0.028901586309075356, 0.27551084756851196, 0.038865428417921066, -0.2610897421836853, -0.06460533291101456, -0.24019715189933777, -0.2761557698249817, 0.05975978821516037, -0.16276125609874725, -0.04336876422166824, 0.02503146231174469, -0.2605424225330353, -0.22530032694339752, -0.1470685601234436, -0.32199424505233765, 0.05351225286722183, -0.002352047711610794, 0.2867797613143921, 0.1029491275548935, 0.3622288703918457, -0.10514917224645615, 0.2671705186367035, 0.18838877975940704, 0.5130308270454407, -0.016359074041247368, -0.3641051650047302, 0.04585859924554825, 0.08209802210330963, 0.3640100359916687, 0.28461599349975586, -0.13690605759620667, 0.20236530900001526, 0.15083959698677063, -0.15222389996051788, -0.2926131784915924, -0.03761880099773407, 0.20744341611862183, -0.09749500453472137, -0.21811366081237793, -0.7230510115623474, 0.5696765780448914, 0.0978810042142868, -0.0004124939441680908, -0.001957436092197895, -0.30173569917678833, -0.34646040201187134, 0.3704974949359894, -0.16789156198501587, 0.627286970615387, 0.3023078441619873, 0.1830364316701889, 0.15752507746219635, -0.05559685826301575, 0.2481970191001892, -0.3494255542755127, -0.023885278031229973, -0.416329562664032, -0.2867583632469177, -0.0985511988401413, -0.13540588319301605, 0.09448221325874329, 0.1828102469444275, 0.21767717599868774, 0.39449769258499146, 0.07682636380195618, 0.12502990663051605, 0.040421925485134125, 0.0975557267665863, 0.12532508373260498, -0.1584518402814865, -0.20858140289783478, 0.06517024338245392, 0.24369966983795166, 0.08261564373970032, -0.07431168109178543, -0.22031095623970032, -0.06042831391096115, -0.23963935673236847, -0.18902695178985596, 0.18442025780677795, -0.5268679857254028, 0.11906222254037857, -0.14543858170509338, -0.3469582200050354, 0.1261160671710968, 0.36521732807159424, -0.01873968541622162, 0.06081186234951019, -0.07213771343231201, 0.14268307387828827, 0.08855649828910828, 0.2744346559047699, 0.07716389000415802, -0.057621248066425323, 0.30900368094444275, -0.01677771657705307, -0.2275029718875885, 0.07374802976846695, -0.24651718139648438, -0.19478186964988708, 0.04048432409763336, 0.2282981276512146, 0.3365582823753357, -0.28840696811676025, -0.5024959444999695, -0.08437461405992508, 0.20326434075832367, -0.23982340097427368, 0.15908542275428772, -0.08666335791349411, -0.14099806547164917, 0.0588267520070076, -0.1823747605085373, -0.4625045955181122, -0.3386463522911072, 0.4147211015224457, 0.11552251875400543, 0.49428096413612366, 0.37027543783187866, -0.020655758678913116, 0.03816129267215729, -0.20405223965644836, 0.4040936827659607, 0.5213619470596313, -0.24777793884277344, 0.26521268486976624, 0.01942136511206627, 0.1483907848596573, -0.04012029245495796, 0.10946984589099884, 0.3291007876396179, -0.12640520930290222, -0.17174163460731506, -0.49449610710144043, -0.07242663204669952, 0.003164157271385193, -0.045190125703811646, 0.1339256763458252, -0.025052562355995178, 0.024070430546998978, -0.2228318750858307, -0.2084580361843109, -0.3273196220397949, -0.03162402659654617, 0.09515155851840973, -0.016165317967534065, 0.1838824450969696, 0.23669525980949402, 0.2316117137670517, 0.0810895711183548, 0.21906977891921997, 0.0644829273223877, -0.12203949689865112, -0.2653663754463196, -0.129262313246727, 0.12074963748455048, -0.15656796097755432, 0.07581070810556412, -0.02582758292555809, -0.1589985489845276, -0.2549309730529785, -0.009645022451877594, 0.24554161727428436, 0.039143308997154236, 0.09230519831180573, 0.1667230725288391, 0.04025305062532425, 0.13188865780830383, -0.3330889940261841, 0.2331232726573944, -0.2409185916185379, 0.3435603976249695, 0.07140985876321793, 0.021154841408133507, -0.1399541050195694, 0.06446164846420288, -0.37808525562286377, -0.31964585185050964, -0.051605574786663055, 0.2618039846420288, 0.26419827342033386, -0.3162258267402649, -0.009335733950138092, 0.27518200874328613, 0.31326329708099365, 0.3189268112182617, -0.33792445063591003, -0.07806956768035889, 0.11946619302034378, 0.23537954688072205, -0.3920392394065857, 0.0773196741938591, -0.09334567189216614, -0.12205497175455093, 0.13831570744514465, 0.3619287610054016, 0.16052274405956268, 0.06778040528297424, -0.25064998865127563, 0.16599810123443604, 0.22101838886737823, 0.07508155703544617, 0.4142794609069824, 0.4248616695404053, 0.16824203729629517, 0.3011457026004791, 0.2716900110244751, 0.13960176706314087, 0.24192215502262115, 0.7786778211593628, 0.1673412173986435, 0.2987660765647888, 0.22120720148086548, 0.06226272135972977, -0.27251091599464417, -0.736932635307312, 0.5235528945922852, 0.2906171679496765, -0.2879209816455841, 0.013602465391159058, 0.017808500677347183, 0.24063169956207275, -0.424739807844162, 0.2164078950881958, -0.36010077595710754, -0.2234320044517517, -0.188987597823143, -0.14851367473602295, 0.08536534756422043, -0.2661482095718384, 0.05016765743494034, 0.14410124719142914, 0.0368804931640625, 0.1950569748878479, -0.12119998037815094, -0.10589738190174103, -0.3826296627521515, 0.03722043335437775, 0.05875055491924286, 0.11733832955360413, 0.08961604535579681, -0.20890358090400696, 0.29210594296455383, 0.0770188644528389, -0.09690921753644943, 0.055200569331645966, 0.23861630260944366, 0.40055856108665466, 0.41936206817626953, 0.254663348197937, -0.2585781216621399, 0.29806673526763916, -0.2381121814250946, 0.007092006504535675, 0.06854968518018723, -0.016421280801296234, 0.16553859412670135, 0.11218331754207611, 0.20895832777023315, -0.22280022501945496, 0.37127161026000977, 0.3319588899612427, 0.07199539244174957, -0.5388200283050537, 0.19487714767456055, -0.10477252304553986, -0.0626482218503952, -0.21998174488544464, 0.16729380190372467, -0.3342527151107788, -0.14298689365386963, 0.48379677534103394, 0.0075897276401519775, 0.25740671157836914, 0.124820776283741, 0.07633113861083984, -0.16977190971374512, 0.3266042172908783, 0.1957000195980072, -0.4268079996109009, -0.3225233852863312, 0.1957000195980072, -0.5786137580871582, 0.1241142600774765, -0.1382514238357544, -0.08254828304052353, -0.1035587340593338, 0.10126613825559616, -0.15855182707309723, -0.08279800415039062, 0.26683148741722107, -0.10181910544633865, 0.05841094255447388, 0.3603360056877136, -0.2321295291185379, -0.28726500272750854, -0.41631969809532166, 0.24091053009033203, -0.10688531398773193, -0.4594151973724365, -0.028906334191560745, -0.1587498039007187, 0.05583949387073517, 0.04358557611703873, -0.08500552177429199, 0.23485317826271057, -0.06402978301048279, 0.6470233201980591, 0.006374696269631386, 0.5102147459983826, -0.315096914768219, 0.08095932751893997, -0.31554916501045227, -0.1627526730298996, -0.23800547420978546, 0.07336709648370743, 0.07866314053535461, 0.24881181120872498, -0.22054295241832733, -0.18063674867153168, -0.2751655876636505, 0.04903044179081917, 0.15556813776493073, -0.16982948780059814, -0.01569286733865738, 0.2305580973625183, -0.21339797973632812, 0.04176988825201988, 0.37309038639068604, 0.25531595945358276, -0.0022289585322141647, 0.02706219255924225, -0.017504572868347168, -0.2665298879146576, 0.38715463876724243, -0.2863178849220276, -0.12059499323368073, -0.13877584040164948, 0.2628534734249115, -0.2210354208946228, -0.03965207189321518, 0.004305288195610046, 0.021326199173927307, 0.41409626603126526, 0.02201462909579277, -0.17925287783145905, 0.2847842574119568, -0.16653084754943848, 0.04489341378211975, 0.041924506425857544, 0.20915037393569946, 0.11629779636859894, -0.31442388892173767, 0.2269045114517212, -0.31121939420700073 ]
https://github.com/huggingface/datasets/issues/5837
The other question: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1498, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1127, in dataset_module_factory return PackagedDatasetModuleFactory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 708, in get_module data_files = DataFilesDict.from_local_or_remote( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 796, in from_local_or_remote DataFilesList.from_local_or_remote( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 764, in from_local_or_remote data_files = resolve_patterns_locally_or_by_urls(base_path, patterns, allowed_extensions) File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 362, in resolve_patterns_locally_or_by_urls for path in _resolve_single_pattern_locally(base_path, pattern, allowed_extensions): File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 306, in _resolve_single_pattern_locally raise FileNotFoundError(error_msg) FileNotFoundError: Unable to find '/home/fm001/hzl/Data/qa/' at / >>> mydata = load_dataset("/home/fm001/hzl/Data/qa/") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1508, in load_dataset_builder builder_cls = import_main_class(dataset_module.module_path) File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 115, in import_main_class module = importlib.import_module(module_path) File "/home/fm001/.conda/envs/hzl/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/fm001/.cache/huggingface/modules/datasets_modules/datasets/qa/b8b9f481eff9d17b769b4b50f30a51da32b47c94d1af4d2bdffb9fc2c589513a/qa.py", line 2, in <module> mydata = load_dataset("/home/fm001/hzl/Data/qa/") File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1524, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( TypeError: 'NoneType' object is not callable And I follow the setting with https://huggingface.co/docs/datasets/dataset_script
Use DeepSpeed load myself " .csv " dataset.
### Describe the bug When I use DeepSpeed train a model with my own " XXX.csv" dataset I got the follow question: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1498, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1217, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /home/fm001/hzl/Data/qa.csv/qa.csv.py or any data file in the same directory. ### Steps to reproduce the bug my code is : from datasets import load_dataset mydata = load_dataset("/home/fm001/hzl/Data/qa.csv") ### Expected behavior 。。。 ### Environment info 。。。
229
Use DeepSpeed load myself " .csv " dataset. ### Describe the bug When I use DeepSpeed train a model with my own " XXX.csv" dataset I got the follow question: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1498, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1217, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /home/fm001/hzl/Data/qa.csv/qa.csv.py or any data file in the same directory. ### Steps to reproduce the bug my code is : from datasets import load_dataset mydata = load_dataset("/home/fm001/hzl/Data/qa.csv") ### Expected behavior 。。。 ### Environment info 。。。 The other question: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1498, in load_dataset_builder dataset_module = dataset_module_factory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1127, in dataset_module_factory return PackagedDatasetModuleFactory( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 708, in get_module data_files = DataFilesDict.from_local_or_remote( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 796, in from_local_or_remote DataFilesList.from_local_or_remote( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 764, in from_local_or_remote data_files = resolve_patterns_locally_or_by_urls(base_path, patterns, allowed_extensions) File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 362, in resolve_patterns_locally_or_by_urls for path in _resolve_single_pattern_locally(base_path, pattern, allowed_extensions): File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/data_files.py", line 306, in _resolve_single_pattern_locally raise FileNotFoundError(error_msg) FileNotFoundError: Unable to find '/home/fm001/hzl/Data/qa/' at / >>> mydata = load_dataset("/home/fm001/hzl/Data/qa/") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1508, in load_dataset_builder builder_cls = import_main_class(dataset_module.module_path) File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 115, in import_main_class module = importlib.import_module(module_path) File "/home/fm001/.conda/envs/hzl/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/fm001/.cache/huggingface/modules/datasets_modules/datasets/qa/b8b9f481eff9d17b769b4b50f30a51da32b47c94d1af4d2bdffb9fc2c589513a/qa.py", line 2, in <module> mydata = load_dataset("/home/fm001/hzl/Data/qa/") File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1767, in load_dataset builder_instance = load_dataset_builder( File "/home/fm001/.conda/envs/hzl/lib/python3.8/site-packages/datasets/load.py", line 1524, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( TypeError: 'NoneType' object is not callable And I follow the setting with https://huggingface.co/docs/datasets/dataset_script
[ -0.2316916137933731, -0.08913345634937286, -0.03008565865457058, 0.3897944390773773, 0.13162685930728912, 0.2130463421344757, 0.546649158000946, 0.09271926432847977, 0.23029524087905884, 0.25812938809394836, 0.02489587664604187, 0.17865730822086334, -0.06958972662687302, 0.3221999406814575, 0.40954142808914185, 0.45779159665107727, 0.10258350521326065, -0.07857053726911545, -0.24704378843307495, -0.10745055228471756, -0.3009967505931854, -0.08678188920021057, -0.02673432230949402, 0.015548733994364738, -0.3301527500152588, 0.11994969099760056, 0.1092148870229721, 0.3894946277141571, 0.3271932899951935, -0.2743862271308899, 0.4476580023765564, -0.022816987708210945, 0.4112339913845062, 0.6788300275802612, -0.0001131022727349773, 0.3231828212738037, 0.3149617612361908, -0.1503223180770874, -0.103665292263031, -0.16692987084388733, -0.39909836649894714, -0.06924857944250107, 0.1516743302345276, -0.37388795614242554, -0.14301787316799164, -0.09120458364486694, -0.128349170088768, -0.34860464930534363, 0.05980081483721733, 0.3662208914756775, 0.24414220452308655, 0.2680462598800659, -0.288973867893219, -0.301607608795166, 0.2923217713832855, -0.14701174199581146, -0.02545326203107834, 0.23392678797245026, -0.22551828622817993, -0.25617849826812744, -0.11606867611408234, 0.19160506129264832, -0.02443026378750801, -0.0580533929169178, 0.5556350350379944, 0.12638486921787262, 0.1507166475057602, -0.43793994188308716, 0.04016747698187828, 0.24361112713813782, 0.29034724831581116, -0.22409680485725403, -0.2879018485546112, -0.27889931201934814, -0.12329274415969849, -0.3812083899974823, 0.08279602229595184, 0.18669140338897705, 0.15927547216415405, 0.23223894834518433, 0.033184271305799484, 0.3395712375640869, -0.0796213299036026, -0.2367444932460785, -0.04221106320619583, 0.17549708485603333, -0.057557363063097, 0.03252037987112999, -0.033115118741989136, 0.08162985742092133, 0.20714764297008514, -0.35936784744262695, -0.11036065220832825, -0.060454949736595154, -0.28755587339401245, -0.0625273808836937, 0.10392329841852188, -0.05776241794228554, 0.10732799768447876, 0.1001201868057251, 0.4928816258907318, -0.15634995698928833, -0.14844699203968048, 0.15917125344276428, 0.09238581359386444, 0.24776780605316162, -0.06348268687725067, 0.05853689834475517, 0.3085440695285797, 0.15558813512325287, -0.13551978766918182, -0.07256823778152466, 0.06263837218284607, -0.11860235035419464, 0.11998981237411499, 0.03354736417531967, 0.11378153413534164, -0.042479582130908966, -0.3850826323032379, 0.033927083015441895, -0.09844827651977539, -0.13207650184631348, -0.03466043993830681, 0.4294475018978119, -0.1359887272119522, 0.08936906605958939, -0.08219359070062637, 0.1979060024023056, -0.19537973403930664, -0.22494515776634216, -0.2917031943798065, 0.1294819414615631, -0.14202088117599487, 0.010318245738744736, -0.029762282967567444, 0.16966655850410461, 0.3832353949546814, 0.09637348353862762, -0.18707746267318726, -0.21363946795463562, 0.026696518063545227, -0.03791246563196182, -0.1285126656293869, 0.28680428862571716, 0.1825578808784485, 0.07108158618211746, 0.00784253515303135, 0.04290451109409332, -0.02407868206501007, 0.3534710109233856, -0.5365661382675171, -0.428591787815094, 0.275998592376709, 0.24430347979068756, -0.19886335730552673, -0.25274088978767395, -0.11459121108055115, 0.0843098908662796, 0.08075769245624542, -0.12293501198291779, 0.0072889067232608795, -0.07276468724012375, -0.4736271798610687, -0.3172979950904846, 0.1964741349220276, 0.5533018708229065, -0.6585522890090942, 0.010075248777866364, -0.4394361674785614, 0.06221623346209526, 0.1761791706085205, 0.2090986669063568, -0.3414071798324585, 0.5566363334655762, -0.3785400390625, 0.032464399933815, 0.37651336193084717, -0.295299768447876, -0.3227798640727997, 0.0998961552977562, -0.30445796251296997, 0.25406092405319214, 0.32755008339881897, 0.06540647149085999, 0.20802077651023865, -0.2674412429332733, 0.32732126116752625, 0.2102491557598114, -0.014076583087444305, -0.0976814478635788, -0.17847678065299988, -0.23815371096134186, 0.1296200305223465, 0.010666392743587494, 0.06841494888067245, 0.13954269886016846, 0.35415413975715637, -0.46772652864456177, 0.20981349050998688, -0.1194133460521698, -0.06882248818874359, 0.258518248796463, 0.010651178658008575, 0.2603989243507385, -0.14388041198253632, 0.10232186317443848, -0.38300368189811707, 0.3976292908191681, -0.2568368911743164, -0.12254153192043304, 0.1633179783821106, -0.08717811107635498, -0.345538467168808, -0.1101825088262558, -0.3046739399433136, -0.3369441330432892, 0.06778270751237869, 0.2269960343837738, -0.08427825570106506, 0.05713104456663132, -0.07318983972072601, 0.28166013956069946, -0.16400423645973206, -0.04451794549822807, -0.4597465991973877, 0.21728277206420898, 0.0002842601388692856, 0.017895814031362534, -0.025971557945013046, 0.14356045424938202, 0.18229053914546967, -0.09015083312988281, -0.09822826087474823, 0.4162835478782654, 0.010358165949583054, 0.17929548025131226, -0.2548639178276062, 0.18493252992630005, 0.19230665266513824, -0.28885000944137573, 0.10104835033416748, 0.04394632205367088, 0.36116814613342285, -0.05379004403948784, -0.010228095576167107, 0.5960966348648071, -0.15952014923095703, 0.13085779547691345, 0.11061616241931915, -0.3469386100769043, 0.10459688305854797, -0.15121860802173615, 0.007370665669441223, -0.012189559638500214, 0.02674625813961029, 0.14835985004901886, 0.409123957157135, 0.2870226800441742, -0.1881789267063141, 0.05905372276902199, 0.33398303389549255, -0.10773073881864548, -0.08512718975543976, 0.09677974134683609, -0.2201378494501114, -0.06821176409721375, -0.13443341851234436, 0.49342671036720276, 0.5548515915870667, 0.3373495936393738, -0.06165698170661926, -0.002229182980954647, -0.019397303462028503, -0.30748462677001953, 0.19732436537742615, -0.062428511679172516, 0.49105575680732727, 0.23354469239711761, 0.13267256319522858, 0.1270666867494583, -0.06561942398548126, -0.195590078830719, 0.04527575522661209, -0.14182989299297333, -0.4020652770996094, 0.19090880453586578, -0.32261085510253906, -0.07535555213689804, -0.20515966415405273, -0.03174001723527908, 0.14912612736225128, 0.005697488784790039, -0.16496646404266357, 0.05536853149533272, -0.25479909777641296, 0.10742942988872528, -0.1620020866394043, 0.1560731679201126, -0.03832145780324936, -0.05957018584012985, -0.007509760558605194, 0.0442507378757, -0.29457753896713257, -0.01659015193581581, 0.17771703004837036, -0.1139107495546341, 0.19157946109771729, 0.08692619204521179, -0.22337281703948975, -0.09770715981721878, -0.06656777858734131, -0.06543825566768646, 0.1264456957578659, 0.3922382891178131, -0.01239478588104248, 0.006508667021989822, 0.4872382581233978, -0.05561401695013046, 0.1691899448633194, 0.07600067555904388, 0.028662316501140594, -0.036041103303432465, 0.1813630759716034, 0.08763644844293594, -0.10293016582727432, -0.377299427986145, -0.33386558294296265, -0.34163016080856323, -0.13929858803749084, -0.006724320352077484, 0.08248430490493774, 0.18400423228740692, 0.04901007190346718, 0.025308385491371155, 0.26775240898132324, -0.006530068814754486, 0.06205187365412712, -0.043282799422740936, 0.4076399803161621, -0.12172224372625351, -0.31132835149765015, 0.029611721634864807, -0.30013155937194824, -0.04038350656628609, -0.13809187710285187, -0.56102454662323, 0.20217497646808624, -0.39916911721229553, 0.3451019823551178, 0.03480145335197449, 0.09372071921825409, 0.3456442058086395, -0.17426450550556183, -0.047617726027965546, -0.3139951825141907, -0.46458297967910767, 0.20983543992042542, -0.18240229785442352, 0.04932985082268715, 0.2621726393699646, 0.6571826338768005, -0.3138778507709503, 0.5613220930099487, 0.11326879262924194, -0.14786839485168457, 0.35876020789146423, -0.26390984654426575, 0.3683931827545166, -0.32750892639160156, -0.17854662239551544, -0.24281413853168488, 0.016589105129241943, -0.3626997172832489, 0.35445162653923035, -0.22324426472187042, 0.05016959458589554, -0.10374312102794647, -0.22942513227462769, -0.2436809539794922, 0.041531652212142944, 0.04049418121576309, -0.2528522312641144, -0.05332523584365845, 0.15729376673698425, 0.02973499894142151, 0.013948410749435425, 0.07610014081001282, -0.05551386997103691, 0.155827134847641, 0.21352824568748474, -0.1026366800069809, -0.09080401062965393, 0.06802096962928772, -0.23535633087158203, 0.1406174749135971, -0.10306903719902039, 0.27606815099716187, 0.007395364344120026, -0.21304574608802795, -0.0031720660626888275, -0.08297936618328094, 0.8118511438369751, -0.3364067077636719, 0.25840216875076294, -0.026976589113473892, -0.08044806122779846, -0.14321689307689667, -0.31877660751342773, -0.03273347392678261, -0.1136208325624466, 0.14206798374652863, 0.35450494289398193, 0.03260946273803711, -0.08566400408744812, 0.27652910351753235, 0.041398219764232635, -0.25260207056999207, -0.14820080995559692, -0.1904708445072174, -0.20644617080688477, 0.1070355698466301, -0.21809393167495728, -0.09506452083587646, -0.0017265379428863525, -0.2913251221179962, -0.23745891451835632, -0.10609102249145508, -0.2859766483306885, 0.06568239629268646, -0.034658282995224, 0.2834722399711609, 0.014445509761571884, 0.3866453766822815, -0.12700346112251282, 0.2995196580886841, 0.2191217839717865, 0.5244784355163574, -0.0622241273522377, -0.3081781268119812, 0.04130256175994873, 0.0007509514689445496, 0.3595599830150604, 0.3523259162902832, -0.08484005928039551, 0.19048050045967102, 0.11844787746667862, -0.21290136873722076, -0.2456321269273758, -0.13448503613471985, 0.20910075306892395, -0.11978937685489655, -0.15240944921970367, -0.7355701923370361, 0.5882121920585632, 0.10414081811904907, -0.03698105365037918, 0.022756971418857574, -0.33352130651474, -0.3634028732776642, 0.36760082840919495, -0.22048726677894592, 0.6975291967391968, 0.3758203685283661, 0.1922883540391922, 0.14642804861068726, -0.08622530847787857, 0.24237096309661865, -0.3391919732093811, -0.028923142701387405, -0.43728870153427124, -0.26988163590431213, -0.09153532236814499, -0.16637209057807922, 0.0895732194185257, 0.22255165874958038, 0.20901042222976685, 0.3977176249027252, 0.06804826855659485, 0.14294283092021942, 0.01181495189666748, 0.0748567134141922, 0.12607353925704956, -0.11493407189846039, -0.22663408517837524, 0.041276682168245316, 0.28468918800354004, 0.13896818459033966, -0.08071485906839371, -0.23985107243061066, -0.10236234962940216, -0.2249310463666916, -0.15002970397472382, 0.19835969805717468, -0.5394066572189331, 0.12809017300605774, -0.11470207571983337, -0.3571080267429352, 0.15627719461917877, 0.385562539100647, -0.015297707170248032, 0.0009983398485928774, -0.026720454916357994, 0.16255460679531097, 0.1448477804660797, 0.3549506962299347, 0.06666207313537598, -0.07537020742893219, 0.3489742875099182, -0.05217692255973816, -0.2697342336177826, 0.06406852602958679, -0.29128336906433105, -0.11254417151212692, 0.0051711201667785645, 0.23244638741016388, 0.30537036061286926, -0.30760836601257324, -0.5211066007614136, -0.04990863427519798, 0.1466471552848816, -0.18490126729011536, 0.14254909753799438, -0.11076224595308304, -0.10392387211322784, 0.07697229832410812, -0.22297903895378113, -0.4635888636112213, -0.34345391392707825, 0.40394771099090576, 0.15912264585494995, 0.49707603454589844, 0.38689252734184265, -0.051531482487916946, 0.022636540234088898, -0.1997615098953247, 0.40488994121551514, 0.5324603319168091, -0.23765361309051514, 0.2658984661102295, 0.004977907985448837, 0.1430351287126541, 0.015998035669326782, 0.10040737688541412, 0.3465119004249573, -0.1358381062746048, -0.1774400770664215, -0.44066327810287476, -0.05049474537372589, 0.02342631295323372, -0.002286462113261223, 0.14212732017040253, -0.1106942817568779, 0.046441901475191116, -0.19006535410881042, -0.20479737222194672, -0.31768208742141724, -0.024817287921905518, 0.11446183174848557, 0.007670138031244278, 0.14417855441570282, 0.23942649364471436, 0.1994609236717224, 0.11907422542572021, 0.18976826965808868, 0.03560679033398628, -0.14705191552639008, -0.24646928906440735, -0.09441281110048294, 0.13690884411334991, -0.14660559594631195, 0.03697416931390762, -0.032762311398983, -0.1359105259180069, -0.18775534629821777, -0.024675600230693817, 0.2964356243610382, 0.003355152904987335, 0.09344764798879623, 0.1384376883506775, 0.05789164453744888, 0.12008203566074371, -0.39856046438217163, 0.30657443404197693, -0.2521214485168457, 0.3606066107749939, 0.07353612035512924, -0.012773646041750908, -0.14185896515846252, 0.0415988564491272, -0.3733763098716736, -0.3464741110801697, -0.07542526721954346, 0.30155450105667114, 0.2577868103981018, -0.2860721945762634, 0.02787228673696518, 0.25119346380233765, 0.2553443908691406, 0.32288414239883423, -0.33415889739990234, -0.08704246580600739, 0.04410094767808914, 0.2280668467283249, -0.3394591808319092, 0.1338851898908615, -0.0922662541270256, -0.1340208500623703, 0.1228049099445343, 0.3712170720100403, 0.18848387897014618, 0.06637971103191376, -0.2469310313463211, 0.1653079390525818, 0.2649100422859192, 0.07630136609077454, 0.4274981915950775, 0.38774579763412476, 0.198288232088089, 0.3525322675704956, 0.2663693130016327, 0.1464744508266449, 0.1757066696882248, 0.7052750587463379, 0.17890191078186035, 0.27526092529296875, 0.21567341685295105, 0.02473294921219349, -0.1723507046699524, -0.7218681573867798, 0.4934205412864685, 0.3673405051231384, -0.2726749777793884, -0.023596029728651047, 0.01145264320075512, 0.18187393248081207, -0.3890082836151123, 0.21335643529891968, -0.3614322543144226, -0.17319147288799286, -0.14390292763710022, -0.15672487020492554, 0.044616520404815674, -0.31345707178115845, 0.04984225332736969, 0.1079154759645462, 0.029100552201271057, 0.25252217054367065, -0.1345180720090866, -0.03511939197778702, -0.37596026062965393, 0.06221789866685867, 0.07814735919237137, 0.08824946731328964, 0.0793490782380104, -0.19076821208000183, 0.37634769082069397, 0.1332225352525711, -0.052020616829395294, 0.1334536373615265, 0.27430254220962524, 0.4064968526363373, 0.4558243155479431, 0.26607149839401245, -0.2563193440437317, 0.347944438457489, -0.24790091812610626, 0.04732000082731247, 0.07414910942316055, -0.05525996536016464, 0.10033215582370758, 0.10991238802671432, 0.20900501310825348, -0.21092894673347473, 0.3420419692993164, 0.3294467031955719, 0.053633395582437515, -0.5462547540664673, 0.22532908618450165, -0.1721363067626953, -0.07956599444150925, -0.22204750776290894, 0.15781790018081665, -0.3659769594669342, -0.10752682387828827, 0.46491101384162903, 0.007289271801710129, 0.23842087388038635, 0.1601095348596573, 0.06566759198904037, -0.19068540632724762, 0.3433632254600525, 0.20025566220283508, -0.432585746049881, -0.3450177013874054, 0.1740196943283081, -0.533574104309082, 0.12250527739524841, -0.14465485513210297, -0.06274665892124176, -0.13298563659191132, 0.10605590790510178, -0.16562485694885254, -0.15047630667686462, 0.3396211564540863, -0.1225234717130661, 0.041958849877119064, 0.3766052722930908, -0.29295870661735535, -0.3072912395000458, -0.3650451898574829, 0.21839766204357147, -0.14468494057655334, -0.43968653678894043, -0.01280445046722889, -0.13304786384105682, 0.03819328546524048, 0.06336519122123718, -0.07691828161478043, 0.29362863302230835, -0.06060664728283882, 0.6280603408813477, 0.04053136706352234, 0.5965129137039185, -0.3108798563480377, 0.053260438144207, -0.2605341076850891, -0.17087042331695557, -0.2038997858762741, 0.12123756855726242, 0.07178780436515808, 0.2399187833070755, -0.209109827876091, -0.18699069321155548, -0.27114608883857727, 0.05635697767138481, 0.09326358884572983, -0.19308634102344513, 0.024594858288764954, 0.16884487867355347, -0.21510738134384155, -0.00045718252658843994, 0.4277231991291046, 0.25954535603523254, 0.014165718108415604, 0.038194864988327026, -0.04867314547300339, -0.2792985439300537, 0.3844200372695923, -0.28595995903015137, -0.09206099063158035, -0.15098939836025238, 0.2756226658821106, -0.24514707922935486, 0.014923522248864174, -0.012641668319702148, -0.012026920914649963, 0.4227316677570343, -0.00994310062378645, -0.14786799252033234, 0.2709681987762451, -0.10786223411560059, 0.048458412289619446, 0.04828590154647827, 0.12674932181835175, 0.11109934747219086, -0.33650702238082886, 0.13890773057937622, -0.2665190100669861 ]
https://github.com/huggingface/datasets/issues/5834
Hi ! The numpy formatting detaults to int64 and float32 - but you can use uint8 using ```python ds = ds.with_format("numpy", dtype=np.uint8) ```
Is uint8 supported?
### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
23
Is uint8 supported? ### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Hi ! The numpy formatting detaults to int64 and float32 - but you can use uint8 using ```python ds = ds.with_format("numpy", dtype=np.uint8) ```
[ -0.0773063451051712, -0.37703418731689453, 0.007305428385734558, 0.2908572554588318, 0.5897737145423889, -0.02267012745141983, 0.5053195953369141, 0.2177438735961914, 0.016887344419956207, -0.12525634467601776, -0.2633092701435089, 0.10247842967510223, 0.05486701801419258, 0.0042044371366500854, -0.007235892117023468, 0.11060783267021179, 0.3330041766166687, 0.09610352665185928, 0.14332613348960876, -0.052469827234745026, -0.19488021731376648, 0.02123825065791607, -0.2496800422668457, 0.040884993970394135, -0.4746001958847046, -0.006986103020608425, -0.04463912174105644, 0.18564267456531525, -0.30465590953826904, -0.4016098380088806, 0.588899552822113, 0.18841832876205444, 0.3328055739402771, 0.5645982623100281, -0.0001281598670175299, -0.010259047150611877, 0.269725501537323, -0.0923648476600647, -0.041233740746974945, -0.014734983444213867, 0.0017585530877113342, -0.255817711353302, -0.028666118159890175, -0.24115769565105438, -0.026597991585731506, -0.2988682687282562, -0.1883571594953537, -0.03498372435569763, 0.05404021590948105, 0.005173545330762863, 0.1104794517159462, 0.5177201628684998, 0.3498503267765045, 0.23209799826145172, -0.08900494873523712, 0.44873157143592834, -0.23538348078727722, 0.4667142629623413, 0.2409176230430603, 0.2418246567249298, 0.1982024610042572, -0.04888579994440079, -0.08691573888063431, -0.1409902274608612, 0.08890540897846222, 0.306280255317688, -0.05311177298426628, -0.0062178075313568115, -0.16796641051769257, 0.2094654142856598, 0.10381437838077545, -0.14431610703468323, -0.4964292347431183, -0.2066493034362793, -0.2226327657699585, -0.4118337631225586, 0.18746644258499146, 0.04294119030237198, 0.050397224724292755, 0.11757378280162811, -0.04218868538737297, -0.09617218375205994, -0.3107575476169586, 0.3896673321723938, -0.1841057389974594, 0.28069818019866943, -0.2500704824924469, 0.1695147305727005, -0.07439206540584564, -0.3316768407821655, -0.18926165997982025, -0.03140464425086975, 0.20899598300457, 0.01341826468706131, -0.11480756103992462, -0.22416925430297852, -0.28956282138824463, 0.09243544936180115, 0.24369566142559052, -0.4302747845649719, 0.025788933038711548, 0.15246376395225525, -0.6095144748687744, 0.10203585028648376, 0.5263699889183044, 0.11121444404125214, -0.1800093650817871, 0.08049154281616211, 0.4457448124885559, 0.21153044700622559, 0.3227677345275879, -0.1640874296426773, 0.07933962345123291, 0.12995415925979614, 0.01684512197971344, -0.18114528059959412, 0.3897317051887512, -0.11395549774169922, -0.20114779472351074, -0.02062332071363926, 0.10294561088085175, 0.2411469966173172, 0.29382094740867615, 0.22235915064811707, -0.13184496760368347, 0.48644790053367615, -0.10679198056459427, 0.38631343841552734, -0.20029926300048828, 0.07940833270549774, -0.04551640897989273, 0.01113751158118248, 0.0814984142780304, -0.41184210777282715, 0.11232203245162964, -0.42424437403678894, -0.025753742083907127, 0.35668468475341797, 0.3327378034591675, 0.024631664156913757, -0.3635689318180084, 0.0018655620515346527, 0.3497700095176697, 0.21573278307914734, -0.18219856917858124, 0.32652992010116577, 0.0026315534487366676, -0.34373098611831665, -0.14764969050884247, 0.11656412482261658, -0.34308645129203796, -0.08575736731290817, -0.30516090989112854, -0.04231143742799759, -0.14646264910697937, -0.0822870284318924, 0.01998969539999962, -0.07863497734069824, 0.026786036789417267, -0.09867444634437561, 0.27149853110313416, -0.19804906845092773, 0.14588704705238342, -0.4020822048187256, 0.224323570728302, -0.009411051869392395, 0.0006052181124687195, -0.0004189610481262207, 0.06451556086540222, 0.1272374391555786, 0.04901748150587082, 0.33354753255844116, 0.18768629431724548, -0.3522922396659851, -0.26120075583457947, 0.39217132329940796, 0.24173571169376373, -0.5522275567054749, -0.4274527430534363, -0.17687872052192688, 0.1827859878540039, -0.00124388188123703, -0.2966388165950775, 0.3903413414955139, -0.0012098997831344604, -0.038090791553258896, 0.14313167333602905, 0.38383913040161133, -0.05517420172691345, 0.18590888381004333, -0.29196587204933167, -0.30185335874557495, 0.09197962284088135, 0.3290139138698578, -0.14084023237228394, -0.082884281873703, 0.18302030861377716, 0.197889506816864, 0.2112707793712616, -0.10200881212949753, 0.03915111720561981, -0.027529217302799225, 0.4539334177970886, 0.13118216395378113, 0.07533720135688782, -0.23944397270679474, -0.3982037603855133, 0.15971092879772186, 0.38285306096076965, -0.1709050089120865, -0.0072874464094638824, -0.1929159313440323, -0.14074555039405823, 0.11469342559576035, -0.10376803576946259, 0.08581152558326721, -0.005624089390039444, -0.12642639875411987, -0.11229810118675232, 0.043086789548397064, -0.3591681122779846, 0.25869593024253845, 0.02385738492012024, 0.3039676249027252, -0.3983882963657379, 0.4389258623123169, 0.04030098021030426, -0.3367127478122711, -0.02109730988740921, 0.4149257242679596, 0.1318211555480957, -0.24679416418075562, 0.018422238528728485, 0.36507272720336914, -0.05674535408616066, 0.2981007397174835, -0.08879762887954712, 0.39382994174957275, 0.588967502117157, -0.02145252376794815, 0.08757422119379044, 0.1377546191215515, 0.11374995112419128, 0.06499473005533218, -0.13867688179016113, 0.7829520106315613, -0.3585667014122009, -0.1591922640800476, -0.09313196688890457, 0.2268659472465515, 0.18346238136291504, 0.25933974981307983, -0.19187968969345093, -0.3117856979370117, 0.08373841643333435, 0.12842190265655518, 0.14521905779838562, -0.21119560301303864, -0.25515541434288025, 0.10957899689674377, 0.5201345682144165, -0.06611783057451248, 0.4668436646461487, 0.12545178830623627, -0.23601868748664856, 0.08667796850204468, 0.0780494436621666, -0.42754262685775757, 0.29057779908180237, -0.1120963990688324, 0.01618165895342827, -0.015814563259482384, -0.0854460820555687, -0.1934053897857666, 0.13818319141864777, 0.039171043783426285, -0.18705053627490997, -0.08831742405891418, 0.33488765358924866, -0.1372482180595398, -0.3648908734321594, 0.22982224822044373, -0.21993936598300934, 0.004338154569268227, -0.32065659761428833, 0.21367377042770386, -0.3470044434070587, 0.08705827593803406, 0.005820043385028839, -0.6701070070266724, -0.3586927354335785, -0.2024371176958084, -0.2239067554473877, 0.47634443640708923, 0.0057042911648750305, -0.025014426559209824, 0.16081932187080383, 0.3690049350261688, 0.2448546290397644, 0.01576351933181286, -0.15065905451774597, 0.110091432929039, -0.12007257342338562, -0.07096374779939651, -0.005996447056531906, -0.10278783738613129, 0.23703356087207794, 0.21861395239830017, 0.07315844297409058, -0.21513837575912476, -0.41839799284935, 0.0965624749660492, -0.28127652406692505, 0.5335307121276855, 0.17458981275558472, 0.2302524894475937, -0.2134718894958496, 0.34568578004837036, 0.40861693024635315, -0.20186291635036469, -0.07425004988908768, 0.24543985724449158, 0.012510690838098526, 0.07977664470672607, -0.16381442546844482, 0.2890978157520294, -0.28861743211746216, -0.19557052850723267, 0.4120956063270569, 0.09851258993148804, 0.010880188085138798, 0.013932596892118454, 0.008534606546163559, -0.013305574655532837, 0.005203042179346085, -0.2291419506072998, -0.32733988761901855, -0.3606939911842346, 0.6290361881256104, -0.1038685142993927, -0.3276951014995575, -0.05458615720272064, 0.019347622990608215, -0.14932586252689362, -0.04838472604751587, -0.10570498555898666, -0.3307797312736511, -0.21911664307117462, 0.5516924858093262, 0.26492735743522644, 0.1365557312965393, 0.3317752182483673, -0.4221072196960449, 0.15842542052268982, -0.2007465362548828, 0.002838246524333954, -0.07681801915168762, 0.5591503977775574, -0.1041492149233818, 0.34728553891181946, -0.034955933690071106, 0.05921226739883423, 0.16026295721530914, 0.5015661120414734, -0.20513604581356049, 0.428629606962204, -0.029185818508267403, 0.4468455910682678, -0.16593626141548157, -0.34024593234062195, 0.03103002905845642, 0.16363713145256042, 0.0798964723944664, 0.21289630234241486, 0.25153762102127075, 0.29927271604537964, -0.0969328060746193, -0.24972626566886902, -0.13423427939414978, -0.2849317193031311, 0.25541651248931885, 0.20906174182891846, 0.013187453150749207, -0.1745394766330719, 0.01018456369638443, -0.20208029448986053, -0.41884514689445496, -0.03325194492936134, 0.5131784081459045, -0.013853825628757477, 0.13092643022537231, -0.22090929746627808, -0.4479377865791321, -0.512695848941803, 0.27151989936828613, 0.17531457543373108, 0.6400522589683533, 0.10334418714046478, 0.09700183570384979, 0.12168006598949432, -0.013193124905228615, 0.39510399103164673, -0.24765430390834808, -0.03671334683895111, -0.033637769520282745, -0.16801497340202332, -0.5443939566612244, -0.0334063321352005, -0.20999109745025635, 0.11389118432998657, 0.04547625035047531, 0.3280990719795227, -0.2661559581756592, -0.17415735125541687, 0.012543611228466034, -0.06846534460783005, -0.1517648845911026, -0.04316215589642525, -0.333537220954895, -0.18229582905769348, -0.14265185594558716, -0.042969852685928345, 0.17984119057655334, 0.10612691938877106, -0.1099560335278511, -0.2369866967201233, -0.31269675493240356, -0.3142170011997223, 0.06611139327287674, -0.04808664694428444, 0.4021012485027313, -0.07464917004108429, -0.15945613384246826, 0.34301725029945374, -0.07620573788881302, -0.1979929655790329, 0.33875733613967896, 0.4599836766719818, -0.27529165148735046, 0.016580909490585327, -0.17299814522266388, 0.07045731693506241, 0.35419952869415283, -0.020751552656292915, 0.11058267205953598, 0.029805507510900497, 0.14060242474079132, -0.7334198355674744, -0.1814684420824051, 0.36671727895736694, 0.15459801256656647, -0.23401883244514465, 0.15779411792755127, 0.5767187476158142, -0.1357533037662506, 0.11887072026729584, 0.4399758577346802, 0.5034082531929016, -0.268149197101593, 0.21194428205490112, 0.26746779680252075, 0.97477126121521, 0.1325092315673828, 0.3201274871826172, 0.4775198996067047, -0.04272683337330818, 0.5784785151481628, 0.05839298665523529, 0.010432656854391098, -0.5030317306518555, 0.01647469773888588, -0.15062564611434937, -0.1567513644695282, 0.11517578363418579, -0.31740444898605347, -0.3027864694595337, 0.0026578418910503387, -0.2852335274219513, 0.5508025884628296, -0.21498547494411469, 0.05658562481403351, -0.2662631869316101, -0.24687297642230988, -0.407651424407959, 0.012907709926366806, -0.0795440524816513, 0.17553618550300598, -0.20305940508842468, -0.04955799877643585, -0.22526827454566956, -0.1909831464290619, -0.5833575129508972, -0.37476646900177, 0.29873865842819214, 0.23189690709114075, 0.20974406599998474, -0.1479436159133911, -0.18719376623630524, 0.03270098194479942, 0.997427225112915, -0.15564018487930298, -0.4157043993473053, -0.08519837260246277, -0.1645468920469284, -0.048859529197216034, 0.15801681578159332, -0.07866086810827255, 0.1692725121974945, 0.04291307181119919, -0.21069523692131042, -0.0769653171300888, 0.1746377944946289, -0.340925395488739, -0.31639695167541504, 0.03079162910580635, -0.14992506802082062, -0.39363986253738403, -0.005430120974779129, -0.30610519647598267, 0.07367970049381256, -0.060804639011621475, 0.0029628309421241283, 0.34692439436912537, 0.2631787359714508, 0.17124129831790924, 0.35886672139167786, 0.0816132128238678, -0.1523720920085907, 0.10498057305812836, 0.12862935662269592, -0.15225499868392944, 0.10663983225822449, 0.0932624563574791, -0.30289363861083984, -0.02971848100423813, 0.3205943703651428, 0.13450375199317932, -0.3371344804763794, 0.11685207486152649, -0.20161227881908417, -0.07518844306468964, -0.3101259171962738, 0.005929701030254364, 0.1154727190732956, -0.09133915603160858, -0.2866981029510498, -0.5892151594161987, -0.1840914636850357, 0.29292500019073486, -0.12116484344005585, 0.18337196111679077, -0.10735949128866196, -0.1568157821893692, -0.005196705460548401, -0.2937783896923065, -0.1578064262866974, 0.14307457208633423, -0.04635263979434967, 0.016266100108623505, -0.03481823951005936, -0.07428443431854248, 0.18639323115348816, -0.28543326258659363, -0.005336228758096695, 0.14540785551071167, -0.30303579568862915, -0.012106481939554214, -0.272146999835968, 0.23345685005187988, 0.13193990290164948, -0.35788124799728394, -0.014320511370897293, -0.1917279213666916, -0.14623281359672546, -0.2161213904619217, 0.10534477233886719, 0.1328039914369583, 0.14082127809524536, 0.12982970476150513, 0.22948503494262695, 0.23716780543327332, 0.029030174016952515, 0.19280987977981567, 0.3298019766807556, 0.48370566964149475, 0.029240287840366364, 0.049451615661382675, -0.12623754143714905, -0.035975269973278046, -0.06367600709199905, 0.31215032935142517, 0.0764322355389595, 0.02053925022482872, 0.423093318939209, -0.21800246834754944, 0.17871136963367462, 0.002294231206178665, 0.2967456579208374, 0.3370853364467621, -0.3133387863636017, 0.14447146654129028, 0.004092443734407425, 0.037979256361722946, 0.03692799061536789, -0.2048875093460083, 0.07514593750238419, 0.20637430250644684, -0.06428679823875427, 0.393169641494751, 0.21655026078224182, 0.199984610080719, 0.028761550784111023, -0.0019286833703517914, 0.20033925771713257, -0.0785345807671547, 0.031714532524347305, 0.17633271217346191, -0.08791307359933853, -0.045636046677827835, 0.1665058135986328, -0.0214562825858593, 0.05052552372217178, 0.5986394882202148, -0.15162751078605652, 0.08061716705560684, 0.18887649476528168, -0.11442214250564575, 0.3039955794811249, -0.048965081572532654, -0.09642200171947479, 0.19334836304187775, -0.11800023913383484, 0.28530067205429077, 0.25656887888908386, 0.5278357863426208, -0.507323682308197, -0.08379010856151581, -0.5195045471191406, -0.046863142400979996, -0.40245094895362854, 0.03780020400881767, -0.14386267960071564, -0.07768571376800537, -0.2664167881011963, -0.03204973414540291, -0.4448806047439575, -0.1775379180908203, 0.15625624358654022, 0.22697719931602478, 0.09810183942317963, -0.4835613965988159, 0.2827644944190979, 0.19606821238994598, 0.20363068580627441, -0.044787053018808365, 0.1685630828142166, 0.3989727795124054, 0.13281439244747162, 0.013834377750754356, 0.47891107201576233, 0.41464734077453613, 0.05903715267777443, -0.19807718694210052, 0.33051425218582153, -0.10892172157764435, -0.158971905708313, 0.16194094717502594, -0.028703104704618454, 0.06861011683940887, 0.06332120299339294, 0.08365102857351303, 0.13594380021095276, 0.0472148135304451, -0.10004496574401855, -0.11572501063346863, 0.17086941003799438, -0.31814712285995483, 0.3327820897102356, -0.2834361493587494, 0.005415171384811401, 0.032130006700754166, -0.2486450970172882, -0.23597043752670288, 0.10244502872228622, 0.2239265739917755, -0.05867847055196762, 0.16398896276950836, -0.04917557165026665, -0.03183210641145706, -0.08483462035655975, 0.37085482478141785, 0.12640073895454407, -0.1122024804353714, 0.10225488245487213, -0.17767633497714996, -0.5333406329154968, 0.15893591940402985, 0.21379217505455017, -0.06338459998369217, 0.1993538737297058, 0.07429630309343338, 0.16423961520195007, 0.2499857246875763, 0.2840159833431244, -0.22876183688640594, 0.16512784361839294, 0.16313855350017548, -0.13556374609470367, -0.05168047174811363, 0.1487608700990677, -0.08612054586410522, -0.21215438842773438, -0.13454633951187134, 0.6068980693817139, -0.1109527200460434, -0.12310739606618881, -0.09086237847805023, 0.24549975991249084, -0.3047918677330017, -0.18082238733768463, 0.2730693817138672, 0.3730143904685974, -0.11341860890388489, -0.05789140611886978, -0.14612576365470886, -0.3557194471359253, -0.17338675260543823, -0.12047496438026428, 0.23139521479606628, -0.33239006996154785, 0.6935158967971802, -0.2515108585357666, -0.24739132821559906, -0.20568996667861938, -0.05615490302443504, -0.10926009714603424, -0.1655098795890808, 0.0023336708545684814, 0.34725433588027954, -0.2595508098602295, 0.007080152630805969, 0.11394597589969635, 0.3317742645740509, 0.11624220013618469, 0.12245263159275055, -0.1371036320924759, -0.40492910146713257, 0.3829362988471985, -0.15103447437286377, -0.2334836721420288, -0.05408911779522896, 0.044242825359106064, 0.4609953761100769, -0.10808975249528885, -0.5416635870933533, 0.04975719749927521, 0.15230640769004822, -0.09710167348384857, -0.25261759757995605, 0.2041415572166443, 0.03998921066522598, -0.12983563542366028, -0.19178643822669983, 0.5541352033615112, 0.1781735122203827, -0.1277712732553482, 0.3893723487854004, -0.15485553443431854 ]
https://github.com/huggingface/datasets/issues/5834
Thank you! By setting `ds.with_format("numpy", dtype=np.uint8)`, the dataset returns the data in `uint8`. However, `with_format` and `set_format` seem to cast the data on-the-fly. I want to reduce the dataset size by using `uint8` instead of `int64` and I observe no difference between using `int64` and `uint8` for the vector. Is there any way to actually store the data in `uint8` and save the disk space and the downloading time when loaded from the hub?
Is uint8 supported?
### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
74
Is uint8 supported? ### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Thank you! By setting `ds.with_format("numpy", dtype=np.uint8)`, the dataset returns the data in `uint8`. However, `with_format` and `set_format` seem to cast the data on-the-fly. I want to reduce the dataset size by using `uint8` instead of `int64` and I observe no difference between using `int64` and `uint8` for the vector. Is there any way to actually store the data in `uint8` and save the disk space and the downloading time when loaded from the hub?
[ -0.07757597416639328, -0.31044113636016846, 0.009639076888561249, 0.3099156618118286, 0.6234179735183716, -0.06039707362651825, 0.44952890276908875, 0.24180036783218384, -0.0026682615280151367, -0.12752535939216614, -0.2918073534965515, 0.16088151931762695, -0.007652686908841133, 0.030916936695575714, 0.04796798527240753, 0.13349772989749908, 0.3776808977127075, 0.0949685275554657, 0.11135917156934738, -0.021021127700805664, -0.15441063046455383, 0.04098816215991974, -0.18748044967651367, 0.0000013560056686401367, -0.4244404137134552, -0.06442613899707794, -0.036687690764665604, 0.15856492519378662, -0.32709383964538574, -0.43067246675491333, 0.5655120015144348, 0.16248784959316254, 0.37573912739753723, 0.5777611136436462, -0.00012767058797180653, 0.0036412328481674194, 0.23956787586212158, -0.12333729863166809, -0.09479591995477676, 0.062436092644929886, -0.006063938140869141, -0.2665322422981262, -0.00913861021399498, -0.29769933223724365, 0.0245383158326149, -0.34230780601501465, -0.20037488639354706, -0.028969570994377136, 0.034105703234672546, 0.011417660862207413, 0.10580428689718246, 0.544148862361908, 0.24452577531337738, 0.25874051451683044, -0.1280602216720581, 0.5105143785476685, -0.2660304307937622, 0.4552304148674011, 0.20712009072303772, 0.3631150722503662, 0.15990319848060608, -0.015000037848949432, -0.1402813345193863, -0.1341383159160614, 0.1169871985912323, 0.2707922160625458, -0.056866277009248734, 0.009614584967494011, -0.11354370415210724, 0.1991492658853531, 0.2258206009864807, -0.24835561215877533, -0.5530493855476379, -0.2194090634584427, -0.19103512167930603, -0.3669224977493286, 0.2599928379058838, 0.015177533030509949, 0.05015922710299492, 0.11359024792909622, -0.15013161301612854, -0.1397131234407425, -0.2742447257041931, 0.3363024890422821, -0.1941528171300888, 0.18280141055583954, -0.24149104952812195, 0.12651783227920532, -0.07067424058914185, -0.3232988119125366, -0.18639329075813293, -0.1030956357717514, 0.24955584108829498, -0.0075483135879039764, -0.12758325040340424, -0.23977477848529816, -0.24113322794437408, 0.13664613664150238, 0.2477135807275772, -0.3847580552101135, 0.03596792742609978, 0.1334313154220581, -0.5859795212745667, -0.004381383769214153, 0.5228539705276489, 0.19352619349956512, -0.20137552917003632, 0.00584922730922699, 0.41583162546157837, 0.2137373685836792, 0.3938213586807251, -0.1667717695236206, 0.003309343010187149, 0.18243712186813354, 0.07040302455425262, -0.25850892066955566, 0.42960241436958313, -0.12754987180233002, -0.15369966626167297, -0.019918717443943024, 0.20281583070755005, 0.2342980057001114, 0.2968590259552002, 0.23058180510997772, -0.20211759209632874, 0.5237404108047485, -0.11946455389261246, 0.41253435611724854, -0.25390365719795227, 0.12280979752540588, -0.06394288688898087, -0.00356278195977211, 0.05160006880760193, -0.38527315855026245, 0.10688254237174988, -0.36122024059295654, -0.0035061314702033997, 0.31640946865081787, 0.30474454164505005, 0.03955952823162079, -0.34888482093811035, -0.00663226842880249, 0.2768251299858093, 0.2682057321071625, -0.18535009026527405, 0.36076074838638306, -0.07559452950954437, -0.3259965777397156, -0.19868099689483643, 0.16299182176589966, -0.30834195017814636, -0.13522504270076752, -0.30355873703956604, -0.04465991631150246, -0.24635213613510132, -0.09972058981657028, 0.014235418289899826, -0.08623483777046204, 0.02888907864689827, -0.09073622524738312, 0.21025100350379944, -0.2289392352104187, 0.1556578427553177, -0.4415953457355499, 0.2751414179801941, -0.03623386472463608, -0.08768147975206375, 0.005521565675735474, 0.0451790951192379, 0.10234382748603821, 0.07023583352565765, 0.3376849889755249, 0.19219419360160828, -0.2814956605434418, -0.2147606760263443, 0.3127111792564392, 0.2980431914329529, -0.48075807094573975, -0.4805290699005127, -0.1607799232006073, 0.17536643147468567, 0.0393657460808754, -0.23219862580299377, 0.37058764696121216, -0.014421060681343079, -0.04591905325651169, -0.01787671074271202, 0.3534512519836426, -0.07624164968729019, 0.2126101553440094, -0.27572423219680786, -0.41006535291671753, 0.065549835562706, 0.3300759196281433, -0.10569076985120773, -0.11953400075435638, 0.13973289728164673, 0.2567233443260193, 0.1865009367465973, -0.07624061405658722, 0.09378934651613235, -0.057929810136556625, 0.4634682834148407, 0.09744029492139816, 0.12769503891468048, -0.15236517786979675, -0.46505483984947205, 0.16474449634552002, 0.38754960894584656, -0.2505328059196472, -0.06331159919500351, -0.2208373248577118, -0.1526188850402832, 0.09472975134849548, -0.05524734407663345, 0.1025550365447998, -0.018318984657526016, -0.11592678725719452, -0.000738970935344696, 0.03684910386800766, -0.3711915612220764, 0.15132689476013184, 0.014946945011615753, 0.2513877749443054, -0.41049885749816895, 0.38117849826812744, 0.06558334827423096, -0.3462103307247162, -0.026142440736293793, 0.34261253476142883, -0.007232096046209335, -0.23318353295326233, -0.007333775982260704, 0.33332914113998413, -0.0036640465259552, 0.33191272616386414, -0.07525540888309479, 0.4634861648082733, 0.5807816386222839, 0.018846556544303894, 0.17084559798240662, 0.1345132738351822, 0.1691311001777649, 0.15982672572135925, -0.31887397170066833, 0.6663684844970703, -0.33929726481437683, -0.12107378244400024, -0.10529445111751556, 0.14934468269348145, 0.24976901710033417, 0.24464324116706848, -0.18911540508270264, -0.3018120527267456, 0.016110297292470932, 0.12430046498775482, 0.22832703590393066, -0.15198111534118652, -0.26680055260658264, 0.15953151881694794, 0.5173041224479675, -0.06921616196632385, 0.45870864391326904, 0.20716118812561035, -0.27039581537246704, -0.0055128708481788635, 0.09325454384088516, -0.4096131920814514, 0.33834579586982727, -0.08072791993618011, 0.09272995591163635, -0.09970921277999878, -0.05475921183824539, -0.23171652853488922, 0.17022062838077545, 0.065102219581604, -0.1969204545021057, -0.05580058693885803, 0.30146995186805725, -0.13922962546348572, -0.3584665060043335, 0.22949710488319397, -0.15097633004188538, -0.006846537813544273, -0.32949161529541016, 0.17077362537384033, -0.3701886534690857, 0.11375515908002853, -0.011987915262579918, -0.5588558912277222, -0.31285446882247925, -0.1569250375032425, -0.18873655796051025, 0.44579076766967773, -0.08471144735813141, -0.00458134338259697, 0.1683245599269867, 0.418599933385849, 0.2323751002550125, -0.018395710736513138, -0.11449325829744339, 0.1046377420425415, -0.11133413016796112, -0.055524490773677826, 0.02732875570654869, -0.10297924280166626, 0.2848789691925049, 0.129328191280365, 0.09007702022790909, -0.21584588289260864, -0.3993781805038452, 0.08136789500713348, -0.20660719275474548, 0.5516692399978638, 0.14621642231941223, 0.24163484573364258, -0.20948484539985657, 0.352805495262146, 0.34363850951194763, -0.2379797101020813, -0.10045820474624634, 0.2255435436964035, 0.003544934093952179, 0.1095852330327034, -0.1365876942873001, 0.23173744976520538, -0.29523566365242004, -0.22992795705795288, 0.41190287470817566, 0.07724681496620178, 0.03198308125138283, 0.014809716492891312, 0.0847114622592926, 0.057020530104637146, 0.008677560836076736, -0.19729645550251007, -0.33046048879623413, -0.41113799810409546, 0.6103668212890625, -0.03328543156385422, -0.3199167251586914, -0.03765963017940521, -0.0035412684082984924, -0.10607752203941345, -0.025810305029153824, -0.2195882797241211, -0.2932348847389221, -0.20148544013500214, 0.538969874382019, 0.3182925283908844, 0.15987949073314667, 0.3935573399066925, -0.36243510246276855, 0.16448020935058594, -0.1716940850019455, 0.004159107804298401, -0.0806240439414978, 0.5529077053070068, 0.006818342953920364, 0.3547317385673523, 0.010950345546007156, 0.03838182985782623, 0.20829860866069794, 0.5027524828910828, -0.2032890021800995, 0.36740198731422424, 0.03552251309156418, 0.46024757623672485, -0.21662014722824097, -0.2157323956489563, 0.06183681637048721, 0.1081027016043663, 0.07350660860538483, 0.3288082182407379, 0.26993387937545776, 0.24196955561637878, -0.021733030676841736, -0.23075194656848907, -0.11355079710483551, -0.29009729623794556, 0.3483794331550598, 0.20825031399726868, -0.02451956644654274, -0.1664470136165619, 0.014345481991767883, -0.2211044430732727, -0.38457638025283813, -0.06152317300438881, 0.5104976892471313, -0.011854387819766998, 0.18286845088005066, -0.26332786679267883, -0.4203546345233917, -0.6139140725135803, 0.25617653131484985, 0.16770507395267487, 0.5937007069587708, 0.12036953121423721, 0.055002763867378235, 0.1461942046880722, -0.04611986503005028, 0.3777194619178772, -0.20243795216083527, -0.10154235363006592, -0.02018504962325096, -0.1890062689781189, -0.5485392808914185, -0.010295815765857697, -0.2144310176372528, 0.03865065053105354, -0.028513221070170403, 0.376007080078125, -0.2965402901172638, -0.1837833821773529, -0.03913653641939163, 0.05959918722510338, -0.14979669451713562, -0.0776665210723877, -0.3016764521598816, -0.23003670573234558, -0.2087095081806183, 0.021335290744900703, 0.11000552773475647, 0.058280281722545624, -0.09812331199645996, -0.21806007623672485, -0.28686463832855225, -0.27238184213638306, 0.05841701477766037, -0.057184912264347076, 0.4532626271247864, -0.021166706457734108, -0.07212799787521362, 0.37373656034469604, -0.10708089917898178, -0.1868620365858078, 0.3938230276107788, 0.4147340953350067, -0.26374122500419617, 0.0962216928601265, -0.08327838033437729, 0.036184150725603104, 0.38127318024635315, -0.03340308740735054, 0.0338430181145668, 0.03769230842590332, 0.13161978125572205, -0.7620731592178345, -0.12911349534988403, 0.3238551616668701, 0.14580099284648895, -0.21480485796928406, 0.042858123779296875, 0.5587706565856934, -0.11558425426483154, 0.09743717312812805, 0.42319709062576294, 0.4933779537677765, -0.27416926622390747, 0.26920825242996216, 0.35543951392173767, 0.9884189367294312, 0.1058538407087326, 0.38280463218688965, 0.5162417888641357, -0.048948656767606735, 0.5952138304710388, 0.004636488854885101, -0.020311489701271057, -0.398174911737442, 0.043493982404470444, -0.11944332718849182, -0.1322869509458542, 0.10378766804933548, -0.2606699764728546, -0.29788583517074585, -0.03284474462270737, -0.27836400270462036, 0.522753894329071, -0.22067074477672577, 0.13682639598846436, -0.27160948514938354, -0.31030696630477905, -0.44433876872062683, 0.0033998042345046997, -0.06463903188705444, 0.07423082739114761, -0.14122793078422546, 0.005687106400728226, -0.2352973222732544, -0.16429133713245392, -0.481298565864563, -0.39312487840652466, 0.2942248582839966, 0.2590862810611725, 0.09805642068386078, -0.17506618797779083, -0.17548251152038574, 0.07948920130729675, 0.9579828977584839, -0.09709376096725464, -0.3871140778064728, -0.032413698732852936, -0.16447126865386963, 0.04577776789665222, 0.201727956533432, -0.11897648125886917, 0.22846324741840363, 0.05400550365447998, -0.1402486115694046, -0.16501322388648987, 0.12528203427791595, -0.22364085912704468, -0.25435829162597656, -0.07471384108066559, -0.13611924648284912, -0.4604108929634094, -0.04195648059248924, -0.34293606877326965, 0.07883250713348389, -0.02533077448606491, 0.003805323038250208, 0.3681400716304779, 0.3009381592273712, 0.31182873249053955, 0.33287230134010315, 0.043410688638687134, -0.18439236283302307, 0.10028746724128723, 0.2135097235441208, -0.1328466832637787, 0.1461975872516632, 0.061261340975761414, -0.3206948935985565, -0.03593318536877632, 0.3182998597621918, 0.14150243997573853, -0.41463541984558105, 0.14785251021385193, -0.21581146121025085, -0.12057375907897949, -0.33459338545799255, -0.033460259437561035, 0.13103872537612915, -0.1272827386856079, -0.3048710823059082, -0.5151425004005432, -0.22239379584789276, 0.3988111615180969, -0.05503815412521362, 0.2287694811820984, -0.09465393424034119, -0.19213712215423584, -0.009941138327121735, -0.27468106150627136, -0.15587478876113892, 0.08973490446805954, -0.030290678143501282, 0.030006833374500275, -0.018885737285017967, -0.04108326509594917, 0.1988304704427719, -0.34357336163520813, -0.03293989971280098, 0.10659204423427582, -0.30633091926574707, -0.018443243578076363, -0.3080981969833374, 0.2416679859161377, 0.1067674532532692, -0.3498229384422302, 0.05181778594851494, -0.21163173019886017, -0.1735782027244568, -0.2510424554347992, 0.1334926187992096, 0.12918123602867126, 0.12535178661346436, -0.016720816493034363, 0.2121431976556778, 0.21020126342773438, 0.04610155522823334, 0.27045661211013794, 0.31221017241477966, 0.4553978443145752, 0.018224433064460754, 0.0708901435136795, -0.12187472730875015, -0.04719015955924988, -0.06217341125011444, 0.2897542119026184, 0.1520898938179016, 0.05573652312159538, 0.4155474603176117, -0.1502693146467209, 0.19958233833312988, 0.017646949738264084, 0.271583616733551, 0.38867610692977905, -0.25758713483810425, 0.08748916536569595, 0.07248171418905258, 0.02436513453722, 0.013924039900302887, -0.24005566537380219, 0.02982918918132782, 0.15723590552806854, -0.09045445173978806, 0.39265739917755127, 0.2266412377357483, 0.23653529584407806, 0.022568117827177048, 0.02514789253473282, 0.28169962763786316, -0.035527389496564865, 0.06854121387004852, 0.20913131535053253, -0.13649766147136688, -0.04459406062960625, 0.1623832881450653, 0.025689221918582916, 0.0658881738781929, 0.5702821612358093, -0.23573797941207886, 0.08157985657453537, 0.23223929107189178, 0.00510259298607707, 0.24243062734603882, -0.08961746841669083, -0.12754757702350616, 0.13142675161361694, -0.2254336029291153, 0.293544739484787, 0.27968907356262207, 0.4508598744869232, -0.5131518840789795, -0.07804229110479355, -0.48122382164001465, 0.015200138092041016, -0.367443323135376, 0.017672128975391388, -0.14432042837142944, -0.12422412633895874, -0.2568419575691223, -0.030830036848783493, -0.4882565140724182, -0.23267994821071625, 0.20344439148902893, 0.20030224323272705, 0.11381878703832626, -0.46710821986198425, 0.2748541235923767, 0.10388407111167908, 0.16157199442386627, -0.11574669182300568, 0.2583691477775574, 0.3735041618347168, 0.10860098898410797, -0.009197410196065903, 0.4776208996772766, 0.414720356464386, 0.06811997294425964, -0.15005242824554443, 0.30074918270111084, -0.05338886007666588, -0.13264800608158112, 0.11069968342781067, -0.06377942860126495, 0.10386459529399872, 0.07286309450864792, 0.0889129638671875, 0.1185903251171112, 0.03799497336149216, -0.18302564322948456, -0.11659269779920578, 0.12432324886322021, -0.29459813237190247, 0.3430291712284088, -0.21830108761787415, 0.06982088088989258, 0.06176352500915527, -0.24124686419963837, -0.29552575945854187, 0.09601570665836334, 0.22988614439964294, -0.10368525981903076, 0.1710730940103531, -0.05559823289513588, -0.02525431290268898, -0.08805949985980988, 0.4443047344684601, 0.08856135606765747, -0.20164449512958527, 0.09999769926071167, -0.13539740443229675, -0.5551868081092834, 0.08581387996673584, 0.23105597496032715, -0.0580262616276741, 0.20505228638648987, 0.12838226556777954, 0.14145329594612122, 0.23170988261699677, 0.2338147908449173, -0.1848216950893402, 0.1862494945526123, 0.11656008660793304, -0.1336348056793213, -0.07441863417625427, 0.08212875574827194, 0.004204297438263893, -0.18575513362884521, -0.19909687340259552, 0.6159074306488037, -0.04661557450890541, -0.14935395121574402, -0.062355633825063705, 0.24102477729320526, -0.17192327976226807, -0.20003050565719604, 0.2791319787502289, 0.30159515142440796, -0.07798675447702408, -0.046904247254133224, -0.18423500657081604, -0.3439352214336395, -0.17860688269138336, -0.1670341193675995, 0.2281414419412613, -0.3116510510444641, 0.7022837400436401, -0.3111121654510498, -0.19125866889953613, -0.19913241267204285, -0.08486148715019226, -0.16507171094417572, -0.15121832489967346, 0.023839794099330902, 0.303774356842041, -0.3188742399215698, 0.034471385180950165, 0.15831534564495087, 0.37877121567726135, 0.06789302080869675, 0.08239909261465073, -0.160349503159523, -0.45656272768974304, 0.42448538541793823, -0.14777597784996033, -0.2315298616886139, -0.022706158459186554, 0.014013946056365967, 0.43809041380882263, -0.14440743625164032, -0.5603262782096863, 0.10337576270103455, 0.1390421986579895, -0.10055722296237946, -0.20174509286880493, 0.14474713802337646, 0.0048497505486011505, -0.11571382731199265, -0.2286151647567749, 0.6186149716377258, 0.13638243079185486, -0.1465340554714203, 0.3047086000442505, -0.2166263908147812 ]
https://github.com/huggingface/datasets/issues/5834
If the feature type is `Value("uint8")` then it's written an uint8 on disk using the uint8 Arrow dtype. e.g. ```python ds = Dataset.from_dict({"a": range(10)}, features=Features({"a": Value("uint8")})) ds.data.nbytes # 10 ```
Is uint8 supported?
### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
30
Is uint8 supported? ### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 If the feature type is `Value("uint8")` then it's written an uint8 on disk using the uint8 Arrow dtype. e.g. ```python ds = Dataset.from_dict({"a": range(10)}, features=Features({"a": Value("uint8")})) ds.data.nbytes # 10 ```
[ -0.04128550738096237, -0.408857136964798, 0.0004546605050563812, 0.26819339394569397, 0.5924240946769714, -0.038157060742378235, 0.49679771065711975, 0.20345473289489746, 0.04306764155626297, -0.13159647583961487, -0.25536489486694336, 0.14052356779575348, 0.033094555139541626, 0.036020174622535706, -0.008850250393152237, 0.17080220580101013, 0.32913392782211304, 0.08015099912881851, 0.14009493589401245, -0.09282071888446808, -0.22376175224781036, 0.012759754434227943, -0.20086079835891724, 0.05907173454761505, -0.4731887876987457, -0.03995383903384209, -0.018738318234682083, 0.15043891966342926, -0.2831629812717438, -0.3711397647857666, 0.5625524520874023, 0.1278688609600067, 0.3469863533973694, 0.5512304902076721, -0.00012816110393032432, -0.0036912262439727783, 0.2973049283027649, -0.10028873383998871, -0.0687149316072464, 0.0058794692158699036, 0.02199302613735199, -0.25156909227371216, -0.047004178166389465, -0.2648041248321533, 0.03975694626569748, -0.3238787353038788, -0.18039663136005402, -0.07358953356742859, -0.008645106106996536, -0.0009785816073417664, 0.10833045840263367, 0.5099654197692871, 0.33842653036117554, 0.2545018494129181, -0.06441786885261536, 0.5154216289520264, -0.24795345962047577, 0.42939493060112, 0.19326037168502808, 0.26377737522125244, 0.2040654718875885, -0.0722571313381195, -0.0894804373383522, -0.0818423479795456, 0.115460604429245, 0.31153273582458496, -0.040428295731544495, -0.029164567589759827, -0.13906817138195038, 0.20903053879737854, 0.1294477880001068, -0.11958159506320953, -0.5245051383972168, -0.20831647515296936, -0.21499347686767578, -0.3714717626571655, 0.23544842004776, 0.049339838325977325, 0.03186514973640442, 0.10832436382770538, 0.01106954738497734, -0.11618851125240326, -0.2569137513637543, 0.33673638105392456, -0.20780211687088013, 0.21324226260185242, -0.2624655067920685, 0.1662740707397461, -0.04778708145022392, -0.345075786113739, -0.17669537663459778, -0.01631878688931465, 0.21281078457832336, 0.028469044715166092, -0.0996222198009491, -0.22805067896842957, -0.27633771300315857, 0.05307020992040634, 0.25140756368637085, -0.40917161107063293, 0.03749382495880127, 0.12621228396892548, -0.6680262088775635, 0.09659039229154587, 0.4838760197162628, 0.08700889348983765, -0.20076708495616913, 0.05206315964460373, 0.43250423669815063, 0.18525159358978271, 0.3089824616909027, -0.177508145570755, 0.06861014664173126, 0.13109499216079712, 0.09259948134422302, -0.20293071866035461, 0.4646793603897095, -0.10443983972072601, -0.22731569409370422, -0.016015920788049698, 0.1279926598072052, 0.2504146993160248, 0.2609858512878418, 0.2190799117088318, -0.10874585062265396, 0.4864531457424164, -0.11098088324069977, 0.40185844898223877, -0.19196733832359314, 0.07026194036006927, -0.019351070746779442, -0.043395623564720154, 0.11426928639411926, -0.378001868724823, 0.11909898370504379, -0.3902820348739624, -0.03503847122192383, 0.372600793838501, 0.3047110438346863, -0.008623428642749786, -0.3638397753238678, 0.01122579351067543, 0.3371450901031494, 0.24373900890350342, -0.1813904196023941, 0.34785136580467224, -0.006910837255418301, -0.3254024088382721, -0.18761871755123138, 0.17295658588409424, -0.3545803725719452, -0.10197796672582626, -0.2975744605064392, -0.04890875518321991, -0.14338546991348267, -0.13561338186264038, -0.05899292975664139, -0.06844925880432129, -0.014908235520124435, -0.03860032930970192, 0.27884531021118164, -0.15369898080825806, 0.14459821581840515, -0.406259149312973, 0.19012920558452606, -0.01134924590587616, -0.005188249051570892, 0.009371072053909302, 0.00784611701965332, 0.1484450399875641, 0.0430685430765152, 0.34372836351394653, 0.1888745129108429, -0.3615710139274597, -0.27402791380882263, 0.38731473684310913, 0.2569211721420288, -0.5047580003738403, -0.429776668548584, -0.14710146188735962, 0.1861245483160019, -0.02368776872754097, -0.25364428758621216, 0.3954901695251465, -0.06960733979940414, -0.0355989970266819, 0.1121111810207367, 0.34489843249320984, -0.041574522852897644, 0.21324536204338074, -0.2762370705604553, -0.32743358612060547, 0.14007052779197693, 0.29944172501564026, -0.1496867537498474, -0.0672144889831543, 0.22839117050170898, 0.14738711714744568, 0.19210337102413177, -0.10183136910200119, 0.04348936676979065, -0.03861076757311821, 0.4987969994544983, 0.12771329283714294, 0.07424432039260864, -0.22944781184196472, -0.3840574324131012, 0.18025413155555725, 0.37176063656806946, -0.20592813193798065, -0.012454003095626831, -0.22622418403625488, -0.14345934987068176, 0.15327854454517365, -0.0837131217122078, 0.12285949289798737, -0.008506286889314651, -0.10517072677612305, -0.1623683124780655, 0.05963258445262909, -0.3652621805667877, 0.20143896341323853, 0.03547295182943344, 0.2529297173023224, -0.3728823959827423, 0.4368457496166229, 0.06934837251901627, -0.3206471800804138, -0.05876155197620392, 0.40103405714035034, 0.11283455789089203, -0.204294353723526, 0.0049184709787368774, 0.3312709927558899, -0.058090999722480774, 0.3240174353122711, -0.013106906786561012, 0.43932032585144043, 0.5934041142463684, -0.023933522403240204, 0.10042361170053482, 0.16411089897155762, 0.14822730422019958, 0.08636399358510971, -0.12132959067821503, 0.7510918378829956, -0.3306887745857239, -0.17209172248840332, -0.10537129640579224, 0.2310056984424591, 0.20125561952590942, 0.29245638847351074, -0.22863543033599854, -0.22613009810447693, 0.05550682172179222, 0.1365262120962143, 0.12828600406646729, -0.18303987383842468, -0.2333669364452362, 0.13427312672138214, 0.5222156643867493, -0.09372927993535995, 0.4979671239852905, 0.1693894863128662, -0.23793675005435944, 0.09562374651432037, 0.06247255951166153, -0.40811383724212646, 0.29915398359298706, -0.10957474261522293, 0.05582168325781822, -0.06333601474761963, -0.08823370933532715, -0.15837350487709045, 0.14511063694953918, 0.02720949426293373, -0.1627569943666458, -0.08574040234088898, 0.3391468822956085, -0.14056482911109924, -0.376425564289093, 0.23656293749809265, -0.1856556385755539, -0.00914011336863041, -0.3199925124645233, 0.20882582664489746, -0.33323967456817627, 0.11538664996623993, 0.006394248455762863, -0.6179839968681335, -0.3411245048046112, -0.177716463804245, -0.24326924979686737, 0.4800803065299988, 0.004626139998435974, -0.037116460502147675, 0.13375553488731384, 0.38943320512771606, 0.25582873821258545, 0.025296183302998543, -0.1391274631023407, 0.15347200632095337, -0.11691215634346008, -0.08026771247386932, -0.014083761721849442, -0.07664331048727036, 0.25761157274246216, 0.2489682137966156, 0.08160169422626495, -0.27553698420524597, -0.39957189559936523, 0.05306727811694145, -0.2780553102493286, 0.5339310169219971, 0.139818012714386, 0.1892913281917572, -0.20028901100158691, 0.3560130000114441, 0.4040292501449585, -0.19514203071594238, -0.09926268458366394, 0.23878450691699982, 0.03418640419840813, 0.07591956853866577, -0.13401612639427185, 0.30348193645477295, -0.27990254759788513, -0.20000649988651276, 0.4608350992202759, 0.104649618268013, 0.024873849004507065, 0.03745470196008682, 0.010456737130880356, -0.010331764817237854, 0.07986797392368317, -0.25272464752197266, -0.3496896028518677, -0.31710824370384216, 0.6400181651115417, -0.08225444704294205, -0.3142824172973633, -0.012426815927028656, -0.004930868744850159, -0.16137844324111938, -0.03500889241695404, -0.13958320021629333, -0.3186478912830353, -0.2655189335346222, 0.5901556015014648, 0.23040078580379486, 0.1237635612487793, 0.32188260555267334, -0.396767795085907, 0.15558314323425293, -0.19396120309829712, -0.02426496148109436, -0.05588430166244507, 0.555671215057373, -0.11321790516376495, 0.3401152789592743, -0.040562570095062256, 0.0375407412648201, 0.12471486628055573, 0.4821420907974243, -0.1806628555059433, 0.45665234327316284, -0.04183954745531082, 0.4179203510284424, -0.1881001591682434, -0.32955682277679443, 0.02191746234893799, 0.12642504274845123, 0.02993573248386383, 0.17868439853191376, 0.2192380428314209, 0.2597152590751648, -0.07703922688961029, -0.2580762803554535, -0.10922257602214813, -0.2808161973953247, 0.2733760178089142, 0.13817349076271057, 0.0033554481342434883, -0.2175336629152298, -0.03905021399259567, -0.2495335340499878, -0.37652939558029175, 0.00020961463451385498, 0.4967465102672577, 0.02286137267947197, 0.1523701250553131, -0.2547132968902588, -0.4180547297000885, -0.5266591906547546, 0.23397697508335114, 0.15675762295722961, 0.6284220218658447, 0.09617982804775238, 0.07673819363117218, 0.13187721371650696, -0.01798802614212036, 0.37103042006492615, -0.21078452467918396, 0.013303682208061218, -0.06565161049365997, -0.17403194308280945, -0.5460103154182434, -0.04100960120558739, -0.19327598810195923, 0.1156826764345169, -0.01959056966006756, 0.33777564764022827, -0.2376837134361267, -0.09404237568378448, -0.027508657425642014, -0.06394636631011963, -0.16504928469657898, -0.04035358875989914, -0.3349485397338867, -0.20393985509872437, -0.1421583592891693, -0.060427747666835785, 0.21482616662979126, 0.0907323807477951, -0.12919260561466217, -0.2890152931213379, -0.3656991124153137, -0.31886786222457886, 0.08103323727846146, -0.08252342790365219, 0.4059242308139801, -0.07360199838876724, -0.12625733017921448, 0.3165518045425415, -0.06870707124471664, -0.21693803369998932, 0.3996882736682892, 0.5341277122497559, -0.31376904249191284, 0.02132592350244522, -0.17602692544460297, 0.06801734119653702, 0.32012128829956055, -0.03157816082239151, 0.12065349519252777, 0.05056382715702057, 0.11243672668933868, -0.7760642170906067, -0.18191328644752502, 0.3699856102466583, 0.19470089673995972, -0.18923509120941162, 0.1661888211965561, 0.6283044219017029, -0.16639204323291779, 0.1307290643453598, 0.42604824900627136, 0.5163161158561707, -0.26863256096839905, 0.20941609144210815, 0.30195361375808716, 0.944095253944397, 0.11826924979686737, 0.302445650100708, 0.4907890260219574, 0.004232555627822876, 0.5571346879005432, 0.07289040088653564, -0.024376124143600464, -0.472123384475708, -0.013842916116118431, -0.15095171332359314, -0.15303371846675873, 0.05891207978129387, -0.3300856053829193, -0.2808903455734253, -0.0393008217215538, -0.2623611092567444, 0.5074400305747986, -0.21097064018249512, 0.044655993580818176, -0.30230194330215454, -0.23251426219940186, -0.3481631875038147, 0.00848250463604927, -0.04808662459254265, 0.19155484437942505, -0.16349121928215027, -0.05219365656375885, -0.23644888401031494, -0.17732325196266174, -0.6036751866340637, -0.4131755232810974, 0.2599413990974426, 0.2498682588338852, 0.21930469572544098, -0.1199762225151062, -0.2073102593421936, 0.0017934141214936972, 0.9925527572631836, -0.16098281741142273, -0.4086233079433441, -0.12782146036624908, -0.1370517909526825, -0.043070919811725616, 0.1861453801393509, -0.08140303194522858, 0.14435333013534546, 0.04469019174575806, -0.25485143065452576, -0.07361707836389542, 0.18474268913269043, -0.3535763919353485, -0.2719641327857971, -0.0044858865439891815, -0.20147141814231873, -0.38736119866371155, -0.01774199679493904, -0.3219963312149048, 0.037997111678123474, -0.037848588079214096, -0.0031074080616235733, 0.33736518025398254, 0.2608625888824463, 0.15432226657867432, 0.375197172164917, 0.04263705015182495, -0.1259089857339859, 0.07047748565673828, 0.11132082343101501, -0.08157462626695633, 0.1230117678642273, 0.032907381653785706, -0.29417988657951355, -0.006763920187950134, 0.33726292848587036, 0.11787150800228119, -0.3518739342689514, 0.12274763733148575, -0.23348714411258698, -0.11068081110715866, -0.3190874457359314, 0.030345002189278603, 0.1305251121520996, -0.0815826877951622, -0.3461683392524719, -0.550878643989563, -0.20570337772369385, 0.3094804286956787, -0.14250494539737701, 0.17802339792251587, -0.1557815968990326, -0.1792941689491272, 0.023768439888954163, -0.31594979763031006, -0.14414848387241364, 0.15678727626800537, -0.036792490631341934, -0.000672047957777977, 0.004543326795101166, -0.06962713599205017, 0.1581176370382309, -0.24814459681510925, -0.007408596575260162, 0.11362798511981964, -0.25253617763519287, -0.011326830834150314, -0.26703935861587524, 0.23870864510536194, 0.14812448620796204, -0.3441343307495117, -0.014989804476499557, -0.23467347025871277, -0.15946164727210999, -0.1945635825395584, 0.05427601933479309, 0.14514130353927612, 0.11849269270896912, 0.12944111227989197, 0.23998919129371643, 0.21518856287002563, 0.046643272042274475, 0.2477584183216095, 0.35310274362564087, 0.4554998278617859, -0.012072093784809113, 0.0353207141160965, -0.09815982729196548, -0.008460469543933868, -0.10691797733306885, 0.28178268671035767, 0.022250186651945114, 0.04017544537782669, 0.4133290648460388, -0.2197926789522171, 0.18157291412353516, -0.0002306327223777771, 0.26416534185409546, 0.32974255084991455, -0.30014485120773315, 0.13975533843040466, 0.0029220841825008392, 0.04033315181732178, 0.01099715381860733, -0.22007977962493896, 0.03660570830106735, 0.2145402431488037, -0.06692508608102798, 0.42880693078041077, 0.2374364286661148, 0.21123668551445007, 0.0772637352347374, -0.031217951327562332, 0.15449731051921844, -0.089202880859375, 0.027144212275743484, 0.19459256529808044, -0.10895417630672455, -0.05735621601343155, 0.19987227022647858, -0.019381903111934662, 0.0821639746427536, 0.6214280128479004, -0.16434651613235474, 0.0331234410405159, 0.2508210837841034, -0.10494709014892578, 0.3192075490951538, -0.04939766228199005, -0.1006217673420906, 0.1442459523677826, -0.14029745757579803, 0.29833266139030457, 0.3096146285533905, 0.5113210678100586, -0.49753284454345703, -0.08901762217283249, -0.5348198413848877, -0.08619590848684311, -0.4242221415042877, 0.015000961720943451, -0.10720956325531006, -0.10360825061798096, -0.27577850222587585, -0.03459785506129265, -0.44758743047714233, -0.16234058141708374, 0.17123068869113922, 0.20203553140163422, 0.10116339474916458, -0.46957826614379883, 0.2782967984676361, 0.16934353113174438, 0.20447129011154175, -0.018765129148960114, 0.16987799108028412, 0.3644482493400574, 0.11218549311161041, 0.04867691546678543, 0.5115389227867126, 0.3746788501739502, 0.08890320360660553, -0.2038506418466568, 0.3775671422481537, -0.11165732890367508, -0.1418800950050354, 0.13770604133605957, -0.07282775640487671, 0.06351117789745331, 0.07645018398761749, 0.06890080869197845, 0.1275075078010559, 0.0633992850780487, -0.09074532240629196, -0.164291650056839, 0.1496903896331787, -0.31687161326408386, 0.36206141114234924, -0.26983416080474854, 0.01966056227684021, 0.03619508817791939, -0.2212197184562683, -0.18992865085601807, 0.08173791319131851, 0.24998058378696442, -0.09765471518039703, 0.18054185807704926, -0.026767568662762642, -0.03402814269065857, -0.15547171235084534, 0.352560430765152, 0.14641553163528442, -0.12409086525440216, 0.11847154796123505, -0.10125398635864258, -0.5605367422103882, 0.18723712861537933, 0.23057270050048828, -0.08713427186012268, 0.25087082386016846, 0.0905737578868866, 0.1894858330488205, 0.24612627923488617, 0.316855251789093, -0.27311232686042786, 0.17506247758865356, 0.13657888770103455, -0.13194206357002258, -0.1009804755449295, 0.13205808401107788, -0.05821576341986656, -0.22492855787277222, -0.17528322339057922, 0.6246774792671204, -0.07268574833869934, -0.12033933401107788, -0.06979505717754364, 0.22375038266181946, -0.30752629041671753, -0.15656240284442902, 0.2935970723628998, 0.35372376441955566, -0.1344289481639862, -0.0633215457201004, -0.1369991898536682, -0.36391276121139526, -0.18647818267345428, -0.1421566605567932, 0.20724064111709595, -0.3115605115890503, 0.6775071024894714, -0.26933640241622925, -0.16135773062705994, -0.21692106127738953, -0.07449748367071152, -0.10215742886066437, -0.18104073405265808, -0.008784476667642593, 0.348908931016922, -0.2844183146953583, 0.00939863920211792, 0.11462745070457458, 0.33058977127075195, 0.10585794597864151, 0.11985708028078079, -0.10797249525785446, -0.39019742608070374, 0.3977259397506714, -0.11789929121732712, -0.24184124171733856, -0.01529146358370781, 0.0651678740978241, 0.5263460278511047, -0.10013210773468018, -0.5423429012298584, 0.032963529229164124, 0.1709282100200653, -0.09452126920223236, -0.21231141686439514, 0.13972561061382294, -0.021440979093313217, -0.11830160021781921, -0.18178388476371765, 0.6130573749542236, 0.12417857348918915, -0.07354679703712463, 0.3727823495864868, -0.1747317612171173 ]
https://github.com/huggingface/datasets/issues/5834
Oh, I understand now. The data was stored in `uint8` from the beginning (when the dataset returns `int64`). Thank you for your time! My question is fully resolved.
Is uint8 supported?
### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
28
Is uint8 supported? ### Describe the bug I expect the dataset to store the data in the `uint8` data type, but it's returning `int64` instead. While I've found that `datasets` doesn't yet support float16 (https://github.com/huggingface/datasets/issues/4981), I'm wondering if this is the case for other data types as well. Is there a way to store vector data as `uint8` and then upload it to the hub? ### Steps to reproduce the bug ```python from datasets import Features, Dataset, Sequence, Value import numpy as np dataset = Dataset.from_dict( {"vector": [np.array([0, 1, 2], dtype=np.uint8)]}, features=Features({"vector": Sequence(Value("uint8"))}) ).with_format("numpy") print(dataset[0]["vector"].dtype) ``` ### Expected behavior Expected: `uint8` Actual: `int64` ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-12.1-x86_64-i386-64bit - Python version: 3.8.12 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Oh, I understand now. The data was stored in `uint8` from the beginning (when the dataset returns `int64`). Thank you for your time! My question is fully resolved.
[ -0.014799565076828003, -0.42494139075279236, 0.0009363330900669098, 0.2994321882724762, 0.5796529054641724, -0.0617339164018631, 0.4964897632598877, 0.17840290069580078, 0.015032373368740082, -0.11957670748233795, -0.2177356630563736, 0.09623894095420837, 0.0689069926738739, -0.00031278282403945923, -0.001093406230211258, 0.11450542509555817, 0.341582328081131, 0.06609474122524261, 0.11926392465829849, -0.09783182293176651, -0.22778046131134033, 0.00849185325205326, -0.26224368810653687, 0.05746002495288849, -0.4717733860015869, -0.015109558589756489, -0.038538072258234024, 0.1708165556192398, -0.2934790849685669, -0.3870052695274353, 0.6064321398735046, 0.12260134518146515, 0.36512744426727295, 0.5509591102600098, -0.00012875527318101376, -0.02783043682575226, 0.2927858829498291, -0.07904624938964844, -0.024359621107578278, -0.022372908890247345, -0.010628081858158112, -0.193341463804245, -0.031449541449546814, -0.2687908709049225, 0.020900800824165344, -0.3137971758842468, -0.18225248157978058, -0.059083353728055954, 0.04815509542822838, 0.006248358637094498, 0.10003986954689026, 0.5201276540756226, 0.32468560338020325, 0.22622793912887573, -0.09009848535060883, 0.4777035713195801, -0.20848536491394043, 0.45624834299087524, 0.18797221779823303, 0.2510201334953308, 0.1970651000738144, -0.09145412594079971, -0.08412541449069977, -0.06832025945186615, 0.09409047663211823, 0.3103179335594177, -0.07808111608028412, -0.053049370646476746, -0.12541915476322174, 0.20750977098941803, 0.12263160198926926, -0.14311817288398743, -0.4974478483200073, -0.19764605164527893, -0.20118767023086548, -0.37902382016181946, 0.2174583077430725, 0.037544719874858856, 0.047372475266456604, 0.12697213888168335, 0.03081236407160759, -0.089051254093647, -0.28969311714172363, 0.33895939588546753, -0.23605448007583618, 0.2696687579154968, -0.24957898259162903, 0.21025750041007996, -0.07182183116674423, -0.32634320855140686, -0.17395615577697754, -0.01094795297831297, 0.24766382575035095, 0.03712926059961319, -0.10087451338768005, -0.2349998652935028, -0.28504690527915955, 0.10418470203876495, 0.24530155956745148, -0.39917126297950745, -0.02508743666112423, 0.11766411364078522, -0.6275597810745239, 0.06911374628543854, 0.5150873064994812, 0.07291053235530853, -0.21848997473716736, 0.07019826024770737, 0.4331744909286499, 0.2107517123222351, 0.27026087045669556, -0.1476956009864807, 0.03609544038772583, 0.12287959456443787, 0.054918207228183746, -0.19364899396896362, 0.4412708580493927, -0.08464059233665466, -0.19012778997421265, -0.017222851514816284, 0.11010994017124176, 0.19167563319206238, 0.2785462737083435, 0.24118423461914062, -0.18342559039592743, 0.45710617303848267, -0.13477005064487457, 0.41040143370628357, -0.18058395385742188, 0.07875251770019531, -0.0379471555352211, 0.007452361285686493, 0.12020273506641388, -0.39957597851753235, 0.1180637776851654, -0.4207781255245209, -0.02823912724852562, 0.4036756157875061, 0.3266315758228302, 0.012588828802108765, -0.3861091732978821, -0.0313488245010376, 0.3384138345718384, 0.24469147622585297, -0.1798596829175949, 0.36675629019737244, 0.034461092203855515, -0.3091881275177002, -0.16036807000637054, 0.17152681946754456, -0.37258613109588623, -0.10739724338054657, -0.2704530656337738, -0.06801586598157883, -0.16654087603092194, -0.11177269369363785, -0.018244832754135132, -0.09836940467357635, -0.009380199015140533, -0.062161706387996674, 0.27727818489074707, -0.1845514476299286, 0.16820353269577026, -0.40149787068367004, 0.22027632594108582, -0.03799702227115631, -0.0017851069569587708, 0.03951600193977356, 0.037799034267663956, 0.14572355151176453, 0.06584559381008148, 0.3512963354587555, 0.16691899299621582, -0.32059696316719055, -0.25597092509269714, 0.386648952960968, 0.2209363877773285, -0.5232101678848267, -0.4429645538330078, -0.18190671503543854, 0.18053995072841644, 0.01796482503414154, -0.2723694443702698, 0.377092182636261, -0.06430299580097198, -0.012005485594272614, 0.1450425237417221, 0.32656317949295044, -0.03210907429456711, 0.21466702222824097, -0.2832645773887634, -0.3168700933456421, 0.14665132761001587, 0.30869626998901367, -0.12019061297178268, -0.04600047692656517, 0.19508090615272522, 0.17347005009651184, 0.200494647026062, -0.06462711095809937, 0.021759308874607086, -0.03586024418473244, 0.5199399590492249, 0.11370464414358139, 0.11057262122631073, -0.21004056930541992, -0.37975630164146423, 0.15701515972614288, 0.3369666337966919, -0.186031311750412, -0.024263281375169754, -0.2021765559911728, -0.1749192476272583, 0.12815158069133759, -0.0665280669927597, 0.12536627054214478, -0.024011023342609406, -0.11937491595745087, -0.1151358112692833, 0.04834930598735809, -0.38308829069137573, 0.25930023193359375, -0.02838561311364174, 0.276824027299881, -0.3933514952659607, 0.42288774251937866, 0.06133691966533661, -0.30961716175079346, 0.0002806559205055237, 0.3773948550224304, 0.13039277493953705, -0.22430121898651123, 0.010480351746082306, 0.3090328574180603, -0.05383022874593735, 0.3135744631290436, -0.03305826708674431, 0.39646387100219727, 0.5622991323471069, -0.04827187955379486, 0.08686387538909912, 0.11562060564756393, 0.1529405415058136, 0.09972849488258362, -0.08475201576948166, 0.732269287109375, -0.33210134506225586, -0.15034715831279755, -0.09614479541778564, 0.1772404909133911, 0.18448573350906372, 0.2719796299934387, -0.23188474774360657, -0.22545912861824036, 0.09425405412912369, 0.1398152858018875, 0.18219831585884094, -0.15797942876815796, -0.24947589635849, 0.09147670865058899, 0.5432067513465881, -0.07324656844139099, 0.464375376701355, 0.1751387119293213, -0.2441430389881134, 0.08581183850765228, 0.06261494755744934, -0.39370667934417725, 0.3295475244522095, -0.12374643981456757, 0.05114883556962013, -0.037135642021894455, -0.11087958514690399, -0.17106182873249054, 0.12308674305677414, 0.03321808576583862, -0.13504476845264435, -0.1009870395064354, 0.31951168179512024, -0.10133156180381775, -0.33579525351524353, 0.2503231465816498, -0.22140541672706604, 0.011569982394576073, -0.34086212515830994, 0.22975042462348938, -0.3483600616455078, 0.07964251935482025, 0.009952310472726822, -0.653336763381958, -0.36516401171684265, -0.1604636311531067, -0.24645379185676575, 0.41356953978538513, 0.018657609820365906, -0.032003648579120636, 0.19032640755176544, 0.4059281051158905, 0.21774983406066895, 0.026226868852972984, -0.13386107981204987, 0.1591491848230362, -0.09289316833019257, -0.07038596272468567, -0.017490204423666, -0.06348157674074173, 0.2444155365228653, 0.20227724313735962, 0.08831582963466644, -0.2274414300918579, -0.426713228225708, 0.07295876741409302, -0.2847844958305359, 0.5579800605773926, 0.12388604879379272, 0.2401769757270813, -0.2333163022994995, 0.343788206577301, 0.37296175956726074, -0.22628271579742432, -0.07691003382205963, 0.20691721141338348, 0.00033986568450927734, 0.10868370532989502, -0.09314301609992981, 0.27774080634117126, -0.3007293939590454, -0.17055395245552063, 0.45236313343048096, 0.12928465008735657, 0.00274491123855114, -0.02070394717156887, -0.005322571843862534, 0.0034738220274448395, 0.05013645812869072, -0.2231014370918274, -0.35349518060684204, -0.38339313864707947, 0.6136577129364014, -0.08493006229400635, -0.34283745288848877, -0.030405960977077484, -0.0369291789829731, -0.10055889934301376, -0.06865490972995758, -0.13812308013439178, -0.32065433263778687, -0.22390136122703552, 0.5247223973274231, 0.2619777321815491, 0.11870568245649338, 0.3476138710975647, -0.4560799300670624, 0.1721712350845337, -0.20994333922863007, -0.00475630909204483, -0.0674659013748169, 0.5803685188293457, -0.10728401690721512, 0.36459410190582275, -0.03786064684391022, 0.02431768923997879, 0.1976318210363388, 0.5172724723815918, -0.19100913405418396, 0.427099347114563, -0.054912909865379333, 0.393798828125, -0.18257194757461548, -0.32060110569000244, -0.008797790855169296, 0.11915852129459381, 0.06542286276817322, 0.21170535683631897, 0.22131723165512085, 0.3087044954299927, -0.09376350790262222, -0.2415889948606491, -0.1631268858909607, -0.26710736751556396, 0.28950393199920654, 0.17114627361297607, 0.014791104942560196, -0.16143980622291565, -0.06490827351808548, -0.2445686161518097, -0.3867409825325012, -0.04313471168279648, 0.4951132833957672, 0.027192167937755585, 0.13113869726657867, -0.22414979338645935, -0.4501676559448242, -0.5323206186294556, 0.25344157218933105, 0.16887106001377106, 0.6095052361488342, 0.10138329863548279, 0.07288216054439545, 0.15022265911102295, -0.003386225551366806, 0.36523616313934326, -0.2197541892528534, -0.055452361702919006, -0.08634446561336517, -0.1795945167541504, -0.5373871922492981, -0.008738107979297638, -0.21332332491874695, 0.08941821753978729, -0.014588164165616035, 0.32182469964027405, -0.27710074186325073, -0.13898439705371857, 0.022583261132240295, -0.04918057844042778, -0.13707789778709412, -0.084858238697052, -0.3764808773994446, -0.16841170191764832, -0.17733213305473328, -0.041161928325891495, 0.20190532505512238, 0.07896570861339569, -0.17524531483650208, -0.26585841178894043, -0.33618277311325073, -0.292639821767807, 0.08236967772245407, -0.079241544008255, 0.368768572807312, -0.05580103397369385, -0.15649482607841492, 0.31377217173576355, -0.07522216439247131, -0.18838483095169067, 0.38426530361175537, 0.5224250555038452, -0.3028501272201538, 0.050671596080064774, -0.13761284947395325, 0.08906707167625427, 0.3587293028831482, -0.04180695861577988, 0.15503430366516113, 0.0583278127014637, 0.10786901414394379, -0.7820847034454346, -0.19535228610038757, 0.4050728976726532, 0.16511663794517517, -0.22990234196186066, 0.14905822277069092, 0.6057427525520325, -0.16096743941307068, 0.12333546578884125, 0.4495648741722107, 0.5418370962142944, -0.23040735721588135, 0.1548009067773819, 0.26906853914260864, 1.0177217721939087, 0.10717764496803284, 0.30247122049331665, 0.4810444116592407, 0.0029272139072418213, 0.5857825875282288, 0.097140371799469, -0.024413667619228363, -0.5036760568618774, 0.01126425713300705, -0.165682852268219, -0.153969407081604, 0.1304515302181244, -0.3450409770011902, -0.2648058235645294, -0.02901364304125309, -0.24706578254699707, 0.5311734080314636, -0.21157173812389374, 0.04673866182565689, -0.27506837248802185, -0.23527249693870544, -0.41863715648651123, -0.00288979709148407, -0.060423847287893295, 0.2197391837835312, -0.18393340706825256, -0.02341504395008087, -0.27712008357048035, -0.20195135474205017, -0.5790406465530396, -0.40373173356056213, 0.30627357959747314, 0.21226343512535095, 0.23931899666786194, -0.12420456856489182, -0.1819731891155243, 0.055131759494543076, 1.0130096673965454, -0.15995432436466217, -0.3961407244205475, -0.0892467126250267, -0.18553464114665985, -0.041325993835926056, 0.1844981610774994, -0.07646548748016357, 0.17861226201057434, 0.035072632133960724, -0.2579980194568634, -0.06382463127374649, 0.1440150886774063, -0.37579146027565, -0.2875618040561676, 0.03746872767806053, -0.17193466424942017, -0.39524441957473755, -0.046866726130247116, -0.3045758008956909, 0.06431938707828522, -0.03336649015545845, -0.0006766044534742832, 0.3465748727321625, 0.2839803695678711, 0.1652241051197052, 0.39362746477127075, 0.03196194767951965, -0.16026097536087036, 0.1010773628950119, 0.12039361894130707, -0.11595522612333298, 0.1175689697265625, 0.058264702558517456, -0.2830074429512024, -0.007851071655750275, 0.3420521914958954, 0.12265847623348236, -0.3655272424221039, 0.0918896496295929, -0.18879817426204681, -0.04291820526123047, -0.3311730921268463, -0.004384741187095642, 0.13014096021652222, -0.11322522908449173, -0.3062543272972107, -0.5670867562294006, -0.21635067462921143, 0.331792414188385, -0.14677992463111877, 0.12990906834602356, -0.10858499258756638, -0.1675635129213333, 0.044212862849235535, -0.2875288426876068, -0.145339697599411, 0.15228566527366638, -0.06345736235380173, 0.008256591856479645, -0.0066208019852638245, -0.05838284641504288, 0.15060636401176453, -0.24820289015769958, -0.007123470306396484, 0.1485772430896759, -0.2724759578704834, -0.021538078784942627, -0.2772204875946045, 0.24648131430149078, 0.15690281987190247, -0.36560243368148804, 0.0050260573625564575, -0.23847293853759766, -0.15997907519340515, -0.1969803273677826, 0.06560689210891724, 0.12027351558208466, 0.13263598084449768, 0.1284375786781311, 0.25015801191329956, 0.2614527642726898, -0.006798043847084045, 0.22454117238521576, 0.30747896432876587, 0.46694880723953247, -0.008824773132801056, 0.018068332225084305, -0.12120790779590607, -0.01225367933511734, -0.08825622498989105, 0.2586403787136078, 0.0852685421705246, 0.03420349210500717, 0.4250503182411194, -0.19785894453525543, 0.19905489683151245, -0.028230657801032066, 0.2689931392669678, 0.3196353316307068, -0.3241128623485565, 0.16885143518447876, 0.024420615285634995, 0.016028575599193573, -0.011666133999824524, -0.17271919548511505, 0.061553046107292175, 0.22233617305755615, -0.0866297259926796, 0.39836201071739197, 0.2416599839925766, 0.25730016827583313, 0.09056252986192703, -0.04128491133451462, 0.21621893346309662, -0.09735290706157684, 0.041378360241651535, 0.1737011820077896, -0.1134309470653534, -0.029004622250795364, 0.2101772576570511, 0.023731645196676254, 0.06282263994216919, 0.6109718680381775, -0.19594095647335052, 0.06227083504199982, 0.1299717128276825, -0.09074704349040985, 0.33240288496017456, -0.06816821545362473, -0.07870130240917206, 0.205890491604805, -0.158369779586792, 0.262687623500824, 0.2771095037460327, 0.5371012687683105, -0.4925628900527954, -0.058940619230270386, -0.5696975588798523, -0.07608067989349365, -0.3876887857913971, 0.02773013338446617, -0.10822490602731705, -0.09367376565933228, -0.2517402172088623, -0.044456757605075836, -0.4502239227294922, -0.16849572956562042, 0.17499738931655884, 0.21713435649871826, 0.09393922984600067, -0.4872856140136719, 0.25509113073349, 0.17923623323440552, 0.1924215704202652, -0.013875037431716919, 0.21474172174930573, 0.3512097895145416, 0.11296184360980988, 0.05088558793067932, 0.47547397017478943, 0.37776973843574524, 0.08995300531387329, -0.18471843004226685, 0.3668167293071747, -0.10472236573696136, -0.14683809876441956, 0.16829350590705872, -0.02656491845846176, 0.09436486661434174, 0.11509783565998077, 0.05337627977132797, 0.13010695576667786, 0.05580003932118416, -0.10630391538143158, -0.14218296110630035, 0.2124648541212082, -0.3595549166202545, 0.358333945274353, -0.3142165243625641, 0.04513682425022125, 0.037250224500894547, -0.1968725472688675, -0.23776696622371674, 0.13779860734939575, 0.1904105246067047, -0.09264317899942398, 0.15971717238426208, -0.06275725364685059, -0.03779757767915726, -0.1374729871749878, 0.3672459125518799, 0.1107085794210434, -0.08635915815830231, 0.09931159019470215, -0.17849773168563843, -0.5962865352630615, 0.20117662847042084, 0.2450178861618042, -0.029204335063695908, 0.24141620099544525, 0.06367567926645279, 0.1583825945854187, 0.24931813776493073, 0.3057139217853546, -0.2778598666191101, 0.15203171968460083, 0.09956033527851105, -0.11503253132104874, -0.07191942632198334, 0.10472129285335541, -0.06950485706329346, -0.23268800973892212, -0.11269676685333252, 0.6392920017242432, -0.0775817409157753, -0.15324580669403076, -0.0831594467163086, 0.22305801510810852, -0.26741331815719604, -0.17652219533920288, 0.29672759771347046, 0.35766324400901794, -0.0786585658788681, -0.07261256128549576, -0.11037934571504593, -0.33476927876472473, -0.19585320353507996, -0.10855184495449066, 0.24428939819335938, -0.3138042986392975, 0.6730760335922241, -0.2554032802581787, -0.23717370629310608, -0.2041870653629303, -0.08980774879455566, -0.11044367402791977, -0.18152610957622528, -0.03951532393693924, 0.3234447240829468, -0.2549898028373718, 0.012590907514095306, 0.12369424104690552, 0.31952446699142456, 0.11038388311862946, 0.10070306807756424, -0.11050911247730255, -0.36518362164497375, 0.39323949813842773, -0.15313296020030975, -0.23197099566459656, -0.05645812302827835, 0.04438234865665436, 0.47565957903862, -0.12804919481277466, -0.5386338233947754, 0.042127400636672974, 0.17007134854793549, -0.06748443841934204, -0.19643229246139526, 0.16418029367923737, 0.0027652978897094727, -0.10972602665424347, -0.1946268081665039, 0.5762563943862915, 0.1478344351053238, -0.0723884254693985, 0.42695605754852295, -0.17966443300247192 ]
https://github.com/huggingface/datasets/issues/5833
Thanks for reporting, @agombert. In this case, I think the root issue is authentication: before pushing to Hub, you should authenticate. See our docs: https://huggingface.co/docs/datasets/upload_dataset#upload-with-python > 2. To upload a dataset on the Hub in Python, you need to log in to your Hugging Face account: ``` huggingface-cli login ```
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
50
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Thanks for reporting, @agombert. In this case, I think the root issue is authentication: before pushing to Hub, you should authenticate. See our docs: https://huggingface.co/docs/datasets/upload_dataset#upload-with-python > 2. To upload a dataset on the Hub in Python, you need to log in to your Hugging Face account: ``` huggingface-cli login ```
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
Hey @albertvillanova well I actually did :D <img width="1079" alt="Capture d’écran 2023-05-09 à 18 02 58" src="https://github.com/huggingface/datasets/assets/17645711/e091aa20-06b1-4dd3-bfdb-35e832c66f8d">
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
17
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Hey @albertvillanova well I actually did :D <img width="1079" alt="Capture d’écran 2023-05-09 à 18 02 58" src="https://github.com/huggingface/datasets/assets/17645711/e091aa20-06b1-4dd3-bfdb-35e832c66f8d">
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
That is weird that you get a Forbidden error if you are properly authenticated... Today we had a big outage issue affecting the Hugging Face Hub. Could you please retry to push_to_hub your dataset? Maybe that was the cause...
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
39
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` That is weird that you get a Forbidden error if you are properly authenticated... Today we had a big outage issue affecting the Hugging Face Hub. Could you please retry to push_to_hub your dataset? Maybe that was the cause...
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
Login successful but also got this error "Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request"
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
19
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Login successful but also got this error "Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request"
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
Make sure your API token has a `write` role. I had the same issue as you with the `read` token. Creating a `write` token and using that solved the issue.
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
30
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Make sure your API token has a `write` role. I had the same issue as you with the `read` token. Creating a `write` token and using that solved the issue.
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
> Make sure your API token has a `write` role. I had the same issue as you with the `read` token. Creating a `write` token and using that solved the issue. I generate a token with write role. It works! thank you so much.
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
44
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` > Make sure your API token has a `write` role. I had the same issue as you with the `read` token. Creating a `write` token and using that solved the issue. I generate a token with write role. It works! thank you so much.
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
@dmitrijsk amazing thanks so much ! The error should be clearer when the token is read-only – I wasted a lot of time there..
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
24
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` @dmitrijsk amazing thanks so much ! The error should be clearer when the token is read-only – I wasted a lot of time there..
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
Based on the number of reactions (https://github.com/huggingface/datasets/issues/5833#issuecomment-1586521001), many users have issues debugging this. @Wauplin Maybe a more informative error can be thrown in `hfh` if a token's role is insufficient for an op. WDYT?
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
34
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Based on the number of reactions (https://github.com/huggingface/datasets/issues/5833#issuecomment-1586521001), many users have issues debugging this. @Wauplin Maybe a more informative error can be thrown in `hfh` if a token's role is insufficient for an op. WDYT?
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
Yes indeed. I created an issue some time ago about it: https://github.com/huggingface/huggingface_hub/issues/1653. I'll prioritize it more and let you know. Thanks for the ping.
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
24
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Yes indeed. I created an issue some time ago about it: https://github.com/huggingface/huggingface_hub/issues/1653. I'll prioritize it more and let you know. Thanks for the ping.
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
Hey everyone :wave: The error message has been fixed to be more informative. As mentioned in https://github.com/huggingface/datasets/issues/5833#issuecomment-1586521001, the n°1 reason why this is happening is that a `read` token has been used instead of `write`. The fix has being shipped on the server meaning that you don't need to update any client library. The new error message looks like this: ``` huggingface_hub.utils._errors.HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/models/Wauplin/test_recovered/preupload/main (Request ID: Root=1-6532752e-1ee492b070d9e3020e68bddc;25ca3387-44bc-433e-b49f-6e290305ed10) Forbidden: you must use a write token to upload to a repository. ``` --- cc @mariosasko I let you close this issue if you feel it's completely solved
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
100
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` Hey everyone :wave: The error message has been fixed to be more informative. As mentioned in https://github.com/huggingface/datasets/issues/5833#issuecomment-1586521001, the n°1 reason why this is happening is that a `read` token has been used instead of `write`. The fix has being shipped on the server meaning that you don't need to update any client library. The new error message looks like this: ``` huggingface_hub.utils._errors.HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/models/Wauplin/test_recovered/preupload/main (Request ID: Root=1-6532752e-1ee492b070d9e3020e68bddc;25ca3387-44bc-433e-b49f-6e290305ed10) Forbidden: you must use a write token to upload to a repository. ``` --- cc @mariosasko I let you close this issue if you feel it's completely solved
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
@Wauplin Reopening it. Indeed, the above error message is thrown if pushing to an **existing** repo with a `read` token. However, if the repo does not exist and needs to be created (by calling `create_repo` in `push_to_hub`), then passing a `read` token will raise the following: ```python HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name) 318 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 319 # as well (request id and/or server error message) --> 320 raise HfHubHTTPError(str(e), response=response) from e 321 322 HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create (Request ID: Root=1-653291a1-0e9cc2b16c049ff510834d47;7edeb8a3-4bf1-4d9b-8f7f-06d430da9ee7) You don't have the rights to create a dataset under this namespace ``` I think this error message should also be more informative!
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
140
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` @Wauplin Reopening it. Indeed, the above error message is thrown if pushing to an **existing** repo with a `read` token. However, if the repo does not exist and needs to be created (by calling `create_repo` in `push_to_hub`), then passing a `read` token will raise the following: ```python HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py](https://localhost:8080/#) in hf_raise_for_status(response, endpoint_name) 318 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 319 # as well (request id and/or server error message) --> 320 raise HfHubHTTPError(str(e), response=response) from e 321 322 HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/repos/create (Request ID: Root=1-653291a1-0e9cc2b16c049ff510834d47;7edeb8a3-4bf1-4d9b-8f7f-06d430da9ee7) You don't have the rights to create a dataset under this namespace ``` I think this error message should also be more informative!
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5833
> However, if the repo does not exist and needs to be created (by calling create_repo in push_to_hub), then passing a read token will raise the following: This seems to be a different issue than the one reported above right? Still agree that a more informative message would be nice. Can you open an issue on moon-landing for it please? (not sure I can open a PR myself for this one :grimacing: )
Unable to push dataset - `create_pr` problem
### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ```
73
Unable to push dataset - `create_pr` problem ### Describe the bug I can't upload to the hub the dataset I manually created locally (Image dataset). I have a problem when using the method `.push_to_hub` which asks for a `create_pr` attribute which is not compatible. ### Steps to reproduce the bug here what I have: ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") ``` Output: ```python Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:00<?, ?it/s] Creating parquet from Arrow format: 0%| | 0/3 [00:00<?, ?ba/s] Creating parquet from Arrow format: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 12.70ba/s] Pushing dataset shards to the dataset hub: 0%| | 0/2 [00:01<?, ?it/s] --------------------------------------------------------------------------- HTTPError Traceback (most recent call last) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:259, in hf_raise_for_status(response, endpoint_name) 258 try: --> 259 response.raise_for_status() 260 except HTTPError as e: File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/requests/models.py:1021, in Response.raise_for_status(self) 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main The above exception was the direct cause of the following exception: HfHubHTTPError Traceback (most recent call last) Cell In[7], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/dataset_dict.py:1583, in DatasetDict.push_to_hub(self, repo_id, private, token, branch, max_shard_size, num_shards, embed_external_files) 1581 logger.warning(f"Pushing split {split} to the Hub.") 1582 # The split=key needs to be removed before merging -> 1583 repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( 1584 repo_id, 1585 split=split, 1586 private=private, 1587 token=token, 1588 branch=branch, 1589 max_shard_size=max_shard_size, 1590 num_shards=num_shards.get(split), 1591 embed_external_files=embed_external_files, 1592 ) 1593 total_uploaded_size += uploaded_size 1594 total_dataset_nbytes += dataset_nbytes File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/arrow_dataset.py:5275, in Dataset._push_parquet_shards_to_hub(self, repo_id, split, private, token, branch, max_shard_size, num_shards, embed_external_files) 5273 shard.to_parquet(buffer) 5274 uploaded_size += buffer.tell() -> 5275 _retry( 5276 api.upload_file, 5277 func_kwargs={ 5278 "path_or_fileobj": buffer.getvalue(), 5279 "path_in_repo": shard_path_in_repo, 5280 "repo_id": repo_id, 5281 "token": token, 5282 "repo_type": "dataset", 5283 "revision": branch, 5284 }, 5285 exceptions=HTTPError, 5286 status_codes=[504], 5287 base_wait_time=2.0, 5288 max_retries=5, 5289 max_wait_time=20.0, 5290 ) 5291 shards_path_in_repo.append(shard_path_in_repo) 5293 # Cleanup to remove unused files File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:285, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): --> 285 raise err 286 else: 287 sleep_time = min(max_wait_time, base_wait_time * 2**retry) # Exponential backoff File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/datasets/utils/file_utils.py:282, in _retry(func, func_args, func_kwargs, exceptions, status_codes, max_retries, base_wait_time, max_wait_time) 280 while True: 281 try: --> 282 return func(*func_args, **func_kwargs) 283 except exceptions as err: 284 if retry >= max_retries or (status_codes and err.response.status_code not in status_codes): File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2998, in HfApi.upload_file(self, path_or_fileobj, path_in_repo, repo_id, token, repo_type, revision, commit_message, commit_description, create_pr, parent_commit) 2990 commit_message = ( 2991 commit_message if commit_message is not None else f"Upload {path_in_repo} with huggingface_hub" 2992 ) 2993 operation = CommitOperationAdd( 2994 path_or_fileobj=path_or_fileobj, 2995 path_in_repo=path_in_repo, 2996 ) -> 2998 commit_info = self.create_commit( 2999 repo_id=repo_id, 3000 repo_type=repo_type, 3001 operations=[operation], 3002 commit_message=commit_message, 3003 commit_description=commit_description, 3004 token=token, 3005 revision=revision, 3006 create_pr=create_pr, 3007 parent_commit=parent_commit, 3008 ) 3010 if commit_info.pr_url is not None: 3011 revision = quote(_parse_revision_from_pr_url(commit_info.pr_url), safe="") File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py:120, in validate_hf_hub_args.<locals>._inner_fn(*args, **kwargs) 117 if check_use_auth_token: 118 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=has_token, kwargs=kwargs) --> 120 return fn(*args, **kwargs) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/hf_api.py:2548, in HfApi.create_commit(self, repo_id, operations, commit_message, commit_description, token, repo_type, revision, create_pr, num_threads, parent_commit) 2546 try: 2547 commit_resp = get_session().post(url=commit_url, headers=headers, data=data, params=params) -> 2548 hf_raise_for_status(commit_resp, endpoint_name="commit") 2549 except RepositoryNotFoundError as e: 2550 e.append_to_message(_CREATE_COMMIT_NO_REPO_ERROR_MESSAGE) File ~/miniconda3/envs/hwocr/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py:301, in hf_raise_for_status(response, endpoint_name) 297 raise BadRequestError(message, response=response) from e 299 # Convert `HTTPError` into a `HfHubHTTPError` to display request information 300 # as well (request id and/or server error message) --> 301 raise HfHubHTTPError(str(e), response=response) from e HfHubHTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/api/datasets/agomberto/FrenchCensus-handwritten-texts/commit/main (Request ID: Root=1-645a66bf-255ad91602a6404e6cb70fba) Forbidden: pass `create_pr=1` as a query parameter to create a Pull Request ``` And then when I do ```python dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) ``` I get ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[8], line 1 ----> 1 dataset.push_to_hub("agomberto/FrenchCensus-handwritten-texts", create_pr=1) TypeError: push_to_hub() got an unexpected keyword argument 'create_pr' ``` ### Expected behavior I would like to have the dataset updloaded [here](https://huggingface.co/datasets/agomberto/FrenchCensus-handwritten-texts). ### Environment info ```bash - `datasets` version: 2.12.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.5.3 ``` > However, if the repo does not exist and needs to be created (by calling create_repo in push_to_hub), then passing a read token will raise the following: This seems to be a different issue than the one reported above right? Still agree that a more informative message would be nice. Can you open an issue on moon-landing for it please? (not sure I can open a PR myself for this one :grimacing: )
[ -0.3313612937927246, -0.5114108920097351, 0.0488574355840683, 0.2377043217420578, 0.16082608699798584, -0.022989168763160706, 0.147964209318161, 0.22991344332695007, -0.06724781543016434, 0.05386371165513992, 0.11776133626699448, 0.38434380292892456, -0.08146622776985168, 0.26467639207839966, 0.12772902846336365, 0.04632726311683655, 0.14661119878292084, 0.013344042003154755, 0.34518739581108093, -0.12914571166038513, -0.2834765315055847, -0.15758569538593292, 0.0545077919960022, 0.07821665704250336, -0.5880188345909119, -0.10047342628240585, 0.01696455478668213, 0.37881410121917725, -0.18856869637966156, -0.18179404735565186, 0.3298819959163666, 0.02234782837331295, 0.08113507926464081, 0.438577800989151, -0.00012421670544426888, 0.14067602157592773, 0.3678440451622009, -0.05715426802635193, -0.19705620408058167, -0.311779648065567, -0.3488956689834595, -0.07173663377761841, -0.15181705355644226, -0.0647401213645935, 0.0557020902633667, 0.058620862662792206, -0.11903240531682968, 0.14650537073612213, 0.2706732749938965, 0.34378018975257874, 0.08369715511798859, 0.3715764284133911, 0.28010302782058716, -0.25714343786239624, 0.06724309921264648, 0.4391980469226837, -0.44632822275161743, 0.13332785665988922, 0.04571576789021492, 0.14717862010002136, 0.09146855771541595, -0.30068495869636536, 0.3445950150489807, 0.02769787609577179, 0.3506062626838684, -0.030827924609184265, -0.18018218874931335, -0.3108595609664917, 0.039096325635910034, -0.0978313535451889, 0.21830753982067108, -0.39254480600357056, -0.3883831202983856, -0.06592921912670135, 0.007599778473377228, -0.2706020176410675, 0.3687146008014679, 0.38928574323654175, -0.24128752946853638, 0.13576537370681763, -0.30351680517196655, -0.3036598563194275, -0.2954055964946747, 0.018986430019140244, 0.14175382256507874, 0.016196755692362785, 0.21968136727809906, 0.023905280977487564, -0.1142631322145462, -0.021189246326684952, 0.32995447516441345, -0.19131571054458618, 0.06089889630675316, -0.0161737073212862, -0.054425496608018875, 0.1000632792711258, -0.09884369373321533, 0.35714444518089294, 0.10582423210144043, 0.2576039433479309, -0.22123312950134277, -0.0823044627904892, -0.13483405113220215, 0.19004717469215393, 0.10550840944051743, 0.10567374527454376, 0.0831519365310669, 0.3653556704521179, 0.21122853457927704, 0.37851783633232117, 0.07838474959135056, -0.002981974743306637, 0.031830161809921265, -0.1551390290260315, 0.31522902846336365, -0.11572547256946564, 0.3250044584274292, -0.06832076609134674, -0.35225850343704224, 0.034694962203502655, -0.09280374646186829, 0.1728665828704834, 0.03227667883038521, 0.1655890941619873, 0.053224802017211914, 0.1152418702840805, -0.09574361890554428, 0.31701064109802246, -0.29637110233306885, 0.08883307129144669, -0.13451914489269257, 0.17699667811393738, 0.03189930319786072, 0.07811205834150314, 0.038767009973526, -0.40688395500183105, -0.04437166079878807, 0.30861592292785645, 0.23334041237831116, -0.01408512145280838, -0.1078481525182724, -0.021644994616508484, 0.005740225315093994, 0.22525067627429962, 0.2742529809474945, -0.0010884776711463928, -0.1285632848739624, -0.3528827726840973, -0.07800254970788956, 0.14028018712997437, -0.37689170241355896, -0.5405703186988831, -0.16933007538318634, 0.13723666965961456, -0.035539500415325165, 0.1291443407535553, -0.38788872957229614, -0.017878375947475433, 0.02337362989783287, 0.13703200221061707, 0.030784059315919876, -0.012678989209234715, -0.07177583128213882, -0.09937126934528351, 0.2785577178001404, 0.3929833471775055, -0.27351099252700806, -0.00955323874950409, 0.1991335153579712, -0.034905049949884415, 0.019663561135530472, 0.22283706068992615, -0.12780649960041046, 0.24517497420310974, -0.2038257122039795, 0.11261944472789764, 0.28359174728393555, -0.6493818759918213, -0.5065617561340332, -0.10004396736621857, -0.09097344428300858, -0.2885656952857971, 0.023625707253813744, 0.05606065317988396, 0.12670038640499115, 0.0616254061460495, 0.20819251239299774, 0.37003666162490845, -0.06444336473941803, 0.09464749693870544, -0.3220652937889099, -0.19827896356582642, -0.04021677374839783, 0.2057534158229828, 0.12339898943901062, 0.25053855776786804, 0.36834555864334106, 0.3469087779521942, 0.033788226544857025, -0.0048345886170864105, 0.4431343674659729, 0.04498752951622009, 0.507767379283905, -0.1767442226409912, -0.0546828955411911, -0.23587185144424438, -0.3402063548564911, 0.18750770390033722, -0.12691175937652588, 0.2580944299697876, -0.11380928754806519, 0.059830620884895325, -0.6384412050247192, 0.10501755774021149, -0.3544837534427643, -0.021897081285715103, -0.0009795166552066803, -0.3232380747795105, 0.08957305550575256, 0.03337351977825165, -0.13741111755371094, 0.6227709650993347, -0.17811906337738037, 0.25007009506225586, -0.48683303594589233, 0.6260399222373962, -0.2744464576244354, -0.310771107673645, -0.049684833735227585, 0.2661212682723999, 0.354300320148468, -0.04548889771103859, -0.12674210965633392, 0.24496425688266754, 0.10233739018440247, 0.29129794239997864, 0.20424404740333557, -0.031208917498588562, 0.39360150694847107, -0.2769607901573181, -0.06157602369785309, -0.24735993146896362, 0.12442050129175186, 0.11069285869598389, -0.27674439549446106, 0.22477436065673828, 0.14318647980690002, 0.0012576691806316376, 0.003914065659046173, 0.15684211254119873, 0.035017967224121094, 0.018010035157203674, 0.2819696068763733, -0.0006977245211601257, 0.24222758412361145, 0.3162774443626404, 0.20412102341651917, -0.22392843663692474, 0.09513263404369354, 0.08987116813659668, 0.23619817197322845, 0.1989252269268036, 0.08457987010478973, 0.2540671229362488, -0.04239620268344879, -0.142577663064003, 0.17353998124599457, 0.14257466793060303, 0.1700671911239624, -0.025938156992197037, -0.29094943404197693, 0.2719889283180237, -0.2834775447845459, -0.15587618947029114, 0.00816522166132927, -0.06847317516803741, 0.029162682592868805, 0.07327275723218918, 0.40625685453414917, 0.14856182038784027, -0.3640824854373932, -0.007578708231449127, 0.15624284744262695, 0.4112849533557892, -0.3495924174785614, -0.1116703599691391, -0.0677817240357399, 0.3179125189781189, 0.029041212052106857, -0.07055813074111938, -0.5493183732032776, -0.2583082616329193, 0.0617525652050972, 0.20737631618976593, 0.1763991117477417, 0.06422435492277145, 0.10517469793558121, 0.18046626448631287, -0.03003697097301483, -0.2355358600616455, -0.26315343379974365, -0.009040385484695435, -0.18674995005130768, -0.04504306986927986, 0.05946637690067291, 0.16630536317825317, 0.5512362718582153, -0.03320145979523659, -0.014391317963600159, -0.3144890367984772, -0.04986446350812912, 0.12129218876361847, 0.11049146205186844, 0.3237365782260895, 0.07527121156454086, -0.12488183379173279, 0.08165928721427917, -0.14003686606884003, 0.42153555154800415, -0.21132256090641022, -0.3897384703159332, -0.053383633494377136, -0.2514626383781433, -0.23620739579200745, 0.0671488419175148, -0.17009305953979492, -0.1587129831314087, -0.26758769154548645, 0.4160451889038086, 0.502815842628479, 0.09769374132156372, -0.059538230299949646, 0.013314221054315567, -0.15640871226787567, 0.3678922951221466, -0.44833147525787354, -0.19817809760570526, -0.3409273624420166, 0.29299652576446533, -0.2360464334487915, -0.3900817334651947, -0.0006009042263031006, -0.10138373076915741, -0.0950436070561409, 0.3490319848060608, -0.19075848162174225, -0.6743317246437073, -0.29289716482162476, 0.7140616774559021, 0.003932698164135218, 0.1077520027756691, 0.35957419872283936, -0.15536463260650635, 0.1037360280752182, -0.07785586267709732, -0.47861284017562866, 0.24258439242839813, 0.5477833151817322, 0.05002085492014885, 0.13620516657829285, 0.11209339648485184, -0.08222820609807968, 0.49280959367752075, 0.20616784691810608, -0.17009566724300385, 0.6857815384864807, -0.2802053987979889, 0.316402792930603, -0.2319762110710144, -0.3279969394207001, 0.1651928871870041, 0.11844532191753387, -0.03277426213026047, -0.06387406587600708, 0.09852631390094757, 0.19613447785377502, -0.269586980342865, -0.25425341725349426, -0.23382556438446045, -0.04711918160319328, -0.26999983191490173, 0.005776618607342243, 0.26213183999061584, -0.016970966011285782, -0.1181613951921463, -0.3412752151489258, -0.37428510189056396, 0.3270980715751648, 0.1444273144006729, 0.1479400098323822, 0.10101237893104553, -0.22310957312583923, 0.1512385755777359, -0.4580678939819336, 0.1908431053161621, 0.20653299987316132, 0.478778213262558, -0.18827490508556366, 0.19814248383045197, 0.19675038754940033, -0.31677451729774475, 0.7310614585876465, -0.6447747349739075, 0.23399481177330017, -0.26155203580856323, 0.06326231360435486, -0.3765389919281006, 0.032963141798973083, -0.023631855845451355, 0.23887282609939575, -0.1698315590620041, 0.7513535022735596, -0.13007329404354095, 0.030493490397930145, -0.1839459389448166, -0.07101193070411682, -0.36405307054519653, -0.1864037960767746, -0.050882015377283096, -0.34550151228904724, -0.3420538902282715, 0.08244848251342773, 0.1611558496952057, 0.3998914361000061, 0.20462971925735474, -0.0060969144105911255, -0.02953081950545311, 0.1067052036523819, 0.049664609134197235, -0.05851075425744057, 0.25758442282676697, -0.07507308572530746, 0.18603713810443878, 0.03340129554271698, 0.05683983117341995, 0.4457953870296478, 0.6277214288711548, 0.031238216906785965, -0.40224331617355347, -0.05151112377643585, -0.1280149519443512, 0.08179386705160141, 0.39083611965179443, 0.1559430956840515, 0.23860318958759308, -0.19021689891815186, 0.14703616499900818, -0.46399566531181335, -0.14481221139431, 0.25539857149124146, -0.42989805340766907, -0.21353793144226074, -0.0841364711523056, 0.3343198895454407, -0.09070459008216858, 0.11586204171180725, 0.023324383422732353, 0.3880276679992676, -0.16154006123542786, 0.18048200011253357, 0.183992400765419, 1.0223443508148193, -0.023771662265062332, 0.11907139420509338, 0.08215951919555664, -0.4262704849243164, 0.40750154852867126, -0.4920019805431366, 0.01026800274848938, -0.4749577045440674, -0.07773208618164062, -0.12021078169345856, -0.11773768067359924, 0.24418474733829498, 0.014059036038815975, 0.03359439969062805, 0.2008117139339447, -0.24670156836509705, 0.3390296697616577, -0.007947349920868874, 0.25232890248298645, -0.36263507604599, -0.36897823214530945, -0.40596601366996765, 0.1368887722492218, -0.020785465836524963, 0.12440522015094757, -0.07276251167058945, -0.09070093929767609, -0.3223779797554016, -0.15561816096305847, -0.45984917879104614, 0.2241550087928772, 0.005604419857263565, 0.07092922180891037, 0.0707632526755333, -0.23444929718971252, 0.1130920946598053, 0.052557799965143204, 0.6484783291816711, -0.1379728466272354, -0.33083677291870117, 0.292652428150177, -0.0626353770494461, -0.012628916651010513, -0.15829065442085266, -0.01775604858994484, 0.36262246966362, -0.1979895532131195, -0.18858546018600464, -0.03621066361665726, -0.022514555603265762, -0.2830544412136078, -0.22249490022659302, -0.0000708363950252533, 0.15102672576904297, -0.1586153209209442, 0.0016056820750236511, -0.14213812351226807, 0.008203603327274323, -0.2602854073047638, 0.044321510940790176, -0.08650839328765869, -0.07616020739078522, -0.014968033879995346, 0.168243408203125, 0.007476881146430969, 0.02338399365544319, 0.408062607049942, -0.133320152759552, -0.040558572858572006, 0.23350889980793, -0.12169283628463745, -0.07402870804071426, -0.09926240146160126, 0.15406620502471924, 0.28475940227508545, -0.7350741028785706, 0.1160854697227478, -0.07656758278608322, -0.007294163107872009, -0.1535535454750061, 0.029988311231136322, 0.196788027882576, -0.08008180558681488, 0.09004707634449005, -0.2692793905735016, -0.22629451751708984, -0.2566899061203003, 0.10079315304756165, 0.0555456206202507, -0.05307789519429207, 0.2545353174209595, 0.2964640259742737, 0.15641452372074127, -0.1809806525707245, 0.04265022277832031, -0.16495080292224884, 0.20453833043575287, -0.25624263286590576, -0.16398316621780396, -0.0043844617903232574, -0.48812076449394226, -0.025191759690642357, 0.10576912015676498, -0.2407616376876831, -0.08060319721698761, -0.42093393206596375, 0.24048155546188354, 0.3427133560180664, -0.18829227983951569, -0.34463968873023987, -0.16072224080562592, -0.15212179720401764, -0.031844887882471085, 0.03952385485172272, 0.37059485912323, -0.17665480077266693, -0.21513374149799347, 0.8426553606987, 0.10461008548736572, -0.3027484118938446, 0.021461568772792816, 0.1412453055381775, 0.43492138385772705, -0.13103032112121582, -0.06724132597446442, -0.04718395322561264, 0.11172129213809967, -0.20871099829673767, 0.13354606926441193, 0.3048022389411926, 0.19890132546424866, 0.13033494353294373, -0.3481714129447937, 0.030682511627674103, -0.12004552781581879, 0.44936561584472656, 0.26454558968544006, -0.1944626122713089, -0.018762946128845215, 0.30255839228630066, 0.08862005174160004, -0.1427505910396576, -0.17745786905288696, 0.4310940206050873, -0.29331234097480774, -0.1325235813856125, 0.15206044912338257, 0.49267035722732544, 0.21297279000282288, -0.6135634779930115, 0.11122998595237732, 0.40607306361198425, -0.4723610579967499, -0.01885305531322956, 0.12551450729370117, -0.04165113344788551, 0.30861932039260864, 0.28336429595947266, 0.12092547863721848, -0.08173845708370209, 0.4200100898742676, 0.1503407508134842, 0.3450382947921753, 0.2610663175582886, -0.06501641869544983, 0.28465497493743896, -0.18674299120903015, 0.032923199236392975, -0.28670987486839294, 0.18887260556221008, 0.08420051634311676, 0.18344658613204956, 0.4361054301261902, -0.15221083164215088, -0.20163413882255554, -0.3889957666397095, -0.09001334011554718, -0.09428234398365021, 0.19266805052757263, -0.02842114120721817, -0.26830244064331055, -0.4054083228111267, -0.0003105476498603821, 0.03377180173993111, -0.20438548922538757, 0.33977144956588745, 0.12661153078079224, -0.044857289642095566, -0.08884069323539734, -0.07248510420322418, 0.25518661737442017, 0.27582770586013794, -0.13219881057739258, 0.2335677146911621, 0.006110843271017075, -0.3411426544189453, -0.18454426527023315, 0.3092649281024933, 0.4101736843585968, 0.3525892198085785, -0.15526607632637024, 0.13932959735393524, 0.4242216944694519, 0.016713745892047882, 0.11210982501506805, 0.2477966845035553, 0.11054486036300659, 0.20592692494392395, 0.002356868237257004, 0.09788769483566284, -0.05789667367935181, 0.03218548744916916, 0.03340381011366844, 0.23202499747276306, 0.0008564218878746033, 0.6215785145759583, -0.09677810221910477, -0.2601623237133026, -0.03851909190416336, -0.009323827922344208, 0.01314651221036911, 0.09909257292747498, 0.1890210509300232, -0.20982512831687927, 0.17751233279705048, -0.32411742210388184, 0.010664891451597214, -0.1261996030807495, 0.4691517651081085, 0.4027590751647949, -0.3120921850204468, -0.15754225850105286, -0.050474777817726135, -0.45297008752822876, 0.2880156934261322, -0.2103061079978943, -0.1897781640291214, 0.13933739066123962, 0.09311115741729736, -0.1073853075504303, -0.08707752823829651, -0.037931330502033234, 0.3442440629005432, 0.06712334603071213, 0.2962796092033386, -0.2379072606563568, 0.11065502464771271, 0.21337923407554626, -0.14673514664173126, 0.013610579073429108, -0.4128502905368805, 0.29895398020744324, 0.259711354970932, -0.09234505891799927, -0.0911855399608612, 0.0131460502743721, 0.22751659154891968, -0.2999737560749054, 0.2953570783138275, 0.09048312157392502, 0.4027755558490753, -0.19149503111839294, 0.03627117723226547, -0.16785132884979248, -0.2324575036764145, -0.3250287175178528, 0.17729148268699646, -0.27186235785484314, 0.16782093048095703, 0.07141568511724472, -0.48845556378364563, -0.35240209102630615, 0.3772803246974945, 0.01341259479522705, 0.22857719659805298, -0.07130080461502075, 0.07896547764539719, -0.2763529419898987, -0.052149876952171326, 0.23118974268436432, -0.007349837571382523, -0.02679133042693138, 0.15601441264152527, -0.3404783010482788, -0.36708036065101624, 0.2739788293838501, -0.25541844964027405, -0.3216090500354767, 0.019015386700630188, 0.15787242352962494, 0.3168431520462036, -0.28896430134773254, -0.2079894244670868, -0.040928468108177185, 0.32856321334838867, -0.32543978095054626, -0.1003020778298378, 0.3077164888381958, -0.3141012489795685, -0.02139972895383835, 0.07977649569511414, 0.33056339621543884, -0.027893412858247757, -0.22554993629455566, 0.42824551463127136, 0.09601520746946335 ]
https://github.com/huggingface/datasets/issues/5831
I am experiencing the same problem with the following environment: * `datasets` version: 2.11.0 * Platform: `Linux 5.19.0-41-generic x86_64 GNU/Linux` * Python version: `3.8.5` * Huggingface_hub version: 0.13.3 * PyArrow version: `11.0.0` * Pandas version: `1.5.3` Trying to get some diagnostics, I got the following: ```python >>> from huggingface_hub import scan_cache_dir >>> sd = scan_cache_dir() >>> sd HFCacheInfo(size_on_disk=0, repos=frozenset(), warnings=[CorruptedCacheException('Repo path is not a directory: /home/myname/.cache/huggingface/hub/version_diffusers_cache.txt')]) ``` However, that might also be because I had tried to manually specify the `cache_dir` and that resulted in trying to download the dataset again ... but into a folder one level higher up than it should have. Note that my issue is with the `huggan/wikiart` dataset, so it is not a dataset-specific issue.
[Bug]504 Server Error when loading dataset which was already cached
### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
120
[Bug]504 Server Error when loading dataset which was already cached ### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 I am experiencing the same problem with the following environment: * `datasets` version: 2.11.0 * Platform: `Linux 5.19.0-41-generic x86_64 GNU/Linux` * Python version: `3.8.5` * Huggingface_hub version: 0.13.3 * PyArrow version: `11.0.0` * Pandas version: `1.5.3` Trying to get some diagnostics, I got the following: ```python >>> from huggingface_hub import scan_cache_dir >>> sd = scan_cache_dir() >>> sd HFCacheInfo(size_on_disk=0, repos=frozenset(), warnings=[CorruptedCacheException('Repo path is not a directory: /home/myname/.cache/huggingface/hub/version_diffusers_cache.txt')]) ``` However, that might also be because I had tried to manually specify the `cache_dir` and that resulted in trying to download the dataset again ... but into a folder one level higher up than it should have. Note that my issue is with the `huggan/wikiart` dataset, so it is not a dataset-specific issue.
[ -0.1444699466228485, 0.002489805221557617, 0.03585709258913994, 0.3607310950756073, 0.345577210187912, 0.07848291844129562, 0.4264727532863617, 0.2986140847206116, -0.215998575091362, -0.09981349855661392, -0.14252692461013794, 0.34242287278175354, 0.07249689847230911, 0.011891968548297882, 0.20382392406463623, -0.04307795315980911, 0.11238783597946167, 0.1594155877828598, -0.4168981909751892, 0.10806548595428467, -0.17476072907447815, -0.0319291315972805, 0.06798338890075684, -0.14181208610534668, -0.5365023016929626, 0.14265647530555725, -0.0688859075307846, 0.4437931180000305, 0.04017331451177597, -0.49043816328048706, 0.4439797103404999, -0.11991538107395172, 0.27622801065444946, 0.5225337743759155, -0.0001183514395961538, 0.18378666043281555, 0.22820767760276794, 0.18910673260688782, -0.40206286311149597, 0.06522051244974136, -0.30804312229156494, -0.1764124035835266, 0.15456636250019073, -0.1732877492904663, -0.04478345811367035, 0.050609104335308075, -0.22859090566635132, -0.3987477719783783, 0.46109551191329956, 0.27729833126068115, 0.17530503869056702, 0.14079411327838898, -0.05201968923211098, -0.14781859517097473, 0.08156430721282959, -0.30723944306373596, 0.06937921047210693, 0.2810690104961395, 0.05189159885048866, -0.030665582045912743, -0.12121595442295074, 0.2399907112121582, 0.03545700013637543, 0.35758739709854126, -0.10360059142112732, -0.08496187627315521, 0.15913020074367523, -0.1787797510623932, 0.2122148722410202, 0.2680908143520355, 0.8666792511940002, -0.11817874014377594, -0.28208351135253906, -0.11430638283491135, -0.015579022467136383, -0.30416572093963623, 0.23836596310138702, 0.1250057816505432, 0.14780254662036896, -0.0004216263769194484, -0.13496771454811096, -0.04798489436507225, 0.019389361143112183, 0.12956050038337708, 0.06592722237110138, 0.22740358114242554, 0.07495644688606262, 0.18466171622276306, -0.19027072191238403, -0.10529957711696625, 0.30672064423561096, 0.27328941226005554, -0.22028537094593048, 0.25100624561309814, -0.6411430835723877, 0.010981135070323944, 0.055411361157894135, -0.05479978770017624, 0.062131285667419434, 0.30625802278518677, -0.028781771659851074, -0.03420089930295944, -0.0628855749964714, 0.09287697821855545, 0.18418356776237488, 0.17298325896263123, -0.25778165459632874, 0.2442810982465744, 0.17400379478931427, 0.3118211627006531, -0.4050522446632385, 0.05398448929190636, -0.10560470074415207, -0.24662145972251892, 0.40924543142318726, 0.06549680233001709, 0.3228606879711151, -0.250373899936676, -0.2093823254108429, 0.19585362076759338, -0.2718101143836975, -0.18487676978111267, 0.1770613193511963, 0.43359246850013733, -0.08280181884765625, 0.22876933217048645, -0.16011372208595276, 0.10252083092927933, -0.2341243475675583, -0.2763053774833679, -0.26858723163604736, -0.010177260264754295, -0.09182571619749069, 0.13521024584770203, 0.1801309734582901, -0.2663535177707672, 0.3582727015018463, 0.2122824341058731, -0.08923010528087616, -0.22497332096099854, 0.24348032474517822, -0.20334260165691376, -0.15945738554000854, 0.4474966526031494, 0.04045087844133377, 0.11236872524023056, 0.2817001938819885, 0.3013730049133301, 0.016829729080200195, 0.12412144243717194, -0.3080054223537445, -0.47779959440231323, -0.2108333259820938, 0.16707484424114227, 0.025769338011741638, -0.1218259185552597, -0.232522115111351, -0.0955689400434494, 0.3066293001174927, -0.20257511734962463, 0.08664989471435547, 0.03726682439446449, -0.4008713960647583, -0.2452392578125, 0.25445303320884705, 0.5882125496864319, -0.5447214245796204, -0.08787092566490173, -0.16287106275558472, 0.06325460970401764, -0.06392654776573181, 0.16111843287944794, -0.3797396421432495, 0.16670766472816467, -0.3257269561290741, -0.2517595887184143, 0.06125183030962944, -0.3675423860549927, -0.44896161556243896, 0.08898310363292694, -0.1800801157951355, 0.1590801179409027, -0.12617625296115875, -0.11129868030548096, -0.09362475574016571, 0.05923418328166008, 0.30997490882873535, 0.06535385549068451, -0.03519970178604126, 0.09984804689884186, -0.287528932094574, -0.4309695065021515, 0.29908496141433716, 0.3104657530784607, 0.25255531072616577, 0.11791303753852844, 0.3377189040184021, -0.31917524337768555, 0.14348268508911133, -0.08201614022254944, 0.05689941346645355, 0.3419364094734192, 0.2836114764213562, 0.20971804857254028, 0.24601104855537415, -0.10488761961460114, -0.392455130815506, 0.39409685134887695, -0.2985309958457947, -0.1119578629732132, 0.08244730532169342, 0.02658563107252121, -0.16578494012355804, -0.13704609870910645, -0.46472984552383423, -0.14881031215190887, 0.09104553610086441, -0.10526770353317261, -0.13259005546569824, -0.011745430529117584, -0.23316514492034912, 0.6271123886108398, 0.1259927749633789, 0.14744792878627777, -0.2509582042694092, 0.154829204082489, -0.11573401838541031, 0.01656600460410118, -0.08319848775863647, 0.12587252259254456, 0.42560452222824097, -0.0030336715281009674, -0.34258848428726196, 0.2733021378517151, -0.04106516391038895, -0.07638228684663773, 0.07889817655086517, -0.016093745827674866, 0.16579023003578186, 0.02693268656730652, 0.04587157070636749, 0.1153767853975296, 0.16943791508674622, -0.02270432561635971, 0.1838623285293579, 0.019756942987442017, 0.09331323206424713, 0.04236944764852524, 0.01636861264705658, -0.08798243850469589, 0.28221356868743896, -0.06725507974624634, 0.24939700961112976, -0.12486473470926285, 0.2898114025592804, 0.2725064754486084, 0.5127248764038086, -0.025719722732901573, 0.0814698189496994, 0.020765837281942368, 0.1828712671995163, 0.062227338552474976, 0.05986327677965164, 0.0463639572262764, -0.22533349692821503, -0.21807125210762024, 0.16679757833480835, 0.23858921229839325, 0.42152994871139526, 0.026413649320602417, -0.22860965132713318, -0.020257385447621346, -0.0789424329996109, 0.10103544592857361, 0.07380636781454086, -0.009408049285411835, 0.5704045295715332, 0.1363339126110077, 0.30337220430374146, 0.12061900645494461, -0.15701934695243835, -0.12447576224803925, 0.2826152741909027, 0.2512355148792267, -0.4371522068977356, 0.035685017704963684, -0.3731655478477478, -0.16080529987812042, 0.07237419486045837, 0.20515459775924683, -0.12603043019771576, -0.1533890664577484, -0.10918435454368591, 0.2066696733236313, -0.11501254886388779, 0.17493483424186707, -0.4331725537776947, 0.0644637793302536, 0.06644229590892792, -0.07514208555221558, -0.05403013154864311, 0.013312306255102158, -0.20879395306110382, -0.018526026979088783, 0.00400741770863533, -0.22614780068397522, 0.35885241627693176, 0.10823683440685272, -0.07980469614267349, -0.4409545063972473, -0.14453153312206268, 0.09470893442630768, 0.10929868370294571, 0.3877067565917969, -0.057010672986507416, 0.1434185802936554, -0.16618463397026062, -0.1649758368730545, 0.35889291763305664, 0.03413775563240051, 0.039309777319431305, 0.11089315265417099, -0.14109769463539124, 0.11605624854564667, 0.11519938707351685, -0.15585555136203766, -0.18062551319599152, -0.21194222569465637, -0.10933446884155273, -0.011999733746051788, 0.10894973576068878, 0.034192558377981186, -0.008506350219249725, 0.06344954669475555, 0.1545163094997406, 0.06542525440454483, -0.3791833519935608, -0.674432098865509, 0.0688062459230423, -0.2055526077747345, -0.09689733386039734, -0.05180937051773071, -0.050191134214401245, 0.22243475914001465, 0.019932720810174942, -0.3460763990879059, -0.2681753635406494, -0.24990534782409668, 0.36480769515037537, -0.42097821831703186, -0.06346815824508667, 0.3937935531139374, 0.04102132469415665, -0.0650218203663826, -0.1539507806301117, -0.061787188053131104, 0.12095612287521362, 0.07379856705665588, 0.19640614092350006, -0.14592409133911133, 0.36139339208602905, -0.15166884660720825, 0.3840024769306183, 0.1353369653224945, 0.017538538202643394, 0.6981136202812195, -0.050082482397556305, 0.20139162242412567, -0.15790686011314392, -0.21787209808826447, -0.18640363216400146, -0.2615137994289398, -0.07652098685503006, -0.04524846002459526, -0.024367347359657288, -0.2056932896375656, -0.12373331189155579, -0.24880553781986237, -0.36868977546691895, -0.07016501575708389, -0.08049938827753067, -0.4436844289302826, 0.035091422498226166, 0.25823572278022766, -0.011535458266735077, -0.08677975088357925, -0.021828537806868553, -0.06210954114794731, 0.13449418544769287, 0.09210946410894394, 0.04128029942512512, -0.07222766429185867, -0.18145830929279327, -0.20368975400924683, 0.2179778516292572, 0.10143277049064636, 0.42690545320510864, -0.02824397385120392, 0.10957895219326019, 0.06065570190548897, -0.22002221643924713, 0.4593932628631592, -0.5043135285377502, 0.30276402831077576, 0.24616192281246185, 0.014244288206100464, 0.023772425949573517, -0.3180352449417114, 0.1905122846364975, 0.2592918872833252, -0.057711027562618256, 0.16787748038768768, -0.15254734456539154, -0.10208626091480255, 0.2610403895378113, 0.11779291927814484, -0.2050967812538147, -0.3102566599845886, -0.3942502439022064, -0.21591335535049438, -0.26722997426986694, -0.02386588230729103, -0.24601832032203674, 0.15379206836223602, -0.16837579011917114, -0.11464009433984756, -0.051601700484752655, 0.03570472449064255, -0.25875937938690186, 0.09769710898399353, 0.3685157597064972, -0.10147805511951447, 0.5235635042190552, 0.28358590602874756, 0.08554576337337494, 0.31745103001594543, 0.6318058967590332, -0.20566609501838684, -0.26708781719207764, -0.061764080077409744, 0.163578063249588, -0.04728786647319794, 0.11314956843852997, -0.10171476006507874, 0.06866907328367233, 0.10403895378112793, 0.2153530716896057, -0.06912202388048172, -0.04723339527845383, 0.21949826180934906, 0.003290485590696335, -0.5447520613670349, -0.42355072498321533, 0.5792015790939331, -0.06522760540246964, 0.10768792033195496, 0.46094319224357605, 0.05083530768752098, -0.20374369621276855, 0.27101007103919983, 0.05861188471317291, 0.6728886365890503, 0.05252479761838913, 0.27700188755989075, 0.3038198947906494, -0.09332767128944397, 0.39694467186927795, -0.35885190963745117, 0.08998583257198334, -0.4880227744579315, -0.06847154349088669, 0.007025301456451416, -0.054134905338287354, -0.17132258415222168, -0.043401945382356644, 0.11550687253475189, 0.2926608622074127, -0.35208433866500854, 0.18560492992401123, 0.07740151882171631, 0.1743490844964981, -0.21293675899505615, -0.11872801184654236, -0.12342672049999237, 0.20602606236934662, -0.3521178662776947, 0.08435051888227463, -0.24139396846294403, 0.11785225570201874, 0.15657128393650055, -0.31637057662010193, -0.391244500875473, 0.26834964752197266, -0.4938187003135681, 0.6286317706108093, -0.3212297558784485, -0.1907568722963333, -0.03950212150812149, -0.16476570069789886, 0.13803409039974213, 0.053373150527477264, -0.07475776225328445, 0.31099429726600647, 0.2242375761270523, 0.1182384341955185, -0.17475271224975586, -0.18584060668945312, 0.5123452544212341, -0.006340943276882172, -0.39237916469573975, -0.1833687424659729, -0.28916141390800476, -0.48903071880340576, -0.06521874666213989, 0.19845500588417053, -0.27147194743156433, -0.2400144338607788, -0.05744963139295578, -0.05482283979654312, 0.16415105760097504, -0.3066540062427521, 0.10636711120605469, 0.15449249744415283, -0.10108259320259094, 0.06872814893722534, 0.04472387209534645, -0.283413827419281, -0.11418215185403824, 0.4461764395236969, -0.01408314611762762, 0.02039802074432373, 0.5998364090919495, 0.16948038339614868, -0.10200522094964981, -0.13949154317378998, 0.0025424212217330933, 0.33780425786972046, -0.4585244059562683, 0.12817874550819397, 0.023760106414556503, 0.11643750965595245, 0.014777589589357376, -0.12850584089756012, 0.0345727875828743, 0.05039437487721443, 0.19558584690093994, -0.46122437715530396, -0.43509042263031006, 0.12216836214065552, -0.23733437061309814, 0.03730958327651024, 0.27127665281295776, 0.10037103295326233, -0.027359802275896072, 0.13771335780620575, -0.217529758810997, 0.267874538898468, -0.03295089304447174, -0.009830292314291, -0.01120363175868988, -0.18767298758029938, 0.2919813096523285, -0.12631136178970337, 0.1389165073633194, 0.18073102831840515, -0.06534357368946075, -0.23329128324985504, -0.4364716708660126, 0.16532284021377563, 0.08414818346500397, -0.2955617606639862, -0.11770014464855194, -0.21506384015083313, 0.023329563438892365, -0.007872156798839569, 0.11871443688869476, 0.23242630064487457, 0.12641514837741852, -0.029079971835017204, 0.35566234588623047, -0.01865139976143837, -0.28995874524116516, 0.3505179286003113, 0.046421829611063004, 0.02566199004650116, 0.04484926536679268, 0.18653471767902374, -0.034187767654657364, 0.03797400742769241, -0.1548909693956375, -0.22402876615524292, 0.0936160460114479, -0.03797699511051178, 0.22085897624492645, -0.5956956744194031, 0.04819826781749725, -0.09335175156593323, 0.17227408289909363, 0.2744709849357605, -0.24587778747081757, -0.1716381311416626, 0.22994956374168396, 0.21586255729198456, -0.19947877526283264, -0.14573201537132263, 0.13540688157081604, -0.05733982473611832, -0.08682648837566376, -0.1336863934993744, 0.16909755766391754, 0.1067933440208435, 0.05975944176316261, 0.10639280080795288, 0.510636568069458, -0.4000450074672699, 0.29639187455177307, 0.08466753363609314, 0.07233991473913193, -0.0211375430226326, 0.0419987291097641, 0.20194661617279053, 0.0728544220328331, 0.5271238088607788, -0.06670603901147842, -0.036302220076322556, 0.08857069909572601, -0.09240294992923737, -0.0614766851067543, -0.5270278453826904, 0.11937803775072098, 0.340533971786499, -0.3664064109325409, 0.20540258288383484, -0.08713354915380478, 0.606884777545929, -0.11193592846393585, -0.12601906061172485, -0.3004278838634491, 0.01737055554986, -0.2617473006248474, -0.009960826486349106, 0.10692547261714935, -0.11170313507318497, 0.0009004473686218262, 0.2524224817752838, -0.09694318473339081, -0.11194515973329544, 0.005844280123710632, 0.3405323028564453, -0.33433622121810913, -0.44873255491256714, 0.2671677768230438, 0.5542370676994324, 0.019176803529262543, -0.05389366298913956, 0.26033660769462585, 0.6320203542709351, -0.3430185616016388, 0.0030635688453912735, 0.00831276923418045, 0.5110350251197815, 0.15919595956802368, -0.25807985663414, 0.2044796645641327, 0.1687745898962021, 0.0889860987663269, 0.06505810469388962, -0.13517652451992035, 0.18900910019874573, -0.19548971951007843, 0.2190590500831604, 0.1221197098493576, -0.13169124722480774, 0.24976220726966858, 0.007285369094461203, 0.301502525806427, -0.18396666646003723, 0.20130933821201324, -0.019812844693660736, -0.06322164833545685, -0.05601082742214203, 0.10721489787101746, -0.19311267137527466, 0.42038649320602417, 0.6053605079650879, 0.11239813268184662, 0.01888030394911766, -0.040976736694574356, 0.052128564566373825, -0.014247818849980831, 0.47126972675323486, 0.31696560978889465, -0.1260925829410553, -0.3908785283565521, 0.10801036655902863, -0.6093943119049072, 0.11275838315486908, -0.32473358511924744, 0.24244830012321472, 0.11539990454912186, 0.09348249435424805, -0.20515134930610657, -0.22468848526477814, 0.5394143462181091, -0.009535185992717743, 0.3131077289581299, 0.2699817419052124, -0.23030848801136017, -0.11331035196781158, 0.0909392237663269, 0.0719657614827156, -0.011941548436880112, -0.6237967610359192, 0.0635661780834198, 0.08409331738948822, -0.03640963137149811, -0.14313125610351562, -0.28701063990592957, 0.22550074756145477, -0.5486243963241577, 0.3755955696105957, 0.11172913014888763, 0.5196930766105652, 0.013245336711406708, -0.07478953897953033, -0.3698584735393524, -0.314348429441452, -0.16623751819133759, -0.019575588405132294, 0.16579745709896088, 0.4413841962814331, -0.017449278384447098, 0.014128567650914192, -0.41692113876342773, 0.27447354793548584, -0.22826702892780304, 0.034852832555770874, -0.21127718687057495, 0.052857980132102966, 0.1489344984292984, 0.10262315720319748, 0.1294419765472412, 0.29353564977645874, 0.047971658408641815, 0.41674819588661194, -0.391074001789093, -0.4308297038078308, 0.4672960340976715, -0.536807656288147, -0.19615356624126434, -0.26996150612831116, 0.4315111041069031, 0.14470578730106354, -0.1193326860666275, -0.37909984588623047, 0.11928871273994446, 0.3465966582298279, 0.006722567602992058, -0.2619442343711853, 0.3001845180988312, 0.22956621646881104, 0.05471578240394592, -0.06852351129055023, 0.2980799078941345, 0.00883605144917965, -0.15819227695465088, 0.022173330187797546, -0.17173302173614502 ]
https://github.com/huggingface/datasets/issues/5831
same problem with a private dataset repo, seems the huggingface hub server got some connection problem?
[Bug]504 Server Error when loading dataset which was already cached
### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
16
[Bug]504 Server Error when loading dataset which was already cached ### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 same problem with a private dataset repo, seems the huggingface hub server got some connection problem?
[ -0.1444699466228485, 0.002489805221557617, 0.03585709258913994, 0.3607310950756073, 0.345577210187912, 0.07848291844129562, 0.4264727532863617, 0.2986140847206116, -0.215998575091362, -0.09981349855661392, -0.14252692461013794, 0.34242287278175354, 0.07249689847230911, 0.011891968548297882, 0.20382392406463623, -0.04307795315980911, 0.11238783597946167, 0.1594155877828598, -0.4168981909751892, 0.10806548595428467, -0.17476072907447815, -0.0319291315972805, 0.06798338890075684, -0.14181208610534668, -0.5365023016929626, 0.14265647530555725, -0.0688859075307846, 0.4437931180000305, 0.04017331451177597, -0.49043816328048706, 0.4439797103404999, -0.11991538107395172, 0.27622801065444946, 0.5225337743759155, -0.0001183514395961538, 0.18378666043281555, 0.22820767760276794, 0.18910673260688782, -0.40206286311149597, 0.06522051244974136, -0.30804312229156494, -0.1764124035835266, 0.15456636250019073, -0.1732877492904663, -0.04478345811367035, 0.050609104335308075, -0.22859090566635132, -0.3987477719783783, 0.46109551191329956, 0.27729833126068115, 0.17530503869056702, 0.14079411327838898, -0.05201968923211098, -0.14781859517097473, 0.08156430721282959, -0.30723944306373596, 0.06937921047210693, 0.2810690104961395, 0.05189159885048866, -0.030665582045912743, -0.12121595442295074, 0.2399907112121582, 0.03545700013637543, 0.35758739709854126, -0.10360059142112732, -0.08496187627315521, 0.15913020074367523, -0.1787797510623932, 0.2122148722410202, 0.2680908143520355, 0.8666792511940002, -0.11817874014377594, -0.28208351135253906, -0.11430638283491135, -0.015579022467136383, -0.30416572093963623, 0.23836596310138702, 0.1250057816505432, 0.14780254662036896, -0.0004216263769194484, -0.13496771454811096, -0.04798489436507225, 0.019389361143112183, 0.12956050038337708, 0.06592722237110138, 0.22740358114242554, 0.07495644688606262, 0.18466171622276306, -0.19027072191238403, -0.10529957711696625, 0.30672064423561096, 0.27328941226005554, -0.22028537094593048, 0.25100624561309814, -0.6411430835723877, 0.010981135070323944, 0.055411361157894135, -0.05479978770017624, 0.062131285667419434, 0.30625802278518677, -0.028781771659851074, -0.03420089930295944, -0.0628855749964714, 0.09287697821855545, 0.18418356776237488, 0.17298325896263123, -0.25778165459632874, 0.2442810982465744, 0.17400379478931427, 0.3118211627006531, -0.4050522446632385, 0.05398448929190636, -0.10560470074415207, -0.24662145972251892, 0.40924543142318726, 0.06549680233001709, 0.3228606879711151, -0.250373899936676, -0.2093823254108429, 0.19585362076759338, -0.2718101143836975, -0.18487676978111267, 0.1770613193511963, 0.43359246850013733, -0.08280181884765625, 0.22876933217048645, -0.16011372208595276, 0.10252083092927933, -0.2341243475675583, -0.2763053774833679, -0.26858723163604736, -0.010177260264754295, -0.09182571619749069, 0.13521024584770203, 0.1801309734582901, -0.2663535177707672, 0.3582727015018463, 0.2122824341058731, -0.08923010528087616, -0.22497332096099854, 0.24348032474517822, -0.20334260165691376, -0.15945738554000854, 0.4474966526031494, 0.04045087844133377, 0.11236872524023056, 0.2817001938819885, 0.3013730049133301, 0.016829729080200195, 0.12412144243717194, -0.3080054223537445, -0.47779959440231323, -0.2108333259820938, 0.16707484424114227, 0.025769338011741638, -0.1218259185552597, -0.232522115111351, -0.0955689400434494, 0.3066293001174927, -0.20257511734962463, 0.08664989471435547, 0.03726682439446449, -0.4008713960647583, -0.2452392578125, 0.25445303320884705, 0.5882125496864319, -0.5447214245796204, -0.08787092566490173, -0.16287106275558472, 0.06325460970401764, -0.06392654776573181, 0.16111843287944794, -0.3797396421432495, 0.16670766472816467, -0.3257269561290741, -0.2517595887184143, 0.06125183030962944, -0.3675423860549927, -0.44896161556243896, 0.08898310363292694, -0.1800801157951355, 0.1590801179409027, -0.12617625296115875, -0.11129868030548096, -0.09362475574016571, 0.05923418328166008, 0.30997490882873535, 0.06535385549068451, -0.03519970178604126, 0.09984804689884186, -0.287528932094574, -0.4309695065021515, 0.29908496141433716, 0.3104657530784607, 0.25255531072616577, 0.11791303753852844, 0.3377189040184021, -0.31917524337768555, 0.14348268508911133, -0.08201614022254944, 0.05689941346645355, 0.3419364094734192, 0.2836114764213562, 0.20971804857254028, 0.24601104855537415, -0.10488761961460114, -0.392455130815506, 0.39409685134887695, -0.2985309958457947, -0.1119578629732132, 0.08244730532169342, 0.02658563107252121, -0.16578494012355804, -0.13704609870910645, -0.46472984552383423, -0.14881031215190887, 0.09104553610086441, -0.10526770353317261, -0.13259005546569824, -0.011745430529117584, -0.23316514492034912, 0.6271123886108398, 0.1259927749633789, 0.14744792878627777, -0.2509582042694092, 0.154829204082489, -0.11573401838541031, 0.01656600460410118, -0.08319848775863647, 0.12587252259254456, 0.42560452222824097, -0.0030336715281009674, -0.34258848428726196, 0.2733021378517151, -0.04106516391038895, -0.07638228684663773, 0.07889817655086517, -0.016093745827674866, 0.16579023003578186, 0.02693268656730652, 0.04587157070636749, 0.1153767853975296, 0.16943791508674622, -0.02270432561635971, 0.1838623285293579, 0.019756942987442017, 0.09331323206424713, 0.04236944764852524, 0.01636861264705658, -0.08798243850469589, 0.28221356868743896, -0.06725507974624634, 0.24939700961112976, -0.12486473470926285, 0.2898114025592804, 0.2725064754486084, 0.5127248764038086, -0.025719722732901573, 0.0814698189496994, 0.020765837281942368, 0.1828712671995163, 0.062227338552474976, 0.05986327677965164, 0.0463639572262764, -0.22533349692821503, -0.21807125210762024, 0.16679757833480835, 0.23858921229839325, 0.42152994871139526, 0.026413649320602417, -0.22860965132713318, -0.020257385447621346, -0.0789424329996109, 0.10103544592857361, 0.07380636781454086, -0.009408049285411835, 0.5704045295715332, 0.1363339126110077, 0.30337220430374146, 0.12061900645494461, -0.15701934695243835, -0.12447576224803925, 0.2826152741909027, 0.2512355148792267, -0.4371522068977356, 0.035685017704963684, -0.3731655478477478, -0.16080529987812042, 0.07237419486045837, 0.20515459775924683, -0.12603043019771576, -0.1533890664577484, -0.10918435454368591, 0.2066696733236313, -0.11501254886388779, 0.17493483424186707, -0.4331725537776947, 0.0644637793302536, 0.06644229590892792, -0.07514208555221558, -0.05403013154864311, 0.013312306255102158, -0.20879395306110382, -0.018526026979088783, 0.00400741770863533, -0.22614780068397522, 0.35885241627693176, 0.10823683440685272, -0.07980469614267349, -0.4409545063972473, -0.14453153312206268, 0.09470893442630768, 0.10929868370294571, 0.3877067565917969, -0.057010672986507416, 0.1434185802936554, -0.16618463397026062, -0.1649758368730545, 0.35889291763305664, 0.03413775563240051, 0.039309777319431305, 0.11089315265417099, -0.14109769463539124, 0.11605624854564667, 0.11519938707351685, -0.15585555136203766, -0.18062551319599152, -0.21194222569465637, -0.10933446884155273, -0.011999733746051788, 0.10894973576068878, 0.034192558377981186, -0.008506350219249725, 0.06344954669475555, 0.1545163094997406, 0.06542525440454483, -0.3791833519935608, -0.674432098865509, 0.0688062459230423, -0.2055526077747345, -0.09689733386039734, -0.05180937051773071, -0.050191134214401245, 0.22243475914001465, 0.019932720810174942, -0.3460763990879059, -0.2681753635406494, -0.24990534782409668, 0.36480769515037537, -0.42097821831703186, -0.06346815824508667, 0.3937935531139374, 0.04102132469415665, -0.0650218203663826, -0.1539507806301117, -0.061787188053131104, 0.12095612287521362, 0.07379856705665588, 0.19640614092350006, -0.14592409133911133, 0.36139339208602905, -0.15166884660720825, 0.3840024769306183, 0.1353369653224945, 0.017538538202643394, 0.6981136202812195, -0.050082482397556305, 0.20139162242412567, -0.15790686011314392, -0.21787209808826447, -0.18640363216400146, -0.2615137994289398, -0.07652098685503006, -0.04524846002459526, -0.024367347359657288, -0.2056932896375656, -0.12373331189155579, -0.24880553781986237, -0.36868977546691895, -0.07016501575708389, -0.08049938827753067, -0.4436844289302826, 0.035091422498226166, 0.25823572278022766, -0.011535458266735077, -0.08677975088357925, -0.021828537806868553, -0.06210954114794731, 0.13449418544769287, 0.09210946410894394, 0.04128029942512512, -0.07222766429185867, -0.18145830929279327, -0.20368975400924683, 0.2179778516292572, 0.10143277049064636, 0.42690545320510864, -0.02824397385120392, 0.10957895219326019, 0.06065570190548897, -0.22002221643924713, 0.4593932628631592, -0.5043135285377502, 0.30276402831077576, 0.24616192281246185, 0.014244288206100464, 0.023772425949573517, -0.3180352449417114, 0.1905122846364975, 0.2592918872833252, -0.057711027562618256, 0.16787748038768768, -0.15254734456539154, -0.10208626091480255, 0.2610403895378113, 0.11779291927814484, -0.2050967812538147, -0.3102566599845886, -0.3942502439022064, -0.21591335535049438, -0.26722997426986694, -0.02386588230729103, -0.24601832032203674, 0.15379206836223602, -0.16837579011917114, -0.11464009433984756, -0.051601700484752655, 0.03570472449064255, -0.25875937938690186, 0.09769710898399353, 0.3685157597064972, -0.10147805511951447, 0.5235635042190552, 0.28358590602874756, 0.08554576337337494, 0.31745103001594543, 0.6318058967590332, -0.20566609501838684, -0.26708781719207764, -0.061764080077409744, 0.163578063249588, -0.04728786647319794, 0.11314956843852997, -0.10171476006507874, 0.06866907328367233, 0.10403895378112793, 0.2153530716896057, -0.06912202388048172, -0.04723339527845383, 0.21949826180934906, 0.003290485590696335, -0.5447520613670349, -0.42355072498321533, 0.5792015790939331, -0.06522760540246964, 0.10768792033195496, 0.46094319224357605, 0.05083530768752098, -0.20374369621276855, 0.27101007103919983, 0.05861188471317291, 0.6728886365890503, 0.05252479761838913, 0.27700188755989075, 0.3038198947906494, -0.09332767128944397, 0.39694467186927795, -0.35885190963745117, 0.08998583257198334, -0.4880227744579315, -0.06847154349088669, 0.007025301456451416, -0.054134905338287354, -0.17132258415222168, -0.043401945382356644, 0.11550687253475189, 0.2926608622074127, -0.35208433866500854, 0.18560492992401123, 0.07740151882171631, 0.1743490844964981, -0.21293675899505615, -0.11872801184654236, -0.12342672049999237, 0.20602606236934662, -0.3521178662776947, 0.08435051888227463, -0.24139396846294403, 0.11785225570201874, 0.15657128393650055, -0.31637057662010193, -0.391244500875473, 0.26834964752197266, -0.4938187003135681, 0.6286317706108093, -0.3212297558784485, -0.1907568722963333, -0.03950212150812149, -0.16476570069789886, 0.13803409039974213, 0.053373150527477264, -0.07475776225328445, 0.31099429726600647, 0.2242375761270523, 0.1182384341955185, -0.17475271224975586, -0.18584060668945312, 0.5123452544212341, -0.006340943276882172, -0.39237916469573975, -0.1833687424659729, -0.28916141390800476, -0.48903071880340576, -0.06521874666213989, 0.19845500588417053, -0.27147194743156433, -0.2400144338607788, -0.05744963139295578, -0.05482283979654312, 0.16415105760097504, -0.3066540062427521, 0.10636711120605469, 0.15449249744415283, -0.10108259320259094, 0.06872814893722534, 0.04472387209534645, -0.283413827419281, -0.11418215185403824, 0.4461764395236969, -0.01408314611762762, 0.02039802074432373, 0.5998364090919495, 0.16948038339614868, -0.10200522094964981, -0.13949154317378998, 0.0025424212217330933, 0.33780425786972046, -0.4585244059562683, 0.12817874550819397, 0.023760106414556503, 0.11643750965595245, 0.014777589589357376, -0.12850584089756012, 0.0345727875828743, 0.05039437487721443, 0.19558584690093994, -0.46122437715530396, -0.43509042263031006, 0.12216836214065552, -0.23733437061309814, 0.03730958327651024, 0.27127665281295776, 0.10037103295326233, -0.027359802275896072, 0.13771335780620575, -0.217529758810997, 0.267874538898468, -0.03295089304447174, -0.009830292314291, -0.01120363175868988, -0.18767298758029938, 0.2919813096523285, -0.12631136178970337, 0.1389165073633194, 0.18073102831840515, -0.06534357368946075, -0.23329128324985504, -0.4364716708660126, 0.16532284021377563, 0.08414818346500397, -0.2955617606639862, -0.11770014464855194, -0.21506384015083313, 0.023329563438892365, -0.007872156798839569, 0.11871443688869476, 0.23242630064487457, 0.12641514837741852, -0.029079971835017204, 0.35566234588623047, -0.01865139976143837, -0.28995874524116516, 0.3505179286003113, 0.046421829611063004, 0.02566199004650116, 0.04484926536679268, 0.18653471767902374, -0.034187767654657364, 0.03797400742769241, -0.1548909693956375, -0.22402876615524292, 0.0936160460114479, -0.03797699511051178, 0.22085897624492645, -0.5956956744194031, 0.04819826781749725, -0.09335175156593323, 0.17227408289909363, 0.2744709849357605, -0.24587778747081757, -0.1716381311416626, 0.22994956374168396, 0.21586255729198456, -0.19947877526283264, -0.14573201537132263, 0.13540688157081604, -0.05733982473611832, -0.08682648837566376, -0.1336863934993744, 0.16909755766391754, 0.1067933440208435, 0.05975944176316261, 0.10639280080795288, 0.510636568069458, -0.4000450074672699, 0.29639187455177307, 0.08466753363609314, 0.07233991473913193, -0.0211375430226326, 0.0419987291097641, 0.20194661617279053, 0.0728544220328331, 0.5271238088607788, -0.06670603901147842, -0.036302220076322556, 0.08857069909572601, -0.09240294992923737, -0.0614766851067543, -0.5270278453826904, 0.11937803775072098, 0.340533971786499, -0.3664064109325409, 0.20540258288383484, -0.08713354915380478, 0.606884777545929, -0.11193592846393585, -0.12601906061172485, -0.3004278838634491, 0.01737055554986, -0.2617473006248474, -0.009960826486349106, 0.10692547261714935, -0.11170313507318497, 0.0009004473686218262, 0.2524224817752838, -0.09694318473339081, -0.11194515973329544, 0.005844280123710632, 0.3405323028564453, -0.33433622121810913, -0.44873255491256714, 0.2671677768230438, 0.5542370676994324, 0.019176803529262543, -0.05389366298913956, 0.26033660769462585, 0.6320203542709351, -0.3430185616016388, 0.0030635688453912735, 0.00831276923418045, 0.5110350251197815, 0.15919595956802368, -0.25807985663414, 0.2044796645641327, 0.1687745898962021, 0.0889860987663269, 0.06505810469388962, -0.13517652451992035, 0.18900910019874573, -0.19548971951007843, 0.2190590500831604, 0.1221197098493576, -0.13169124722480774, 0.24976220726966858, 0.007285369094461203, 0.301502525806427, -0.18396666646003723, 0.20130933821201324, -0.019812844693660736, -0.06322164833545685, -0.05601082742214203, 0.10721489787101746, -0.19311267137527466, 0.42038649320602417, 0.6053605079650879, 0.11239813268184662, 0.01888030394911766, -0.040976736694574356, 0.052128564566373825, -0.014247818849980831, 0.47126972675323486, 0.31696560978889465, -0.1260925829410553, -0.3908785283565521, 0.10801036655902863, -0.6093943119049072, 0.11275838315486908, -0.32473358511924744, 0.24244830012321472, 0.11539990454912186, 0.09348249435424805, -0.20515134930610657, -0.22468848526477814, 0.5394143462181091, -0.009535185992717743, 0.3131077289581299, 0.2699817419052124, -0.23030848801136017, -0.11331035196781158, 0.0909392237663269, 0.0719657614827156, -0.011941548436880112, -0.6237967610359192, 0.0635661780834198, 0.08409331738948822, -0.03640963137149811, -0.14313125610351562, -0.28701063990592957, 0.22550074756145477, -0.5486243963241577, 0.3755955696105957, 0.11172913014888763, 0.5196930766105652, 0.013245336711406708, -0.07478953897953033, -0.3698584735393524, -0.314348429441452, -0.16623751819133759, -0.019575588405132294, 0.16579745709896088, 0.4413841962814331, -0.017449278384447098, 0.014128567650914192, -0.41692113876342773, 0.27447354793548584, -0.22826702892780304, 0.034852832555770874, -0.21127718687057495, 0.052857980132102966, 0.1489344984292984, 0.10262315720319748, 0.1294419765472412, 0.29353564977645874, 0.047971658408641815, 0.41674819588661194, -0.391074001789093, -0.4308297038078308, 0.4672960340976715, -0.536807656288147, -0.19615356624126434, -0.26996150612831116, 0.4315111041069031, 0.14470578730106354, -0.1193326860666275, -0.37909984588623047, 0.11928871273994446, 0.3465966582298279, 0.006722567602992058, -0.2619442343711853, 0.3001845180988312, 0.22956621646881104, 0.05471578240394592, -0.06852351129055023, 0.2980799078941345, 0.00883605144917965, -0.15819227695465088, 0.022173330187797546, -0.17173302173614502 ]
https://github.com/huggingface/datasets/issues/5831
@SingL3 You can avoid this error by setting the [`HF_DATASETS_OFFLINE`](https://huggingface.co/docs/datasets/v2.12.0/en/loading#offline) env variable to 1. By default, if an internet connection is available, we check whether the cache of a cached dataset is up-to-date. @lucidBrot `datasets`' cache is still not aligned with `huggigface_hub`'s. We plan to align it eventually.
[Bug]504 Server Error when loading dataset which was already cached
### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
48
[Bug]504 Server Error when loading dataset which was already cached ### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 @SingL3 You can avoid this error by setting the [`HF_DATASETS_OFFLINE`](https://huggingface.co/docs/datasets/v2.12.0/en/loading#offline) env variable to 1. By default, if an internet connection is available, we check whether the cache of a cached dataset is up-to-date. @lucidBrot `datasets`' cache is still not aligned with `huggigface_hub`'s. We plan to align it eventually.
[ -0.1444699466228485, 0.002489805221557617, 0.03585709258913994, 0.3607310950756073, 0.345577210187912, 0.07848291844129562, 0.4264727532863617, 0.2986140847206116, -0.215998575091362, -0.09981349855661392, -0.14252692461013794, 0.34242287278175354, 0.07249689847230911, 0.011891968548297882, 0.20382392406463623, -0.04307795315980911, 0.11238783597946167, 0.1594155877828598, -0.4168981909751892, 0.10806548595428467, -0.17476072907447815, -0.0319291315972805, 0.06798338890075684, -0.14181208610534668, -0.5365023016929626, 0.14265647530555725, -0.0688859075307846, 0.4437931180000305, 0.04017331451177597, -0.49043816328048706, 0.4439797103404999, -0.11991538107395172, 0.27622801065444946, 0.5225337743759155, -0.0001183514395961538, 0.18378666043281555, 0.22820767760276794, 0.18910673260688782, -0.40206286311149597, 0.06522051244974136, -0.30804312229156494, -0.1764124035835266, 0.15456636250019073, -0.1732877492904663, -0.04478345811367035, 0.050609104335308075, -0.22859090566635132, -0.3987477719783783, 0.46109551191329956, 0.27729833126068115, 0.17530503869056702, 0.14079411327838898, -0.05201968923211098, -0.14781859517097473, 0.08156430721282959, -0.30723944306373596, 0.06937921047210693, 0.2810690104961395, 0.05189159885048866, -0.030665582045912743, -0.12121595442295074, 0.2399907112121582, 0.03545700013637543, 0.35758739709854126, -0.10360059142112732, -0.08496187627315521, 0.15913020074367523, -0.1787797510623932, 0.2122148722410202, 0.2680908143520355, 0.8666792511940002, -0.11817874014377594, -0.28208351135253906, -0.11430638283491135, -0.015579022467136383, -0.30416572093963623, 0.23836596310138702, 0.1250057816505432, 0.14780254662036896, -0.0004216263769194484, -0.13496771454811096, -0.04798489436507225, 0.019389361143112183, 0.12956050038337708, 0.06592722237110138, 0.22740358114242554, 0.07495644688606262, 0.18466171622276306, -0.19027072191238403, -0.10529957711696625, 0.30672064423561096, 0.27328941226005554, -0.22028537094593048, 0.25100624561309814, -0.6411430835723877, 0.010981135070323944, 0.055411361157894135, -0.05479978770017624, 0.062131285667419434, 0.30625802278518677, -0.028781771659851074, -0.03420089930295944, -0.0628855749964714, 0.09287697821855545, 0.18418356776237488, 0.17298325896263123, -0.25778165459632874, 0.2442810982465744, 0.17400379478931427, 0.3118211627006531, -0.4050522446632385, 0.05398448929190636, -0.10560470074415207, -0.24662145972251892, 0.40924543142318726, 0.06549680233001709, 0.3228606879711151, -0.250373899936676, -0.2093823254108429, 0.19585362076759338, -0.2718101143836975, -0.18487676978111267, 0.1770613193511963, 0.43359246850013733, -0.08280181884765625, 0.22876933217048645, -0.16011372208595276, 0.10252083092927933, -0.2341243475675583, -0.2763053774833679, -0.26858723163604736, -0.010177260264754295, -0.09182571619749069, 0.13521024584770203, 0.1801309734582901, -0.2663535177707672, 0.3582727015018463, 0.2122824341058731, -0.08923010528087616, -0.22497332096099854, 0.24348032474517822, -0.20334260165691376, -0.15945738554000854, 0.4474966526031494, 0.04045087844133377, 0.11236872524023056, 0.2817001938819885, 0.3013730049133301, 0.016829729080200195, 0.12412144243717194, -0.3080054223537445, -0.47779959440231323, -0.2108333259820938, 0.16707484424114227, 0.025769338011741638, -0.1218259185552597, -0.232522115111351, -0.0955689400434494, 0.3066293001174927, -0.20257511734962463, 0.08664989471435547, 0.03726682439446449, -0.4008713960647583, -0.2452392578125, 0.25445303320884705, 0.5882125496864319, -0.5447214245796204, -0.08787092566490173, -0.16287106275558472, 0.06325460970401764, -0.06392654776573181, 0.16111843287944794, -0.3797396421432495, 0.16670766472816467, -0.3257269561290741, -0.2517595887184143, 0.06125183030962944, -0.3675423860549927, -0.44896161556243896, 0.08898310363292694, -0.1800801157951355, 0.1590801179409027, -0.12617625296115875, -0.11129868030548096, -0.09362475574016571, 0.05923418328166008, 0.30997490882873535, 0.06535385549068451, -0.03519970178604126, 0.09984804689884186, -0.287528932094574, -0.4309695065021515, 0.29908496141433716, 0.3104657530784607, 0.25255531072616577, 0.11791303753852844, 0.3377189040184021, -0.31917524337768555, 0.14348268508911133, -0.08201614022254944, 0.05689941346645355, 0.3419364094734192, 0.2836114764213562, 0.20971804857254028, 0.24601104855537415, -0.10488761961460114, -0.392455130815506, 0.39409685134887695, -0.2985309958457947, -0.1119578629732132, 0.08244730532169342, 0.02658563107252121, -0.16578494012355804, -0.13704609870910645, -0.46472984552383423, -0.14881031215190887, 0.09104553610086441, -0.10526770353317261, -0.13259005546569824, -0.011745430529117584, -0.23316514492034912, 0.6271123886108398, 0.1259927749633789, 0.14744792878627777, -0.2509582042694092, 0.154829204082489, -0.11573401838541031, 0.01656600460410118, -0.08319848775863647, 0.12587252259254456, 0.42560452222824097, -0.0030336715281009674, -0.34258848428726196, 0.2733021378517151, -0.04106516391038895, -0.07638228684663773, 0.07889817655086517, -0.016093745827674866, 0.16579023003578186, 0.02693268656730652, 0.04587157070636749, 0.1153767853975296, 0.16943791508674622, -0.02270432561635971, 0.1838623285293579, 0.019756942987442017, 0.09331323206424713, 0.04236944764852524, 0.01636861264705658, -0.08798243850469589, 0.28221356868743896, -0.06725507974624634, 0.24939700961112976, -0.12486473470926285, 0.2898114025592804, 0.2725064754486084, 0.5127248764038086, -0.025719722732901573, 0.0814698189496994, 0.020765837281942368, 0.1828712671995163, 0.062227338552474976, 0.05986327677965164, 0.0463639572262764, -0.22533349692821503, -0.21807125210762024, 0.16679757833480835, 0.23858921229839325, 0.42152994871139526, 0.026413649320602417, -0.22860965132713318, -0.020257385447621346, -0.0789424329996109, 0.10103544592857361, 0.07380636781454086, -0.009408049285411835, 0.5704045295715332, 0.1363339126110077, 0.30337220430374146, 0.12061900645494461, -0.15701934695243835, -0.12447576224803925, 0.2826152741909027, 0.2512355148792267, -0.4371522068977356, 0.035685017704963684, -0.3731655478477478, -0.16080529987812042, 0.07237419486045837, 0.20515459775924683, -0.12603043019771576, -0.1533890664577484, -0.10918435454368591, 0.2066696733236313, -0.11501254886388779, 0.17493483424186707, -0.4331725537776947, 0.0644637793302536, 0.06644229590892792, -0.07514208555221558, -0.05403013154864311, 0.013312306255102158, -0.20879395306110382, -0.018526026979088783, 0.00400741770863533, -0.22614780068397522, 0.35885241627693176, 0.10823683440685272, -0.07980469614267349, -0.4409545063972473, -0.14453153312206268, 0.09470893442630768, 0.10929868370294571, 0.3877067565917969, -0.057010672986507416, 0.1434185802936554, -0.16618463397026062, -0.1649758368730545, 0.35889291763305664, 0.03413775563240051, 0.039309777319431305, 0.11089315265417099, -0.14109769463539124, 0.11605624854564667, 0.11519938707351685, -0.15585555136203766, -0.18062551319599152, -0.21194222569465637, -0.10933446884155273, -0.011999733746051788, 0.10894973576068878, 0.034192558377981186, -0.008506350219249725, 0.06344954669475555, 0.1545163094997406, 0.06542525440454483, -0.3791833519935608, -0.674432098865509, 0.0688062459230423, -0.2055526077747345, -0.09689733386039734, -0.05180937051773071, -0.050191134214401245, 0.22243475914001465, 0.019932720810174942, -0.3460763990879059, -0.2681753635406494, -0.24990534782409668, 0.36480769515037537, -0.42097821831703186, -0.06346815824508667, 0.3937935531139374, 0.04102132469415665, -0.0650218203663826, -0.1539507806301117, -0.061787188053131104, 0.12095612287521362, 0.07379856705665588, 0.19640614092350006, -0.14592409133911133, 0.36139339208602905, -0.15166884660720825, 0.3840024769306183, 0.1353369653224945, 0.017538538202643394, 0.6981136202812195, -0.050082482397556305, 0.20139162242412567, -0.15790686011314392, -0.21787209808826447, -0.18640363216400146, -0.2615137994289398, -0.07652098685503006, -0.04524846002459526, -0.024367347359657288, -0.2056932896375656, -0.12373331189155579, -0.24880553781986237, -0.36868977546691895, -0.07016501575708389, -0.08049938827753067, -0.4436844289302826, 0.035091422498226166, 0.25823572278022766, -0.011535458266735077, -0.08677975088357925, -0.021828537806868553, -0.06210954114794731, 0.13449418544769287, 0.09210946410894394, 0.04128029942512512, -0.07222766429185867, -0.18145830929279327, -0.20368975400924683, 0.2179778516292572, 0.10143277049064636, 0.42690545320510864, -0.02824397385120392, 0.10957895219326019, 0.06065570190548897, -0.22002221643924713, 0.4593932628631592, -0.5043135285377502, 0.30276402831077576, 0.24616192281246185, 0.014244288206100464, 0.023772425949573517, -0.3180352449417114, 0.1905122846364975, 0.2592918872833252, -0.057711027562618256, 0.16787748038768768, -0.15254734456539154, -0.10208626091480255, 0.2610403895378113, 0.11779291927814484, -0.2050967812538147, -0.3102566599845886, -0.3942502439022064, -0.21591335535049438, -0.26722997426986694, -0.02386588230729103, -0.24601832032203674, 0.15379206836223602, -0.16837579011917114, -0.11464009433984756, -0.051601700484752655, 0.03570472449064255, -0.25875937938690186, 0.09769710898399353, 0.3685157597064972, -0.10147805511951447, 0.5235635042190552, 0.28358590602874756, 0.08554576337337494, 0.31745103001594543, 0.6318058967590332, -0.20566609501838684, -0.26708781719207764, -0.061764080077409744, 0.163578063249588, -0.04728786647319794, 0.11314956843852997, -0.10171476006507874, 0.06866907328367233, 0.10403895378112793, 0.2153530716896057, -0.06912202388048172, -0.04723339527845383, 0.21949826180934906, 0.003290485590696335, -0.5447520613670349, -0.42355072498321533, 0.5792015790939331, -0.06522760540246964, 0.10768792033195496, 0.46094319224357605, 0.05083530768752098, -0.20374369621276855, 0.27101007103919983, 0.05861188471317291, 0.6728886365890503, 0.05252479761838913, 0.27700188755989075, 0.3038198947906494, -0.09332767128944397, 0.39694467186927795, -0.35885190963745117, 0.08998583257198334, -0.4880227744579315, -0.06847154349088669, 0.007025301456451416, -0.054134905338287354, -0.17132258415222168, -0.043401945382356644, 0.11550687253475189, 0.2926608622074127, -0.35208433866500854, 0.18560492992401123, 0.07740151882171631, 0.1743490844964981, -0.21293675899505615, -0.11872801184654236, -0.12342672049999237, 0.20602606236934662, -0.3521178662776947, 0.08435051888227463, -0.24139396846294403, 0.11785225570201874, 0.15657128393650055, -0.31637057662010193, -0.391244500875473, 0.26834964752197266, -0.4938187003135681, 0.6286317706108093, -0.3212297558784485, -0.1907568722963333, -0.03950212150812149, -0.16476570069789886, 0.13803409039974213, 0.053373150527477264, -0.07475776225328445, 0.31099429726600647, 0.2242375761270523, 0.1182384341955185, -0.17475271224975586, -0.18584060668945312, 0.5123452544212341, -0.006340943276882172, -0.39237916469573975, -0.1833687424659729, -0.28916141390800476, -0.48903071880340576, -0.06521874666213989, 0.19845500588417053, -0.27147194743156433, -0.2400144338607788, -0.05744963139295578, -0.05482283979654312, 0.16415105760097504, -0.3066540062427521, 0.10636711120605469, 0.15449249744415283, -0.10108259320259094, 0.06872814893722534, 0.04472387209534645, -0.283413827419281, -0.11418215185403824, 0.4461764395236969, -0.01408314611762762, 0.02039802074432373, 0.5998364090919495, 0.16948038339614868, -0.10200522094964981, -0.13949154317378998, 0.0025424212217330933, 0.33780425786972046, -0.4585244059562683, 0.12817874550819397, 0.023760106414556503, 0.11643750965595245, 0.014777589589357376, -0.12850584089756012, 0.0345727875828743, 0.05039437487721443, 0.19558584690093994, -0.46122437715530396, -0.43509042263031006, 0.12216836214065552, -0.23733437061309814, 0.03730958327651024, 0.27127665281295776, 0.10037103295326233, -0.027359802275896072, 0.13771335780620575, -0.217529758810997, 0.267874538898468, -0.03295089304447174, -0.009830292314291, -0.01120363175868988, -0.18767298758029938, 0.2919813096523285, -0.12631136178970337, 0.1389165073633194, 0.18073102831840515, -0.06534357368946075, -0.23329128324985504, -0.4364716708660126, 0.16532284021377563, 0.08414818346500397, -0.2955617606639862, -0.11770014464855194, -0.21506384015083313, 0.023329563438892365, -0.007872156798839569, 0.11871443688869476, 0.23242630064487457, 0.12641514837741852, -0.029079971835017204, 0.35566234588623047, -0.01865139976143837, -0.28995874524116516, 0.3505179286003113, 0.046421829611063004, 0.02566199004650116, 0.04484926536679268, 0.18653471767902374, -0.034187767654657364, 0.03797400742769241, -0.1548909693956375, -0.22402876615524292, 0.0936160460114479, -0.03797699511051178, 0.22085897624492645, -0.5956956744194031, 0.04819826781749725, -0.09335175156593323, 0.17227408289909363, 0.2744709849357605, -0.24587778747081757, -0.1716381311416626, 0.22994956374168396, 0.21586255729198456, -0.19947877526283264, -0.14573201537132263, 0.13540688157081604, -0.05733982473611832, -0.08682648837566376, -0.1336863934993744, 0.16909755766391754, 0.1067933440208435, 0.05975944176316261, 0.10639280080795288, 0.510636568069458, -0.4000450074672699, 0.29639187455177307, 0.08466753363609314, 0.07233991473913193, -0.0211375430226326, 0.0419987291097641, 0.20194661617279053, 0.0728544220328331, 0.5271238088607788, -0.06670603901147842, -0.036302220076322556, 0.08857069909572601, -0.09240294992923737, -0.0614766851067543, -0.5270278453826904, 0.11937803775072098, 0.340533971786499, -0.3664064109325409, 0.20540258288383484, -0.08713354915380478, 0.606884777545929, -0.11193592846393585, -0.12601906061172485, -0.3004278838634491, 0.01737055554986, -0.2617473006248474, -0.009960826486349106, 0.10692547261714935, -0.11170313507318497, 0.0009004473686218262, 0.2524224817752838, -0.09694318473339081, -0.11194515973329544, 0.005844280123710632, 0.3405323028564453, -0.33433622121810913, -0.44873255491256714, 0.2671677768230438, 0.5542370676994324, 0.019176803529262543, -0.05389366298913956, 0.26033660769462585, 0.6320203542709351, -0.3430185616016388, 0.0030635688453912735, 0.00831276923418045, 0.5110350251197815, 0.15919595956802368, -0.25807985663414, 0.2044796645641327, 0.1687745898962021, 0.0889860987663269, 0.06505810469388962, -0.13517652451992035, 0.18900910019874573, -0.19548971951007843, 0.2190590500831604, 0.1221197098493576, -0.13169124722480774, 0.24976220726966858, 0.007285369094461203, 0.301502525806427, -0.18396666646003723, 0.20130933821201324, -0.019812844693660736, -0.06322164833545685, -0.05601082742214203, 0.10721489787101746, -0.19311267137527466, 0.42038649320602417, 0.6053605079650879, 0.11239813268184662, 0.01888030394911766, -0.040976736694574356, 0.052128564566373825, -0.014247818849980831, 0.47126972675323486, 0.31696560978889465, -0.1260925829410553, -0.3908785283565521, 0.10801036655902863, -0.6093943119049072, 0.11275838315486908, -0.32473358511924744, 0.24244830012321472, 0.11539990454912186, 0.09348249435424805, -0.20515134930610657, -0.22468848526477814, 0.5394143462181091, -0.009535185992717743, 0.3131077289581299, 0.2699817419052124, -0.23030848801136017, -0.11331035196781158, 0.0909392237663269, 0.0719657614827156, -0.011941548436880112, -0.6237967610359192, 0.0635661780834198, 0.08409331738948822, -0.03640963137149811, -0.14313125610351562, -0.28701063990592957, 0.22550074756145477, -0.5486243963241577, 0.3755955696105957, 0.11172913014888763, 0.5196930766105652, 0.013245336711406708, -0.07478953897953033, -0.3698584735393524, -0.314348429441452, -0.16623751819133759, -0.019575588405132294, 0.16579745709896088, 0.4413841962814331, -0.017449278384447098, 0.014128567650914192, -0.41692113876342773, 0.27447354793548584, -0.22826702892780304, 0.034852832555770874, -0.21127718687057495, 0.052857980132102966, 0.1489344984292984, 0.10262315720319748, 0.1294419765472412, 0.29353564977645874, 0.047971658408641815, 0.41674819588661194, -0.391074001789093, -0.4308297038078308, 0.4672960340976715, -0.536807656288147, -0.19615356624126434, -0.26996150612831116, 0.4315111041069031, 0.14470578730106354, -0.1193326860666275, -0.37909984588623047, 0.11928871273994446, 0.3465966582298279, 0.006722567602992058, -0.2619442343711853, 0.3001845180988312, 0.22956621646881104, 0.05471578240394592, -0.06852351129055023, 0.2980799078941345, 0.00883605144917965, -0.15819227695465088, 0.022173330187797546, -0.17173302173614502 ]
https://github.com/huggingface/datasets/issues/5831
Today we had a big issue affecting the Hugging Face Hub, thus all the `504 Server Error: Gateway Time-out` errors. It is fixed now and loading your datasets should work as expected.
[Bug]504 Server Error when loading dataset which was already cached
### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
32
[Bug]504 Server Error when loading dataset which was already cached ### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Today we had a big issue affecting the Hugging Face Hub, thus all the `504 Server Error: Gateway Time-out` errors. It is fixed now and loading your datasets should work as expected.
[ -0.1444699466228485, 0.002489805221557617, 0.03585709258913994, 0.3607310950756073, 0.345577210187912, 0.07848291844129562, 0.4264727532863617, 0.2986140847206116, -0.215998575091362, -0.09981349855661392, -0.14252692461013794, 0.34242287278175354, 0.07249689847230911, 0.011891968548297882, 0.20382392406463623, -0.04307795315980911, 0.11238783597946167, 0.1594155877828598, -0.4168981909751892, 0.10806548595428467, -0.17476072907447815, -0.0319291315972805, 0.06798338890075684, -0.14181208610534668, -0.5365023016929626, 0.14265647530555725, -0.0688859075307846, 0.4437931180000305, 0.04017331451177597, -0.49043816328048706, 0.4439797103404999, -0.11991538107395172, 0.27622801065444946, 0.5225337743759155, -0.0001183514395961538, 0.18378666043281555, 0.22820767760276794, 0.18910673260688782, -0.40206286311149597, 0.06522051244974136, -0.30804312229156494, -0.1764124035835266, 0.15456636250019073, -0.1732877492904663, -0.04478345811367035, 0.050609104335308075, -0.22859090566635132, -0.3987477719783783, 0.46109551191329956, 0.27729833126068115, 0.17530503869056702, 0.14079411327838898, -0.05201968923211098, -0.14781859517097473, 0.08156430721282959, -0.30723944306373596, 0.06937921047210693, 0.2810690104961395, 0.05189159885048866, -0.030665582045912743, -0.12121595442295074, 0.2399907112121582, 0.03545700013637543, 0.35758739709854126, -0.10360059142112732, -0.08496187627315521, 0.15913020074367523, -0.1787797510623932, 0.2122148722410202, 0.2680908143520355, 0.8666792511940002, -0.11817874014377594, -0.28208351135253906, -0.11430638283491135, -0.015579022467136383, -0.30416572093963623, 0.23836596310138702, 0.1250057816505432, 0.14780254662036896, -0.0004216263769194484, -0.13496771454811096, -0.04798489436507225, 0.019389361143112183, 0.12956050038337708, 0.06592722237110138, 0.22740358114242554, 0.07495644688606262, 0.18466171622276306, -0.19027072191238403, -0.10529957711696625, 0.30672064423561096, 0.27328941226005554, -0.22028537094593048, 0.25100624561309814, -0.6411430835723877, 0.010981135070323944, 0.055411361157894135, -0.05479978770017624, 0.062131285667419434, 0.30625802278518677, -0.028781771659851074, -0.03420089930295944, -0.0628855749964714, 0.09287697821855545, 0.18418356776237488, 0.17298325896263123, -0.25778165459632874, 0.2442810982465744, 0.17400379478931427, 0.3118211627006531, -0.4050522446632385, 0.05398448929190636, -0.10560470074415207, -0.24662145972251892, 0.40924543142318726, 0.06549680233001709, 0.3228606879711151, -0.250373899936676, -0.2093823254108429, 0.19585362076759338, -0.2718101143836975, -0.18487676978111267, 0.1770613193511963, 0.43359246850013733, -0.08280181884765625, 0.22876933217048645, -0.16011372208595276, 0.10252083092927933, -0.2341243475675583, -0.2763053774833679, -0.26858723163604736, -0.010177260264754295, -0.09182571619749069, 0.13521024584770203, 0.1801309734582901, -0.2663535177707672, 0.3582727015018463, 0.2122824341058731, -0.08923010528087616, -0.22497332096099854, 0.24348032474517822, -0.20334260165691376, -0.15945738554000854, 0.4474966526031494, 0.04045087844133377, 0.11236872524023056, 0.2817001938819885, 0.3013730049133301, 0.016829729080200195, 0.12412144243717194, -0.3080054223537445, -0.47779959440231323, -0.2108333259820938, 0.16707484424114227, 0.025769338011741638, -0.1218259185552597, -0.232522115111351, -0.0955689400434494, 0.3066293001174927, -0.20257511734962463, 0.08664989471435547, 0.03726682439446449, -0.4008713960647583, -0.2452392578125, 0.25445303320884705, 0.5882125496864319, -0.5447214245796204, -0.08787092566490173, -0.16287106275558472, 0.06325460970401764, -0.06392654776573181, 0.16111843287944794, -0.3797396421432495, 0.16670766472816467, -0.3257269561290741, -0.2517595887184143, 0.06125183030962944, -0.3675423860549927, -0.44896161556243896, 0.08898310363292694, -0.1800801157951355, 0.1590801179409027, -0.12617625296115875, -0.11129868030548096, -0.09362475574016571, 0.05923418328166008, 0.30997490882873535, 0.06535385549068451, -0.03519970178604126, 0.09984804689884186, -0.287528932094574, -0.4309695065021515, 0.29908496141433716, 0.3104657530784607, 0.25255531072616577, 0.11791303753852844, 0.3377189040184021, -0.31917524337768555, 0.14348268508911133, -0.08201614022254944, 0.05689941346645355, 0.3419364094734192, 0.2836114764213562, 0.20971804857254028, 0.24601104855537415, -0.10488761961460114, -0.392455130815506, 0.39409685134887695, -0.2985309958457947, -0.1119578629732132, 0.08244730532169342, 0.02658563107252121, -0.16578494012355804, -0.13704609870910645, -0.46472984552383423, -0.14881031215190887, 0.09104553610086441, -0.10526770353317261, -0.13259005546569824, -0.011745430529117584, -0.23316514492034912, 0.6271123886108398, 0.1259927749633789, 0.14744792878627777, -0.2509582042694092, 0.154829204082489, -0.11573401838541031, 0.01656600460410118, -0.08319848775863647, 0.12587252259254456, 0.42560452222824097, -0.0030336715281009674, -0.34258848428726196, 0.2733021378517151, -0.04106516391038895, -0.07638228684663773, 0.07889817655086517, -0.016093745827674866, 0.16579023003578186, 0.02693268656730652, 0.04587157070636749, 0.1153767853975296, 0.16943791508674622, -0.02270432561635971, 0.1838623285293579, 0.019756942987442017, 0.09331323206424713, 0.04236944764852524, 0.01636861264705658, -0.08798243850469589, 0.28221356868743896, -0.06725507974624634, 0.24939700961112976, -0.12486473470926285, 0.2898114025592804, 0.2725064754486084, 0.5127248764038086, -0.025719722732901573, 0.0814698189496994, 0.020765837281942368, 0.1828712671995163, 0.062227338552474976, 0.05986327677965164, 0.0463639572262764, -0.22533349692821503, -0.21807125210762024, 0.16679757833480835, 0.23858921229839325, 0.42152994871139526, 0.026413649320602417, -0.22860965132713318, -0.020257385447621346, -0.0789424329996109, 0.10103544592857361, 0.07380636781454086, -0.009408049285411835, 0.5704045295715332, 0.1363339126110077, 0.30337220430374146, 0.12061900645494461, -0.15701934695243835, -0.12447576224803925, 0.2826152741909027, 0.2512355148792267, -0.4371522068977356, 0.035685017704963684, -0.3731655478477478, -0.16080529987812042, 0.07237419486045837, 0.20515459775924683, -0.12603043019771576, -0.1533890664577484, -0.10918435454368591, 0.2066696733236313, -0.11501254886388779, 0.17493483424186707, -0.4331725537776947, 0.0644637793302536, 0.06644229590892792, -0.07514208555221558, -0.05403013154864311, 0.013312306255102158, -0.20879395306110382, -0.018526026979088783, 0.00400741770863533, -0.22614780068397522, 0.35885241627693176, 0.10823683440685272, -0.07980469614267349, -0.4409545063972473, -0.14453153312206268, 0.09470893442630768, 0.10929868370294571, 0.3877067565917969, -0.057010672986507416, 0.1434185802936554, -0.16618463397026062, -0.1649758368730545, 0.35889291763305664, 0.03413775563240051, 0.039309777319431305, 0.11089315265417099, -0.14109769463539124, 0.11605624854564667, 0.11519938707351685, -0.15585555136203766, -0.18062551319599152, -0.21194222569465637, -0.10933446884155273, -0.011999733746051788, 0.10894973576068878, 0.034192558377981186, -0.008506350219249725, 0.06344954669475555, 0.1545163094997406, 0.06542525440454483, -0.3791833519935608, -0.674432098865509, 0.0688062459230423, -0.2055526077747345, -0.09689733386039734, -0.05180937051773071, -0.050191134214401245, 0.22243475914001465, 0.019932720810174942, -0.3460763990879059, -0.2681753635406494, -0.24990534782409668, 0.36480769515037537, -0.42097821831703186, -0.06346815824508667, 0.3937935531139374, 0.04102132469415665, -0.0650218203663826, -0.1539507806301117, -0.061787188053131104, 0.12095612287521362, 0.07379856705665588, 0.19640614092350006, -0.14592409133911133, 0.36139339208602905, -0.15166884660720825, 0.3840024769306183, 0.1353369653224945, 0.017538538202643394, 0.6981136202812195, -0.050082482397556305, 0.20139162242412567, -0.15790686011314392, -0.21787209808826447, -0.18640363216400146, -0.2615137994289398, -0.07652098685503006, -0.04524846002459526, -0.024367347359657288, -0.2056932896375656, -0.12373331189155579, -0.24880553781986237, -0.36868977546691895, -0.07016501575708389, -0.08049938827753067, -0.4436844289302826, 0.035091422498226166, 0.25823572278022766, -0.011535458266735077, -0.08677975088357925, -0.021828537806868553, -0.06210954114794731, 0.13449418544769287, 0.09210946410894394, 0.04128029942512512, -0.07222766429185867, -0.18145830929279327, -0.20368975400924683, 0.2179778516292572, 0.10143277049064636, 0.42690545320510864, -0.02824397385120392, 0.10957895219326019, 0.06065570190548897, -0.22002221643924713, 0.4593932628631592, -0.5043135285377502, 0.30276402831077576, 0.24616192281246185, 0.014244288206100464, 0.023772425949573517, -0.3180352449417114, 0.1905122846364975, 0.2592918872833252, -0.057711027562618256, 0.16787748038768768, -0.15254734456539154, -0.10208626091480255, 0.2610403895378113, 0.11779291927814484, -0.2050967812538147, -0.3102566599845886, -0.3942502439022064, -0.21591335535049438, -0.26722997426986694, -0.02386588230729103, -0.24601832032203674, 0.15379206836223602, -0.16837579011917114, -0.11464009433984756, -0.051601700484752655, 0.03570472449064255, -0.25875937938690186, 0.09769710898399353, 0.3685157597064972, -0.10147805511951447, 0.5235635042190552, 0.28358590602874756, 0.08554576337337494, 0.31745103001594543, 0.6318058967590332, -0.20566609501838684, -0.26708781719207764, -0.061764080077409744, 0.163578063249588, -0.04728786647319794, 0.11314956843852997, -0.10171476006507874, 0.06866907328367233, 0.10403895378112793, 0.2153530716896057, -0.06912202388048172, -0.04723339527845383, 0.21949826180934906, 0.003290485590696335, -0.5447520613670349, -0.42355072498321533, 0.5792015790939331, -0.06522760540246964, 0.10768792033195496, 0.46094319224357605, 0.05083530768752098, -0.20374369621276855, 0.27101007103919983, 0.05861188471317291, 0.6728886365890503, 0.05252479761838913, 0.27700188755989075, 0.3038198947906494, -0.09332767128944397, 0.39694467186927795, -0.35885190963745117, 0.08998583257198334, -0.4880227744579315, -0.06847154349088669, 0.007025301456451416, -0.054134905338287354, -0.17132258415222168, -0.043401945382356644, 0.11550687253475189, 0.2926608622074127, -0.35208433866500854, 0.18560492992401123, 0.07740151882171631, 0.1743490844964981, -0.21293675899505615, -0.11872801184654236, -0.12342672049999237, 0.20602606236934662, -0.3521178662776947, 0.08435051888227463, -0.24139396846294403, 0.11785225570201874, 0.15657128393650055, -0.31637057662010193, -0.391244500875473, 0.26834964752197266, -0.4938187003135681, 0.6286317706108093, -0.3212297558784485, -0.1907568722963333, -0.03950212150812149, -0.16476570069789886, 0.13803409039974213, 0.053373150527477264, -0.07475776225328445, 0.31099429726600647, 0.2242375761270523, 0.1182384341955185, -0.17475271224975586, -0.18584060668945312, 0.5123452544212341, -0.006340943276882172, -0.39237916469573975, -0.1833687424659729, -0.28916141390800476, -0.48903071880340576, -0.06521874666213989, 0.19845500588417053, -0.27147194743156433, -0.2400144338607788, -0.05744963139295578, -0.05482283979654312, 0.16415105760097504, -0.3066540062427521, 0.10636711120605469, 0.15449249744415283, -0.10108259320259094, 0.06872814893722534, 0.04472387209534645, -0.283413827419281, -0.11418215185403824, 0.4461764395236969, -0.01408314611762762, 0.02039802074432373, 0.5998364090919495, 0.16948038339614868, -0.10200522094964981, -0.13949154317378998, 0.0025424212217330933, 0.33780425786972046, -0.4585244059562683, 0.12817874550819397, 0.023760106414556503, 0.11643750965595245, 0.014777589589357376, -0.12850584089756012, 0.0345727875828743, 0.05039437487721443, 0.19558584690093994, -0.46122437715530396, -0.43509042263031006, 0.12216836214065552, -0.23733437061309814, 0.03730958327651024, 0.27127665281295776, 0.10037103295326233, -0.027359802275896072, 0.13771335780620575, -0.217529758810997, 0.267874538898468, -0.03295089304447174, -0.009830292314291, -0.01120363175868988, -0.18767298758029938, 0.2919813096523285, -0.12631136178970337, 0.1389165073633194, 0.18073102831840515, -0.06534357368946075, -0.23329128324985504, -0.4364716708660126, 0.16532284021377563, 0.08414818346500397, -0.2955617606639862, -0.11770014464855194, -0.21506384015083313, 0.023329563438892365, -0.007872156798839569, 0.11871443688869476, 0.23242630064487457, 0.12641514837741852, -0.029079971835017204, 0.35566234588623047, -0.01865139976143837, -0.28995874524116516, 0.3505179286003113, 0.046421829611063004, 0.02566199004650116, 0.04484926536679268, 0.18653471767902374, -0.034187767654657364, 0.03797400742769241, -0.1548909693956375, -0.22402876615524292, 0.0936160460114479, -0.03797699511051178, 0.22085897624492645, -0.5956956744194031, 0.04819826781749725, -0.09335175156593323, 0.17227408289909363, 0.2744709849357605, -0.24587778747081757, -0.1716381311416626, 0.22994956374168396, 0.21586255729198456, -0.19947877526283264, -0.14573201537132263, 0.13540688157081604, -0.05733982473611832, -0.08682648837566376, -0.1336863934993744, 0.16909755766391754, 0.1067933440208435, 0.05975944176316261, 0.10639280080795288, 0.510636568069458, -0.4000450074672699, 0.29639187455177307, 0.08466753363609314, 0.07233991473913193, -0.0211375430226326, 0.0419987291097641, 0.20194661617279053, 0.0728544220328331, 0.5271238088607788, -0.06670603901147842, -0.036302220076322556, 0.08857069909572601, -0.09240294992923737, -0.0614766851067543, -0.5270278453826904, 0.11937803775072098, 0.340533971786499, -0.3664064109325409, 0.20540258288383484, -0.08713354915380478, 0.606884777545929, -0.11193592846393585, -0.12601906061172485, -0.3004278838634491, 0.01737055554986, -0.2617473006248474, -0.009960826486349106, 0.10692547261714935, -0.11170313507318497, 0.0009004473686218262, 0.2524224817752838, -0.09694318473339081, -0.11194515973329544, 0.005844280123710632, 0.3405323028564453, -0.33433622121810913, -0.44873255491256714, 0.2671677768230438, 0.5542370676994324, 0.019176803529262543, -0.05389366298913956, 0.26033660769462585, 0.6320203542709351, -0.3430185616016388, 0.0030635688453912735, 0.00831276923418045, 0.5110350251197815, 0.15919595956802368, -0.25807985663414, 0.2044796645641327, 0.1687745898962021, 0.0889860987663269, 0.06505810469388962, -0.13517652451992035, 0.18900910019874573, -0.19548971951007843, 0.2190590500831604, 0.1221197098493576, -0.13169124722480774, 0.24976220726966858, 0.007285369094461203, 0.301502525806427, -0.18396666646003723, 0.20130933821201324, -0.019812844693660736, -0.06322164833545685, -0.05601082742214203, 0.10721489787101746, -0.19311267137527466, 0.42038649320602417, 0.6053605079650879, 0.11239813268184662, 0.01888030394911766, -0.040976736694574356, 0.052128564566373825, -0.014247818849980831, 0.47126972675323486, 0.31696560978889465, -0.1260925829410553, -0.3908785283565521, 0.10801036655902863, -0.6093943119049072, 0.11275838315486908, -0.32473358511924744, 0.24244830012321472, 0.11539990454912186, 0.09348249435424805, -0.20515134930610657, -0.22468848526477814, 0.5394143462181091, -0.009535185992717743, 0.3131077289581299, 0.2699817419052124, -0.23030848801136017, -0.11331035196781158, 0.0909392237663269, 0.0719657614827156, -0.011941548436880112, -0.6237967610359192, 0.0635661780834198, 0.08409331738948822, -0.03640963137149811, -0.14313125610351562, -0.28701063990592957, 0.22550074756145477, -0.5486243963241577, 0.3755955696105957, 0.11172913014888763, 0.5196930766105652, 0.013245336711406708, -0.07478953897953033, -0.3698584735393524, -0.314348429441452, -0.16623751819133759, -0.019575588405132294, 0.16579745709896088, 0.4413841962814331, -0.017449278384447098, 0.014128567650914192, -0.41692113876342773, 0.27447354793548584, -0.22826702892780304, 0.034852832555770874, -0.21127718687057495, 0.052857980132102966, 0.1489344984292984, 0.10262315720319748, 0.1294419765472412, 0.29353564977645874, 0.047971658408641815, 0.41674819588661194, -0.391074001789093, -0.4308297038078308, 0.4672960340976715, -0.536807656288147, -0.19615356624126434, -0.26996150612831116, 0.4315111041069031, 0.14470578730106354, -0.1193326860666275, -0.37909984588623047, 0.11928871273994446, 0.3465966582298279, 0.006722567602992058, -0.2619442343711853, 0.3001845180988312, 0.22956621646881104, 0.05471578240394592, -0.06852351129055023, 0.2980799078941345, 0.00883605144917965, -0.15819227695465088, 0.022173330187797546, -0.17173302173614502 ]
https://github.com/huggingface/datasets/issues/5831
Hi, @albertvillanova. If there is a locally cached version of datasets or something cache using huggingface_hub, when a network problem(either client or server) occurs, is it a better way to fallback to use the current cached version rather than raise a exception and exit?
[Bug]504 Server Error when loading dataset which was already cached
### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
44
[Bug]504 Server Error when loading dataset which was already cached ### Describe the bug I have already cached the dataset using: ``` dataset = load_dataset("databricks/databricks-dolly-15k", cache_dir="/mnt/data/llm/datasets/databricks-dolly-15k") ``` After that, I tried to load it again using the same machine, I got this error: ``` Traceback (most recent call last): File "/mnt/home/llm/pythia/train.py", line 16, in <module> dataset = load_dataset("databricks/databricks-dolly-15k", File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1502, in load_dataset_builder dataset_module = dataset_module_factory( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1219, in dataset_module_factory raise e1 from None File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1186, in dataset_module_factory raise e File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/datasets/load.py", line 1160, in dataset_module_factory dataset_info = hf_api.dataset_info( File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn return fn(*args, **kwargs) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/hf_api.py", line 1667, in dataset_info hf_raise_for_status(r) File "/mnt/data/conda/envs/pythia_ft/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py", line 301, in hf_raise_for_status raise HfHubHTTPError(str(e), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: 504 Server Error: Gateway Time-out for url: https://huggingface.co/api/datasets/databricks/databricks-dolly-15k ``` ### Steps to reproduce the bug 1. cache the databrick-dolly-15k dataset using load_dataset, setting a cache_dir 2. use load_dataset again, setting the same cache_dir ### Expected behavior Dataset loaded succuessfully. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.18.0-372.16.1.el8_6.x86_64-x86_64-with-glibc2.27 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Hi, @albertvillanova. If there is a locally cached version of datasets or something cache using huggingface_hub, when a network problem(either client or server) occurs, is it a better way to fallback to use the current cached version rather than raise a exception and exit?
[ -0.1444699466228485, 0.002489805221557617, 0.03585709258913994, 0.3607310950756073, 0.345577210187912, 0.07848291844129562, 0.4264727532863617, 0.2986140847206116, -0.215998575091362, -0.09981349855661392, -0.14252692461013794, 0.34242287278175354, 0.07249689847230911, 0.011891968548297882, 0.20382392406463623, -0.04307795315980911, 0.11238783597946167, 0.1594155877828598, -0.4168981909751892, 0.10806548595428467, -0.17476072907447815, -0.0319291315972805, 0.06798338890075684, -0.14181208610534668, -0.5365023016929626, 0.14265647530555725, -0.0688859075307846, 0.4437931180000305, 0.04017331451177597, -0.49043816328048706, 0.4439797103404999, -0.11991538107395172, 0.27622801065444946, 0.5225337743759155, -0.0001183514395961538, 0.18378666043281555, 0.22820767760276794, 0.18910673260688782, -0.40206286311149597, 0.06522051244974136, -0.30804312229156494, -0.1764124035835266, 0.15456636250019073, -0.1732877492904663, -0.04478345811367035, 0.050609104335308075, -0.22859090566635132, -0.3987477719783783, 0.46109551191329956, 0.27729833126068115, 0.17530503869056702, 0.14079411327838898, -0.05201968923211098, -0.14781859517097473, 0.08156430721282959, -0.30723944306373596, 0.06937921047210693, 0.2810690104961395, 0.05189159885048866, -0.030665582045912743, -0.12121595442295074, 0.2399907112121582, 0.03545700013637543, 0.35758739709854126, -0.10360059142112732, -0.08496187627315521, 0.15913020074367523, -0.1787797510623932, 0.2122148722410202, 0.2680908143520355, 0.8666792511940002, -0.11817874014377594, -0.28208351135253906, -0.11430638283491135, -0.015579022467136383, -0.30416572093963623, 0.23836596310138702, 0.1250057816505432, 0.14780254662036896, -0.0004216263769194484, -0.13496771454811096, -0.04798489436507225, 0.019389361143112183, 0.12956050038337708, 0.06592722237110138, 0.22740358114242554, 0.07495644688606262, 0.18466171622276306, -0.19027072191238403, -0.10529957711696625, 0.30672064423561096, 0.27328941226005554, -0.22028537094593048, 0.25100624561309814, -0.6411430835723877, 0.010981135070323944, 0.055411361157894135, -0.05479978770017624, 0.062131285667419434, 0.30625802278518677, -0.028781771659851074, -0.03420089930295944, -0.0628855749964714, 0.09287697821855545, 0.18418356776237488, 0.17298325896263123, -0.25778165459632874, 0.2442810982465744, 0.17400379478931427, 0.3118211627006531, -0.4050522446632385, 0.05398448929190636, -0.10560470074415207, -0.24662145972251892, 0.40924543142318726, 0.06549680233001709, 0.3228606879711151, -0.250373899936676, -0.2093823254108429, 0.19585362076759338, -0.2718101143836975, -0.18487676978111267, 0.1770613193511963, 0.43359246850013733, -0.08280181884765625, 0.22876933217048645, -0.16011372208595276, 0.10252083092927933, -0.2341243475675583, -0.2763053774833679, -0.26858723163604736, -0.010177260264754295, -0.09182571619749069, 0.13521024584770203, 0.1801309734582901, -0.2663535177707672, 0.3582727015018463, 0.2122824341058731, -0.08923010528087616, -0.22497332096099854, 0.24348032474517822, -0.20334260165691376, -0.15945738554000854, 0.4474966526031494, 0.04045087844133377, 0.11236872524023056, 0.2817001938819885, 0.3013730049133301, 0.016829729080200195, 0.12412144243717194, -0.3080054223537445, -0.47779959440231323, -0.2108333259820938, 0.16707484424114227, 0.025769338011741638, -0.1218259185552597, -0.232522115111351, -0.0955689400434494, 0.3066293001174927, -0.20257511734962463, 0.08664989471435547, 0.03726682439446449, -0.4008713960647583, -0.2452392578125, 0.25445303320884705, 0.5882125496864319, -0.5447214245796204, -0.08787092566490173, -0.16287106275558472, 0.06325460970401764, -0.06392654776573181, 0.16111843287944794, -0.3797396421432495, 0.16670766472816467, -0.3257269561290741, -0.2517595887184143, 0.06125183030962944, -0.3675423860549927, -0.44896161556243896, 0.08898310363292694, -0.1800801157951355, 0.1590801179409027, -0.12617625296115875, -0.11129868030548096, -0.09362475574016571, 0.05923418328166008, 0.30997490882873535, 0.06535385549068451, -0.03519970178604126, 0.09984804689884186, -0.287528932094574, -0.4309695065021515, 0.29908496141433716, 0.3104657530784607, 0.25255531072616577, 0.11791303753852844, 0.3377189040184021, -0.31917524337768555, 0.14348268508911133, -0.08201614022254944, 0.05689941346645355, 0.3419364094734192, 0.2836114764213562, 0.20971804857254028, 0.24601104855537415, -0.10488761961460114, -0.392455130815506, 0.39409685134887695, -0.2985309958457947, -0.1119578629732132, 0.08244730532169342, 0.02658563107252121, -0.16578494012355804, -0.13704609870910645, -0.46472984552383423, -0.14881031215190887, 0.09104553610086441, -0.10526770353317261, -0.13259005546569824, -0.011745430529117584, -0.23316514492034912, 0.6271123886108398, 0.1259927749633789, 0.14744792878627777, -0.2509582042694092, 0.154829204082489, -0.11573401838541031, 0.01656600460410118, -0.08319848775863647, 0.12587252259254456, 0.42560452222824097, -0.0030336715281009674, -0.34258848428726196, 0.2733021378517151, -0.04106516391038895, -0.07638228684663773, 0.07889817655086517, -0.016093745827674866, 0.16579023003578186, 0.02693268656730652, 0.04587157070636749, 0.1153767853975296, 0.16943791508674622, -0.02270432561635971, 0.1838623285293579, 0.019756942987442017, 0.09331323206424713, 0.04236944764852524, 0.01636861264705658, -0.08798243850469589, 0.28221356868743896, -0.06725507974624634, 0.24939700961112976, -0.12486473470926285, 0.2898114025592804, 0.2725064754486084, 0.5127248764038086, -0.025719722732901573, 0.0814698189496994, 0.020765837281942368, 0.1828712671995163, 0.062227338552474976, 0.05986327677965164, 0.0463639572262764, -0.22533349692821503, -0.21807125210762024, 0.16679757833480835, 0.23858921229839325, 0.42152994871139526, 0.026413649320602417, -0.22860965132713318, -0.020257385447621346, -0.0789424329996109, 0.10103544592857361, 0.07380636781454086, -0.009408049285411835, 0.5704045295715332, 0.1363339126110077, 0.30337220430374146, 0.12061900645494461, -0.15701934695243835, -0.12447576224803925, 0.2826152741909027, 0.2512355148792267, -0.4371522068977356, 0.035685017704963684, -0.3731655478477478, -0.16080529987812042, 0.07237419486045837, 0.20515459775924683, -0.12603043019771576, -0.1533890664577484, -0.10918435454368591, 0.2066696733236313, -0.11501254886388779, 0.17493483424186707, -0.4331725537776947, 0.0644637793302536, 0.06644229590892792, -0.07514208555221558, -0.05403013154864311, 0.013312306255102158, -0.20879395306110382, -0.018526026979088783, 0.00400741770863533, -0.22614780068397522, 0.35885241627693176, 0.10823683440685272, -0.07980469614267349, -0.4409545063972473, -0.14453153312206268, 0.09470893442630768, 0.10929868370294571, 0.3877067565917969, -0.057010672986507416, 0.1434185802936554, -0.16618463397026062, -0.1649758368730545, 0.35889291763305664, 0.03413775563240051, 0.039309777319431305, 0.11089315265417099, -0.14109769463539124, 0.11605624854564667, 0.11519938707351685, -0.15585555136203766, -0.18062551319599152, -0.21194222569465637, -0.10933446884155273, -0.011999733746051788, 0.10894973576068878, 0.034192558377981186, -0.008506350219249725, 0.06344954669475555, 0.1545163094997406, 0.06542525440454483, -0.3791833519935608, -0.674432098865509, 0.0688062459230423, -0.2055526077747345, -0.09689733386039734, -0.05180937051773071, -0.050191134214401245, 0.22243475914001465, 0.019932720810174942, -0.3460763990879059, -0.2681753635406494, -0.24990534782409668, 0.36480769515037537, -0.42097821831703186, -0.06346815824508667, 0.3937935531139374, 0.04102132469415665, -0.0650218203663826, -0.1539507806301117, -0.061787188053131104, 0.12095612287521362, 0.07379856705665588, 0.19640614092350006, -0.14592409133911133, 0.36139339208602905, -0.15166884660720825, 0.3840024769306183, 0.1353369653224945, 0.017538538202643394, 0.6981136202812195, -0.050082482397556305, 0.20139162242412567, -0.15790686011314392, -0.21787209808826447, -0.18640363216400146, -0.2615137994289398, -0.07652098685503006, -0.04524846002459526, -0.024367347359657288, -0.2056932896375656, -0.12373331189155579, -0.24880553781986237, -0.36868977546691895, -0.07016501575708389, -0.08049938827753067, -0.4436844289302826, 0.035091422498226166, 0.25823572278022766, -0.011535458266735077, -0.08677975088357925, -0.021828537806868553, -0.06210954114794731, 0.13449418544769287, 0.09210946410894394, 0.04128029942512512, -0.07222766429185867, -0.18145830929279327, -0.20368975400924683, 0.2179778516292572, 0.10143277049064636, 0.42690545320510864, -0.02824397385120392, 0.10957895219326019, 0.06065570190548897, -0.22002221643924713, 0.4593932628631592, -0.5043135285377502, 0.30276402831077576, 0.24616192281246185, 0.014244288206100464, 0.023772425949573517, -0.3180352449417114, 0.1905122846364975, 0.2592918872833252, -0.057711027562618256, 0.16787748038768768, -0.15254734456539154, -0.10208626091480255, 0.2610403895378113, 0.11779291927814484, -0.2050967812538147, -0.3102566599845886, -0.3942502439022064, -0.21591335535049438, -0.26722997426986694, -0.02386588230729103, -0.24601832032203674, 0.15379206836223602, -0.16837579011917114, -0.11464009433984756, -0.051601700484752655, 0.03570472449064255, -0.25875937938690186, 0.09769710898399353, 0.3685157597064972, -0.10147805511951447, 0.5235635042190552, 0.28358590602874756, 0.08554576337337494, 0.31745103001594543, 0.6318058967590332, -0.20566609501838684, -0.26708781719207764, -0.061764080077409744, 0.163578063249588, -0.04728786647319794, 0.11314956843852997, -0.10171476006507874, 0.06866907328367233, 0.10403895378112793, 0.2153530716896057, -0.06912202388048172, -0.04723339527845383, 0.21949826180934906, 0.003290485590696335, -0.5447520613670349, -0.42355072498321533, 0.5792015790939331, -0.06522760540246964, 0.10768792033195496, 0.46094319224357605, 0.05083530768752098, -0.20374369621276855, 0.27101007103919983, 0.05861188471317291, 0.6728886365890503, 0.05252479761838913, 0.27700188755989075, 0.3038198947906494, -0.09332767128944397, 0.39694467186927795, -0.35885190963745117, 0.08998583257198334, -0.4880227744579315, -0.06847154349088669, 0.007025301456451416, -0.054134905338287354, -0.17132258415222168, -0.043401945382356644, 0.11550687253475189, 0.2926608622074127, -0.35208433866500854, 0.18560492992401123, 0.07740151882171631, 0.1743490844964981, -0.21293675899505615, -0.11872801184654236, -0.12342672049999237, 0.20602606236934662, -0.3521178662776947, 0.08435051888227463, -0.24139396846294403, 0.11785225570201874, 0.15657128393650055, -0.31637057662010193, -0.391244500875473, 0.26834964752197266, -0.4938187003135681, 0.6286317706108093, -0.3212297558784485, -0.1907568722963333, -0.03950212150812149, -0.16476570069789886, 0.13803409039974213, 0.053373150527477264, -0.07475776225328445, 0.31099429726600647, 0.2242375761270523, 0.1182384341955185, -0.17475271224975586, -0.18584060668945312, 0.5123452544212341, -0.006340943276882172, -0.39237916469573975, -0.1833687424659729, -0.28916141390800476, -0.48903071880340576, -0.06521874666213989, 0.19845500588417053, -0.27147194743156433, -0.2400144338607788, -0.05744963139295578, -0.05482283979654312, 0.16415105760097504, -0.3066540062427521, 0.10636711120605469, 0.15449249744415283, -0.10108259320259094, 0.06872814893722534, 0.04472387209534645, -0.283413827419281, -0.11418215185403824, 0.4461764395236969, -0.01408314611762762, 0.02039802074432373, 0.5998364090919495, 0.16948038339614868, -0.10200522094964981, -0.13949154317378998, 0.0025424212217330933, 0.33780425786972046, -0.4585244059562683, 0.12817874550819397, 0.023760106414556503, 0.11643750965595245, 0.014777589589357376, -0.12850584089756012, 0.0345727875828743, 0.05039437487721443, 0.19558584690093994, -0.46122437715530396, -0.43509042263031006, 0.12216836214065552, -0.23733437061309814, 0.03730958327651024, 0.27127665281295776, 0.10037103295326233, -0.027359802275896072, 0.13771335780620575, -0.217529758810997, 0.267874538898468, -0.03295089304447174, -0.009830292314291, -0.01120363175868988, -0.18767298758029938, 0.2919813096523285, -0.12631136178970337, 0.1389165073633194, 0.18073102831840515, -0.06534357368946075, -0.23329128324985504, -0.4364716708660126, 0.16532284021377563, 0.08414818346500397, -0.2955617606639862, -0.11770014464855194, -0.21506384015083313, 0.023329563438892365, -0.007872156798839569, 0.11871443688869476, 0.23242630064487457, 0.12641514837741852, -0.029079971835017204, 0.35566234588623047, -0.01865139976143837, -0.28995874524116516, 0.3505179286003113, 0.046421829611063004, 0.02566199004650116, 0.04484926536679268, 0.18653471767902374, -0.034187767654657364, 0.03797400742769241, -0.1548909693956375, -0.22402876615524292, 0.0936160460114479, -0.03797699511051178, 0.22085897624492645, -0.5956956744194031, 0.04819826781749725, -0.09335175156593323, 0.17227408289909363, 0.2744709849357605, -0.24587778747081757, -0.1716381311416626, 0.22994956374168396, 0.21586255729198456, -0.19947877526283264, -0.14573201537132263, 0.13540688157081604, -0.05733982473611832, -0.08682648837566376, -0.1336863934993744, 0.16909755766391754, 0.1067933440208435, 0.05975944176316261, 0.10639280080795288, 0.510636568069458, -0.4000450074672699, 0.29639187455177307, 0.08466753363609314, 0.07233991473913193, -0.0211375430226326, 0.0419987291097641, 0.20194661617279053, 0.0728544220328331, 0.5271238088607788, -0.06670603901147842, -0.036302220076322556, 0.08857069909572601, -0.09240294992923737, -0.0614766851067543, -0.5270278453826904, 0.11937803775072098, 0.340533971786499, -0.3664064109325409, 0.20540258288383484, -0.08713354915380478, 0.606884777545929, -0.11193592846393585, -0.12601906061172485, -0.3004278838634491, 0.01737055554986, -0.2617473006248474, -0.009960826486349106, 0.10692547261714935, -0.11170313507318497, 0.0009004473686218262, 0.2524224817752838, -0.09694318473339081, -0.11194515973329544, 0.005844280123710632, 0.3405323028564453, -0.33433622121810913, -0.44873255491256714, 0.2671677768230438, 0.5542370676994324, 0.019176803529262543, -0.05389366298913956, 0.26033660769462585, 0.6320203542709351, -0.3430185616016388, 0.0030635688453912735, 0.00831276923418045, 0.5110350251197815, 0.15919595956802368, -0.25807985663414, 0.2044796645641327, 0.1687745898962021, 0.0889860987663269, 0.06505810469388962, -0.13517652451992035, 0.18900910019874573, -0.19548971951007843, 0.2190590500831604, 0.1221197098493576, -0.13169124722480774, 0.24976220726966858, 0.007285369094461203, 0.301502525806427, -0.18396666646003723, 0.20130933821201324, -0.019812844693660736, -0.06322164833545685, -0.05601082742214203, 0.10721489787101746, -0.19311267137527466, 0.42038649320602417, 0.6053605079650879, 0.11239813268184662, 0.01888030394911766, -0.040976736694574356, 0.052128564566373825, -0.014247818849980831, 0.47126972675323486, 0.31696560978889465, -0.1260925829410553, -0.3908785283565521, 0.10801036655902863, -0.6093943119049072, 0.11275838315486908, -0.32473358511924744, 0.24244830012321472, 0.11539990454912186, 0.09348249435424805, -0.20515134930610657, -0.22468848526477814, 0.5394143462181091, -0.009535185992717743, 0.3131077289581299, 0.2699817419052124, -0.23030848801136017, -0.11331035196781158, 0.0909392237663269, 0.0719657614827156, -0.011941548436880112, -0.6237967610359192, 0.0635661780834198, 0.08409331738948822, -0.03640963137149811, -0.14313125610351562, -0.28701063990592957, 0.22550074756145477, -0.5486243963241577, 0.3755955696105957, 0.11172913014888763, 0.5196930766105652, 0.013245336711406708, -0.07478953897953033, -0.3698584735393524, -0.314348429441452, -0.16623751819133759, -0.019575588405132294, 0.16579745709896088, 0.4413841962814331, -0.017449278384447098, 0.014128567650914192, -0.41692113876342773, 0.27447354793548584, -0.22826702892780304, 0.034852832555770874, -0.21127718687057495, 0.052857980132102966, 0.1489344984292984, 0.10262315720319748, 0.1294419765472412, 0.29353564977645874, 0.047971658408641815, 0.41674819588661194, -0.391074001789093, -0.4308297038078308, 0.4672960340976715, -0.536807656288147, -0.19615356624126434, -0.26996150612831116, 0.4315111041069031, 0.14470578730106354, -0.1193326860666275, -0.37909984588623047, 0.11928871273994446, 0.3465966582298279, 0.006722567602992058, -0.2619442343711853, 0.3001845180988312, 0.22956621646881104, 0.05471578240394592, -0.06852351129055023, 0.2980799078941345, 0.00883605144917965, -0.15819227695465088, 0.022173330187797546, -0.17173302173614502 ]
https://github.com/huggingface/datasets/issues/5829
That is weird. I can't reproduce it again after reboot. ```python In [2]: import platform In [3]: platform.platform() Out[3]: 'macOS-13.2-arm64-arm-64bit' In [4]: from datasets import load_dataset ...: ...: jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') Found cached dataset parquet (/Users/sarit/.cache/huggingface/datasets/nomic-ai___parquet/nomic-ai--gpt4all-j-prompt-generations-a3b62015e2e52043/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 63.25it/s] ```
(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
### Describe the bug M2 MBP can't run ```python from datasets import load_dataset jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') ``` ### Steps to reproduce the bug 1. Use M2 MBP 2. Python 3.10.10 from pyenv 3. Run ``` from datasets import load_dataset jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') ``` ### Expected behavior Be able to run normally ### Environment info ``` from datasets import load_dataset jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') ``` OSX: 13.2 CPU: M2
42
(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')) ### Describe the bug M2 MBP can't run ```python from datasets import load_dataset jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') ``` ### Steps to reproduce the bug 1. Use M2 MBP 2. Python 3.10.10 from pyenv 3. Run ``` from datasets import load_dataset jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') ``` ### Expected behavior Be able to run normally ### Environment info ``` from datasets import load_dataset jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') ``` OSX: 13.2 CPU: M2 That is weird. I can't reproduce it again after reboot. ```python In [2]: import platform In [3]: platform.platform() Out[3]: 'macOS-13.2-arm64-arm-64bit' In [4]: from datasets import load_dataset ...: ...: jazzy = load_dataset("nomic-ai/gpt4all-j-prompt-generations", revision='v1.2-jazzy') Found cached dataset parquet (/Users/sarit/.cache/huggingface/datasets/nomic-ai___parquet/nomic-ai--gpt4all-j-prompt-generations-a3b62015e2e52043/0.0.0/2a3b91fbd88a2c90d1dbbb32b460cf621d31bd5b05b934492fdef7d8d6f236ec) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 63.25it/s] ```
[ -0.40310120582580566, -0.2521466910839081, 0.05834469944238663, 0.12893787026405334, 0.3469509780406952, 0.09621185064315796, 0.12205573916435242, 0.3088306784629822, -0.28251463174819946, 0.028164349496364594, -0.1043701022863388, 0.6357762813568115, -0.2538766860961914, -0.0626748725771904, -0.12555594742298126, 0.1543358564376831, 0.1296113133430481, 0.15270452201366425, 0.05392865091562271, -0.04361490532755852, -0.2503855228424072, 0.1897127479314804, -0.12885211408138275, -0.00691261887550354, 0.005708828568458557, -0.05257786810398102, 0.017444781959056854, 0.597740650177002, -0.10086674988269806, -0.3536594808101654, -0.07453115284442902, -0.30053475499153137, -0.09286706149578094, 0.47630882263183594, -0.00011872070899698883, 0.14200875163078308, 0.25941765308380127, 0.1468208134174347, -0.4234839081764221, -0.3662587106227875, 0.17793886363506317, -0.20994752645492554, 0.10068424791097641, -0.3116503357887268, -0.09668780863285065, 0.15462736785411835, -0.043915145099163055, -0.4637486934661865, 0.4990440011024475, 0.38958871364593506, 0.15640591084957123, 0.3319622874259949, -0.29572296142578125, -0.16315463185310364, 0.35991382598876953, 0.40554457902908325, -0.04929220303893089, -0.3883183002471924, 0.1746441125869751, 0.15703244507312775, 0.17501594126224518, 0.170173779129982, -0.2962566018104553, 0.06767329573631287, -0.004957675002515316, -0.11247909814119339, 0.44160178303718567, -0.058723676949739456, -0.08915647864341736, 0.12665221095085144, 0.21388477087020874, -0.26488080620765686, -0.03044375777244568, -0.13450650870800018, -0.12418769299983978, -0.5338115096092224, 0.2781429588794708, 0.11012733727693558, -0.13393524289131165, 0.10379375517368317, -0.22033530473709106, 0.060958851128816605, 0.03159943222999573, -0.08783267438411713, -0.11994002759456635, 0.38087403774261475, 0.09919015318155289, 0.14134445786476135, -0.13545843958854675, 0.049417201429605484, 0.007898185402154922, 0.3607598841190338, -0.014211264438927174, 0.06916461884975433, -0.44425129890441895, -0.14701852202415466, 0.00442088395357132, 0.032424446195364, 0.07731666415929794, 0.07712660729885101, -0.3240429759025574, -0.17731806635856628, 0.31324687600135803, 0.13981080055236816, -0.09057481586933136, -0.028223242610692978, -0.13850931823253632, -0.1743072271347046, 0.23632709681987762, -0.023043055087327957, -0.2854417562484741, 0.02614421769976616, 0.010846603661775589, -0.1010657548904419, 0.01722794771194458, -0.1291816681623459, 0.40524423122406006, -0.30160394310951233, -0.5037932991981506, 0.09111934900283813, -0.31349849700927734, -0.08634773641824722, 0.03496598079800606, 0.49803072214126587, -0.1644154042005539, 0.07815158367156982, -0.04426202178001404, 0.16322073340415955, -0.543747067451477, -0.3133259415626526, -0.11075027287006378, -0.17191851139068604, -0.3576878309249878, -0.06695836782455444, 0.09766321629285812, 0.24045532941818237, 0.31960463523864746, 0.40212374925613403, -0.0745583027601242, -0.06704341620206833, 0.24995306134223938, -0.04881024733185768, -0.22968551516532898, 0.4917466640472412, 0.04199250042438507, 0.1444881558418274, 0.17448797821998596, 0.5465261936187744, -0.05431453883647919, 0.32863670587539673, -0.17783549427986145, -0.24509239196777344, 0.027677437290549278, 0.1701860874891281, -0.18124842643737793, -0.1061704009771347, 0.13185617327690125, -0.027502551674842834, 0.2503109574317932, -0.2842397391796112, 0.12784066796302795, -0.03095143660902977, -0.1642380803823471, -0.29823213815689087, 0.1411166787147522, 0.24955040216445923, 0.006054781377315521, -0.06942178308963776, -0.3787127733230591, 0.07374893873929977, 0.2735404968261719, 0.18185313045978546, 0.003005698323249817, 0.08492106944322586, -0.2738049626350403, -0.21415744721889496, 0.2700904607772827, -0.1554417908191681, -0.2343408465385437, -0.0576736256480217, -0.3218364119529724, 0.1646539568901062, 0.33048999309539795, -0.08185716718435287, -0.13697050511837006, -0.02822141721844673, -0.1248852014541626, 0.1879015862941742, -0.037249427288770676, 0.005363844335079193, -0.24991445243358612, -0.3173789381980896, 0.24303628504276276, 0.41203582286834717, 0.13865210115909576, 0.06594303250312805, 0.11266883462667465, 0.15279865264892578, 0.280312716960907, -0.059617556631565094, -0.12604689598083496, 0.05013369768857956, 0.5201603174209595, -0.07087709754705429, -0.03512895107269287, -0.2600889801979065, -0.14857293665409088, 0.1951308250427246, 0.04931670427322388, -0.025643132627010345, 0.12557780742645264, -0.03173049911856651, 0.01666245609521866, -0.028854042291641235, -0.12131187319755554, -0.4884878098964691, 0.06182973459362984, 0.40484631061553955, 0.13300009071826935, 0.09365933388471603, -0.19141294062137604, 0.4447600543498993, 0.31740450859069824, 0.15380674600601196, -0.2068690061569214, -0.01510147750377655, -0.17336715757846832, -0.17948801815509796, -0.1389177143573761, 0.4153940677642822, 0.17395469546318054, -0.03469058498740196, 0.049235694110393524, 0.344721257686615, 0.12614241242408752, 0.0977301150560379, -0.2852197289466858, 0.23966363072395325, 0.12017516046762466, -0.0674581527709961, 0.09778569638729095, -0.0036561284214258194, -0.14139695465564728, -0.005974330008029938, 0.06440236419439316, 0.3025396466255188, 0.3258672058582306, 0.07661302387714386, -0.06876468658447266, 0.05871007591485977, 0.1407710611820221, -0.21267905831336975, 0.09685729444026947, -0.009924143552780151, 0.5148890018463135, 0.4189453721046448, 0.3266688585281372, -0.09367340803146362, -0.29142823815345764, 0.0076694004237651825, 0.6313400268554688, 0.11534151434898376, 0.09283997118473053, 0.015400363132357597, -0.10030857473611832, -0.022348936647176743, 0.022343965247273445, -0.47104132175445557, 0.6260983347892761, 0.22165964543819427, -0.11096883565187454, 0.42727380990982056, -0.26961255073547363, -0.17956870794296265, 0.18397146463394165, -0.02647111564874649, 0.31558957695961, 0.047024667263031006, 0.45897993445396423, 0.14695163071155548, -0.26633310317993164, -0.005296617746353149, 0.2342512607574463, 0.24027784168720245, -0.34328949451446533, 0.34218519926071167, -0.23129236698150635, 0.2163107693195343, 0.02409333735704422, -0.17078101634979248, -0.309611976146698, -0.23829269409179688, -0.14790992438793182, 0.41611531376838684, 0.2953273057937622, 0.13411705195903778, 0.17830446362495422, 0.10986647754907608, 0.045216962695121765, -0.10508167743682861, -0.027090810239315033, -0.10379432141780853, -0.232011079788208, 0.06014202535152435, 0.17275723814964294, -0.3861362040042877, 0.28499022126197815, -0.15915676951408386, -0.2280580699443817, -0.07232489436864853, -0.5265052914619446, 0.021843135356903076, -0.13514414429664612, 0.3694639503955841, 0.1646016538143158, 0.0028801262378692627, -0.0637684091925621, 0.14518697559833527, 0.26011577248573303, -0.2828350365161896, -0.2829877734184265, 0.09640336036682129, -0.09193149209022522, 0.001463521271944046, -0.14675837755203247, -0.32204172015190125, -0.0681687444448471, -0.30742859840393066, 0.21760806441307068, -0.16589537262916565, 0.14860181510448456, 0.2756183445453644, -0.04473809897899628, 0.21953126788139343, -0.09522673487663269, 0.20955362915992737, -0.3260195553302765, -0.1907629370689392, -0.011334238573908806, -0.2521859109401703, -0.13143914937973022, 0.12012682855129242, 0.1335199475288391, 0.29407763481140137, 0.0714699923992157, -0.6866849064826965, 0.1274043619632721, -0.19549714028835297, 0.2721850574016571, -0.30835869908332825, 0.02887755073606968, 0.3425165116786957, -0.09831321984529495, -0.004339993000030518, -0.30174142122268677, -0.21084068715572357, 0.060476578772068024, 0.3169473707675934, 0.2850779891014099, 0.04297898709774017, 0.6293068528175354, -0.08609368652105331, 0.4905076026916504, -0.02278844639658928, -0.035361725836992264, 0.44041353464126587, -0.11368374526500702, 0.29439398646354675, -0.057025469839572906, -0.0939619392156601, 0.39557456970214844, 0.18012703955173492, -0.34165358543395996, 0.32619529962539673, -0.09119236469268799, -0.13228029012680054, -0.2016107738018036, 0.18808865547180176, -0.07020378112792969, -0.016241714358329773, -0.07640587538480759, -0.1994088590145111, -0.1174515038728714, 0.10831542313098907, 0.23830465972423553, -0.04677347093820572, 0.21512654423713684, 0.2771269381046295, 0.17545312643051147, -0.05938348546624184, 0.08030009269714355, -0.41486507654190063, 0.10988487303256989, -0.2788946330547333, 0.10497716069221497, -0.3665514886379242, 0.27779701352119446, -0.4052269756793976, -0.30751311779022217, 0.2016601711511612, -0.228105366230011, 1.0292999744415283, -0.13808320462703705, 0.24534597992897034, 0.2008853554725647, -0.08313868194818497, -0.6957579851150513, -0.26186251640319824, -0.2682163417339325, 0.22003060579299927, 0.5273688435554504, 0.6195048689842224, -0.11143462359905243, 0.03191942721605301, -0.11660880595445633, -0.0056848786771297455, 0.029391974210739136, -0.3414100110530853, -0.26267072558403015, -0.11029575020074844, -0.08897236734628677, 0.08596405386924744, -0.10627672076225281, 0.2441006302833557, -0.23997493088245392, -0.096595898270607, -0.42865246534347534, -0.14093810319900513, 0.0520910806953907, 0.230795219540596, 0.19459712505340576, -0.43245193362236023, 0.10433906316757202, 0.16599616408348083, 0.3922889828681946, 0.42755773663520813, 0.5861714482307434, -0.21947374939918518, -0.5729690790176392, 0.1841457039117813, -0.06319016218185425, 0.17060616612434387, 0.37307289242744446, 0.14644713699817657, -0.09282619506120682, 0.06875680387020111, 0.02422071248292923, -0.08895997703075409, -0.13076116144657135, 0.3215925991535187, 0.1863618791103363, -0.21513055264949799, -0.11006113886833191, 0.1534583568572998, 0.4060826301574707, 0.03411664068698883, 0.04820486903190613, -0.44050490856170654, -0.21756760776042938, 0.16802296042442322, 0.4408813416957855, 0.9021337032318115, -0.15192914009094238, 0.19642138481140137, 0.41853007674217224, -0.10009143501520157, 0.414537250995636, -0.36777734756469727, 0.20429109036922455, -0.5114149451255798, -0.1599084585905075, 0.031029410660266876, -0.31636887788772583, 0.45695796608924866, -0.14361107349395752, -0.2511247992515564, 0.04331284388899803, -0.20712006092071533, 0.5260061621665955, 0.2900999188423157, -0.06768254935741425, -0.07388447970151901, -0.0017391834408044815, -0.5433114767074585, 0.10023874044418335, -0.04748653247952461, 0.08219201862812042, -0.17739370465278625, -0.05376075208187103, -0.19132599234580994, -0.0002288222312927246, -0.2745929956436157, 0.14641381800174713, -0.751800000667572, -0.13427312672138214, 0.05968712270259857, -0.12090492248535156, 0.10237934440374374, 0.24857577681541443, 0.38313159346580505, 0.12173311412334442, -0.13505060970783234, 0.18346408009529114, 0.42451930046081543, 0.025354675948619843, 0.060454584658145905, -0.19251984357833862, 0.18946215510368347, -0.16838732361793518, -0.1283426582813263, 0.2251301258802414, -0.21176771819591522, -0.3972671329975128, 0.11751249432563782, 0.013368215411901474, 0.3293725550174713, 0.08853276073932648, -0.13148188591003418, -0.22900091111660004, 0.29112356901168823, -0.3635040819644928, 0.06122388690710068, -0.024530965834856033, -0.20162612199783325, 0.07090402394533157, -0.3817552328109741, -0.3419949412345886, -0.16760091483592987, 0.44783955812454224, 0.034231092780828476, -0.004694335162639618, 0.24900969862937927, 0.4427756667137146, 0.02114935964345932, -0.2544862627983093, 0.0834209993481636, 0.20281606912612915, -0.09051737189292908, -0.033140845596790314, -0.03871610760688782, -0.16595706343650818, 0.2455494999885559, 0.018914783373475075, 0.02258489467203617, 0.12526261806488037, -0.18085013329982758, -0.5930247902870178, -0.1373577117919922, -0.16430309414863586, -0.23160263895988464, -0.21710902452468872, 0.5033118724822998, -0.05023801326751709, -0.19087329506874084, -0.10266181826591492, -0.26141321659088135, 0.06490946561098099, 0.2575765550136566, 0.14482469856739044, -0.12047378718852997, -0.3155454695224762, 0.2913215160369873, 0.09652344882488251, 0.07456541061401367, 0.10147272050380707, -0.38362622261047363, -0.16648848354816437, -0.1859707534313202, 0.1622559130191803, -0.026798291131854057, -0.1259865164756775, 0.06003923341631889, -0.12654098868370056, -0.12641245126724243, -0.06494325399398804, 0.19885282218456268, 0.23550719022750854, -0.04162190109491348, -0.31692853569984436, 0.3872125744819641, 0.08665706217288971, -0.3464620113372803, -0.07096898555755615, -0.15785153210163116, -0.38732314109802246, -0.05555932596325874, 0.2709907293319702, -0.18365755677223206, 0.031601883471012115, -0.17725180089473724, -0.056337740272283554, -0.051861125975847244, 0.30757078528404236, 0.011764071881771088, -0.40262576937675476, -0.18166948854923248, 0.4731932580471039, 0.22717878222465515, 0.3200695812702179, 0.03567327931523323, -0.2301710993051529, 0.1283111423254013, 0.21800121665000916, -0.1477438509464264, -0.07556744664907455, 0.08214253187179565, 0.14893056452274323, 0.01746535301208496, 0.49033835530281067, 0.3929298520088196, 0.010971873998641968, -0.24586530029773712, 0.16442161798477173, 0.20803312957286835, 0.05328457057476044, 0.22938629984855652, 0.6167746186256409, -0.163805291056633, -0.035104963928461075, 0.15533094108104706, -0.040204644203186035, 0.03706786036491394, 0.5873445868492126, -0.04289475455880165, 0.28636637330055237, 0.5157397985458374, 0.005145765841007233, -0.06811647117137909, -0.1354016214609146, 0.016639139503240585, 0.1425437480211258, 0.04774237051606178, 0.1478307694196701, -0.21973486244678497, 0.2552262544631958, 0.02902274951338768, -0.4572606086730957, -0.23583337664604187, 0.2004852145910263, -0.3595573902130127, 0.008450645953416824, -0.04642540588974953, -0.11690081655979156, -0.20016580820083618, -0.0028508752584457397, -0.22521956264972687, -0.09965501725673676, 0.3207858204841614, 0.15600618720054626, -0.12017443776130676, -0.42337971925735474, -0.08296138048171997, 0.30861696600914, -0.12051089107990265, -0.2539227306842804, 0.5496547818183899, 0.1501370668411255, -0.3450005352497101, 0.15139295160770416, 0.02625727467238903, 0.5712894201278687, 0.3263087868690491, -0.2526695132255554, 0.14389288425445557, -0.017830677330493927, 0.1610257625579834, -0.11730171740055084, 0.08103268593549728, 0.06691209971904755, 0.3116903007030487, 0.0862179547548294, 0.041000016033649445, -0.1270471215248108, 0.09945500642061234, 0.11697754263877869, 0.16997256875038147, -0.2901398241519928, 0.3342251181602478, -0.08806566148996353, -0.06745664775371552, 0.017824288457632065, 0.39971619844436646, -0.3839159309864044, -0.0862736850976944, 0.20550033450126648, 0.1370445340871811, -0.005325764417648315, 0.11415719985961914, 0.07137271761894226, -0.40549254417419434, 0.18379156291484833, 0.29445892572402954, -0.3202011287212372, -0.25019705295562744, 0.01956804096698761, -0.50077885389328, 0.410582572221756, -0.1493464857339859, -0.11230981349945068, 0.08585196733474731, -0.04340904951095581, -0.06717382371425629, 0.055831942707300186, 0.34523579478263855, 0.19901010394096375, 0.008015729486942291, 0.15778866410255432, -0.5798951983451843, 0.005027007311582565, 0.10632158815860748, -0.35938021540641785, -0.06944574415683746, -0.19612538814544678, 0.36083754897117615, -0.16264262795448303, 0.02197357267141342, -0.2585461139678955, -0.190036803483963, 0.018592454493045807, -0.07980445772409439, 0.3834061622619629, 0.11470970511436462, 0.05445818975567818, 0.13360753655433655, -0.46305161714553833, -0.18492083251476288, 0.11171171069145203, -0.2753235101699829, 0.20498591661453247, -0.06658945977687836, 0.4990442991256714, -0.31902244687080383, -0.07780711352825165, -0.3184426426887512, 0.3870716094970703, 0.2659452259540558, -0.48868945240974426, 0.011706702411174774, 0.3281688690185547, -0.046980202198028564, 0.30370327830314636, 0.10670238733291626, 0.3591489791870117, 0.2541564404964447, 0.38991767168045044, -0.4185750484466553, -0.16949915885925293, 0.4118679165840149, -0.4879494607448578, -0.26258140802383423, -0.21004287898540497, 0.30157288908958435, 0.13597197830677032, -0.12541387975215912, -0.41933515667915344, -0.07971937954425812, 0.2769148647785187, -0.2828812003135681, -0.14352527260780334, 0.2262500524520874, -0.09767411649227142, -0.0014690905809402466, -0.041567135602235794, 0.06219891086220741, -0.000827728770673275, -0.2373306304216385, 0.16629239916801453, -0.04943930357694626 ]
https://github.com/huggingface/datasets/issues/5828
Hi! You can call `map` as follows to avoid the error: ```python augmented_dataset_cln = dataset_cln['train'].map(augment_dataset, features=dataset_cln['train'].features) ```
Stream data concatenation issue
### Describe the bug I am not able to concatenate the augmentation of the stream data. I am using the latest version of dataset. ValueError: The features can't be aligned because the key audio of features {'audio_id': Value(dtype='string', id=None), 'audio': {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)}, 'transcript': Value(dtype='string', id=None)} has unexpected type - {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)} (expected either Audio(sampling_rate=16000, mono=True, decode=True, id=None) or Value("null"). ### Steps to reproduce the bug dataset = load_dataset("tobiolatunji/afrispeech-200", "all", streaming=True).shuffle(seed=42) dataset_cln = dataset.remove_columns(['speaker_id', 'path', 'age_group', 'gender', 'accent', 'domain', 'country', 'duration']) dataset_cln = dataset_cln.cast_column("audio", Audio(sampling_rate=16000)) from audiomentations import AddGaussianNoise,Compose,Gain,OneOf,PitchShift,PolarityInversion,TimeStretch augmentation = Compose([ AddGaussianNoise(min_amplitude=0.005, max_amplitude=0.015, p=0.2) ]) def augment_dataset(batch): audio = batch["audio"] audio["array"] = augmentation(audio["array"], sample_rate=audio["sampling_rate"]) return batch augmented_dataset_cln = dataset_cln['train'].map(augment_dataset) dataset_cln['train'] = interleave_datasets([dataset_cln['train'], augmented_dataset_cln]) dataset_cln['train'] = dataset_cln['train'].shuffle(seed=42) ### Expected behavior I should be able to merge as sampling rate is same. ### Environment info import datasets import transformers import accelerate print(datasets.__version__) print(transformers.__version__) print(torch.__version__) print(evaluate.__version__) print(accelerate.__version__) 2.12.0 4.28.1 2.0.0 0.4.0 0.18.0
17
Stream data concatenation issue ### Describe the bug I am not able to concatenate the augmentation of the stream data. I am using the latest version of dataset. ValueError: The features can't be aligned because the key audio of features {'audio_id': Value(dtype='string', id=None), 'audio': {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)}, 'transcript': Value(dtype='string', id=None)} has unexpected type - {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)} (expected either Audio(sampling_rate=16000, mono=True, decode=True, id=None) or Value("null"). ### Steps to reproduce the bug dataset = load_dataset("tobiolatunji/afrispeech-200", "all", streaming=True).shuffle(seed=42) dataset_cln = dataset.remove_columns(['speaker_id', 'path', 'age_group', 'gender', 'accent', 'domain', 'country', 'duration']) dataset_cln = dataset_cln.cast_column("audio", Audio(sampling_rate=16000)) from audiomentations import AddGaussianNoise,Compose,Gain,OneOf,PitchShift,PolarityInversion,TimeStretch augmentation = Compose([ AddGaussianNoise(min_amplitude=0.005, max_amplitude=0.015, p=0.2) ]) def augment_dataset(batch): audio = batch["audio"] audio["array"] = augmentation(audio["array"], sample_rate=audio["sampling_rate"]) return batch augmented_dataset_cln = dataset_cln['train'].map(augment_dataset) dataset_cln['train'] = interleave_datasets([dataset_cln['train'], augmented_dataset_cln]) dataset_cln['train'] = dataset_cln['train'].shuffle(seed=42) ### Expected behavior I should be able to merge as sampling rate is same. ### Environment info import datasets import transformers import accelerate print(datasets.__version__) print(transformers.__version__) print(torch.__version__) print(evaluate.__version__) print(accelerate.__version__) 2.12.0 4.28.1 2.0.0 0.4.0 0.18.0 Hi! You can call `map` as follows to avoid the error: ```python augmented_dataset_cln = dataset_cln['train'].map(augment_dataset, features=dataset_cln['train'].features) ```
[ -0.2828328609466553, -0.0790247917175293, -0.05130556970834732, 0.2551898956298828, 0.10679186135530472, -0.029187217354774475, 0.19599652290344238, 0.084890216588974, -0.3168542683124542, 0.2629067003726959, -0.14963625371456146, 0.04651915282011032, 0.05549899861216545, 0.4027055501937866, -0.21454493701457977, -0.3908875286579132, 0.30442002415657043, 0.2865194082260132, -0.12723073363304138, 0.1848869025707245, -0.1352403163909912, 0.239314004778862, -0.4890938997268677, 0.01642761379480362, 0.07266978919506073, 0.15613935887813568, -0.10419583320617676, 0.008355045691132545, -0.12679418921470642, -0.21648916602134705, -0.07036206126213074, -0.06796376407146454, 0.03383210301399231, 0.36063143610954285, -0.00011708499368978664, -0.2840651869773865, 0.41102853417396545, -0.1860310286283493, -0.3495040237903595, -0.02296251803636551, -0.22603729367256165, -0.09161758422851562, -0.36112862825393677, 0.12439560890197754, -0.03821815922856331, -0.423956036567688, -0.11122549325227737, -0.46592485904693604, 0.26300352811813354, 0.26791325211524963, 0.13450464606285095, 0.1148841604590416, 0.31542977690696716, 0.2436029016971588, -0.06622810661792755, 0.23905228078365326, 0.14407730102539062, -0.16329514980316162, 0.35533997416496277, 0.22187405824661255, 0.34620481729507446, 0.24564749002456665, -0.07307727634906769, -0.232883483171463, 0.18300092220306396, -0.07274775952100754, 0.045970819890499115, -0.44709381461143494, 0.09735797345638275, 0.23387424647808075, 0.4730710983276367, 0.21767008304595947, -0.38602501153945923, 0.032084569334983826, 0.18344105780124664, -0.2687057852745056, 0.2298259139060974, -0.0026489533483982086, 0.08505191653966904, 0.1246507316827774, -0.17333242297172546, 0.0553409717977047, -0.2154598981142044, 0.12079771608114243, 0.22244584560394287, 0.2971805930137634, -0.010002372786402702, 0.09959033131599426, 0.019161341711878777, -0.6027809977531433, 0.07867401838302612, -0.28903138637542725, -0.35297560691833496, 0.3752846121788025, -0.5386179685592651, 0.03252679109573364, -0.28032785654067993, -0.29984337091445923, 0.1233942061662674, 0.06920425593852997, 0.1392720490694046, 0.11214607208967209, 0.08668730407953262, -0.012470826506614685, 0.3691589832305908, 0.09395875781774521, 0.07279311120510101, 0.0518246591091156, -0.15811169147491455, 0.10696610808372498, 0.32324373722076416, 0.030824683606624603, -0.05096295848488808, -0.044496916234493256, 0.027087338268756866, 0.10998418927192688, -0.05131575092673302, 0.029104799032211304, -0.2181568443775177, 0.11591598391532898, -0.5630239844322205, 0.06593862920999527, 0.13536903262138367, -0.1300777792930603, -0.029757078737020493, 0.5820019245147705, 0.17438960075378418, 0.2944945991039276, 0.19744190573692322, -0.17036470770835876, -0.051141828298568726, -0.09443891793489456, 0.034179165959358215, -0.22472965717315674, -0.11257235705852509, -0.38389673829078674, -0.04448365792632103, 0.18292908370494843, 0.2208017259836197, -0.030419379472732544, -0.2754720151424408, -0.05421074107289314, 0.07767551392316818, 0.09550774097442627, 0.07394766807556152, -0.11799317598342896, -0.336946040391922, 0.017967432737350464, 0.1321413218975067, 0.13959906995296478, -0.3945116400718689, -0.0340769961476326, -0.3973780870437622, 0.23146972060203552, 0.05071637034416199, -0.00827867817133665, -0.15150612592697144, 0.2320852279663086, 0.28907594084739685, -0.19522303342819214, -0.23819705843925476, -0.28448182344436646, -0.06330172717571259, -0.18404754996299744, 0.34197312593460083, -0.017190083861351013, -0.10308268666267395, -0.024704352021217346, -0.2174321860074997, 0.11207938939332962, 0.6017636060714722, 0.10225676745176315, 0.07782132178544998, 0.022226030007004738, -0.3804358243942261, 0.3377295732498169, 0.3979039192199707, -0.3186469078063965, -0.22775426506996155, 0.05920962244272232, -0.0510987713932991, 0.2463291585445404, 0.23186498880386353, 0.004173319786787033, 0.27403804659843445, 0.044742193073034286, 0.73314368724823, 0.6989116668701172, -0.09434682875871658, 0.002075180411338806, -0.06956756114959717, -0.26771581172943115, 0.29645514488220215, -0.114563949406147, -0.3737125098705292, 0.17759618163108826, -0.09257251024246216, -0.311389684677124, 0.2434249073266983, -0.15594640374183655, 0.16194075345993042, 0.0924559012055397, 0.08680634945631027, 0.001665562391281128, -0.03444916754961014, -0.09775640815496445, -0.1886366903781891, -0.13668256998062134, 0.1733967661857605, -0.04525541514158249, 0.07652263343334198, -0.03148448094725609, -0.035507842898368835, -0.06868535280227661, -0.19151198863983154, -0.07658380270004272, 0.14148905873298645, 0.2993471026420593, -0.09473464637994766, -0.3040790557861328, -0.15508703887462616, 0.4145238697528839, 0.17311328649520874, -0.2228604406118393, -0.25253885984420776, 0.26983413100242615, 0.020104674622416496, -0.08293554186820984, 0.23087188601493835, 0.3066554069519043, 0.3010941743850708, 0.029106125235557556, -0.256647527217865, 0.6155125498771667, -0.11139260232448578, 0.2880520522594452, -0.2566075623035431, -0.0610971674323082, 0.07377390563488007, -0.10650134086608887, -0.1604415476322174, 0.15177401900291443, 0.06157663092017174, -0.22019633650779724, 0.20100727677345276, 0.25543853640556335, 0.11802968382835388, 0.4332636594772339, 0.013658970594406128, 0.11763014644384384, 0.39775770902633667, 0.22375419735908508, -0.21217995882034302, -0.14356766641139984, 0.21834079921245575, -0.36294084787368774, 0.05499239265918732, -0.07317425310611725, -0.5658031105995178, 0.09582547843456268, 0.11092129349708557, 0.01936572790145874, -0.31043052673339844, -0.007656982634216547, -0.3945823609828949, -0.16693627834320068, 0.03621477633714676, 0.07938233017921448, 0.3806810677051544, 0.20206239819526672, 0.10347916185855865, 0.05877372622489929, 0.34285470843315125, 0.04826219752430916, 0.25655531883239746, 0.03131546452641487, -0.13397765159606934, 0.5178306698799133, 0.3946932256221771, 0.25361451506614685, -0.07262067496776581, -0.07233865559101105, -0.16304843127727509, 0.04582773149013519, -0.48096489906311035, 0.05689775198698044, -0.3931260108947754, -0.3203965425491333, -0.17166730761528015, -0.7228190302848816, -0.12898050248622894, -0.3219807744026184, -0.1795385181903839, 0.38418394327163696, -0.20981845259666443, 0.2278519719839096, 0.13944655656814575, 0.11041176319122314, 0.2921619415283203, -0.08609406650066376, -0.23014919459819794, 0.5584537982940674, -0.23948614299297333, 0.005619499832391739, 0.060853179544210434, -0.02256176620721817, 0.010992394760251045, 0.0381181463599205, 0.18196234107017517, -0.3318943679332733, -0.3343297839164734, 0.03381648659706116, 0.024210192263126373, 0.14315348863601685, 0.22572295367717743, 0.13822884857654572, 0.19218707084655762, -0.731695294380188, 0.09525166451931, 0.2666935324668884, -0.326191782951355, 0.4360579252243042, 0.16415441036224365, -0.029932523146271706, -0.24981459975242615, -0.18924400210380554, -0.2482217252254486, -0.37234070897102356, -0.03369976207613945, -0.15953093767166138, 0.23847734928131104, 0.10828666388988495, -0.03824177384376526, -0.20487365126609802, 0.11604323983192444, -0.13491427898406982, -0.3499315679073334, -0.10854915529489517, 0.42491549253463745, -0.08268027007579803, -0.27758729457855225, -0.14508701860904694, -0.1612740457057953, 0.08349797874689102, 0.3961162567138672, 0.12812919914722443, 0.2834240794181824, 0.0876733660697937, -0.21667976677417755, -0.31422892212867737, -0.10868004709482193, 0.06969054043292999, 0.0009685792028903961, 0.012178793549537659, -0.03431127592921257, -0.07275544106960297, 0.11330060660839081, 0.43173202872276306, 0.5510657429695129, -0.014799242839217186, 0.03974137082695961, -0.28792712092399597, 0.051433343440294266, 0.3214048743247986, -0.11523784697055817, 0.03297429531812668, -0.07915352284908295, 0.10931708663702011, -0.18798568844795227, -0.13889585435390472, 0.12369950115680695, 0.14603354036808014, -0.001572154462337494, 0.057810403406620026, 0.02298416942358017, -0.04770062118768692, -0.1369367390871048, 0.27522560954093933, -0.11770731955766678, -0.064665786921978, 0.008800679817795753, -0.37663403153419495, 0.403717577457428, -0.12507788836956024, -0.015956848859786987, 0.18500332534313202, 0.007105719298124313, -0.12735624611377716, 0.10009154677391052, 0.05760323628783226, 0.019996758550405502, -0.4307590126991272, -0.33880165219306946, -0.35289466381073, 0.3512434959411621, 0.31513309478759766, 0.8390551209449768, -0.11833446472883224, -0.026461027562618256, -0.1584186851978302, 0.009663533419370651, 0.4440884590148926, -0.38745051622390747, -0.24883300065994263, 0.19533425569534302, 0.6494446992874146, 0.17074614763259888, -0.2792609930038452, -0.07562011480331421, 0.16437773406505585, 0.09080024808645248, 0.6667522192001343, -0.07345506548881531, 0.12241286039352417, 0.1595171093940735, 0.43821316957473755, 0.0025099515914916992, 0.11488883197307587, -0.12792304158210754, -0.09011400490999222, -0.008224815130233765, -0.16518396139144897, 0.008779250085353851, 0.5425527095794678, 0.17659881711006165, -0.122129887342453, 0.0967317447066307, -0.14607539772987366, 0.18534502387046814, -0.1802980601787567, 0.6081022024154663, 0.0965433269739151, 0.23287130892276764, -0.10967478156089783, -0.10151661932468414, 0.6083709001541138, 0.2022327184677124, 0.3976229727268219, -0.474393367767334, -0.011168669909238815, -0.341732382774353, 0.5408784747123718, -0.01753779500722885, -0.11932709813117981, 0.15729942917823792, 0.22937710583209991, 0.15123429894447327, -0.003606002777814865, 0.1839165985584259, 0.5167413949966431, 0.2221481204032898, -0.4689248204231262, -0.3796510100364685, -0.09478317946195602, -0.11058127135038376, 0.009556934237480164, 0.3188309073448181, -0.07575289905071259, -0.2892078459262848, 0.17126764357089996, -0.09872609376907349, 0.959243893623352, 0.5127372145652771, -0.10262694954872131, 0.3867568373680115, -0.4895673990249634, 0.16676676273345947, 0.14617250859737396, 0.1971396803855896, -0.128541499376297, -0.1848401129245758, -0.1934916079044342, -0.09949144721031189, 0.026909224689006805, -0.138163223862648, -0.48922890424728394, 0.20295527577400208, -0.4910696744918823, 0.12737885117530823, -0.03680038824677467, 0.10046757757663727, -0.09114792943000793, -0.17629243433475494, -0.11038020253181458, 0.05398627370595932, -0.1259593665599823, -0.14535649120807648, 0.023126401007175446, -0.3113372027873993, -0.031733132898807526, -0.1311766356229782, -0.3669374883174896, 0.3309342861175537, -0.47445476055145264, -0.12953616678714752, -0.10893285274505615, -0.2464083582162857, -0.017330165952444077, -0.025807861238718033, -0.1593368798494339, 0.059901319444179535, 0.028671449050307274, 0.010382268577814102, 0.19097955524921417, 0.17421630024909973, 0.023793958127498627, -0.21446752548217773, 0.15578322112560272, -0.11994296312332153, -0.12642040848731995, 0.05724291130900383, 0.17351770401000977, -0.21169304847717285, -0.03333583474159241, -0.15165337920188904, 0.25066471099853516, -0.16365225613117218, -0.3028401732444763, 0.26345616579055786, 0.06555825471878052, -0.014090925455093384, 0.08519856631755829, -0.05052616819739342, -0.43813708424568176, -0.08535453677177429, -0.09313364326953888, -0.00024805963039398193, -0.05084357410669327, 0.3149087727069855, 0.21909086406230927, -0.2111499011516571, 0.5216178894042969, -0.05284535139799118, -0.07469820231199265, -0.033534739166498184, -0.09359655529260635, -0.14953181147575378, 0.23561610281467438, -0.09297291934490204, -0.19043704867362976, -0.13616758584976196, -0.07566308975219727, 0.2440863847732544, -0.17116335034370422, 0.18790194392204285, -0.19032537937164307, -0.532227635383606, -0.44514626264572144, 0.08844238519668579, 0.029813241213560104, 0.04926776513457298, -0.20478692650794983, 0.22067822515964508, -0.17977671325206757, 0.03541120886802673, -0.2409730851650238, -0.23765230178833008, 0.17193603515625, 0.075625941157341, 0.017807133495807648, -0.0894007608294487, 0.20548972487449646, -0.18804581463336945, 0.13842818140983582, 0.008721388876438141, -0.032836634665727615, -0.12247306108474731, -0.006033867597579956, 0.13972334563732147, 0.2030879557132721, -0.06876654922962189, -0.13207696378231049, -0.1403951644897461, -0.21919187903404236, -0.1749122589826584, -0.13997763395309448, 0.003564968705177307, -0.15890777111053467, -0.0720691904425621, 0.015916857868433, 0.09529475122690201, 0.05082260072231293, 0.15527668595314026, 0.08458217978477478, -0.2080894559621811, -0.14697113633155823, 0.09197577834129333, -0.18666213750839233, -0.1500190794467926, -0.4514384865760803, 0.12540671229362488, 0.008981756865978241, 0.00391743890941143, 0.3261288106441498, -0.12210775911808014, -0.11683942377567291, -0.0408862829208374, 0.24905942380428314, 0.5370420217514038, -0.14575543999671936, -0.04183400049805641, -0.056700948625802994, 0.15192852914333344, -0.14321380853652954, -0.30285361409187317, -0.27378734946250916, -0.03456531837582588, -0.20162874460220337, -0.029437951743602753, -0.10041221976280212, -0.19457274675369263, -0.19113659858703613, 0.03702699393033981, 0.08768244087696075, 0.02233155071735382, 0.19307662546634674, 0.4463486075401306, -0.047853972762823105, 0.23831301927566528, 0.003258833661675453, -0.07009339332580566, -0.16548070311546326, 0.08390019834041595, 0.050044991075992584, 0.06340033560991287, 0.9414592385292053, -0.23933029174804688, -0.019295264035463333, -0.21934767067432404, -0.09505778551101685, 0.450084924697876, 0.042126305401325226, 0.5489252209663391, 0.6346434950828552, 0.32876333594322205, -0.19325846433639526, -0.460270494222641, 0.00023549050092697144, -0.07158391177654266, -0.12761147320270538, 0.16973266005516052, 0.31252941489219666, -0.0573674738407135, -0.34709393978118896, -0.25951164960861206, 0.3254287540912628, 0.2618611752986908, 0.15382598340511322, -0.16251584887504578, -0.024349551647901535, -0.2510632574558258, -0.10027556121349335, 0.600371778011322, 0.28498953580856323, -0.38454973697662354, 0.198685884475708, 0.3775315284729004, 0.02423825114965439, 0.5042158365249634, 0.3330354690551758, 0.49220168590545654, 0.38933297991752625, 0.11415030807256699, 0.07118472456932068, -0.08647827804088593, -0.13385692238807678, 0.2505473494529724, 0.0374525748193264, 0.09310758858919144, -0.15856505930423737, 0.15445078909397125, 0.1341431438922882, -0.06376763433218002, 0.38210529088974, 0.18505176901817322, 0.2947424352169037, -0.31117579340934753, 0.09357932209968567, -0.22460497915744781, -0.20721203088760376, -0.08095894753932953, -0.18361298739910126, -0.2618759870529175, -0.2031393200159073, 0.12521807849407196, 0.0723409503698349, 0.14332157373428345, 0.24233068525791168, 0.07227573543787003, 0.08162809908390045, 0.3740386962890625, 0.5466774106025696, -0.08781520277261734, -0.04599934443831444, -0.3973090648651123, -0.4417612850666046, -0.0961868092417717, 0.3702060282230377, 0.07019729912281036, 0.14075443148612976, 0.10231783986091614, 0.17054705321788788, 0.01868150569498539, 0.272148996591568, 0.10176857560873032, -0.38166549801826477, 0.05960724875330925, -0.4559931755065918, -0.05084023252129555, 0.10305231809616089, 0.23967105150222778, -0.07106504589319229, -0.29234787821769714, 0.3970367908477783, 0.20614466071128845, 0.07357478141784668, 0.2710856795310974, -0.07794839143753052, -0.09200754761695862, 0.09366144984960556, -0.06665029376745224, 0.2345944195985794, 0.18142607808113098, -0.34807413816452026, 0.07367082685232162, -0.06937028467655182, -0.13355211913585663, -0.3473276197910309, 0.2398025393486023, -0.11874904483556747, 0.5855302810668945, -0.03424224257469177, 0.1526215374469757, -0.191792830824852, 0.10151135176420212, 0.06495386362075806, -0.4913587272167206, -0.5585813522338867, 0.5023150444030762, -0.12202925980091095, 0.19028037786483765, -0.11025787144899368, 0.00230189086869359, 0.01941462978720665, 0.019875705242156982, -0.07754851877689362, -0.28968074917793274, 0.37737441062927246, -0.022829212248325348, -0.3360609710216522, -0.131634920835495, 0.10768802464008331, 0.4860500395298004, 0.4050655663013458, -0.6236519813537598, -0.14143258333206177, 0.30939429998397827, -0.14443740248680115, -0.09147661924362183, 0.306072860956192, -0.3289433419704437, -0.07858572155237198, -0.02403133735060692, 0.20406965911388397, 0.25772005319595337, -0.20398028194904327, 0.15424273908138275, -0.19912120699882507 ]
https://github.com/huggingface/datasets/issues/5828
Hi! I have run into the same problem with you. Could you please let me know how you solve it? Thanks!
Stream data concatenation issue
### Describe the bug I am not able to concatenate the augmentation of the stream data. I am using the latest version of dataset. ValueError: The features can't be aligned because the key audio of features {'audio_id': Value(dtype='string', id=None), 'audio': {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)}, 'transcript': Value(dtype='string', id=None)} has unexpected type - {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)} (expected either Audio(sampling_rate=16000, mono=True, decode=True, id=None) or Value("null"). ### Steps to reproduce the bug dataset = load_dataset("tobiolatunji/afrispeech-200", "all", streaming=True).shuffle(seed=42) dataset_cln = dataset.remove_columns(['speaker_id', 'path', 'age_group', 'gender', 'accent', 'domain', 'country', 'duration']) dataset_cln = dataset_cln.cast_column("audio", Audio(sampling_rate=16000)) from audiomentations import AddGaussianNoise,Compose,Gain,OneOf,PitchShift,PolarityInversion,TimeStretch augmentation = Compose([ AddGaussianNoise(min_amplitude=0.005, max_amplitude=0.015, p=0.2) ]) def augment_dataset(batch): audio = batch["audio"] audio["array"] = augmentation(audio["array"], sample_rate=audio["sampling_rate"]) return batch augmented_dataset_cln = dataset_cln['train'].map(augment_dataset) dataset_cln['train'] = interleave_datasets([dataset_cln['train'], augmented_dataset_cln]) dataset_cln['train'] = dataset_cln['train'].shuffle(seed=42) ### Expected behavior I should be able to merge as sampling rate is same. ### Environment info import datasets import transformers import accelerate print(datasets.__version__) print(transformers.__version__) print(torch.__version__) print(evaluate.__version__) print(accelerate.__version__) 2.12.0 4.28.1 2.0.0 0.4.0 0.18.0
21
Stream data concatenation issue ### Describe the bug I am not able to concatenate the augmentation of the stream data. I am using the latest version of dataset. ValueError: The features can't be aligned because the key audio of features {'audio_id': Value(dtype='string', id=None), 'audio': {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)}, 'transcript': Value(dtype='string', id=None)} has unexpected type - {'array': Sequence(feature=Value(dtype='float32', id=None), length=-1, id=None), 'path': Value(dtype='null', id=None), 'sampling_rate': Value(dtype='int64', id=None)} (expected either Audio(sampling_rate=16000, mono=True, decode=True, id=None) or Value("null"). ### Steps to reproduce the bug dataset = load_dataset("tobiolatunji/afrispeech-200", "all", streaming=True).shuffle(seed=42) dataset_cln = dataset.remove_columns(['speaker_id', 'path', 'age_group', 'gender', 'accent', 'domain', 'country', 'duration']) dataset_cln = dataset_cln.cast_column("audio", Audio(sampling_rate=16000)) from audiomentations import AddGaussianNoise,Compose,Gain,OneOf,PitchShift,PolarityInversion,TimeStretch augmentation = Compose([ AddGaussianNoise(min_amplitude=0.005, max_amplitude=0.015, p=0.2) ]) def augment_dataset(batch): audio = batch["audio"] audio["array"] = augmentation(audio["array"], sample_rate=audio["sampling_rate"]) return batch augmented_dataset_cln = dataset_cln['train'].map(augment_dataset) dataset_cln['train'] = interleave_datasets([dataset_cln['train'], augmented_dataset_cln]) dataset_cln['train'] = dataset_cln['train'].shuffle(seed=42) ### Expected behavior I should be able to merge as sampling rate is same. ### Environment info import datasets import transformers import accelerate print(datasets.__version__) print(transformers.__version__) print(torch.__version__) print(evaluate.__version__) print(accelerate.__version__) 2.12.0 4.28.1 2.0.0 0.4.0 0.18.0 Hi! I have run into the same problem with you. Could you please let me know how you solve it? Thanks!
[ -0.2828328609466553, -0.0790247917175293, -0.05130556970834732, 0.2551898956298828, 0.10679186135530472, -0.029187217354774475, 0.19599652290344238, 0.084890216588974, -0.3168542683124542, 0.2629067003726959, -0.14963625371456146, 0.04651915282011032, 0.05549899861216545, 0.4027055501937866, -0.21454493701457977, -0.3908875286579132, 0.30442002415657043, 0.2865194082260132, -0.12723073363304138, 0.1848869025707245, -0.1352403163909912, 0.239314004778862, -0.4890938997268677, 0.01642761379480362, 0.07266978919506073, 0.15613935887813568, -0.10419583320617676, 0.008355045691132545, -0.12679418921470642, -0.21648916602134705, -0.07036206126213074, -0.06796376407146454, 0.03383210301399231, 0.36063143610954285, -0.00011708499368978664, -0.2840651869773865, 0.41102853417396545, -0.1860310286283493, -0.3495040237903595, -0.02296251803636551, -0.22603729367256165, -0.09161758422851562, -0.36112862825393677, 0.12439560890197754, -0.03821815922856331, -0.423956036567688, -0.11122549325227737, -0.46592485904693604, 0.26300352811813354, 0.26791325211524963, 0.13450464606285095, 0.1148841604590416, 0.31542977690696716, 0.2436029016971588, -0.06622810661792755, 0.23905228078365326, 0.14407730102539062, -0.16329514980316162, 0.35533997416496277, 0.22187405824661255, 0.34620481729507446, 0.24564749002456665, -0.07307727634906769, -0.232883483171463, 0.18300092220306396, -0.07274775952100754, 0.045970819890499115, -0.44709381461143494, 0.09735797345638275, 0.23387424647808075, 0.4730710983276367, 0.21767008304595947, -0.38602501153945923, 0.032084569334983826, 0.18344105780124664, -0.2687057852745056, 0.2298259139060974, -0.0026489533483982086, 0.08505191653966904, 0.1246507316827774, -0.17333242297172546, 0.0553409717977047, -0.2154598981142044, 0.12079771608114243, 0.22244584560394287, 0.2971805930137634, -0.010002372786402702, 0.09959033131599426, 0.019161341711878777, -0.6027809977531433, 0.07867401838302612, -0.28903138637542725, -0.35297560691833496, 0.3752846121788025, -0.5386179685592651, 0.03252679109573364, -0.28032785654067993, -0.29984337091445923, 0.1233942061662674, 0.06920425593852997, 0.1392720490694046, 0.11214607208967209, 0.08668730407953262, -0.012470826506614685, 0.3691589832305908, 0.09395875781774521, 0.07279311120510101, 0.0518246591091156, -0.15811169147491455, 0.10696610808372498, 0.32324373722076416, 0.030824683606624603, -0.05096295848488808, -0.044496916234493256, 0.027087338268756866, 0.10998418927192688, -0.05131575092673302, 0.029104799032211304, -0.2181568443775177, 0.11591598391532898, -0.5630239844322205, 0.06593862920999527, 0.13536903262138367, -0.1300777792930603, -0.029757078737020493, 0.5820019245147705, 0.17438960075378418, 0.2944945991039276, 0.19744190573692322, -0.17036470770835876, -0.051141828298568726, -0.09443891793489456, 0.034179165959358215, -0.22472965717315674, -0.11257235705852509, -0.38389673829078674, -0.04448365792632103, 0.18292908370494843, 0.2208017259836197, -0.030419379472732544, -0.2754720151424408, -0.05421074107289314, 0.07767551392316818, 0.09550774097442627, 0.07394766807556152, -0.11799317598342896, -0.336946040391922, 0.017967432737350464, 0.1321413218975067, 0.13959906995296478, -0.3945116400718689, -0.0340769961476326, -0.3973780870437622, 0.23146972060203552, 0.05071637034416199, -0.00827867817133665, -0.15150612592697144, 0.2320852279663086, 0.28907594084739685, -0.19522303342819214, -0.23819705843925476, -0.28448182344436646, -0.06330172717571259, -0.18404754996299744, 0.34197312593460083, -0.017190083861351013, -0.10308268666267395, -0.024704352021217346, -0.2174321860074997, 0.11207938939332962, 0.6017636060714722, 0.10225676745176315, 0.07782132178544998, 0.022226030007004738, -0.3804358243942261, 0.3377295732498169, 0.3979039192199707, -0.3186469078063965, -0.22775426506996155, 0.05920962244272232, -0.0510987713932991, 0.2463291585445404, 0.23186498880386353, 0.004173319786787033, 0.27403804659843445, 0.044742193073034286, 0.73314368724823, 0.6989116668701172, -0.09434682875871658, 0.002075180411338806, -0.06956756114959717, -0.26771581172943115, 0.29645514488220215, -0.114563949406147, -0.3737125098705292, 0.17759618163108826, -0.09257251024246216, -0.311389684677124, 0.2434249073266983, -0.15594640374183655, 0.16194075345993042, 0.0924559012055397, 0.08680634945631027, 0.001665562391281128, -0.03444916754961014, -0.09775640815496445, -0.1886366903781891, -0.13668256998062134, 0.1733967661857605, -0.04525541514158249, 0.07652263343334198, -0.03148448094725609, -0.035507842898368835, -0.06868535280227661, -0.19151198863983154, -0.07658380270004272, 0.14148905873298645, 0.2993471026420593, -0.09473464637994766, -0.3040790557861328, -0.15508703887462616, 0.4145238697528839, 0.17311328649520874, -0.2228604406118393, -0.25253885984420776, 0.26983413100242615, 0.020104674622416496, -0.08293554186820984, 0.23087188601493835, 0.3066554069519043, 0.3010941743850708, 0.029106125235557556, -0.256647527217865, 0.6155125498771667, -0.11139260232448578, 0.2880520522594452, -0.2566075623035431, -0.0610971674323082, 0.07377390563488007, -0.10650134086608887, -0.1604415476322174, 0.15177401900291443, 0.06157663092017174, -0.22019633650779724, 0.20100727677345276, 0.25543853640556335, 0.11802968382835388, 0.4332636594772339, 0.013658970594406128, 0.11763014644384384, 0.39775770902633667, 0.22375419735908508, -0.21217995882034302, -0.14356766641139984, 0.21834079921245575, -0.36294084787368774, 0.05499239265918732, -0.07317425310611725, -0.5658031105995178, 0.09582547843456268, 0.11092129349708557, 0.01936572790145874, -0.31043052673339844, -0.007656982634216547, -0.3945823609828949, -0.16693627834320068, 0.03621477633714676, 0.07938233017921448, 0.3806810677051544, 0.20206239819526672, 0.10347916185855865, 0.05877372622489929, 0.34285470843315125, 0.04826219752430916, 0.25655531883239746, 0.03131546452641487, -0.13397765159606934, 0.5178306698799133, 0.3946932256221771, 0.25361451506614685, -0.07262067496776581, -0.07233865559101105, -0.16304843127727509, 0.04582773149013519, -0.48096489906311035, 0.05689775198698044, -0.3931260108947754, -0.3203965425491333, -0.17166730761528015, -0.7228190302848816, -0.12898050248622894, -0.3219807744026184, -0.1795385181903839, 0.38418394327163696, -0.20981845259666443, 0.2278519719839096, 0.13944655656814575, 0.11041176319122314, 0.2921619415283203, -0.08609406650066376, -0.23014919459819794, 0.5584537982940674, -0.23948614299297333, 0.005619499832391739, 0.060853179544210434, -0.02256176620721817, 0.010992394760251045, 0.0381181463599205, 0.18196234107017517, -0.3318943679332733, -0.3343297839164734, 0.03381648659706116, 0.024210192263126373, 0.14315348863601685, 0.22572295367717743, 0.13822884857654572, 0.19218707084655762, -0.731695294380188, 0.09525166451931, 0.2666935324668884, -0.326191782951355, 0.4360579252243042, 0.16415441036224365, -0.029932523146271706, -0.24981459975242615, -0.18924400210380554, -0.2482217252254486, -0.37234070897102356, -0.03369976207613945, -0.15953093767166138, 0.23847734928131104, 0.10828666388988495, -0.03824177384376526, -0.20487365126609802, 0.11604323983192444, -0.13491427898406982, -0.3499315679073334, -0.10854915529489517, 0.42491549253463745, -0.08268027007579803, -0.27758729457855225, -0.14508701860904694, -0.1612740457057953, 0.08349797874689102, 0.3961162567138672, 0.12812919914722443, 0.2834240794181824, 0.0876733660697937, -0.21667976677417755, -0.31422892212867737, -0.10868004709482193, 0.06969054043292999, 0.0009685792028903961, 0.012178793549537659, -0.03431127592921257, -0.07275544106960297, 0.11330060660839081, 0.43173202872276306, 0.5510657429695129, -0.014799242839217186, 0.03974137082695961, -0.28792712092399597, 0.051433343440294266, 0.3214048743247986, -0.11523784697055817, 0.03297429531812668, -0.07915352284908295, 0.10931708663702011, -0.18798568844795227, -0.13889585435390472, 0.12369950115680695, 0.14603354036808014, -0.001572154462337494, 0.057810403406620026, 0.02298416942358017, -0.04770062118768692, -0.1369367390871048, 0.27522560954093933, -0.11770731955766678, -0.064665786921978, 0.008800679817795753, -0.37663403153419495, 0.403717577457428, -0.12507788836956024, -0.015956848859786987, 0.18500332534313202, 0.007105719298124313, -0.12735624611377716, 0.10009154677391052, 0.05760323628783226, 0.019996758550405502, -0.4307590126991272, -0.33880165219306946, -0.35289466381073, 0.3512434959411621, 0.31513309478759766, 0.8390551209449768, -0.11833446472883224, -0.026461027562618256, -0.1584186851978302, 0.009663533419370651, 0.4440884590148926, -0.38745051622390747, -0.24883300065994263, 0.19533425569534302, 0.6494446992874146, 0.17074614763259888, -0.2792609930038452, -0.07562011480331421, 0.16437773406505585, 0.09080024808645248, 0.6667522192001343, -0.07345506548881531, 0.12241286039352417, 0.1595171093940735, 0.43821316957473755, 0.0025099515914916992, 0.11488883197307587, -0.12792304158210754, -0.09011400490999222, -0.008224815130233765, -0.16518396139144897, 0.008779250085353851, 0.5425527095794678, 0.17659881711006165, -0.122129887342453, 0.0967317447066307, -0.14607539772987366, 0.18534502387046814, -0.1802980601787567, 0.6081022024154663, 0.0965433269739151, 0.23287130892276764, -0.10967478156089783, -0.10151661932468414, 0.6083709001541138, 0.2022327184677124, 0.3976229727268219, -0.474393367767334, -0.011168669909238815, -0.341732382774353, 0.5408784747123718, -0.01753779500722885, -0.11932709813117981, 0.15729942917823792, 0.22937710583209991, 0.15123429894447327, -0.003606002777814865, 0.1839165985584259, 0.5167413949966431, 0.2221481204032898, -0.4689248204231262, -0.3796510100364685, -0.09478317946195602, -0.11058127135038376, 0.009556934237480164, 0.3188309073448181, -0.07575289905071259, -0.2892078459262848, 0.17126764357089996, -0.09872609376907349, 0.959243893623352, 0.5127372145652771, -0.10262694954872131, 0.3867568373680115, -0.4895673990249634, 0.16676676273345947, 0.14617250859737396, 0.1971396803855896, -0.128541499376297, -0.1848401129245758, -0.1934916079044342, -0.09949144721031189, 0.026909224689006805, -0.138163223862648, -0.48922890424728394, 0.20295527577400208, -0.4910696744918823, 0.12737885117530823, -0.03680038824677467, 0.10046757757663727, -0.09114792943000793, -0.17629243433475494, -0.11038020253181458, 0.05398627370595932, -0.1259593665599823, -0.14535649120807648, 0.023126401007175446, -0.3113372027873993, -0.031733132898807526, -0.1311766356229782, -0.3669374883174896, 0.3309342861175537, -0.47445476055145264, -0.12953616678714752, -0.10893285274505615, -0.2464083582162857, -0.017330165952444077, -0.025807861238718033, -0.1593368798494339, 0.059901319444179535, 0.028671449050307274, 0.010382268577814102, 0.19097955524921417, 0.17421630024909973, 0.023793958127498627, -0.21446752548217773, 0.15578322112560272, -0.11994296312332153, -0.12642040848731995, 0.05724291130900383, 0.17351770401000977, -0.21169304847717285, -0.03333583474159241, -0.15165337920188904, 0.25066471099853516, -0.16365225613117218, -0.3028401732444763, 0.26345616579055786, 0.06555825471878052, -0.014090925455093384, 0.08519856631755829, -0.05052616819739342, -0.43813708424568176, -0.08535453677177429, -0.09313364326953888, -0.00024805963039398193, -0.05084357410669327, 0.3149087727069855, 0.21909086406230927, -0.2111499011516571, 0.5216178894042969, -0.05284535139799118, -0.07469820231199265, -0.033534739166498184, -0.09359655529260635, -0.14953181147575378, 0.23561610281467438, -0.09297291934490204, -0.19043704867362976, -0.13616758584976196, -0.07566308975219727, 0.2440863847732544, -0.17116335034370422, 0.18790194392204285, -0.19032537937164307, -0.532227635383606, -0.44514626264572144, 0.08844238519668579, 0.029813241213560104, 0.04926776513457298, -0.20478692650794983, 0.22067822515964508, -0.17977671325206757, 0.03541120886802673, -0.2409730851650238, -0.23765230178833008, 0.17193603515625, 0.075625941157341, 0.017807133495807648, -0.0894007608294487, 0.20548972487449646, -0.18804581463336945, 0.13842818140983582, 0.008721388876438141, -0.032836634665727615, -0.12247306108474731, -0.006033867597579956, 0.13972334563732147, 0.2030879557132721, -0.06876654922962189, -0.13207696378231049, -0.1403951644897461, -0.21919187903404236, -0.1749122589826584, -0.13997763395309448, 0.003564968705177307, -0.15890777111053467, -0.0720691904425621, 0.015916857868433, 0.09529475122690201, 0.05082260072231293, 0.15527668595314026, 0.08458217978477478, -0.2080894559621811, -0.14697113633155823, 0.09197577834129333, -0.18666213750839233, -0.1500190794467926, -0.4514384865760803, 0.12540671229362488, 0.008981756865978241, 0.00391743890941143, 0.3261288106441498, -0.12210775911808014, -0.11683942377567291, -0.0408862829208374, 0.24905942380428314, 0.5370420217514038, -0.14575543999671936, -0.04183400049805641, -0.056700948625802994, 0.15192852914333344, -0.14321380853652954, -0.30285361409187317, -0.27378734946250916, -0.03456531837582588, -0.20162874460220337, -0.029437951743602753, -0.10041221976280212, -0.19457274675369263, -0.19113659858703613, 0.03702699393033981, 0.08768244087696075, 0.02233155071735382, 0.19307662546634674, 0.4463486075401306, -0.047853972762823105, 0.23831301927566528, 0.003258833661675453, -0.07009339332580566, -0.16548070311546326, 0.08390019834041595, 0.050044991075992584, 0.06340033560991287, 0.9414592385292053, -0.23933029174804688, -0.019295264035463333, -0.21934767067432404, -0.09505778551101685, 0.450084924697876, 0.042126305401325226, 0.5489252209663391, 0.6346434950828552, 0.32876333594322205, -0.19325846433639526, -0.460270494222641, 0.00023549050092697144, -0.07158391177654266, -0.12761147320270538, 0.16973266005516052, 0.31252941489219666, -0.0573674738407135, -0.34709393978118896, -0.25951164960861206, 0.3254287540912628, 0.2618611752986908, 0.15382598340511322, -0.16251584887504578, -0.024349551647901535, -0.2510632574558258, -0.10027556121349335, 0.600371778011322, 0.28498953580856323, -0.38454973697662354, 0.198685884475708, 0.3775315284729004, 0.02423825114965439, 0.5042158365249634, 0.3330354690551758, 0.49220168590545654, 0.38933297991752625, 0.11415030807256699, 0.07118472456932068, -0.08647827804088593, -0.13385692238807678, 0.2505473494529724, 0.0374525748193264, 0.09310758858919144, -0.15856505930423737, 0.15445078909397125, 0.1341431438922882, -0.06376763433218002, 0.38210529088974, 0.18505176901817322, 0.2947424352169037, -0.31117579340934753, 0.09357932209968567, -0.22460497915744781, -0.20721203088760376, -0.08095894753932953, -0.18361298739910126, -0.2618759870529175, -0.2031393200159073, 0.12521807849407196, 0.0723409503698349, 0.14332157373428345, 0.24233068525791168, 0.07227573543787003, 0.08162809908390045, 0.3740386962890625, 0.5466774106025696, -0.08781520277261734, -0.04599934443831444, -0.3973090648651123, -0.4417612850666046, -0.0961868092417717, 0.3702060282230377, 0.07019729912281036, 0.14075443148612976, 0.10231783986091614, 0.17054705321788788, 0.01868150569498539, 0.272148996591568, 0.10176857560873032, -0.38166549801826477, 0.05960724875330925, -0.4559931755065918, -0.05084023252129555, 0.10305231809616089, 0.23967105150222778, -0.07106504589319229, -0.29234787821769714, 0.3970367908477783, 0.20614466071128845, 0.07357478141784668, 0.2710856795310974, -0.07794839143753052, -0.09200754761695862, 0.09366144984960556, -0.06665029376745224, 0.2345944195985794, 0.18142607808113098, -0.34807413816452026, 0.07367082685232162, -0.06937028467655182, -0.13355211913585663, -0.3473276197910309, 0.2398025393486023, -0.11874904483556747, 0.5855302810668945, -0.03424224257469177, 0.1526215374469757, -0.191792830824852, 0.10151135176420212, 0.06495386362075806, -0.4913587272167206, -0.5585813522338867, 0.5023150444030762, -0.12202925980091095, 0.19028037786483765, -0.11025787144899368, 0.00230189086869359, 0.01941462978720665, 0.019875705242156982, -0.07754851877689362, -0.28968074917793274, 0.37737441062927246, -0.022829212248325348, -0.3360609710216522, -0.131634920835495, 0.10768802464008331, 0.4860500395298004, 0.4050655663013458, -0.6236519813537598, -0.14143258333206177, 0.30939429998397827, -0.14443740248680115, -0.09147661924362183, 0.306072860956192, -0.3289433419704437, -0.07858572155237198, -0.02403133735060692, 0.20406965911388397, 0.25772005319595337, -0.20398028194904327, 0.15424273908138275, -0.19912120699882507 ]
https://github.com/huggingface/datasets/issues/5827
Indeed the JSON dataset builder raises an error when it encounters an unexpected type. There's an old PR open to add away to ignore such elements though, if it can help: https://github.com/huggingface/datasets/pull/2838
load json dataset interrupt when dtype cast problem occured
### Describe the bug i have a json like this: [ {"id": 1, "name": 1}, {"id": 2, "name": "Nan"}, {"id": 3, "name": 3}, .... ] ,which have several problematic rows data like row 2, then i load it with datasets.load_dataset('json', data_files=['xx.json'], split='train'), it will report like this: Generating train split: 0 examples [00:00, ? examples/s]Failed to read file 'C:\Users\gawinjunwu\Downloads\test\data\a.json' with error <class 'pyarrow.lib.ArrowInvalid'>: Could not convert '2' with type str: tried to convert to int64 Traceback (most recent call last): File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 1858, in _prepare_split_single for _, table in generator: File "D:\Python3.9\lib\site-packages\datasets\packaged_modules\json\json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at C:\Users\gawinjunwu\Downloads\test\data\a.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Users\gawinjunwu\Downloads\test\scripts\a.py", line 4, in <module> ds = load_dataset('json', data_dir='data', split='train') File "D:\Python3.9\lib\site-packages\datasets\load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 890, in download_and_prepare self._download_and_prepare( File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 1891, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset. Could datasets skip those problematic data row? ### Steps to reproduce the bug prepare a json file like this: [ {"id": 1, "name": 1}, {"id": 2, "name": "Nan"}, {"id": 3, "name": 3} ] then use datasets.load_dataset('json', dir_files=['xxx.json']) to load the json file ### Expected behavior skip the problematic data row and load row1 and row3 ### Environment info python3.9
32
load json dataset interrupt when dtype cast problem occured ### Describe the bug i have a json like this: [ {"id": 1, "name": 1}, {"id": 2, "name": "Nan"}, {"id": 3, "name": 3}, .... ] ,which have several problematic rows data like row 2, then i load it with datasets.load_dataset('json', data_files=['xx.json'], split='train'), it will report like this: Generating train split: 0 examples [00:00, ? examples/s]Failed to read file 'C:\Users\gawinjunwu\Downloads\test\data\a.json' with error <class 'pyarrow.lib.ArrowInvalid'>: Could not convert '2' with type str: tried to convert to int64 Traceback (most recent call last): File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 1858, in _prepare_split_single for _, table in generator: File "D:\Python3.9\lib\site-packages\datasets\packaged_modules\json\json.py", line 146, in _generate_tables raise ValueError(f"Not able to read records in the JSON file at {file}.") from None ValueError: Not able to read records in the JSON file at C:\Users\gawinjunwu\Downloads\test\data\a.json. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\Users\gawinjunwu\Downloads\test\scripts\a.py", line 4, in <module> ds = load_dataset('json', data_dir='data', split='train') File "D:\Python3.9\lib\site-packages\datasets\load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 890, in download_and_prepare self._download_and_prepare( File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 1746, in _prepare_split for job_id, done, content in self._prepare_split_single( File "D:\Python3.9\lib\site-packages\datasets\builder.py", line 1891, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset. Could datasets skip those problematic data row? ### Steps to reproduce the bug prepare a json file like this: [ {"id": 1, "name": 1}, {"id": 2, "name": "Nan"}, {"id": 3, "name": 3} ] then use datasets.load_dataset('json', dir_files=['xxx.json']) to load the json file ### Expected behavior skip the problematic data row and load row1 and row3 ### Environment info python3.9 Indeed the JSON dataset builder raises an error when it encounters an unexpected type. There's an old PR open to add away to ignore such elements though, if it can help: https://github.com/huggingface/datasets/pull/2838
[ -0.29087209701538086, 0.005442589521408081, -0.023509161546826363, 0.6575196981430054, 0.6633947491645813, 0.0485328733921051, 0.3084115982055664, 0.336452841758728, -0.14784428477287292, -0.007055878639221191, 0.06579495221376419, 0.43404433131217957, -0.1574418544769287, 0.010361619293689728, -0.2496701031923294, -0.20384185016155243, -0.064145028591156, 0.1651192605495453, -0.1412290334701538, 0.22937482595443726, -0.37688881158828735, 0.029546933248639107, -0.2313896119594574, -0.0452311635017395, -0.06140841543674469, -0.0840160921216011, 0.3673226237297058, 0.37398022413253784, -0.10982140153646469, -0.5198230147361755, 0.1763746440410614, -0.17548511922359467, 0.12041498720645905, 0.47363319993019104, -0.00011585743050090969, 0.30911770462989807, 0.26165732741355896, 0.06563801318407059, -0.45581477880477905, -0.04744448512792587, -0.2047889232635498, -0.1077900230884552, 0.2571764588356018, -0.3156821131706238, -0.06090833246707916, -0.5647268891334534, -0.2675358057022095, -0.37291207909584045, 0.47302377223968506, 0.41676074266433716, 0.13269178569316864, 0.2888561487197876, 0.047327131032943726, 0.1199927031993866, 0.15324608981609344, 0.325367271900177, 0.08360640704631805, 0.4098481833934784, -0.06967984884977341, 0.49296024441719055, -0.10448611527681351, 0.024041157215833664, -0.09697334468364716, 0.01888653263449669, 0.0435493029654026, -0.0823226049542427, -0.09871240705251694, -0.2654361128807068, -0.10727843642234802, 0.02230806276202202, 0.430542916059494, -0.1693265289068222, -0.3284384310245514, -0.1975456327199936, 0.12263695895671844, -0.28985995054244995, 0.1990548074245453, -0.008791979402303696, -0.15134172141551971, 0.22801747918128967, -0.08807924389839172, 0.15815548598766327, -0.26773032546043396, -0.045949507504701614, -0.17563557624816895, -0.2443104386329651, -0.054801177233457565, 0.17177645862102509, -0.06763307750225067, -0.0626513734459877, 0.1571316421031952, -0.050452254712581635, -0.2687215209007263, 0.08951187133789062, -0.2668479382991791, -0.20982234179973602, 0.02309686318039894, -0.45509541034698486, -0.030539847910404205, -0.02636932209134102, -0.09460164606571198, 0.12091656029224396, -0.027348676696419716, 0.02372055873274803, 0.24392904341220856, -0.0343865305185318, -0.1623154878616333, -0.0396132692694664, 0.3699604868888855, 0.17322733998298645, -0.023862704634666443, 0.1127350926399231, -0.2186632752418518, -0.1217418909072876, 0.15315809845924377, 0.21051663160324097, 0.41463667154312134, 0.04591534286737442, -0.4329872131347656, 0.12512648105621338, -0.6589651107788086, 0.058535825461149216, 0.1474577784538269, 0.27183812856674194, 0.07481570541858673, 0.397112637758255, 0.12691505253314972, 0.12637591361999512, -0.09103905409574509, -0.16978871822357178, -0.08388464152812958, 0.06418545544147491, 0.040170855820178986, -0.2734491527080536, 0.21547064185142517, 0.23345905542373657, -0.016647256910800934, 0.2317224144935608, -0.27056294679641724, -0.24564522504806519, 0.13582170009613037, -0.1036892980337143, 0.06368087232112885, 0.40355154871940613, -0.06690330803394318, 0.15642845630645752, 0.13579607009887695, -0.18372729420661926, -0.04530856013298035, 0.3482652008533478, -0.11628718674182892, -0.2204436957836151, -0.16247417032718658, 0.2154325693845749, -0.14713206887245178, 0.17295758426189423, -0.4643232524394989, 0.1078265905380249, 0.03164781630039215, -0.32383668422698975, 0.146351620554924, -0.38453152775764465, 0.07216263562440872, -0.23233313858509064, 0.14359986782073975, 0.2146797925233841, -0.559899628162384, 0.07674308121204376, 0.02619786560535431, -0.18298088014125824, 0.3049033284187317, 0.24132388830184937, -0.3074468672275543, 0.4061379134654999, -0.2329908013343811, 0.1604488044977188, 0.5110702514648438, -0.13367874920368195, -0.3955584466457367, 0.177415132522583, -0.34376072883605957, 0.11542236804962158, 0.050348155200481415, 0.027255546301603317, 0.2212853729724884, -0.0076105594635009766, 0.1573144793510437, 0.5291928648948669, -0.08720516413450241, 0.3149896264076233, -0.057918764650821686, -0.12035910785198212, 0.19953744113445282, 0.31065940856933594, -0.2525029182434082, -0.12587523460388184, 0.12071620672941208, 0.21892105042934418, 0.13595084846019745, -0.13322091102600098, -0.006077848374843597, 0.1535073071718216, -0.04959223046898842, -0.17343947291374207, 0.1425936222076416, -0.19492219388484955, -0.3981584310531616, -0.06209380179643631, 0.08401279151439667, -0.06725969165563583, -0.4329829216003418, -0.16188055276870728, -0.11761823296546936, 0.13134647905826569, -0.11913138628005981, 0.09324879944324493, 0.13139410316944122, -0.13057707250118256, -0.07917111366987228, 0.13200879096984863, -0.08301340043544769, -0.07610612362623215, -0.06400851160287857, 0.24265481531620026, -0.25654980540275574, 0.13005374372005463, 0.10469965636730194, -0.28326451778411865, -0.04253959283232689, 0.03855133056640625, -0.021244361996650696, -0.3901694416999817, -0.300029993057251, 0.16458086669445038, 0.34427928924560547, 0.11983662843704224, -0.2824142277240753, -0.24120548367500305, 0.13124610483646393, -0.14507921040058136, -0.16979148983955383, 0.16938793659210205, 0.2670363783836365, -0.10094583034515381, -0.03596746176481247, 0.3439139127731323, -0.13178248703479767, 0.14093247056007385, 0.059309281408786774, -0.09534233063459396, 0.531526505947113, 0.05456521362066269, 0.049350835382938385, -0.17260290682315826, 0.03166631609201431, 0.42344605922698975, -0.08418697118759155, 0.23472048342227936, -0.4927024245262146, 0.12570691108703613, 0.5511637926101685, -0.3301428556442261, 0.011774945072829723, 0.1566196084022522, -0.21643920242786407, -0.0017916932702064514, 0.026427151635289192, 0.20352160930633545, 0.4368346929550171, 0.10114401578903198, 0.048633355647325516, -0.12627249956130981, 0.11676982045173645, -0.2539638578891754, 0.23400171101093292, 0.2558826208114624, 0.2464522421360016, 0.34061145782470703, 0.466350257396698, 0.053748778998851776, -0.392964243888855, -0.27464139461517334, 0.2678506374359131, 0.4499641954898834, -0.3801795542240143, 0.3538568317890167, -0.3901096284389496, -0.3492141366004944, -0.2397291362285614, -0.25280842185020447, 0.28087931871414185, -0.10332724452018738, -0.13684333860874176, 0.2631322145462036, -0.25186288356781006, 0.2806408107280731, -0.036541298031806946, 0.22906531393527985, 0.1080082356929779, -0.1300218552350998, -0.12156706303358078, -0.0670037567615509, -0.25846824049949646, 0.001455649733543396, 0.4241050183773041, 0.14026011526584625, 0.3109440505504608, -0.11564622819423676, 0.02116827666759491, -0.03472031280398369, -0.19348180294036865, 0.11216972768306732, 0.054877396672964096, 0.16063164174556732, 0.24818414449691772, 0.16196602582931519, -0.051776088774204254, -0.2517075538635254, 0.18864838778972626, 0.2166353166103363, -0.33654406666755676, 0.431552529335022, -0.24126578867435455, 0.11305136978626251, -0.18018364906311035, -0.38668590784072876, -0.1229991614818573, -0.3538070321083069, 0.2519795298576355, -0.13918229937553406, 0.06974047422409058, -0.15872791409492493, -0.011701494455337524, 0.2616869807243347, 0.13907839357852936, 0.06574144214391708, -0.06445176154375076, -0.05734435096383095, 0.21434229612350464, -0.1897369772195816, -0.028554925695061684, -0.022284865379333496, -0.33162108063697815, -0.04150572419166565, 0.06037863716483116, -0.3980652093887329, 0.03571928292512894, -0.38077229261398315, 0.4953741133213043, -0.3648948073387146, -0.34445109963417053, 0.15862295031547546, 0.24394893646240234, -0.035201672464609146, -0.041542988270521164, 0.14144475758075714, 0.1905851513147354, 0.006264500319957733, -0.05176800116896629, 0.11140061169862747, 0.7729950547218323, -0.19177377223968506, 0.26555919647216797, 0.17031769454479218, -0.3512830436229706, 0.19261057674884796, -0.09277840703725815, -0.15679723024368286, -0.09618046134710312, -0.029690828174352646, -0.04353348910808563, 0.04748370870947838, -0.17669841647148132, 0.10177890211343765, -0.22433561086654663, -0.2916046380996704, -0.018198125064373016, -0.15748092532157898, -0.42567330598831177, -0.36740413308143616, 0.13108594715595245, -0.2805030345916748, -0.19861720502376556, -0.1287352740764618, 0.045530229806900024, 0.0018691569566726685, 0.1457705944776535, 0.04042311757802963, 0.21517448127269745, 0.1454790234565735, -0.1994464099407196, -0.19098007678985596, -0.6218810081481934, 0.05003826320171356, 0.13452333211898804, 0.21677500009536743, 0.6180078983306885, 0.12404385209083557, -0.04260850325226784, 0.26366931200027466, -0.19155460596084595, 0.7599358558654785, 0.05576668679714203, 0.1939718872308731, 0.0934646725654602, 0.36348286271095276, -0.25547724962234497, -0.004771307110786438, -0.22771626710891724, 0.23136524856090546, 0.18574528396129608, 0.546476423740387, -0.36695045232772827, -0.031125694513320923, 0.482178270816803, 0.4294564127922058, -0.15294639766216278, -0.24521781504154205, -0.018321000039577484, -0.5227478742599487, -0.35621213912963867, 0.1852046549320221, 0.27283430099487305, 0.11309418082237244, -0.20427626371383667, -0.33257725834846497, -0.18110494315624237, -0.04376460611820221, -0.07398618757724762, 0.28310805559158325, 0.22629693150520325, -0.10323985666036606, 0.33966052532196045, -0.0038403733633458614, -0.07506778836250305, 0.5199199914932251, 0.7283166646957397, 0.37380972504615784, -0.6341813206672668, 0.10664179921150208, -0.009634658694267273, 0.14399829506874084, 0.21184414625167847, -0.18547256290912628, 0.2802908420562744, -0.08692625164985657, 0.09082140773534775, -0.18265394866466522, -0.005090486258268356, 0.38625627756118774, -0.06671953201293945, -0.4437815248966217, -0.3210994303226471, 0.24249053001403809, -0.1833094358444214, 0.0492110550403595, 0.06369438767433167, 0.014046862721443176, -0.19488181173801422, 0.4016108214855194, 0.02920294553041458, 0.7565521001815796, 0.23323188722133636, 0.002243081573396921, 0.6977697014808655, -0.2340301275253296, 0.407765656709671, -0.1298297792673111, 0.13746431469917297, -0.44854727387428284, 0.055826298892498016, -0.03799369931221008, -0.20186468958854675, -0.11655401438474655, 0.14347226917743683, -0.16362154483795166, -0.1907634437084198, -0.2031479775905609, -0.05761003494262695, -0.12296414375305176, 0.18945690989494324, -0.12959998846054077, -0.23336860537528992, -0.4224420189857483, 0.029886137694120407, -0.14971068501472473, -0.15738409757614136, 0.08705540746450424, -0.24806885421276093, -0.11293212324380875, -0.12854132056236267, -0.34582626819610596, 0.08468000590801239, -0.1605905443429947, 0.048959895968437195, 0.07558435946702957, -0.24407799541950226, 0.13996610045433044, -0.023875243961811066, 0.1958881914615631, 0.11876977235078812, -0.01163369882851839, 0.19139805436134338, 0.04143412411212921, 0.15581095218658447, 0.11066208779811859, 0.0494682602584362, 0.5345691442489624, 0.02010469138622284, -0.17514272034168243, 0.09590138494968414, -0.2848814129829407, 0.1374867558479309, 0.08987438678741455, -0.024790357798337936, -0.4259341359138489, -0.3739006817340851, -0.09572121500968933, -0.2760825455188751, 0.1231803447008133, -0.27166885137557983, 0.11917097121477127, -0.12346560508012772, 0.14176294207572937, 0.15103131532669067, -0.031036242842674255, -0.3427814543247223, -0.05145608261227608, 0.1934373378753662, 0.14282077550888062, 0.24751989543437958, 0.6243450045585632, 0.3455232083797455, -0.3431614339351654, -0.2026008665561676, 0.26992714405059814, 0.1444542109966278, -0.6139292120933533, 0.2619709074497223, 0.008019696921110153, 0.1867230385541916, 0.10853980481624603, 0.035602107644081116, -0.06402458250522614, -0.07679948210716248, -0.19513018429279327, -0.4636620879173279, -0.4485877752304077, 0.22531957924365997, 0.20764349400997162, 0.20697066187858582, 0.14741218090057373, 0.32753047347068787, -0.3901735842227936, -0.16735073924064636, -0.22979438304901123, 0.18622595071792603, -0.18129068613052368, 0.17360594868659973, -0.3000042140483856, 0.04967685416340828, 0.029488086700439453, 0.00928463414311409, 0.15047983825206757, 0.09560330212116241, 0.14155840873718262, -0.11865358799695969, -0.17683729529380798, 0.13686630129814148, -0.030305951833724976, -0.07968203723430634, -0.05657878518104553, -0.24149587750434875, -0.06474237143993378, 0.08665454387664795, 0.16726045310497284, -0.09345535933971405, 0.007296731695532799, 0.07987239956855774, 0.4649929106235504, 0.198523610830307, 0.01326209306716919, 0.3593010902404785, -0.2583114206790924, 0.2975234091281891, -0.06465386599302292, 0.11285962164402008, -0.10023100674152374, 0.07276120781898499, -0.36342889070510864, -0.046093523502349854, 0.13630342483520508, 0.02990659698843956, 0.32994866371154785, -0.334113746881485, 0.1031273603439331, 0.07442398369312286, 0.12967705726623535, 0.4960213899612427, -0.2904861271381378, 0.00415492057800293, 0.10967668890953064, 0.15369582176208496, -0.0841280072927475, -0.07238849997520447, -0.07292748987674713, -0.32839494943618774, -0.057687900960445404, 0.16369809210300446, -0.41391289234161377, 0.06650267541408539, -0.0936679020524025, 0.1403817981481552, 0.32808917760849, 0.11981784552335739, -0.10055449604988098, 0.4864489734172821, -0.13868120312690735, -0.22095255553722382, 0.1798100769519806, 0.15385520458221436, 0.5045019388198853, 0.36200395226478577, -0.16432948410511017, 0.025653941556811333, 0.014334216713905334, 0.09483574330806732, -0.14956338703632355, -0.26568055152893066, 0.14750374853610992, 0.19747856259346008, -0.3487624526023865, 0.002107542008161545, 0.4451788067817688, 0.4533420503139496, -0.21294040977954865, 0.030480340123176575, -0.19093890488147736, 0.1758323758840561, -0.258257120847702, 0.07195346057415009, -0.2029954195022583, -0.22462688386440277, -0.02592715620994568, -0.07912777364253998, -0.2698032855987549, 0.36271536350250244, -0.03677085414528847, 0.42038464546203613, -0.21094255149364471, -0.3696388304233551, 0.12006504833698273, -0.12249574065208435, 0.15749771893024445, -0.23840560019016266, 0.2187357246875763, 0.5270644426345825, -0.09726757556200027, 0.19276495277881622, 0.03243760019540787, 0.2527841329574585, 0.2302296906709671, -0.26010972261428833, -0.19998739659786224, -0.06235617771744728, -0.2800002098083496, -0.10648366808891296, 0.39888909459114075, 0.16333547234535217, 0.08638517558574677, 0.1712440848350525, 0.18126589059829712, -0.13821078836917877, 0.12964555621147156, 0.3081322908401489, -0.028399620205163956, -0.14433646202087402, 0.3003663122653961, -0.09545817971229553, -0.18400749564170837, -0.015223887749016285, -0.3131260573863983, -0.21238845586776733, -0.19808347523212433, 0.08431883156299591, -0.05636918544769287, 0.0487452931702137, -0.04857233911752701, 0.07377386093139648, -0.06399443745613098, 0.42091476917266846, 0.11011695116758347, -0.04691076651215553, -0.019904131069779396, 0.06420814990997314, -0.2677996754646301, 0.2769925594329834, 0.11656206846237183, -0.0029680579900741577, 0.3990645110607147, -0.012759454548358917, 0.019827108830213547, 0.23998114466667175, 0.10991207510232925, 0.12357696890830994, 0.11515134572982788, 0.5267473459243774, -0.3430718183517456, -0.34753185510635376, 0.15835070610046387, -0.15273720026016235, -0.3441794514656067, -0.34016019105911255, 0.4473486840724945, 0.05805526673793793, 0.048464685678482056, -0.28988778591156006, -0.010979019105434418, 0.15384240448474884, -0.06543061137199402, 0.246647909283638, 0.21286717057228088, 0.3529250919818878, -0.12484726309776306, -0.03184840455651283, 0.06514221429824829, -0.4273041784763336, -0.20092929899692535, 0.3602294325828552, 0.05173750966787338, 0.40097108483314514, 0.13429942727088928, 0.18097776174545288, -0.24947728216648102, -0.27333033084869385, -0.2993961274623871, 0.12733712792396545, -0.6274157166481018, 0.34990042448043823, -0.4240345358848572, 0.13271167874336243, 0.10386116802692413, 0.06392017006874084, 0.35888317227363586, 0.31625276803970337, -0.21468447148799896, -0.4077392816543579, 0.37658798694610596, -0.2724449634552002, -0.1729990541934967, 0.3411295711994171, -0.010394707322120667, -0.32052186131477356, -0.04265177622437477, -0.35905176401138306, 0.1543731689453125, 0.39222952723503113, -0.1700824797153473, -0.09653937071561813, 0.3311055898666382, 0.23077361285686493, 0.06358157843351364, -0.11405825614929199, 0.4706571400165558, -0.023104876279830933, 0.06701420247554779, -0.04165837913751602, 0.022157125174999237 ]
https://github.com/huggingface/datasets/issues/5825
Hi! This would only work if `bigscience/xP3` was a no-code dataset, but it isn't (it has a Python builder script). But this should work: ```python load_dataset("json", data_files="https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl") ```
FileNotFound even though exists
### Describe the bug I'm trying to download https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl which works fine in my webbrowser, but somehow not with datasets. Am I doing sth wrong? ``` Downloading builder script: 100% 2.82k/2.82k [00:00<00:00, 64.2kB/s] Downloading readme: 100% 12.6k/12.6k [00:00<00:00, 585kB/s] --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-2-4b45446a91d5>](https://localhost:8080/#) in <cell line: 4>() 2 lang = "ur" 3 fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" ----> 4 dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") 6 frames [/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in _resolve_single_pattern_locally(base_path, pattern, allowed_extensions) 291 if allowed_extensions is not None: 292 error_msg += f" with any supported extension {list(allowed_extensions)}" --> 293 raise FileNotFoundError(error_msg) 294 return sorted(out) 295 FileNotFoundError: Unable to find 'https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl' at /content/https:/huggingface.co/datasets/bigscience/xP3/resolve/main ``` ### Steps to reproduce the bug ``` !pip install -q datasets from datasets import load_dataset lang = "ur" fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") ``` ### Expected behavior Correctly downloads ### Environment info latest versions
28
FileNotFound even though exists ### Describe the bug I'm trying to download https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl which works fine in my webbrowser, but somehow not with datasets. Am I doing sth wrong? ``` Downloading builder script: 100% 2.82k/2.82k [00:00<00:00, 64.2kB/s] Downloading readme: 100% 12.6k/12.6k [00:00<00:00, 585kB/s] --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-2-4b45446a91d5>](https://localhost:8080/#) in <cell line: 4>() 2 lang = "ur" 3 fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" ----> 4 dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") 6 frames [/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in _resolve_single_pattern_locally(base_path, pattern, allowed_extensions) 291 if allowed_extensions is not None: 292 error_msg += f" with any supported extension {list(allowed_extensions)}" --> 293 raise FileNotFoundError(error_msg) 294 return sorted(out) 295 FileNotFoundError: Unable to find 'https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl' at /content/https:/huggingface.co/datasets/bigscience/xP3/resolve/main ``` ### Steps to reproduce the bug ``` !pip install -q datasets from datasets import load_dataset lang = "ur" fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") ``` ### Expected behavior Correctly downloads ### Environment info latest versions Hi! This would only work if `bigscience/xP3` was a no-code dataset, but it isn't (it has a Python builder script). But this should work: ```python load_dataset("json", data_files="https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl") ```
[ -0.2510882019996643, 0.14677296578884125, 0.09450720995664597, 0.31087517738342285, 0.3156176805496216, -0.10854393988847733, 0.19184064865112305, 0.47219040989875793, -0.021109148859977722, -0.014219947159290314, 0.039334096014499664, -0.04836209863424301, -0.006035400554537773, 0.07823775708675385, 0.03708745539188385, 0.24487215280532837, 0.005397960543632507, -0.0416969433426857, 0.15210872888565063, -0.0006577745079994202, -0.35457101464271545, 0.2847941219806671, -0.16470661759376526, 0.07096788287162781, -0.2691900432109833, 0.24831919372081757, -0.09499756991863251, 0.4132421016693115, -0.29954540729522705, -0.09838997572660446, 0.33912819623947144, -0.031024571508169174, 0.38811880350112915, 0.44450658559799194, -0.00012019872519886121, 0.12895753979682922, 0.4716346859931946, -0.15061454474925995, -0.2682364881038666, -0.29372474551200867, -0.482326865196228, -0.199232280254364, -0.17461779713630676, -0.4158334732055664, 0.14689797163009644, -0.13342925906181335, 0.15415643155574799, -0.13870598375797272, 0.2641070485115051, 0.4220246970653534, 0.1195642426609993, 0.1419946253299713, 0.20221152901649475, -0.022348841652274132, 0.5701897740364075, 0.3195282518863678, -0.07733123004436493, 0.19767440855503082, 0.1807352602481842, 0.15945765376091003, 0.22071418166160583, 0.206953763961792, -0.23973101377487183, 0.13687050342559814, 0.47948580980300903, 0.1432672142982483, 0.15760520100593567, -0.18279482424259186, 0.0156919714063406, 0.4238365888595581, 0.44465774297714233, -0.08200576901435852, -0.5095714926719666, -0.2777233421802521, -0.11575779318809509, 0.04499392956495285, 0.43111830949783325, 0.1909993290901184, -0.06510095298290253, 0.16026902198791504, -0.14818772673606873, -0.3522404730319977, -0.03978195786476135, 0.40588632225990295, -0.23142676055431366, 0.27759289741516113, -0.14003616571426392, 0.14679411053657532, -0.13387811183929443, -0.2573758065700531, 0.0029127486050128937, -0.6851415634155273, 0.0014137309044599533, 0.13459719717502594, -0.09331293404102325, -0.1496366411447525, 0.17037630081176758, 0.010867299512028694, 0.40507930517196655, 0.23804673552513123, 0.04332868754863739, -0.06462793052196503, -0.1252860128879547, 0.05611622706055641, 0.08773134648799896, 0.1540757119655609, -0.14818082749843597, 0.15870746970176697, 0.5245150923728943, 0.5061956644058228, -0.06246574968099594, 0.0411762073636055, -0.06284399330615997, -0.05727236345410347, -0.3555610477924347, -0.1751634180545807, 0.6801139116287231, -0.1594335436820984, -0.6024113297462463, 0.0765347108244896, -0.6522055864334106, -0.18630404770374298, 0.11474977433681488, 0.3787408769130707, -0.21386046707630157, 0.10402742028236389, 0.14955256879329681, 0.19461363554000854, -0.05376148223876953, -0.08713601529598236, -0.09745904803276062, 0.1270478367805481, 0.09980110824108124, -0.0715552419424057, 0.29297271370887756, -0.1324365735054016, 0.2458212971687317, -0.15361058712005615, -0.09932807832956314, 0.031713858246803284, -0.18737247586250305, -0.017578769475221634, 0.011250495910644531, 0.1689855307340622, -0.1410733163356781, 0.1899333894252777, -0.04174390435218811, -0.3441976308822632, -0.15480567514896393, 0.300879567861557, -0.15098893642425537, 0.0350860133767128, -0.3542703092098236, 0.10366606712341309, -0.4530298113822937, -0.10557800531387329, 0.055226150900125504, -0.2377454787492752, -0.17509400844573975, -0.17378291487693787, 0.10084088146686554, -0.23763667047023773, -0.15351602435112, -0.2124868482351303, 0.35494711995124817, 0.7274510860443115, -0.14737577736377716, 0.015643224120140076, -0.21877118945121765, -0.22914797067642212, 0.11656220257282257, 0.11830728501081467, -0.011344172060489655, 0.2263418734073639, -0.5804932117462158, 0.34591934084892273, 0.5227383375167847, -0.3645285964012146, -0.3661642074584961, 0.6197426915168762, -0.09912902116775513, 0.208539217710495, 0.20734436810016632, 0.05574723333120346, -0.1237189918756485, -0.031422942876815796, 0.01989002525806427, 0.14245623350143433, 0.04862754046916962, -0.04912830889225006, -0.34426724910736084, -0.12975314259529114, -0.04430847987532616, 0.1744443029165268, 0.11233572661876678, 0.14367324113845825, 0.1596207618713379, 0.08925306051969528, 0.31891992688179016, -0.025313619524240494, 0.28918635845184326, 0.14113925397396088, 0.45318350195884705, 0.05599634721875191, -0.13764609396457672, -0.15828514099121094, -0.6912152767181396, 0.24811695516109467, 0.1376371681690216, -0.2730214595794678, -0.41480252146720886, -0.1551886349916458, -0.2721186578273773, -0.03437276929616928, -0.35950416326522827, -0.13692091405391693, 0.008210450410842896, 0.239222452044487, 0.11324452608823776, 0.12461403012275696, -0.3190825283527374, 0.25863075256347656, -0.12906122207641602, 0.17553900182247162, -0.1085960865020752, 0.38667434453964233, -0.16852058470249176, -0.29169052839279175, -0.003618955612182617, -0.11896538734436035, 0.11405117809772491, -0.1433044672012329, -0.018360428512096405, 0.2350897192955017, 0.040320947766304016, -0.19696049392223358, 0.08551743626594543, 0.14396637678146362, 0.1593908965587616, -0.05694228410720825, -0.08274742215871811, 0.40405628085136414, 0.2465846836566925, 0.09520884603261948, -0.35927802324295044, 0.20573167502880096, 0.041570208966732025, 0.050861719995737076, 0.16379615664482117, -0.18949131667613983, 0.3200533986091614, -0.2841891646385193, -0.12558193504810333, -0.06543201208114624, 0.26966211199760437, 0.362538605928421, 0.17297092080116272, 0.02033616043627262, -0.21474477648735046, -0.060769129544496536, 0.46771207451820374, -0.1467950940132141, -0.0033089835196733475, 0.08829629421234131, -0.20538973808288574, 0.1527288556098938, -0.006750941276550293, 0.4834669232368469, 0.5511338114738464, 0.14121496677398682, 0.10494257509708405, 0.20254020392894745, 0.09325924515724182, -0.20351003110408783, 0.0792657807469368, 0.018986640498042107, 0.004515796899795532, 0.3937057852745056, -0.0635160356760025, -0.12079952657222748, -0.17417407035827637, -0.22927314043045044, 0.0465325266122818, 0.1495911329984665, -0.4807929992675781, -0.017373237758874893, -0.3350991904735565, -0.4402068257331848, -0.21564432978630066, -0.11926538497209549, -0.20202285051345825, -0.37433332204818726, -0.030001437291502953, 0.3362932801246643, -0.2070125788450241, -0.00467962771654129, -0.43303167819976807, -0.11394472420215607, 0.03634701669216156, -0.6112504005432129, -0.3271775245666504, 0.07242798805236816, -0.30589863657951355, -0.006213102489709854, 0.5616757273674011, -0.12521478533744812, 0.07258263230323792, -0.42530179023742676, 0.05619300901889801, -0.6212414503097534, -0.3426209092140198, 0.1349959373474121, 0.0008208993822336197, 0.36969640851020813, 0.27229154109954834, 0.20907798409461975, -0.09101784229278564, -0.0018916800618171692, 0.37952470779418945, -0.026710372418165207, -0.3207659125328064, -0.08461865037679672, 0.19046428799629211, -0.2398499846458435, -0.19893725216388702, -0.2883617877960205, -0.05176473408937454, -0.3918265998363495, 0.011820176616311073, -0.012997061014175415, 0.01755688525736332, 0.03202880546450615, 0.13682126998901367, 0.2856266498565674, -0.29953715205192566, -0.12902897596359253, -0.10186722874641418, -0.3239040970802307, 0.6029108762741089, 0.04325662925839424, -0.362569123506546, 0.463753342628479, -0.1962447166442871, -0.17656531929969788, 0.1109127476811409, -0.37157702445983887, -0.06504344195127487, -0.03247884660959244, 0.3855399787425995, -0.016649702563881874, 0.0969543531537056, 0.20241662859916687, -0.16022074222564697, 0.08789462596178055, -0.24186092615127563, -0.13112545013427734, -0.08123968541622162, 0.07776246219873428, 0.40507936477661133, 0.04319249466061592, 0.1211184710264206, -0.04584888368844986, 0.3169565200805664, 0.2107750028371811, -0.046951986849308014, 0.6747385859489441, -0.13239341974258423, 0.36615487933158875, 0.056731510907411575, -0.09902569651603699, -0.05851658061146736, 0.14130859076976776, 0.009774565696716309, 0.2622554302215576, 0.08499954640865326, 0.11004991084337234, -0.477377712726593, -0.1006145030260086, -0.23687346279621124, -0.29826369881629944, -0.04421573504805565, 0.18477323651313782, -0.08911404758691788, 0.053974591195583344, 0.036155037581920624, 0.23932266235351562, -0.03222785145044327, 0.11081358790397644, 0.5831024050712585, 0.23491257429122925, 0.144718199968338, 0.05749286711215973, 0.03785920515656471, -0.044022515416145325, 0.36459481716156006, 0.40225428342819214, 0.0200895257294178, -0.009527929127216339, -0.11086653172969818, 0.04797741770744324, -0.27176496386528015, 0.705767035484314, 0.10566800832748413, 0.16147083044052124, -0.027299564331769943, 0.059060148894786835, -0.28332510590553284, -0.1956813931465149, -0.10912764817476273, -0.04512104019522667, 0.2589658200740814, 0.4827183485031128, -0.47238898277282715, -0.0891643613576889, 0.18127810955047607, 0.028404954820871353, 0.011902913451194763, -0.19078552722930908, -0.263264536857605, -0.4173997938632965, -0.4608730673789978, -0.18209192156791687, 0.1113126203417778, 0.1053532063961029, 0.18399542570114136, -0.0998331606388092, -0.032584816217422485, -0.06596887856721878, -0.03602682426571846, 0.004483282566070557, 0.19142834842205048, -0.0998997613787651, 0.19061672687530518, -0.017189020290970802, 0.4210623502731323, 0.25413766503334045, 0.8004397749900818, 0.3277956247329712, -0.3818357586860657, -0.015857161954045296, -0.03748919069766998, 0.01337074488401413, 0.1551545113325119, -0.12263451516628265, -0.22143054008483887, 0.23578405380249023, 0.09137234091758728, -0.14623838663101196, 0.17757117748260498, 0.6022219061851501, -0.10761509835720062, -0.19444222748279572, -0.2124875783920288, 0.4896883964538574, 0.019388481974601746, 0.16385668516159058, 0.14203448593616486, 0.2553554177284241, 0.044159963726997375, -0.39747974276542664, -0.3241954743862152, 0.7516404986381531, 0.25210872292518616, 0.1675327867269516, 0.41903766989707947, -0.21679618954658508, 0.513601541519165, 0.03956504166126251, 0.13375404477119446, -0.16568325459957123, -0.01184842549264431, -0.14659661054611206, -0.15782830119132996, 0.27220621705055237, 0.13526827096939087, -0.17105485498905182, 0.22457680106163025, 0.2983531951904297, 0.39125072956085205, 0.10756418108940125, 0.20141498744487762, -0.38621652126312256, 0.25368285179138184, -0.23885513842105865, 0.06799869984388351, -0.18733184039592743, 0.5775859355926514, -0.08338809013366699, -0.20768016576766968, -0.4657289981842041, -0.2698519229888916, -0.15162549912929535, 0.3154924511909485, -0.2425224781036377, -0.04883323609828949, 0.007234165444970131, -0.12906217575073242, -0.04669367894530296, 0.02979278936982155, -0.3367827534675598, -0.1034989133477211, -0.40737271308898926, 0.20246504247188568, -0.18520744144916534, -0.08499787747859955, 0.025401033461093903, -0.031520549207925797, 0.3319633901119232, -0.1835782825946808, -0.21633115410804749, -0.0419875867664814, -0.021266259253025055, -0.16282810270786285, 0.15978530049324036, -0.03105738013982773, -0.16758482158184052, -0.2350907325744629, -0.36520838737487793, 0.013598710298538208, 0.05191703140735626, -0.10677217692136765, 0.05953700840473175, 0.0769171342253685, -0.06543353199958801, -0.04417731240391731, -0.07834887504577637, -0.14489738643169403, -0.09175010025501251, 0.5684577822685242, -0.28623732924461365, 0.11564960330724716, 0.2937338054180145, 0.1349806785583496, -0.23924405872821808, -0.08631110936403275, 0.28143274784088135, -0.19617398083209991, -0.08507747948169708, 0.15020811557769775, -0.04768386855721474, 0.28309035301208496, -0.19550791382789612, 0.29870134592056274, 0.10949043929576874, -0.23259125649929047, 0.22976472973823547, -0.4569242596626282, -0.08866629004478455, 0.10540667176246643, -0.013072717934846878, 0.07236352562904358, 0.012110285460948944, 0.14971823990345, 0.35188794136047363, -0.5547195672988892, -0.21226145327091217, 0.1571764200925827, -0.06433625519275665, -0.08317947387695312, 0.18691760301589966, 0.37253573536872864, 0.43075981736183167, -0.007866676896810532, 0.0006938241422176361, 0.008610647171735764, -0.14663386344909668, -0.13510578870773315, -0.06951633840799332, 0.19248484075069427, 0.33258306980133057, -0.1473902463912964, 0.12020661681890488, -0.32998156547546387, 0.030827291309833527, 0.06142155081033707, 0.13525663316249847, 0.1631431132555008, -0.115461066365242, 0.011378243565559387, 0.00006748829036951065, -0.07921053469181061, -0.2120106816291809, 0.18079441785812378, -0.13551674783229828, 0.49211809039115906, 0.10595902055501938, 0.18393729627132416, 0.13666048645973206, 0.12251680344343185, -0.1814713180065155, -0.19559143483638763, -0.10523965209722519, 0.10128936916589737, 0.49616777896881104, -0.3507457971572876, -0.14998696744441986, -0.07038794457912445, 0.22864624857902527, 0.625700056552887, -0.2661622166633606, -0.009901408106088638, 0.19276635348796844, 0.12957653403282166, -0.38391345739364624, 0.18070824444293976, 0.394206166267395, -0.01309473067522049, 0.10875910520553589, 0.15686708688735962, -0.3388194441795349, -0.017804592847824097, -0.15130583941936493, 0.30106234550476074, 0.5190191268920898, 0.21832987666130066, 0.062092237174510956, 0.4117930233478546, -0.20758706331253052, 0.23098082840442657, 0.3315342366695404, 0.042432911694049835, 0.20531538128852844, 0.4234302043914795, -0.23652416467666626, 0.08662230521440506, -0.17620648443698883, 0.30810147523880005, 0.1216755360364914, -0.28059813380241394, 0.0020639137364923954, 0.16501370072364807, 0.009706709533929825, 0.025659803301095963, 0.04403380677103996, -0.028081044554710388, -0.20243123173713684, 0.4294690489768982, -0.29070693254470825, 0.3470713794231415, -0.045131150633096695, 0.12398246675729752, -0.3217116594314575, -0.4413330554962158, -0.1026463434100151, 0.06056469678878784, 0.009692381136119366, -0.12376430630683899, 0.20396453142166138, 0.23864863812923431, -0.18037499487400055, -0.23353606462478638, 0.2348584085702896, -0.25720587372779846, 0.07313206791877747, -0.3822055459022522, 0.15215416252613068, 0.26899537444114685, -0.04606395587325096, 0.12763485312461853, 0.40279901027679443, 0.4857690632343292, 0.35140711069107056, 0.03914688900113106, -0.27187633514404297, -0.09741918742656708, -0.16525323688983917, -0.19531866908073425, 0.342504620552063, -0.10149604827165604, 0.04683907330036163, 0.3962002992630005, 0.112139493227005, -0.12935598194599152, 0.29454588890075684, -0.22319379448890686, -0.12041285634040833, -0.20332829654216766, 0.44539281725883484, -0.4962369203567505, 0.13295356929302216, -0.09789150953292847, -0.12942342460155487, -0.3205019235610962, 0.012256961315870285, 0.08325028419494629, 0.006618484854698181, 0.1644681692123413, -0.050490427762269974, 0.04787760227918625, -0.05667818337678909, 0.11116236448287964, 0.530142605304718, -0.005716145038604736, -0.19208768010139465, 0.028664633631706238, -0.637361466884613, 0.26520881056785583, -0.2013455480337143, -0.20212602615356445, -0.13717150688171387, 0.22891080379486084, -0.23938873410224915, 0.0927012711763382, -0.016514360904693604, -0.03063119202852249, 0.13680684566497803, 0.23532891273498535, -0.1705704927444458, -0.24721501767635345, 0.1443340927362442, -0.004424961283802986, 0.03235200047492981, -0.4163822531700134, 0.25376924872398376, -0.4628157913684845, -0.08317112922668457, -0.09976799786090851, -0.11378162354230881, 0.1297498494386673, -0.348460853099823, 0.4195500612258911, 0.10942061245441437, 0.4539036750793457, -0.14194002747535706, -0.22124125063419342, -0.13290539383888245, -0.027548717334866524, -0.16210967302322388, 0.16112348437309265, -0.13696011900901794, 0.27959051728248596, -0.054777756333351135, 0.21611574292182922, -0.4867675006389618, 0.23958012461662292, -0.1740921437740326, 0.13561758399009705, -0.09182746708393097, -0.07493860274553299, -0.530912458896637, 0.07125724852085114, -0.07937866449356079, -0.13358080387115479, -0.19366928935050964, 0.0866532251238823, -0.42079636454582214, -0.33709579706192017, 0.5411854386329651, -0.3231888711452484, -0.173937126994133, 0.004581067711114883, 0.023171905428171158, -0.026155803352594376, -0.09181317687034607, -0.3987163305282593, 0.20182152092456818, 0.43763768672943115, 0.15278811752796173, -0.14609894156455994, 0.014663681387901306, -0.04151395335793495, -0.08516405522823334, 0.15334445238113403, 0.12289375066757202, 0.0904349759221077, -0.1987885981798172, 0.08398279547691345, -0.10987496376037598 ]
https://github.com/huggingface/datasets/issues/5825
> I see, it's not compatible w/ regex right? e.g. `load_dataset("json", data_files="https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/*")` It should work for patterns that "reference" the local filesystem, but to make this work with the Hub, we must implement https://github.com/huggingface/datasets/issues/5281 first. In the meantime, you can fetch these glob files with `HfFileSystem` and pass them as a list to `load_dataset`: ```python from datasets import load_dataset from huggingface_hub import HfFileSystem, hf_hub_url # `HfFileSystem` requires the latest version of `huggingface_hub` fs = HfFileSystem() glob_files = fs.glob("datasets/bigscience/xP3/ur/*") # convert fsspec URLs to HTTP URLs resolved_paths = [fs.resolve_path(file) for file in glob_files] data_files = [hf_hub_url(resolved_path.repo_id, resolved_path.path_in_repo, repo_type=resolved_path.repo_type) for resolved_path in resolved_paths] ds = load_dataset("json", data_files=data_files) ```
FileNotFound even though exists
### Describe the bug I'm trying to download https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl which works fine in my webbrowser, but somehow not with datasets. Am I doing sth wrong? ``` Downloading builder script: 100% 2.82k/2.82k [00:00<00:00, 64.2kB/s] Downloading readme: 100% 12.6k/12.6k [00:00<00:00, 585kB/s] --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-2-4b45446a91d5>](https://localhost:8080/#) in <cell line: 4>() 2 lang = "ur" 3 fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" ----> 4 dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") 6 frames [/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in _resolve_single_pattern_locally(base_path, pattern, allowed_extensions) 291 if allowed_extensions is not None: 292 error_msg += f" with any supported extension {list(allowed_extensions)}" --> 293 raise FileNotFoundError(error_msg) 294 return sorted(out) 295 FileNotFoundError: Unable to find 'https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl' at /content/https:/huggingface.co/datasets/bigscience/xP3/resolve/main ``` ### Steps to reproduce the bug ``` !pip install -q datasets from datasets import load_dataset lang = "ur" fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") ``` ### Expected behavior Correctly downloads ### Environment info latest versions
106
FileNotFound even though exists ### Describe the bug I'm trying to download https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl which works fine in my webbrowser, but somehow not with datasets. Am I doing sth wrong? ``` Downloading builder script: 100% 2.82k/2.82k [00:00<00:00, 64.2kB/s] Downloading readme: 100% 12.6k/12.6k [00:00<00:00, 585kB/s] --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-2-4b45446a91d5>](https://localhost:8080/#) in <cell line: 4>() 2 lang = "ur" 3 fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" ----> 4 dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") 6 frames [/usr/local/lib/python3.10/dist-packages/datasets/data_files.py](https://localhost:8080/#) in _resolve_single_pattern_locally(base_path, pattern, allowed_extensions) 291 if allowed_extensions is not None: 292 error_msg += f" with any supported extension {list(allowed_extensions)}" --> 293 raise FileNotFoundError(error_msg) 294 return sorted(out) 295 FileNotFoundError: Unable to find 'https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl' at /content/https:/huggingface.co/datasets/bigscience/xP3/resolve/main ``` ### Steps to reproduce the bug ``` !pip install -q datasets from datasets import load_dataset lang = "ur" fname = "xp3_facebook_flores_spa_Latn-urd_Arab_devtest_ab-spa_Latn-urd_Arab.jsonl" dataset = load_dataset("bigscience/xP3", data_files=f"{lang}/{fname}") ``` ### Expected behavior Correctly downloads ### Environment info latest versions > I see, it's not compatible w/ regex right? e.g. `load_dataset("json", data_files="https://huggingface.co/datasets/bigscience/xP3/resolve/main/ur/*")` It should work for patterns that "reference" the local filesystem, but to make this work with the Hub, we must implement https://github.com/huggingface/datasets/issues/5281 first. In the meantime, you can fetch these glob files with `HfFileSystem` and pass them as a list to `load_dataset`: ```python from datasets import load_dataset from huggingface_hub import HfFileSystem, hf_hub_url # `HfFileSystem` requires the latest version of `huggingface_hub` fs = HfFileSystem() glob_files = fs.glob("datasets/bigscience/xP3/ur/*") # convert fsspec URLs to HTTP URLs resolved_paths = [fs.resolve_path(file) for file in glob_files] data_files = [hf_hub_url(resolved_path.repo_id, resolved_path.path_in_repo, repo_type=resolved_path.repo_type) for resolved_path in resolved_paths] ds = load_dataset("json", data_files=data_files) ```
[ -0.2510882019996643, 0.14677296578884125, 0.09450720995664597, 0.31087517738342285, 0.3156176805496216, -0.10854393988847733, 0.19184064865112305, 0.47219040989875793, -0.021109148859977722, -0.014219947159290314, 0.039334096014499664, -0.04836209863424301, -0.006035400554537773, 0.07823775708675385, 0.03708745539188385, 0.24487215280532837, 0.005397960543632507, -0.0416969433426857, 0.15210872888565063, -0.0006577745079994202, -0.35457101464271545, 0.2847941219806671, -0.16470661759376526, 0.07096788287162781, -0.2691900432109833, 0.24831919372081757, -0.09499756991863251, 0.4132421016693115, -0.29954540729522705, -0.09838997572660446, 0.33912819623947144, -0.031024571508169174, 0.38811880350112915, 0.44450658559799194, -0.00012019872519886121, 0.12895753979682922, 0.4716346859931946, -0.15061454474925995, -0.2682364881038666, -0.29372474551200867, -0.482326865196228, -0.199232280254364, -0.17461779713630676, -0.4158334732055664, 0.14689797163009644, -0.13342925906181335, 0.15415643155574799, -0.13870598375797272, 0.2641070485115051, 0.4220246970653534, 0.1195642426609993, 0.1419946253299713, 0.20221152901649475, -0.022348841652274132, 0.5701897740364075, 0.3195282518863678, -0.07733123004436493, 0.19767440855503082, 0.1807352602481842, 0.15945765376091003, 0.22071418166160583, 0.206953763961792, -0.23973101377487183, 0.13687050342559814, 0.47948580980300903, 0.1432672142982483, 0.15760520100593567, -0.18279482424259186, 0.0156919714063406, 0.4238365888595581, 0.44465774297714233, -0.08200576901435852, -0.5095714926719666, -0.2777233421802521, -0.11575779318809509, 0.04499392956495285, 0.43111830949783325, 0.1909993290901184, -0.06510095298290253, 0.16026902198791504, -0.14818772673606873, -0.3522404730319977, -0.03978195786476135, 0.40588632225990295, -0.23142676055431366, 0.27759289741516113, -0.14003616571426392, 0.14679411053657532, -0.13387811183929443, -0.2573758065700531, 0.0029127486050128937, -0.6851415634155273, 0.0014137309044599533, 0.13459719717502594, -0.09331293404102325, -0.1496366411447525, 0.17037630081176758, 0.010867299512028694, 0.40507930517196655, 0.23804673552513123, 0.04332868754863739, -0.06462793052196503, -0.1252860128879547, 0.05611622706055641, 0.08773134648799896, 0.1540757119655609, -0.14818082749843597, 0.15870746970176697, 0.5245150923728943, 0.5061956644058228, -0.06246574968099594, 0.0411762073636055, -0.06284399330615997, -0.05727236345410347, -0.3555610477924347, -0.1751634180545807, 0.6801139116287231, -0.1594335436820984, -0.6024113297462463, 0.0765347108244896, -0.6522055864334106, -0.18630404770374298, 0.11474977433681488, 0.3787408769130707, -0.21386046707630157, 0.10402742028236389, 0.14955256879329681, 0.19461363554000854, -0.05376148223876953, -0.08713601529598236, -0.09745904803276062, 0.1270478367805481, 0.09980110824108124, -0.0715552419424057, 0.29297271370887756, -0.1324365735054016, 0.2458212971687317, -0.15361058712005615, -0.09932807832956314, 0.031713858246803284, -0.18737247586250305, -0.017578769475221634, 0.011250495910644531, 0.1689855307340622, -0.1410733163356781, 0.1899333894252777, -0.04174390435218811, -0.3441976308822632, -0.15480567514896393, 0.300879567861557, -0.15098893642425537, 0.0350860133767128, -0.3542703092098236, 0.10366606712341309, -0.4530298113822937, -0.10557800531387329, 0.055226150900125504, -0.2377454787492752, -0.17509400844573975, -0.17378291487693787, 0.10084088146686554, -0.23763667047023773, -0.15351602435112, -0.2124868482351303, 0.35494711995124817, 0.7274510860443115, -0.14737577736377716, 0.015643224120140076, -0.21877118945121765, -0.22914797067642212, 0.11656220257282257, 0.11830728501081467, -0.011344172060489655, 0.2263418734073639, -0.5804932117462158, 0.34591934084892273, 0.5227383375167847, -0.3645285964012146, -0.3661642074584961, 0.6197426915168762, -0.09912902116775513, 0.208539217710495, 0.20734436810016632, 0.05574723333120346, -0.1237189918756485, -0.031422942876815796, 0.01989002525806427, 0.14245623350143433, 0.04862754046916962, -0.04912830889225006, -0.34426724910736084, -0.12975314259529114, -0.04430847987532616, 0.1744443029165268, 0.11233572661876678, 0.14367324113845825, 0.1596207618713379, 0.08925306051969528, 0.31891992688179016, -0.025313619524240494, 0.28918635845184326, 0.14113925397396088, 0.45318350195884705, 0.05599634721875191, -0.13764609396457672, -0.15828514099121094, -0.6912152767181396, 0.24811695516109467, 0.1376371681690216, -0.2730214595794678, -0.41480252146720886, -0.1551886349916458, -0.2721186578273773, -0.03437276929616928, -0.35950416326522827, -0.13692091405391693, 0.008210450410842896, 0.239222452044487, 0.11324452608823776, 0.12461403012275696, -0.3190825283527374, 0.25863075256347656, -0.12906122207641602, 0.17553900182247162, -0.1085960865020752, 0.38667434453964233, -0.16852058470249176, -0.29169052839279175, -0.003618955612182617, -0.11896538734436035, 0.11405117809772491, -0.1433044672012329, -0.018360428512096405, 0.2350897192955017, 0.040320947766304016, -0.19696049392223358, 0.08551743626594543, 0.14396637678146362, 0.1593908965587616, -0.05694228410720825, -0.08274742215871811, 0.40405628085136414, 0.2465846836566925, 0.09520884603261948, -0.35927802324295044, 0.20573167502880096, 0.041570208966732025, 0.050861719995737076, 0.16379615664482117, -0.18949131667613983, 0.3200533986091614, -0.2841891646385193, -0.12558193504810333, -0.06543201208114624, 0.26966211199760437, 0.362538605928421, 0.17297092080116272, 0.02033616043627262, -0.21474477648735046, -0.060769129544496536, 0.46771207451820374, -0.1467950940132141, -0.0033089835196733475, 0.08829629421234131, -0.20538973808288574, 0.1527288556098938, -0.006750941276550293, 0.4834669232368469, 0.5511338114738464, 0.14121496677398682, 0.10494257509708405, 0.20254020392894745, 0.09325924515724182, -0.20351003110408783, 0.0792657807469368, 0.018986640498042107, 0.004515796899795532, 0.3937057852745056, -0.0635160356760025, -0.12079952657222748, -0.17417407035827637, -0.22927314043045044, 0.0465325266122818, 0.1495911329984665, -0.4807929992675781, -0.017373237758874893, -0.3350991904735565, -0.4402068257331848, -0.21564432978630066, -0.11926538497209549, -0.20202285051345825, -0.37433332204818726, -0.030001437291502953, 0.3362932801246643, -0.2070125788450241, -0.00467962771654129, -0.43303167819976807, -0.11394472420215607, 0.03634701669216156, -0.6112504005432129, -0.3271775245666504, 0.07242798805236816, -0.30589863657951355, -0.006213102489709854, 0.5616757273674011, -0.12521478533744812, 0.07258263230323792, -0.42530179023742676, 0.05619300901889801, -0.6212414503097534, -0.3426209092140198, 0.1349959373474121, 0.0008208993822336197, 0.36969640851020813, 0.27229154109954834, 0.20907798409461975, -0.09101784229278564, -0.0018916800618171692, 0.37952470779418945, -0.026710372418165207, -0.3207659125328064, -0.08461865037679672, 0.19046428799629211, -0.2398499846458435, -0.19893725216388702, -0.2883617877960205, -0.05176473408937454, -0.3918265998363495, 0.011820176616311073, -0.012997061014175415, 0.01755688525736332, 0.03202880546450615, 0.13682126998901367, 0.2856266498565674, -0.29953715205192566, -0.12902897596359253, -0.10186722874641418, -0.3239040970802307, 0.6029108762741089, 0.04325662925839424, -0.362569123506546, 0.463753342628479, -0.1962447166442871, -0.17656531929969788, 0.1109127476811409, -0.37157702445983887, -0.06504344195127487, -0.03247884660959244, 0.3855399787425995, -0.016649702563881874, 0.0969543531537056, 0.20241662859916687, -0.16022074222564697, 0.08789462596178055, -0.24186092615127563, -0.13112545013427734, -0.08123968541622162, 0.07776246219873428, 0.40507936477661133, 0.04319249466061592, 0.1211184710264206, -0.04584888368844986, 0.3169565200805664, 0.2107750028371811, -0.046951986849308014, 0.6747385859489441, -0.13239341974258423, 0.36615487933158875, 0.056731510907411575, -0.09902569651603699, -0.05851658061146736, 0.14130859076976776, 0.009774565696716309, 0.2622554302215576, 0.08499954640865326, 0.11004991084337234, -0.477377712726593, -0.1006145030260086, -0.23687346279621124, -0.29826369881629944, -0.04421573504805565, 0.18477323651313782, -0.08911404758691788, 0.053974591195583344, 0.036155037581920624, 0.23932266235351562, -0.03222785145044327, 0.11081358790397644, 0.5831024050712585, 0.23491257429122925, 0.144718199968338, 0.05749286711215973, 0.03785920515656471, -0.044022515416145325, 0.36459481716156006, 0.40225428342819214, 0.0200895257294178, -0.009527929127216339, -0.11086653172969818, 0.04797741770744324, -0.27176496386528015, 0.705767035484314, 0.10566800832748413, 0.16147083044052124, -0.027299564331769943, 0.059060148894786835, -0.28332510590553284, -0.1956813931465149, -0.10912764817476273, -0.04512104019522667, 0.2589658200740814, 0.4827183485031128, -0.47238898277282715, -0.0891643613576889, 0.18127810955047607, 0.028404954820871353, 0.011902913451194763, -0.19078552722930908, -0.263264536857605, -0.4173997938632965, -0.4608730673789978, -0.18209192156791687, 0.1113126203417778, 0.1053532063961029, 0.18399542570114136, -0.0998331606388092, -0.032584816217422485, -0.06596887856721878, -0.03602682426571846, 0.004483282566070557, 0.19142834842205048, -0.0998997613787651, 0.19061672687530518, -0.017189020290970802, 0.4210623502731323, 0.25413766503334045, 0.8004397749900818, 0.3277956247329712, -0.3818357586860657, -0.015857161954045296, -0.03748919069766998, 0.01337074488401413, 0.1551545113325119, -0.12263451516628265, -0.22143054008483887, 0.23578405380249023, 0.09137234091758728, -0.14623838663101196, 0.17757117748260498, 0.6022219061851501, -0.10761509835720062, -0.19444222748279572, -0.2124875783920288, 0.4896883964538574, 0.019388481974601746, 0.16385668516159058, 0.14203448593616486, 0.2553554177284241, 0.044159963726997375, -0.39747974276542664, -0.3241954743862152, 0.7516404986381531, 0.25210872292518616, 0.1675327867269516, 0.41903766989707947, -0.21679618954658508, 0.513601541519165, 0.03956504166126251, 0.13375404477119446, -0.16568325459957123, -0.01184842549264431, -0.14659661054611206, -0.15782830119132996, 0.27220621705055237, 0.13526827096939087, -0.17105485498905182, 0.22457680106163025, 0.2983531951904297, 0.39125072956085205, 0.10756418108940125, 0.20141498744487762, -0.38621652126312256, 0.25368285179138184, -0.23885513842105865, 0.06799869984388351, -0.18733184039592743, 0.5775859355926514, -0.08338809013366699, -0.20768016576766968, -0.4657289981842041, -0.2698519229888916, -0.15162549912929535, 0.3154924511909485, -0.2425224781036377, -0.04883323609828949, 0.007234165444970131, -0.12906217575073242, -0.04669367894530296, 0.02979278936982155, -0.3367827534675598, -0.1034989133477211, -0.40737271308898926, 0.20246504247188568, -0.18520744144916534, -0.08499787747859955, 0.025401033461093903, -0.031520549207925797, 0.3319633901119232, -0.1835782825946808, -0.21633115410804749, -0.0419875867664814, -0.021266259253025055, -0.16282810270786285, 0.15978530049324036, -0.03105738013982773, -0.16758482158184052, -0.2350907325744629, -0.36520838737487793, 0.013598710298538208, 0.05191703140735626, -0.10677217692136765, 0.05953700840473175, 0.0769171342253685, -0.06543353199958801, -0.04417731240391731, -0.07834887504577637, -0.14489738643169403, -0.09175010025501251, 0.5684577822685242, -0.28623732924461365, 0.11564960330724716, 0.2937338054180145, 0.1349806785583496, -0.23924405872821808, -0.08631110936403275, 0.28143274784088135, -0.19617398083209991, -0.08507747948169708, 0.15020811557769775, -0.04768386855721474, 0.28309035301208496, -0.19550791382789612, 0.29870134592056274, 0.10949043929576874, -0.23259125649929047, 0.22976472973823547, -0.4569242596626282, -0.08866629004478455, 0.10540667176246643, -0.013072717934846878, 0.07236352562904358, 0.012110285460948944, 0.14971823990345, 0.35188794136047363, -0.5547195672988892, -0.21226145327091217, 0.1571764200925827, -0.06433625519275665, -0.08317947387695312, 0.18691760301589966, 0.37253573536872864, 0.43075981736183167, -0.007866676896810532, 0.0006938241422176361, 0.008610647171735764, -0.14663386344909668, -0.13510578870773315, -0.06951633840799332, 0.19248484075069427, 0.33258306980133057, -0.1473902463912964, 0.12020661681890488, -0.32998156547546387, 0.030827291309833527, 0.06142155081033707, 0.13525663316249847, 0.1631431132555008, -0.115461066365242, 0.011378243565559387, 0.00006748829036951065, -0.07921053469181061, -0.2120106816291809, 0.18079441785812378, -0.13551674783229828, 0.49211809039115906, 0.10595902055501938, 0.18393729627132416, 0.13666048645973206, 0.12251680344343185, -0.1814713180065155, -0.19559143483638763, -0.10523965209722519, 0.10128936916589737, 0.49616777896881104, -0.3507457971572876, -0.14998696744441986, -0.07038794457912445, 0.22864624857902527, 0.625700056552887, -0.2661622166633606, -0.009901408106088638, 0.19276635348796844, 0.12957653403282166, -0.38391345739364624, 0.18070824444293976, 0.394206166267395, -0.01309473067522049, 0.10875910520553589, 0.15686708688735962, -0.3388194441795349, -0.017804592847824097, -0.15130583941936493, 0.30106234550476074, 0.5190191268920898, 0.21832987666130066, 0.062092237174510956, 0.4117930233478546, -0.20758706331253052, 0.23098082840442657, 0.3315342366695404, 0.042432911694049835, 0.20531538128852844, 0.4234302043914795, -0.23652416467666626, 0.08662230521440506, -0.17620648443698883, 0.30810147523880005, 0.1216755360364914, -0.28059813380241394, 0.0020639137364923954, 0.16501370072364807, 0.009706709533929825, 0.025659803301095963, 0.04403380677103996, -0.028081044554710388, -0.20243123173713684, 0.4294690489768982, -0.29070693254470825, 0.3470713794231415, -0.045131150633096695, 0.12398246675729752, -0.3217116594314575, -0.4413330554962158, -0.1026463434100151, 0.06056469678878784, 0.009692381136119366, -0.12376430630683899, 0.20396453142166138, 0.23864863812923431, -0.18037499487400055, -0.23353606462478638, 0.2348584085702896, -0.25720587372779846, 0.07313206791877747, -0.3822055459022522, 0.15215416252613068, 0.26899537444114685, -0.04606395587325096, 0.12763485312461853, 0.40279901027679443, 0.4857690632343292, 0.35140711069107056, 0.03914688900113106, -0.27187633514404297, -0.09741918742656708, -0.16525323688983917, -0.19531866908073425, 0.342504620552063, -0.10149604827165604, 0.04683907330036163, 0.3962002992630005, 0.112139493227005, -0.12935598194599152, 0.29454588890075684, -0.22319379448890686, -0.12041285634040833, -0.20332829654216766, 0.44539281725883484, -0.4962369203567505, 0.13295356929302216, -0.09789150953292847, -0.12942342460155487, -0.3205019235610962, 0.012256961315870285, 0.08325028419494629, 0.006618484854698181, 0.1644681692123413, -0.050490427762269974, 0.04787760227918625, -0.05667818337678909, 0.11116236448287964, 0.530142605304718, -0.005716145038604736, -0.19208768010139465, 0.028664633631706238, -0.637361466884613, 0.26520881056785583, -0.2013455480337143, -0.20212602615356445, -0.13717150688171387, 0.22891080379486084, -0.23938873410224915, 0.0927012711763382, -0.016514360904693604, -0.03063119202852249, 0.13680684566497803, 0.23532891273498535, -0.1705704927444458, -0.24721501767635345, 0.1443340927362442, -0.004424961283802986, 0.03235200047492981, -0.4163822531700134, 0.25376924872398376, -0.4628157913684845, -0.08317112922668457, -0.09976799786090851, -0.11378162354230881, 0.1297498494386673, -0.348460853099823, 0.4195500612258911, 0.10942061245441437, 0.4539036750793457, -0.14194002747535706, -0.22124125063419342, -0.13290539383888245, -0.027548717334866524, -0.16210967302322388, 0.16112348437309265, -0.13696011900901794, 0.27959051728248596, -0.054777756333351135, 0.21611574292182922, -0.4867675006389618, 0.23958012461662292, -0.1740921437740326, 0.13561758399009705, -0.09182746708393097, -0.07493860274553299, -0.530912458896637, 0.07125724852085114, -0.07937866449356079, -0.13358080387115479, -0.19366928935050964, 0.0866532251238823, -0.42079636454582214, -0.33709579706192017, 0.5411854386329651, -0.3231888711452484, -0.173937126994133, 0.004581067711114883, 0.023171905428171158, -0.026155803352594376, -0.09181317687034607, -0.3987163305282593, 0.20182152092456818, 0.43763768672943115, 0.15278811752796173, -0.14609894156455994, 0.014663681387901306, -0.04151395335793495, -0.08516405522823334, 0.15334445238113403, 0.12289375066757202, 0.0904349759221077, -0.1987885981798172, 0.08398279547691345, -0.10987496376037598 ]
https://github.com/huggingface/datasets/issues/5820
Thanks for reporting! You are more than welcome to improve `BuilderConfig`'s docstring. This class serves an identical purpose as `tensorflow_datasets`'s `BuilderConfig`, and its docstring is [here](https://github.com/tensorflow/datasets/blob/a95e38b5bb018312c3d3720619c2a8ef83ebf57f/tensorflow_datasets/core/dataset_builder.py#L81), so feel free to re-use parts of it.
Incomplete docstring for `BuilderConfig`
Hi guys ! I stumbled upon this docstring while working on a project. Some of the attributes have missing descriptions. https://github.com/huggingface/datasets/blob/bc5fef5b6d91f009e4101684adcb374df2c170f6/src/datasets/builder.py#L104-L117
34
Incomplete docstring for `BuilderConfig` Hi guys ! I stumbled upon this docstring while working on a project. Some of the attributes have missing descriptions. https://github.com/huggingface/datasets/blob/bc5fef5b6d91f009e4101684adcb374df2c170f6/src/datasets/builder.py#L104-L117 Thanks for reporting! You are more than welcome to improve `BuilderConfig`'s docstring. This class serves an identical purpose as `tensorflow_datasets`'s `BuilderConfig`, and its docstring is [here](https://github.com/tensorflow/datasets/blob/a95e38b5bb018312c3d3720619c2a8ef83ebf57f/tensorflow_datasets/core/dataset_builder.py#L81), so feel free to re-use parts of it.
[ -0.3216456174850464, 0.14040017127990723, -0.1410626471042633, 0.21151545643806458, 0.30552026629447937, 0.19221021234989166, 0.10483421385288239, 0.2315959334373474, -0.21633338928222656, 0.1964913010597229, 0.35195815563201904, -0.13295713067054749, 0.06480507552623749, 0.04408065229654312, 0.1395869255065918, -0.08797704428434372, -0.16206206381320953, 0.21534760296344757, 0.23336772620677948, -0.06582661718130112, 0.009667523205280304, 0.20806588232517242, -0.0671587809920311, 0.02126501128077507, -0.30936843156814575, 0.039286039769649506, 0.1322350800037384, -0.23472487926483154, -0.31667813658714294, -0.2679283320903778, 0.3083783984184265, 0.19725513458251953, -0.2729898989200592, 0.07006389647722244, -0.00010447595559526235, 0.2047349065542221, 0.3304904103279114, -0.021604154258966446, -0.3398969769477844, -0.12053777277469635, -0.2890198826789856, -0.23086363077163696, -0.09093886613845825, -0.19879189133644104, -0.22830119729042053, 0.010939352214336395, 0.06608294695615768, 0.2050858736038208, 0.04497988522052765, 0.3649784326553345, 0.2991707921028137, 0.12972043454647064, 0.2360340803861618, -0.10185856372117996, 0.00860217772424221, 0.09405722469091415, -0.09188786894083023, -0.13507361710071564, 0.2881802022457123, 0.17792683839797974, -0.0737294852733612, 0.25762924551963806, -0.055822089314460754, -0.09161810576915741, 0.38043105602264404, -0.09390610456466675, 0.19820183515548706, -0.19762413203716278, 0.2433665543794632, 0.3420219123363495, 0.6649776697158813, -0.2436191886663437, -0.20584672689437866, -0.33524543046951294, 0.18463483452796936, -0.257577508687973, 0.2532654106616974, 0.22188954055309296, -0.2638843059539795, 0.032683033496141434, -0.4042944610118866, -0.27514132857322693, -0.21503722667694092, 0.032811932265758514, -0.21725274622440338, -0.0022107698023319244, -0.18969660997390747, -0.05307284742593765, -0.28717589378356934, -0.1410602331161499, 0.208465576171875, -0.3858354091644287, -0.09995174407958984, 0.07203930616378784, -0.0615740530192852, -0.1126304417848587, 0.01836208626627922, -0.16690464317798615, 0.11217034608125687, -0.09027503430843353, -0.2035437375307083, -0.0006863949820399284, -0.06479494273662567, 0.19635576009750366, -0.13134454190731049, 0.06745520979166031, 0.43799400329589844, 0.22818167507648468, -0.2111411988735199, 0.0446673259139061, -0.10148973762989044, -0.06894300878047943, -0.03621974587440491, -0.3045964241027832, -0.17957186698913574, -0.07077774405479431, -0.005085349082946777, 0.06649219989776611, -0.34599465131759644, 0.3312984108924866, 0.14398320019245148, -0.09923380613327026, 0.25979480147361755, 0.1892947405576706, -0.28876450657844543, -0.15152959525585175, 0.09842564165592194, -0.046201832592487335, -0.11949528753757477, -0.24035027623176575, -0.2788066565990448, 0.01438908651471138, -0.1032923236489296, 0.009568853303790092, -0.007427632808685303, -0.16626423597335815, 0.34084850549697876, -0.0446435771882534, 0.1752188503742218, -0.20771579444408417, -0.013016287237405777, 0.17885571718215942, 0.11899185180664062, 0.3291495144367218, -0.24210882186889648, -0.04260650649666786, -0.0537094920873642, -0.35953715443611145, -0.1437089741230011, 0.005493572913110256, -0.47135302424430847, -0.5030634999275208, -0.4037717878818512, 0.31282326579093933, -0.17492735385894775, -0.057407550513744354, 0.22586765885353088, 0.2657005190849304, 0.25418347120285034, -0.006514988839626312, 0.05062872916460037, -0.01356062013655901, -0.17153644561767578, -0.175781711935997, 0.3817662298679352, 0.007758326828479767, -0.07301697880029678, -0.2876704931259155, 0.2249983698129654, 0.04624683037400246, -0.03673919662833214, -0.03816737234592438, -0.2660595774650574, 0.4832462668418884, 0.012018665671348572, 0.027984917163848877, 0.5805336236953735, -0.2015686333179474, -0.1942305862903595, 0.033268533647060394, 0.22958657145500183, -0.04920823127031326, -0.18008184432983398, -0.21292437613010406, 0.25396811962127686, 0.035474639385938644, 0.1107146143913269, 0.07652629911899567, -0.0014837263152003288, -0.13284176588058472, -0.04253656044602394, -0.3251722753047943, -0.05855743587017059, 0.05182540416717529, 0.13906431198120117, 0.04710942506790161, -0.24047745764255524, 0.036745257675647736, 0.30135250091552734, -0.08808582276105881, 0.07413284480571747, 0.3441169261932373, -0.029247824102640152, 0.2843436300754547, -0.11235632002353668, -0.17868947982788086, -0.5316595435142517, 0.234514981508255, 0.25911423563957214, 0.0919342115521431, 0.2042265683412552, -0.08494340628385544, 0.12369615584611893, 0.038466982543468475, -0.14887824654579163, -0.2241101861000061, 0.2709863483905792, -0.08831244707107544, -0.12075907737016678, -0.17234210669994354, -0.26202037930488586, -0.16009289026260376, -0.581406831741333, 0.18907661736011505, -0.24132804572582245, 0.06383912265300751, -0.06405436247587204, 0.04901168495416641, 0.08928688615560532, 0.16676728427410126, -0.04163539409637451, 0.11938121169805527, -0.08342067152261734, 0.12078529596328735, -0.23314398527145386, 0.12186738848686218, -0.11758121848106384, 0.4514431357383728, 0.12285361438989639, -0.061461128294467926, 0.02831329219043255, -0.246725931763649, -0.15464456379413605, -0.12684307992458344, -0.17925015091896057, 0.12075305730104446, 0.3166482448577881, 0.23290809988975525, 0.20627667009830475, 0.10086221247911453, 0.1296754628419876, 0.059279218316078186, -0.14653250575065613, -0.07755038142204285, 0.12748309969902039, -0.08514633774757385, 0.1135280579328537, 0.13154731690883636, -0.32735878229141235, 0.18727779388427734, 0.4784708619117737, -0.19273217022418976, -0.2312909960746765, 0.1711825132369995, 0.06381487846374512, 0.18338680267333984, -0.07847993820905685, 0.18656159937381744, -0.09062914550304413, 0.13517677783966064, 0.005707448348402977, 0.07424952834844589, -0.19665712118148804, -0.18826168775558472, 0.45125970244407654, 0.13425762951374054, 0.12673607468605042, 0.21288184821605682, -0.21930336952209473, 0.1223648190498352, -0.16282856464385986, -0.20604625344276428, 0.0733584314584732, 0.16961684823036194, -0.3835849463939667, -0.13036394119262695, -0.25937527418136597, -0.012484349310398102, -0.13643452525138855, -0.3126702308654785, -0.4096350073814392, -0.3181803226470947, -0.14118415117263794, -0.15637890994548798, -0.13222873210906982, 0.2609671652317047, -0.13362455368041992, 0.18505334854125977, 0.031005285680294037, -0.21662718057632446, -0.023611217737197876, 0.08695515245199203, -0.012325581163167953, 0.1580558717250824, 0.11167930066585541, -0.28779280185699463, 0.17252251505851746, -0.3106387257575989, -0.12384327501058578, -0.2265167087316513, -0.2822446823120117, 0.43724632263183594, -0.08749336749315262, 0.18233558535575867, 0.33550578355789185, 0.18408800661563873, 0.09993818402290344, -0.3453063368797302, 0.33183345198631287, 0.2598332166671753, -0.034943778067827225, -0.10578060150146484, -0.057236187160015106, -0.4590623676776886, -0.09207946062088013, -0.19242285192012787, 0.013062110170722008, -0.266980916261673, 0.02914445474743843, 0.1250455677509308, 0.26008811593055725, 0.7082147598266602, 0.20702704787254333, 0.10345274209976196, -0.1873084455728531, 0.436830997467041, -0.1529269963502884, -0.9008620381355286, 0.11944831162691116, -0.24674564599990845, -0.23914456367492676, -0.06405195593833923, 0.12598463892936707, 0.3663971722126007, -0.09876037389039993, -0.4675871729850769, 0.1305142194032669, -0.1699119657278061, 0.2228981852531433, 0.06512530148029327, -0.030924025923013687, 0.020747587084770203, 0.015750102698802948, -0.04993399232625961, -0.22456039488315582, -0.2096708118915558, 0.14116844534873962, 0.012788603082299232, 0.3032563626766205, -0.03822992742061615, -0.011519641615450382, -0.10766959190368652, 0.7411947846412659, 0.3237293064594269, -0.40019696950912476, -0.24991059303283691, -0.23554357886314392, 0.3189449906349182, -0.12332138419151306, -0.22815898060798645, 0.4361880421638489, 0.03921285271644592, -0.004740752279758453, 0.2532218396663666, -0.03165001422166824, 0.4124029278755188, 0.02865438163280487, 0.14761829376220703, -0.16086788475513458, -0.40370339155197144, 0.16227194666862488, -0.046128228306770325, 0.11251676827669144, -0.04766099154949188, 0.17038732767105103, -0.21148046851158142, 0.01654592528939247, 0.15565019845962524, 0.5041778087615967, 0.019330475479364395, 0.047717396169900894, -0.07138348370790482, -0.2549079954624176, -0.38988178968429565, -0.05215192586183548, -0.03689492121338844, -0.031542956829071045, -0.10268451273441315, 0.25352245569229126, -0.08614005148410797, 0.1507720649242401, 0.3405165672302246, -0.31941741704940796, -0.1518840193748474, 0.1649375557899475, -0.004431493580341339, -0.07788750529289246, -0.17241013050079346, 0.1097659170627594, 0.2681502103805542, 0.1297186315059662, 0.17063936591148376, -0.07309185713529587, -0.31579309701919556, 0.35556772351264954, -0.12805591523647308, -0.19873426854610443, -0.17806991934776306, -0.01868756115436554, -0.15947479009628296, -0.0564153753221035, -0.3471960127353668, 0.0683538094162941, 0.21520210802555084, 0.11044594645500183, -0.08238725364208221, 0.13715526461601257, 0.28507715463638306, 0.24905356764793396, -0.03940335661172867, 0.1311490386724472, 0.09994210302829742, 0.09142327308654785, 0.026090387254953384, 0.2671900987625122, 0.351755291223526, 0.34063902497291565, -0.04439341649413109, -0.23908711969852448, -0.010851811617612839, -0.10469565540552139, 0.29188454151153564, 0.25324851274490356, -0.05619337409734726, -0.023158226162195206, 0.1059010773897171, 0.2261921763420105, -0.2910294532775879, 0.16441258788108826, 0.4254644513130188, 0.3514809310436249, -0.21854713559150696, -0.4906044006347656, 0.5394353866577148, -0.10017368197441101, -0.06534133106470108, 0.441112756729126, 0.23259691894054413, -0.342093288898468, -0.022894904017448425, 0.4319372773170471, 0.7983441948890686, 0.3304344415664673, -0.044735386967659, 0.023593217134475708, -0.11602757126092911, 0.31283265352249146, -0.47098231315612793, 0.16953329741954803, -0.26186293363571167, -0.20765173435211182, -0.04372045025229454, -0.07089443504810333, 0.12267912179231644, 0.09692725539207458, -0.11729452759027481, 0.03280080109834671, -0.07542086392641068, 0.4087264835834503, 0.11123452335596085, 0.19077779352664948, -0.13504450023174286, -0.24846576154232025, 0.14400793612003326, 0.21686998009681702, 0.07568296790122986, 0.1887824386358261, -0.17086319625377655, -0.0107797272503376, 0.06809835135936737, 0.14046597480773926, -0.5747230648994446, -0.004448369145393372, -0.3178892433643341, -0.031091684475541115, 0.4507398307323456, 0.014421507716178894, 0.3614960014820099, 0.24167472124099731, 0.17818890511989594, 0.19113275408744812, -0.27490898966789246, 0.33647140860557556, -0.07998108863830566, 0.024745453149080276, -0.040671493858098984, -0.15351082384586334, 0.481158047914505, -0.20978808403015137, -0.09999045729637146, -0.013128913938999176, -0.1816534698009491, 0.11733945459127426, -0.12334746867418289, -0.3848276436328888, 0.15664613246917725, -0.4208678603172302, 0.03010760247707367, 0.11968940496444702, 0.07502004504203796, -0.15984122455120087, 0.23011672496795654, 0.06117108464241028, -0.2911783754825592, 0.00028476305305957794, 0.0179896242916584, -0.11953693628311157, 0.08389875292778015, -0.1359606236219406, 0.2283875048160553, -0.032844699919223785, 0.48724430799484253, -0.027766689658164978, -0.18266010284423828, -0.3184112310409546, 0.03174307942390442, 0.30963629484176636, 0.06130525469779968, -0.07631835341453552, -0.15846097469329834, -0.1344379186630249, -0.08782491087913513, 0.2836858034133911, 0.15355336666107178, 0.19227203726768494, -0.014363475143909454, -0.2957938015460968, -0.30169108510017395, -0.026724644005298615, -0.07747664302587509, 0.3585514724254608, -0.4117533564567566, 0.24848783016204834, 0.3142368495464325, -0.0319807305932045, -0.44641631841659546, -0.1954878270626068, -0.18315982818603516, 0.13638393580913544, -0.08041679859161377, 0.13389021158218384, 0.10657137632369995, -0.16315266489982605, 0.13389888405799866, -0.29743948578834534, -0.27535250782966614, -0.2373453974723816, -0.2621980905532837, 0.11846837401390076, 0.08560889959335327, 0.11880553513765335, 0.3138023018836975, 0.2390936315059662, -0.2172708809375763, -0.18120472133159637, 0.09389536082744598, -0.053873658180236816, 0.19533208012580872, 0.4700669050216675, -0.24273936450481415, 0.10712067782878876, -0.010780289769172668, -0.12019878625869751, 0.19418083131313324, 0.6728124618530273, 0.018892619758844376, 0.17440809309482574, -0.11248030513525009, 0.03039593994617462, 0.2346874624490738, 0.4175189435482025, -0.35741493105888367, 0.04744339734315872, 0.2981560230255127, -0.18589037656784058, 0.23743660748004913, 0.1809285283088684, 0.22776031494140625, 0.19145607948303223, -0.3474777638912201, 0.16155999898910522, -0.017855055630207062, 0.3745427429676056, -0.16991370916366577, 0.033800650388002396, 0.24685990810394287, 0.01695023849606514, 0.1717047393321991, 0.026097498834133148, 0.050083138048648834, -0.2535606026649475, -0.12010189890861511, 0.043913498520851135, 0.33197423815727234, -0.3035978078842163, 0.2392510175704956, 0.2708800137042999, 0.03900960832834244, 0.0870860368013382, 0.3192356526851654, 0.2181769162416458, 0.13811364769935608, 0.41394442319869995, 0.10495743155479431, 0.17683258652687073, 0.20305654406547546, -0.029201921075582504, 0.216020405292511, -0.060334213078022, 0.4906776547431946, 0.262605220079422, -0.1879371702671051, 0.12747380137443542, -0.16755136847496033, -0.021397870033979416, -0.021440045908093452, -0.17264050245285034, -0.11198818683624268, 0.23396947979927063, -0.3066646456718445, -0.15779255330562592, -0.5342370867729187, -0.05581040680408478, 0.15890124440193176, -0.1724589616060257, 0.2689719498157501, -0.3547508418560028, -0.0417090579867363, -0.13142727315425873, -0.13778023421764374, -0.014944195747375488, 0.21343688666820526, 0.000597804319113493, 0.05146152153611183, -0.23997612297534943, 0.33116987347602844, 0.13018004596233368, -0.23422449827194214, -0.0034246924333274364, 0.4929417669773102, 0.5891085863113403, 0.06993788480758667, 0.18471087515354156, 0.04587516188621521, -0.019127484411001205, -0.0460597462952137, -0.060129038989543915, 0.1831352710723877, 0.06940340250730515, -0.1623993217945099, 0.3621884286403656, 0.2517049014568329, -0.19168707728385925, -0.18972846865653992, 0.1538582742214203, 0.08951552212238312, -0.24968019127845764, -0.12475751340389252, 0.19779783487319946, -0.29784274101257324, -0.18891192972660065, 0.07095345109701157, -0.17799517512321472, -0.2844808101654053, 0.7243941426277161, 0.014823980629444122, 0.24760492146015167, 0.07589885592460632, 0.1443226933479309, -0.002395983785390854, 0.5789368152618408, 0.2175997942686081, -0.03324442356824875, -0.06887252628803253, -0.17269974946975708, -0.10034129023551941, 0.003536764532327652, 0.08337807655334473, -0.03085438534617424, 0.19656315445899963, 0.25081300735473633, 0.07402694970369339, -0.14857015013694763, 0.13827933371067047, -0.06540557742118835, 0.10692524164915085, -0.15868185460567474, -0.3365139365196228, -0.1748943030834198, 0.10689035058021545, 0.08762244135141373, 0.1524098813533783, 0.050983041524887085, 0.19871504604816437, -0.2887910008430481, 0.06870097666978836, -0.1401158720254898, 0.3646603524684906, 0.4619540870189667, -0.01176406443119049, 0.14767733216285706, 0.10137846320867538, 0.15532246232032776, -0.25934815406799316, -0.2858322262763977, -0.10767705738544464, -0.04940677434206009, -0.2854793965816498, 0.4259524643421173, -0.12548020482063293, 0.04163859784603119, -0.07492165267467499, -0.12218184769153595, -0.32230350375175476, -0.070584736764431, 0.2066863477230072, -0.2952931821346283, -0.44444605708122253, 0.13825711607933044, -0.21287855505943298, 0.24429771304130554, 0.30169549584388733, 0.2218664586544037, -0.06531377881765366, 0.137308731675148, -0.2742435932159424, -0.41983762383461, 0.6271025538444519, -0.25345540046691895, -0.19721296429634094, -0.18491801619529724, 0.1389031708240509, 0.21166791021823883, 0.3609517216682434, -0.8253944516181946, -0.09529639780521393, 0.39906275272369385, -0.3617649972438812, -0.31151747703552246, 0.04405917972326279, 0.10723958909511566, 0.22756263613700867, -0.06907860934734344, 0.3110285997390747, 0.022870659828186035, -0.4463954269886017, -0.18781165778636932, -0.2548947334289551 ]
https://github.com/huggingface/datasets/issues/5819
Hi! It should work if you put `model = torch.compile(model)` inside the `generate_data` function. If a referenced object is outside, it needs to be pickable, and that's not the case for the compiled models (or functions).
Cannot pickle error in Dataset.from_generator()
### Describe the bug I'm trying to use Dataset.from_generator() to generate a large dataset. ### Steps to reproduce the bug Code to reproduce: ``` from transformers import T5Tokenizer, T5ForConditionalGeneration, GenerationConfig import torch from tqdm import tqdm from datasets import load_dataset tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small") model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto") model = torch.compile(model) def generate_data(data_loader): model.eval() for batch in tqdm(data_loader): input_ids = tokenizer(batch['instruction'], return_tensors='pt', padding=True, truncation=True).input_ids.to("cuda:0") with torch.no_grad(): outputs = model.generate(input_ids, generation_config=generation_config) decoder_hidden_states = outputs.decoder_hidden_states for i, h in zip(batch['instruction'], decoder_hidden_states): yield {"instruction": i, "decoder_hidden_states": h} generation_config = GenerationConfig( temperature=1, max_new_tokens=1024, do_sample=False, num_return_sequences=1, return_dict_in_generate=True, output_scores=True, output_hidden_states=True, ) from datasets import Dataset, load_dataset from torch.utils.data import DataLoader dataset = load_dataset("HuggingFaceH4/databricks_dolly_15k") train_loader = DataLoader(dataset['train'], batch_size=2, shuffle=True) dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) dataset.save_to_disk("data/flant5_small_generation") ``` ### Expected behavior The dataset should be generated and saved. But the following error occurred: ``` Traceback (most recent call last): File "/remote-home/xhwang/alpaca-lora/data_collection_t5.py", line 46, in <module> dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1035, in from_generator return GeneratorDatasetInputStream( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/io/generator.py", line 28, in __init__ self.builder = Generator( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 336, in __init__ self.config, self.config_id = self._create_builder_config( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 505, in _create_builder_config config_id = builder_config.create_config_id( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 179, in create_config_id suffix = Hasher.hash(config_kwargs_to_add_to_suffix) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 236, in hash return cls.hash_default(value) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 229, in hash_default return cls.hash_bytes(dumps(value)) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 726, in dumps dump(obj, file) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 701, in dump Pickler(file, recurse=True).dump(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 394, in dump StockPickler.dump(self, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 487, in dump self.save(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 1003, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 578, in save rv = reduce(self.proto) TypeError: cannot pickle 'ConfigModuleInstance' object ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-4.15.0-156-generic-x86_64-with-glibc2.31 - Python version: 3.10.10 - Huggingface_hub version: 0.13.2 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
36
Cannot pickle error in Dataset.from_generator() ### Describe the bug I'm trying to use Dataset.from_generator() to generate a large dataset. ### Steps to reproduce the bug Code to reproduce: ``` from transformers import T5Tokenizer, T5ForConditionalGeneration, GenerationConfig import torch from tqdm import tqdm from datasets import load_dataset tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small") model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto") model = torch.compile(model) def generate_data(data_loader): model.eval() for batch in tqdm(data_loader): input_ids = tokenizer(batch['instruction'], return_tensors='pt', padding=True, truncation=True).input_ids.to("cuda:0") with torch.no_grad(): outputs = model.generate(input_ids, generation_config=generation_config) decoder_hidden_states = outputs.decoder_hidden_states for i, h in zip(batch['instruction'], decoder_hidden_states): yield {"instruction": i, "decoder_hidden_states": h} generation_config = GenerationConfig( temperature=1, max_new_tokens=1024, do_sample=False, num_return_sequences=1, return_dict_in_generate=True, output_scores=True, output_hidden_states=True, ) from datasets import Dataset, load_dataset from torch.utils.data import DataLoader dataset = load_dataset("HuggingFaceH4/databricks_dolly_15k") train_loader = DataLoader(dataset['train'], batch_size=2, shuffle=True) dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) dataset.save_to_disk("data/flant5_small_generation") ``` ### Expected behavior The dataset should be generated and saved. But the following error occurred: ``` Traceback (most recent call last): File "/remote-home/xhwang/alpaca-lora/data_collection_t5.py", line 46, in <module> dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1035, in from_generator return GeneratorDatasetInputStream( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/io/generator.py", line 28, in __init__ self.builder = Generator( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 336, in __init__ self.config, self.config_id = self._create_builder_config( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 505, in _create_builder_config config_id = builder_config.create_config_id( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 179, in create_config_id suffix = Hasher.hash(config_kwargs_to_add_to_suffix) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 236, in hash return cls.hash_default(value) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 229, in hash_default return cls.hash_bytes(dumps(value)) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 726, in dumps dump(obj, file) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 701, in dump Pickler(file, recurse=True).dump(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 394, in dump StockPickler.dump(self, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 487, in dump self.save(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 1003, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 578, in save rv = reduce(self.proto) TypeError: cannot pickle 'ConfigModuleInstance' object ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-4.15.0-156-generic-x86_64-with-glibc2.31 - Python version: 3.10.10 - Huggingface_hub version: 0.13.2 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Hi! It should work if you put `model = torch.compile(model)` inside the `generate_data` function. If a referenced object is outside, it needs to be pickable, and that's not the case for the compiled models (or functions).
[ -0.4289095103740692, -0.2743408679962158, 0.027513988316059113, 0.5192881226539612, 0.38269156217575073, -0.06168058514595032, 0.21634811162948608, 0.3536655604839325, -0.17799019813537598, 0.40683653950691223, 0.15663272142410278, 0.33345890045166016, -0.24602733552455902, 0.10912777483463287, -0.03873465210199356, -0.25536975264549255, -0.20776693522930145, -0.055486150085926056, -0.31222355365753174, -0.08501505851745605, -0.24156613647937775, 0.04233376681804657, -0.11440864205360413, 0.16580097377300262, -0.5090382695198059, -0.22661826014518738, 0.4869147837162018, 0.18426795303821564, -0.011442447081208229, -0.1279115080833435, 0.028821729123592377, -0.41877269744873047, 0.10681155323982239, 0.5318841338157654, -0.00011268632079008967, 0.11627038568258286, 0.22699499130249023, -0.10786151885986328, -0.11016473919153214, -0.001866750419139862, 0.26172178983688354, 0.10617861151695251, -0.21352696418762207, -0.11738766729831696, -0.14911334216594696, 0.19276191294193268, -0.14127692580223083, -0.17808091640472412, 0.27086400985717773, 0.24858617782592773, 0.24601030349731445, 0.6163867712020874, 0.24044457077980042, -0.17584972083568573, 0.27914750576019287, -0.13894113898277283, -0.2242584228515625, -0.04374590888619423, 0.05225692689418793, 0.2263028919696808, -0.09476908296346664, 0.2511015236377716, -0.088619664311409, 0.0267716683447361, 0.11036261171102524, 0.11545461416244507, -0.13481153547763824, -0.27898579835891724, 0.30400973558425903, 0.3713478446006775, 0.5045239925384521, -0.1452721655368805, -0.27705156803131104, -0.06220522150397301, -0.06517548114061356, -0.25755688548088074, 0.2661498785018921, 0.12493713945150375, -0.4379156529903412, 0.08595843613147736, -0.05374310165643692, -0.1871565878391266, -0.18700799345970154, 0.04559379816055298, 0.1548294872045517, 0.09626583009958267, -0.01385684497654438, 0.2075788527727127, 0.2074429988861084, -0.03687300533056259, 0.28071919083595276, 0.0965878963470459, 0.06651563942432404, 0.04592433571815491, -0.31752368807792664, -0.11575673520565033, 0.08522707968950272, -0.33629974722862244, 0.22169598937034607, 0.041825078427791595, -0.026796557009220123, -0.0013296110555529594, -0.09256294369697571, 0.025603432208299637, 0.1375409960746765, -0.06938502937555313, -0.32281494140625, 0.4554487466812134, 0.21116352081298828, -0.21047577261924744, -0.16020283102989197, 0.06242742761969566, 0.0902135968208313, -0.605019748210907, 0.3258197605609894, 0.21258693933486938, 0.07943820208311081, -0.06765636801719666, -0.2878914475440979, -0.02714892104268074, -0.10324832797050476, 0.05987336114048958, -0.016905605792999268, 0.35940465331077576, -0.0009341910481452942, 0.03853301703929901, -0.1353738009929657, 0.0730205625295639, -0.3010627031326294, -0.5528325438499451, -0.3728208541870117, 0.059477441012859344, 0.05050733685493469, -0.0870477557182312, -0.031608521938323975, -0.16289472579956055, 0.20775514841079712, 0.0351148322224617, 0.016037408262491226, 0.2567110061645508, 0.14439640939235687, -0.24827897548675537, -0.01437913253903389, 0.3238641619682312, -0.060630764812231064, 0.07199807465076447, 0.3164842128753662, 0.029979117214679718, -0.08788952231407166, 0.4160788357257843, 0.01697748526930809, -0.5674176216125488, -0.010938478633761406, 0.1539268046617508, 0.12147350609302521, 0.1342383474111557, -0.3522987365722656, -0.06733135879039764, 0.517296314239502, 0.23238803446292877, 0.003415282815694809, -0.23124752938747406, -0.14416134357452393, -0.29824668169021606, 0.1567280888557434, 0.32843682169914246, -0.26048845052719116, 0.10314548015594482, -0.08323453366756439, -0.13653957843780518, 0.4569723308086395, 0.24503342807292938, -0.2893880009651184, 0.359340637922287, -0.17002663016319275, 0.07623624801635742, 0.5145901441574097, -0.23161883652210236, -0.5076031684875488, 0.13634993135929108, -0.23281294107437134, -0.1107221469283104, 0.19657450914382935, 0.06766583770513535, -0.34213125705718994, -0.021218055859208107, 0.2933952808380127, 0.444633424282074, -0.18924273550510406, 0.16633310914039612, -0.31541770696640015, -0.17191405594348907, 0.2768078148365021, 0.24418684840202332, 0.3785666227340698, -0.058044154196977615, -0.07778435200452805, -0.0076727792620658875, 0.17217805981636047, -0.16463850438594818, -0.07529394328594208, 0.1621023267507553, 0.36561834812164307, -0.2889357805252075, -0.1373870074748993, -0.18188318610191345, -0.5234273076057434, 0.30732908844947815, -0.1317465454339981, 0.012087700888514519, -0.2643178105354309, 0.09348398447036743, -0.09683206677436829, 0.16003364324569702, -0.30736154317855835, -0.09720586240291595, 0.048970211297273636, 0.1171395406126976, 0.05086742341518402, -0.27582550048828125, -0.16252070665359497, -0.05222800374031067, -0.1451457440853119, 0.08098310232162476, -0.34825557470321655, 0.21178388595581055, -0.1038345918059349, -0.444452166557312, -0.04002602770924568, -0.11347676813602448, 0.13680526614189148, -0.04975777864456177, -0.329041987657547, 0.2490571141242981, 0.136644646525383, -0.17377671599388123, -0.23465807735919952, -0.10501313209533691, 0.03002258576452732, -0.2904043197631836, -0.17652495205402374, 0.22448593378067017, 0.042041048407554626, 0.30239370465278625, 0.3683639168739319, 0.14416997134685516, -0.33165618777275085, -0.09066425263881683, -0.13205039501190186, 0.08594813942909241, 0.14429251849651337, 0.18042631447315216, 0.5389540195465088, -0.08483969420194626, -0.0245283842086792, 0.2476012110710144, 0.25926774740219116, -0.05365072935819626, -0.484381765127182, 0.19385868310928345, 0.4853058159351349, 0.18357232213020325, 0.025937790051102638, 0.12190885841846466, -0.05110777169466019, -0.004472285509109497, -0.242075577378273, 0.051635339856147766, 0.21999843418598175, 0.019112221896648407, -0.11739476770162582, -0.051836490631103516, 0.18097737431526184, -0.10380630195140839, 0.061565935611724854, 0.08137722313404083, -0.05715586990118027, 0.46603184938430786, -0.10595966875553131, 0.07003705203533173, -0.15734241902828217, -0.06752684712409973, 0.14166705310344696, 0.5315605401992798, -0.34212052822113037, -0.03683290630578995, -0.06586095690727234, 0.2785720229148865, -0.0666293054819107, 0.04019356891512871, -0.10446435213088989, -0.11050426959991455, 0.05904869735240936, 0.3130267560482025, -0.287361204624176, 0.22425055503845215, 0.09934455156326294, -0.1695021688938141, 0.46065598726272583, 0.0014370065182447433, 0.08178472518920898, -0.08348847180604935, -0.3272433876991272, 0.07720918953418732, 0.2395675927400589, -0.02130109630525112, 0.16128195822238922, 0.0519380196928978, 0.038063958287239075, -0.43485891819000244, 0.07113175094127655, 0.25610342621803284, -0.07010139524936676, 0.6371207237243652, 0.25089770555496216, 0.12871766090393066, -0.1977519392967224, -0.24193210899829865, 0.11942590773105621, -0.1393175572156906, -0.17695145308971405, 0.19615694880485535, -0.0021829120814800262, 0.15516451001167297, 0.07544990628957748, -0.3925921320915222, -0.22158829867839813, -0.42063215374946594, -0.04867259040474892, -0.08020082861185074, 0.2223520576953888, 0.4504740238189697, 0.17157763242721558, 0.1813281923532486, 0.3074840307235718, 0.10790342092514038, -0.09016728401184082, -0.27820390462875366, 0.2644084095954895, -0.22419589757919312, -0.38655194640159607, -0.180055171251297, -0.14852885901927948, -0.03744203597307205, 0.21681539714336395, -0.27806776762008667, 0.0678427442908287, -0.3424101173877716, 0.3773679733276367, -0.4818572402000427, 0.13861416280269623, 0.2114778459072113, 0.06775736808776855, -0.09014925360679626, -0.052194006741046906, 0.19021925330162048, 0.17629919946193695, -0.06984276324510574, 0.23597164452075958, 0.07630021125078201, 0.16952402889728546, -0.05175505205988884, 0.9170335531234741, 0.1341041922569275, -0.27146175503730774, 0.28111377358436584, -0.034640923142433167, -0.08966901898384094, -0.2049093246459961, -0.17197707295417786, -0.05671248212456703, 0.027667053043842316, -0.049777425825595856, -0.047539833933115005, -0.3915954530239105, 0.4666900932788849, 0.02126554399728775, 0.12406483292579651, -0.1285899579524994, -0.2925057113170624, 0.16831280291080475, -0.2501327097415924, 0.18004757165908813, -0.16932106018066406, 0.1841602623462677, -0.19049639999866486, 0.1593511998653412, 0.12429270893335342, -0.17516547441482544, 0.36856207251548767, -0.12295439839363098, -0.1381494402885437, -0.09653781354427338, -0.3384528160095215, 0.2522251307964325, 0.1979663372039795, 0.23531094193458557, -0.0044164881110191345, -0.2697405219078064, -0.010472279042005539, 0.039669573307037354, 0.6015465259552002, -0.278903603553772, 0.24331383407115936, 0.15644016861915588, -0.24604357779026031, -0.05612292140722275, 0.0820842832326889, -0.049274176359176636, -0.02161971852183342, -0.03735926002264023, 0.14561857283115387, -0.43014514446258545, -0.13928043842315674, 0.058063261210918427, 0.28955361247062683, -0.0971798300743103, -0.04529205337166786, -0.24528682231903076, -0.0919315367937088, -0.22197452187538147, 0.07672855257987976, 0.31435638666152954, 0.554934561252594, -0.0981706976890564, 0.09215982258319855, -0.14263185858726501, -0.22432337701320648, -0.19660863280296326, -0.03814797103404999, 0.3572355806827545, -0.26946157217025757, 0.28853294253349304, 0.03000717982649803, -0.04269227758049965, 0.10377442836761475, 0.354727178812027, -0.01350412331521511, -0.40077951550483704, 0.08357037603855133, 0.12000641226768494, 0.040783751755952835, 0.08125040680170059, -0.21210022270679474, 0.2635807693004608, -0.21989701688289642, 0.42320966720581055, 0.377330482006073, 0.31727272272109985, 0.10035378485918045, -0.1960521936416626, -0.1203748881816864, -0.3621068000793457, 0.43418169021606445, 0.009355328977108002, 0.2118791788816452, 0.42146918177604675, -0.0650608241558075, -0.01811964251101017, 0.125562384724617, 0.08777076750993729, 0.7533833980560303, -0.007713377475738525, -0.07243064045906067, 0.31275880336761475, 0.1503199189901352, 0.25527694821357727, -0.10408906638622284, 0.04599445313215256, -0.4524012804031372, -0.301063597202301, 0.06769032776355743, -0.21991516649723053, -0.11973993480205536, 0.13884030282497406, -0.027850240468978882, 0.14730070531368256, -0.44152703881263733, -0.034689731895923615, 0.020723659545183182, -0.05711212381720543, -0.030400395393371582, -0.18950164318084717, -0.022589098662137985, 0.021145634353160858, -0.21547314524650574, 0.27754852175712585, 0.01659775897860527, -0.1256549060344696, 0.04049214720726013, -0.3466585874557495, -0.3745882511138916, 0.07425149530172348, -0.29836931824684143, 0.39216405153274536, 0.6264641284942627, -0.5686425566673279, 0.1773451268672943, 0.2756769359111786, 0.40104976296424866, 0.07749176025390625, -0.1299222856760025, 0.3023642599582672, 0.048719581216573715, 0.025033388286828995, -0.08741119503974915, 0.1107797622680664, 0.5406555533409119, -0.10368567705154419, -0.24073302745819092, 0.3753882646560669, -0.20772016048431396, -0.33260560035705566, -0.03439272940158844, -0.2281729280948639, 0.05406596511602402, -0.08993514627218246, -0.09268822520971298, -0.1944958120584488, -0.08562251180410385, -0.33367103338241577, 0.08464591950178146, 0.1331895887851715, -0.24720852077007294, -0.08531495928764343, -0.06322766095399857, -0.21619802713394165, -0.00381120084784925, 0.31140780448913574, 0.05418751761317253, 0.1773303598165512, 0.4057587683200836, 0.21271049976348877, -0.11989027261734009, -0.22728680074214935, 0.1486479789018631, 0.23872500658035278, -0.609123170375824, 0.3487370014190674, -0.08620862662792206, 0.13970699906349182, 0.13128173351287842, 0.7958913445472717, -0.009307924658060074, -0.017429254949092865, -0.025445036590099335, -0.06987565755844116, -0.5290130972862244, 0.017869245260953903, -0.1662394106388092, 0.054439444094896317, -0.0758814737200737, 0.3952424228191376, -0.19206736981868744, 0.17320606112480164, -0.24205206334590912, -0.07917146384716034, -0.21306326985359192, 0.053108103573322296, 0.19698160886764526, -0.22116395831108093, -0.086529940366745, 0.21660034358501434, 0.0893002599477768, 0.23954620957374573, -0.2742626965045929, -0.24865379929542542, -0.2567448019981384, 0.14060787856578827, 0.14190013706684113, -0.18098117411136627, 0.008771736174821854, 0.12781928479671478, -0.16071973741054535, -0.008628051728010178, 0.49118390679359436, -0.05334571376442909, 0.001720299944281578, 0.21941491961479187, -0.006864195689558983, 0.07550488412380219, -0.31205978989601135, 0.05780450999736786, -0.10722411423921585, 0.0670255571603775, 0.15242330729961395, 0.07919009029865265, -0.06531666219234467, -0.21845188736915588, -0.49270033836364746, -0.302171528339386, 0.09518486261367798, 0.06630054861307144, 0.1609175205230713, -0.4755062758922577, -0.15024937689304352, -0.020392652601003647, -0.004927549511194229, 0.10730019211769104, -0.13333244621753693, -0.2790284752845764, 0.3299686312675476, 0.22534073889255524, -0.2908317446708679, -0.07721617817878723, -0.4034242033958435, -0.1046283096075058, 0.06782782077789307, 0.01866462454199791, -0.12369192391633987, 0.023451805114746094, -0.20639094710350037, 0.1595478057861328, 0.15374743938446045, -0.18109941482543945, 0.09492088854312897, 0.6302568316459656, -0.13568097352981567, 0.08472062647342682, 0.26438161730766296, 0.20977210998535156, 0.27410775423049927, 0.5025721788406372, -0.10580138862133026, 0.24994626641273499, -0.37345167994499207, -0.1387898027896881, -0.055199068039655685, -0.7152916193008423, 0.0479545071721077, 0.1629592925310135, -0.13379546999931335, -0.03744835779070854, -0.07362711429595947, 0.22523233294487, 0.006435796618461609, -0.07905564457178116, -0.152813121676445, 0.2543497085571289, -0.09436549991369247, -0.02645360492169857, 0.006972663104534149, -0.09272696077823639, -0.08125119656324387, 0.26399627327919006, 0.012998011894524097, 0.14793652296066284, 0.07620564103126526, 0.17932629585266113, -0.22106745839118958, -0.13778959214687347, 0.10732465237379074, 0.15399691462516785, -0.10011985898017883, -0.3238985538482666, -0.024080438539385796, 0.27589932084083557, -0.18239837884902954, -0.27789437770843506, -0.0012110471725463867, 0.23261268436908722, 0.25467437505722046, -0.4855782389640808, -0.09683870524168015, -0.09242255985736847, 0.016481459140777588, -0.022732574492692947, 0.013905763626098633, -0.07383561134338379, 0.06540475785732269, 0.4454158544540405, 0.0733921155333519, -0.18540894985198975, -0.033704742789268494, 0.11845605075359344, 0.5983359813690186, -0.1625663936138153, 0.08369095623493195, -0.015960313379764557, -0.1564878225326538, -0.18649506568908691, -0.07073609530925751, -0.18563392758369446, 0.19952857494354248, 0.21147963404655457, 0.10252727568149567, 0.06602903455495834, -0.04432610422372818, 0.08398936688899994, -0.10582271963357925, 0.5690257549285889, 0.18411125242710114, -0.0632798969745636, -0.40199583768844604, 0.030803099274635315, -0.31758150458335876, 0.41624560952186584, 0.002083737635985017, 0.004755236208438873, 0.0505414754152298, 0.06474366784095764, 0.05850730836391449, 0.19708222150802612, 0.03528375178575516, 0.20715081691741943, 0.1280057728290558, 0.6355893611907959, -0.17886319756507874, -0.32841047644615173, -0.22657740116119385, -0.03616976737976074, 0.06627628207206726, -0.637870728969574, 0.07221458852291107, 0.1719021201133728, 0.16357307136058807, -0.21562570333480835, -0.28507208824157715, 0.2865738272666931, 0.2525624930858612, 0.2715286314487457, 0.17859502136707306, 0.337524950504303, -0.07499849051237106, 0.028241947293281555, -0.07320881634950638, -0.18722744286060333, 0.041922662407159805, -0.03613710030913353, 0.11766208708286285, 0.5018724799156189, 0.23552268743515015, 0.38275855779647827, -0.6064099073410034, 0.4519108831882477, -0.15671026706695557, 0.12790369987487793, -0.16731932759284973, 0.030454561114311218, -0.015218213200569153, 0.010580245405435562, 0.21476447582244873, 0.06612825393676758, -0.0573388896882534, 0.09558093547821045, -0.4455846846103668, -0.4113101363182068, 0.5964670777320862, -0.2314387410879135, -0.49460509419441223, -0.17647232115268707, 0.17003336548805237, 0.2688485085964203, -0.11808983981609344, -0.26485416293144226, 0.2150261104106903, 0.27969348430633545, -0.07718970626592636, -0.09888249635696411, 0.11346648633480072, 0.3041185736656189, 0.015104740858078003, 0.0968286395072937, 0.7117975354194641, -0.12917158007621765, -0.009090133011341095, 0.10136065632104874, -0.14994555711746216 ]
https://github.com/huggingface/datasets/issues/5819
> Hi! It should work if you put `model = torch.compile(model)` inside the `generate_data` function. If a referenced object is outside, it needs to be pickable, and that's not the case for the compiled models (or functions). Hi! Thank you for your reply! Everything works perfectly with your suggestion! Closing the issue.
Cannot pickle error in Dataset.from_generator()
### Describe the bug I'm trying to use Dataset.from_generator() to generate a large dataset. ### Steps to reproduce the bug Code to reproduce: ``` from transformers import T5Tokenizer, T5ForConditionalGeneration, GenerationConfig import torch from tqdm import tqdm from datasets import load_dataset tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small") model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto") model = torch.compile(model) def generate_data(data_loader): model.eval() for batch in tqdm(data_loader): input_ids = tokenizer(batch['instruction'], return_tensors='pt', padding=True, truncation=True).input_ids.to("cuda:0") with torch.no_grad(): outputs = model.generate(input_ids, generation_config=generation_config) decoder_hidden_states = outputs.decoder_hidden_states for i, h in zip(batch['instruction'], decoder_hidden_states): yield {"instruction": i, "decoder_hidden_states": h} generation_config = GenerationConfig( temperature=1, max_new_tokens=1024, do_sample=False, num_return_sequences=1, return_dict_in_generate=True, output_scores=True, output_hidden_states=True, ) from datasets import Dataset, load_dataset from torch.utils.data import DataLoader dataset = load_dataset("HuggingFaceH4/databricks_dolly_15k") train_loader = DataLoader(dataset['train'], batch_size=2, shuffle=True) dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) dataset.save_to_disk("data/flant5_small_generation") ``` ### Expected behavior The dataset should be generated and saved. But the following error occurred: ``` Traceback (most recent call last): File "/remote-home/xhwang/alpaca-lora/data_collection_t5.py", line 46, in <module> dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1035, in from_generator return GeneratorDatasetInputStream( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/io/generator.py", line 28, in __init__ self.builder = Generator( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 336, in __init__ self.config, self.config_id = self._create_builder_config( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 505, in _create_builder_config config_id = builder_config.create_config_id( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 179, in create_config_id suffix = Hasher.hash(config_kwargs_to_add_to_suffix) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 236, in hash return cls.hash_default(value) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 229, in hash_default return cls.hash_bytes(dumps(value)) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 726, in dumps dump(obj, file) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 701, in dump Pickler(file, recurse=True).dump(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 394, in dump StockPickler.dump(self, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 487, in dump self.save(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 1003, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 578, in save rv = reduce(self.proto) TypeError: cannot pickle 'ConfigModuleInstance' object ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-4.15.0-156-generic-x86_64-with-glibc2.31 - Python version: 3.10.10 - Huggingface_hub version: 0.13.2 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
52
Cannot pickle error in Dataset.from_generator() ### Describe the bug I'm trying to use Dataset.from_generator() to generate a large dataset. ### Steps to reproduce the bug Code to reproduce: ``` from transformers import T5Tokenizer, T5ForConditionalGeneration, GenerationConfig import torch from tqdm import tqdm from datasets import load_dataset tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-small") model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-small", device_map="auto") model = torch.compile(model) def generate_data(data_loader): model.eval() for batch in tqdm(data_loader): input_ids = tokenizer(batch['instruction'], return_tensors='pt', padding=True, truncation=True).input_ids.to("cuda:0") with torch.no_grad(): outputs = model.generate(input_ids, generation_config=generation_config) decoder_hidden_states = outputs.decoder_hidden_states for i, h in zip(batch['instruction'], decoder_hidden_states): yield {"instruction": i, "decoder_hidden_states": h} generation_config = GenerationConfig( temperature=1, max_new_tokens=1024, do_sample=False, num_return_sequences=1, return_dict_in_generate=True, output_scores=True, output_hidden_states=True, ) from datasets import Dataset, load_dataset from torch.utils.data import DataLoader dataset = load_dataset("HuggingFaceH4/databricks_dolly_15k") train_loader = DataLoader(dataset['train'], batch_size=2, shuffle=True) dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) dataset.save_to_disk("data/flant5_small_generation") ``` ### Expected behavior The dataset should be generated and saved. But the following error occurred: ``` Traceback (most recent call last): File "/remote-home/xhwang/alpaca-lora/data_collection_t5.py", line 46, in <module> dataset = Dataset.from_generator(generator=generate_data, gen_kwargs={"data_loader": train_loader}) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1035, in from_generator return GeneratorDatasetInputStream( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/io/generator.py", line 28, in __init__ self.builder = Generator( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 336, in __init__ self.config, self.config_id = self._create_builder_config( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 505, in _create_builder_config config_id = builder_config.create_config_id( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/builder.py", line 179, in create_config_id suffix = Hasher.hash(config_kwargs_to_add_to_suffix) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 236, in hash return cls.hash_default(value) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/fingerprint.py", line 229, in hash_default return cls.hash_bytes(dumps(value)) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 726, in dumps dump(obj, file) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 701, in dump Pickler(file, recurse=True).dump(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 394, in dump StockPickler.dump(self, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 487, in dump self.save(obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 603, in save self.save_reduce(obj=obj, *rv) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1070, in _save_with_postproc pickler.save_reduce(*reduction, obj=obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 717, in save_reduce save(state) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 887, in save_tuple save(element) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1186, in save_module_dict StockPickler.save_dict(pickler, obj) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 972, in save_dict self._batch_setitems(obj.items()) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 1003, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 560, in save f(self, obj) # Call unbound method with explicit self File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1311, in save_function dill._dill._save_with_postproc( File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 1084, in _save_with_postproc pickler._batch_setitems(iter(source.items())) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 998, in _batch_setitems save(v) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 691, in save dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/site-packages/dill/_dill.py", line 388, in save StockPickler.save(self, obj, save_persistent_id) File "/remote-home/xhwang/anaconda3/envs/alpaca-lora/lib/python3.10/pickle.py", line 578, in save rv = reduce(self.proto) TypeError: cannot pickle 'ConfigModuleInstance' object ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-4.15.0-156-generic-x86_64-with-glibc2.31 - Python version: 3.10.10 - Huggingface_hub version: 0.13.2 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 > Hi! It should work if you put `model = torch.compile(model)` inside the `generate_data` function. If a referenced object is outside, it needs to be pickable, and that's not the case for the compiled models (or functions). Hi! Thank you for your reply! Everything works perfectly with your suggestion! Closing the issue.
[ -0.4289095103740692, -0.2743408679962158, 0.027513988316059113, 0.5192881226539612, 0.38269156217575073, -0.06168058514595032, 0.21634811162948608, 0.3536655604839325, -0.17799019813537598, 0.40683653950691223, 0.15663272142410278, 0.33345890045166016, -0.24602733552455902, 0.10912777483463287, -0.03873465210199356, -0.25536975264549255, -0.20776693522930145, -0.055486150085926056, -0.31222355365753174, -0.08501505851745605, -0.24156613647937775, 0.04233376681804657, -0.11440864205360413, 0.16580097377300262, -0.5090382695198059, -0.22661826014518738, 0.4869147837162018, 0.18426795303821564, -0.011442447081208229, -0.1279115080833435, 0.028821729123592377, -0.41877269744873047, 0.10681155323982239, 0.5318841338157654, -0.00011268632079008967, 0.11627038568258286, 0.22699499130249023, -0.10786151885986328, -0.11016473919153214, -0.001866750419139862, 0.26172178983688354, 0.10617861151695251, -0.21352696418762207, -0.11738766729831696, -0.14911334216594696, 0.19276191294193268, -0.14127692580223083, -0.17808091640472412, 0.27086400985717773, 0.24858617782592773, 0.24601030349731445, 0.6163867712020874, 0.24044457077980042, -0.17584972083568573, 0.27914750576019287, -0.13894113898277283, -0.2242584228515625, -0.04374590888619423, 0.05225692689418793, 0.2263028919696808, -0.09476908296346664, 0.2511015236377716, -0.088619664311409, 0.0267716683447361, 0.11036261171102524, 0.11545461416244507, -0.13481153547763824, -0.27898579835891724, 0.30400973558425903, 0.3713478446006775, 0.5045239925384521, -0.1452721655368805, -0.27705156803131104, -0.06220522150397301, -0.06517548114061356, -0.25755688548088074, 0.2661498785018921, 0.12493713945150375, -0.4379156529903412, 0.08595843613147736, -0.05374310165643692, -0.1871565878391266, -0.18700799345970154, 0.04559379816055298, 0.1548294872045517, 0.09626583009958267, -0.01385684497654438, 0.2075788527727127, 0.2074429988861084, -0.03687300533056259, 0.28071919083595276, 0.0965878963470459, 0.06651563942432404, 0.04592433571815491, -0.31752368807792664, -0.11575673520565033, 0.08522707968950272, -0.33629974722862244, 0.22169598937034607, 0.041825078427791595, -0.026796557009220123, -0.0013296110555529594, -0.09256294369697571, 0.025603432208299637, 0.1375409960746765, -0.06938502937555313, -0.32281494140625, 0.4554487466812134, 0.21116352081298828, -0.21047577261924744, -0.16020283102989197, 0.06242742761969566, 0.0902135968208313, -0.605019748210907, 0.3258197605609894, 0.21258693933486938, 0.07943820208311081, -0.06765636801719666, -0.2878914475440979, -0.02714892104268074, -0.10324832797050476, 0.05987336114048958, -0.016905605792999268, 0.35940465331077576, -0.0009341910481452942, 0.03853301703929901, -0.1353738009929657, 0.0730205625295639, -0.3010627031326294, -0.5528325438499451, -0.3728208541870117, 0.059477441012859344, 0.05050733685493469, -0.0870477557182312, -0.031608521938323975, -0.16289472579956055, 0.20775514841079712, 0.0351148322224617, 0.016037408262491226, 0.2567110061645508, 0.14439640939235687, -0.24827897548675537, -0.01437913253903389, 0.3238641619682312, -0.060630764812231064, 0.07199807465076447, 0.3164842128753662, 0.029979117214679718, -0.08788952231407166, 0.4160788357257843, 0.01697748526930809, -0.5674176216125488, -0.010938478633761406, 0.1539268046617508, 0.12147350609302521, 0.1342383474111557, -0.3522987365722656, -0.06733135879039764, 0.517296314239502, 0.23238803446292877, 0.003415282815694809, -0.23124752938747406, -0.14416134357452393, -0.29824668169021606, 0.1567280888557434, 0.32843682169914246, -0.26048845052719116, 0.10314548015594482, -0.08323453366756439, -0.13653957843780518, 0.4569723308086395, 0.24503342807292938, -0.2893880009651184, 0.359340637922287, -0.17002663016319275, 0.07623624801635742, 0.5145901441574097, -0.23161883652210236, -0.5076031684875488, 0.13634993135929108, -0.23281294107437134, -0.1107221469283104, 0.19657450914382935, 0.06766583770513535, -0.34213125705718994, -0.021218055859208107, 0.2933952808380127, 0.444633424282074, -0.18924273550510406, 0.16633310914039612, -0.31541770696640015, -0.17191405594348907, 0.2768078148365021, 0.24418684840202332, 0.3785666227340698, -0.058044154196977615, -0.07778435200452805, -0.0076727792620658875, 0.17217805981636047, -0.16463850438594818, -0.07529394328594208, 0.1621023267507553, 0.36561834812164307, -0.2889357805252075, -0.1373870074748993, -0.18188318610191345, -0.5234273076057434, 0.30732908844947815, -0.1317465454339981, 0.012087700888514519, -0.2643178105354309, 0.09348398447036743, -0.09683206677436829, 0.16003364324569702, -0.30736154317855835, -0.09720586240291595, 0.048970211297273636, 0.1171395406126976, 0.05086742341518402, -0.27582550048828125, -0.16252070665359497, -0.05222800374031067, -0.1451457440853119, 0.08098310232162476, -0.34825557470321655, 0.21178388595581055, -0.1038345918059349, -0.444452166557312, -0.04002602770924568, -0.11347676813602448, 0.13680526614189148, -0.04975777864456177, -0.329041987657547, 0.2490571141242981, 0.136644646525383, -0.17377671599388123, -0.23465807735919952, -0.10501313209533691, 0.03002258576452732, -0.2904043197631836, -0.17652495205402374, 0.22448593378067017, 0.042041048407554626, 0.30239370465278625, 0.3683639168739319, 0.14416997134685516, -0.33165618777275085, -0.09066425263881683, -0.13205039501190186, 0.08594813942909241, 0.14429251849651337, 0.18042631447315216, 0.5389540195465088, -0.08483969420194626, -0.0245283842086792, 0.2476012110710144, 0.25926774740219116, -0.05365072935819626, -0.484381765127182, 0.19385868310928345, 0.4853058159351349, 0.18357232213020325, 0.025937790051102638, 0.12190885841846466, -0.05110777169466019, -0.004472285509109497, -0.242075577378273, 0.051635339856147766, 0.21999843418598175, 0.019112221896648407, -0.11739476770162582, -0.051836490631103516, 0.18097737431526184, -0.10380630195140839, 0.061565935611724854, 0.08137722313404083, -0.05715586990118027, 0.46603184938430786, -0.10595966875553131, 0.07003705203533173, -0.15734241902828217, -0.06752684712409973, 0.14166705310344696, 0.5315605401992798, -0.34212052822113037, -0.03683290630578995, -0.06586095690727234, 0.2785720229148865, -0.0666293054819107, 0.04019356891512871, -0.10446435213088989, -0.11050426959991455, 0.05904869735240936, 0.3130267560482025, -0.287361204624176, 0.22425055503845215, 0.09934455156326294, -0.1695021688938141, 0.46065598726272583, 0.0014370065182447433, 0.08178472518920898, -0.08348847180604935, -0.3272433876991272, 0.07720918953418732, 0.2395675927400589, -0.02130109630525112, 0.16128195822238922, 0.0519380196928978, 0.038063958287239075, -0.43485891819000244, 0.07113175094127655, 0.25610342621803284, -0.07010139524936676, 0.6371207237243652, 0.25089770555496216, 0.12871766090393066, -0.1977519392967224, -0.24193210899829865, 0.11942590773105621, -0.1393175572156906, -0.17695145308971405, 0.19615694880485535, -0.0021829120814800262, 0.15516451001167297, 0.07544990628957748, -0.3925921320915222, -0.22158829867839813, -0.42063215374946594, -0.04867259040474892, -0.08020082861185074, 0.2223520576953888, 0.4504740238189697, 0.17157763242721558, 0.1813281923532486, 0.3074840307235718, 0.10790342092514038, -0.09016728401184082, -0.27820390462875366, 0.2644084095954895, -0.22419589757919312, -0.38655194640159607, -0.180055171251297, -0.14852885901927948, -0.03744203597307205, 0.21681539714336395, -0.27806776762008667, 0.0678427442908287, -0.3424101173877716, 0.3773679733276367, -0.4818572402000427, 0.13861416280269623, 0.2114778459072113, 0.06775736808776855, -0.09014925360679626, -0.052194006741046906, 0.19021925330162048, 0.17629919946193695, -0.06984276324510574, 0.23597164452075958, 0.07630021125078201, 0.16952402889728546, -0.05175505205988884, 0.9170335531234741, 0.1341041922569275, -0.27146175503730774, 0.28111377358436584, -0.034640923142433167, -0.08966901898384094, -0.2049093246459961, -0.17197707295417786, -0.05671248212456703, 0.027667053043842316, -0.049777425825595856, -0.047539833933115005, -0.3915954530239105, 0.4666900932788849, 0.02126554399728775, 0.12406483292579651, -0.1285899579524994, -0.2925057113170624, 0.16831280291080475, -0.2501327097415924, 0.18004757165908813, -0.16932106018066406, 0.1841602623462677, -0.19049639999866486, 0.1593511998653412, 0.12429270893335342, -0.17516547441482544, 0.36856207251548767, -0.12295439839363098, -0.1381494402885437, -0.09653781354427338, -0.3384528160095215, 0.2522251307964325, 0.1979663372039795, 0.23531094193458557, -0.0044164881110191345, -0.2697405219078064, -0.010472279042005539, 0.039669573307037354, 0.6015465259552002, -0.278903603553772, 0.24331383407115936, 0.15644016861915588, -0.24604357779026031, -0.05612292140722275, 0.0820842832326889, -0.049274176359176636, -0.02161971852183342, -0.03735926002264023, 0.14561857283115387, -0.43014514446258545, -0.13928043842315674, 0.058063261210918427, 0.28955361247062683, -0.0971798300743103, -0.04529205337166786, -0.24528682231903076, -0.0919315367937088, -0.22197452187538147, 0.07672855257987976, 0.31435638666152954, 0.554934561252594, -0.0981706976890564, 0.09215982258319855, -0.14263185858726501, -0.22432337701320648, -0.19660863280296326, -0.03814797103404999, 0.3572355806827545, -0.26946157217025757, 0.28853294253349304, 0.03000717982649803, -0.04269227758049965, 0.10377442836761475, 0.354727178812027, -0.01350412331521511, -0.40077951550483704, 0.08357037603855133, 0.12000641226768494, 0.040783751755952835, 0.08125040680170059, -0.21210022270679474, 0.2635807693004608, -0.21989701688289642, 0.42320966720581055, 0.377330482006073, 0.31727272272109985, 0.10035378485918045, -0.1960521936416626, -0.1203748881816864, -0.3621068000793457, 0.43418169021606445, 0.009355328977108002, 0.2118791788816452, 0.42146918177604675, -0.0650608241558075, -0.01811964251101017, 0.125562384724617, 0.08777076750993729, 0.7533833980560303, -0.007713377475738525, -0.07243064045906067, 0.31275880336761475, 0.1503199189901352, 0.25527694821357727, -0.10408906638622284, 0.04599445313215256, -0.4524012804031372, -0.301063597202301, 0.06769032776355743, -0.21991516649723053, -0.11973993480205536, 0.13884030282497406, -0.027850240468978882, 0.14730070531368256, -0.44152703881263733, -0.034689731895923615, 0.020723659545183182, -0.05711212381720543, -0.030400395393371582, -0.18950164318084717, -0.022589098662137985, 0.021145634353160858, -0.21547314524650574, 0.27754852175712585, 0.01659775897860527, -0.1256549060344696, 0.04049214720726013, -0.3466585874557495, -0.3745882511138916, 0.07425149530172348, -0.29836931824684143, 0.39216405153274536, 0.6264641284942627, -0.5686425566673279, 0.1773451268672943, 0.2756769359111786, 0.40104976296424866, 0.07749176025390625, -0.1299222856760025, 0.3023642599582672, 0.048719581216573715, 0.025033388286828995, -0.08741119503974915, 0.1107797622680664, 0.5406555533409119, -0.10368567705154419, -0.24073302745819092, 0.3753882646560669, -0.20772016048431396, -0.33260560035705566, -0.03439272940158844, -0.2281729280948639, 0.05406596511602402, -0.08993514627218246, -0.09268822520971298, -0.1944958120584488, -0.08562251180410385, -0.33367103338241577, 0.08464591950178146, 0.1331895887851715, -0.24720852077007294, -0.08531495928764343, -0.06322766095399857, -0.21619802713394165, -0.00381120084784925, 0.31140780448913574, 0.05418751761317253, 0.1773303598165512, 0.4057587683200836, 0.21271049976348877, -0.11989027261734009, -0.22728680074214935, 0.1486479789018631, 0.23872500658035278, -0.609123170375824, 0.3487370014190674, -0.08620862662792206, 0.13970699906349182, 0.13128173351287842, 0.7958913445472717, -0.009307924658060074, -0.017429254949092865, -0.025445036590099335, -0.06987565755844116, -0.5290130972862244, 0.017869245260953903, -0.1662394106388092, 0.054439444094896317, -0.0758814737200737, 0.3952424228191376, -0.19206736981868744, 0.17320606112480164, -0.24205206334590912, -0.07917146384716034, -0.21306326985359192, 0.053108103573322296, 0.19698160886764526, -0.22116395831108093, -0.086529940366745, 0.21660034358501434, 0.0893002599477768, 0.23954620957374573, -0.2742626965045929, -0.24865379929542542, -0.2567448019981384, 0.14060787856578827, 0.14190013706684113, -0.18098117411136627, 0.008771736174821854, 0.12781928479671478, -0.16071973741054535, -0.008628051728010178, 0.49118390679359436, -0.05334571376442909, 0.001720299944281578, 0.21941491961479187, -0.006864195689558983, 0.07550488412380219, -0.31205978989601135, 0.05780450999736786, -0.10722411423921585, 0.0670255571603775, 0.15242330729961395, 0.07919009029865265, -0.06531666219234467, -0.21845188736915588, -0.49270033836364746, -0.302171528339386, 0.09518486261367798, 0.06630054861307144, 0.1609175205230713, -0.4755062758922577, -0.15024937689304352, -0.020392652601003647, -0.004927549511194229, 0.10730019211769104, -0.13333244621753693, -0.2790284752845764, 0.3299686312675476, 0.22534073889255524, -0.2908317446708679, -0.07721617817878723, -0.4034242033958435, -0.1046283096075058, 0.06782782077789307, 0.01866462454199791, -0.12369192391633987, 0.023451805114746094, -0.20639094710350037, 0.1595478057861328, 0.15374743938446045, -0.18109941482543945, 0.09492088854312897, 0.6302568316459656, -0.13568097352981567, 0.08472062647342682, 0.26438161730766296, 0.20977210998535156, 0.27410775423049927, 0.5025721788406372, -0.10580138862133026, 0.24994626641273499, -0.37345167994499207, -0.1387898027896881, -0.055199068039655685, -0.7152916193008423, 0.0479545071721077, 0.1629592925310135, -0.13379546999931335, -0.03744835779070854, -0.07362711429595947, 0.22523233294487, 0.006435796618461609, -0.07905564457178116, -0.152813121676445, 0.2543497085571289, -0.09436549991369247, -0.02645360492169857, 0.006972663104534149, -0.09272696077823639, -0.08125119656324387, 0.26399627327919006, 0.012998011894524097, 0.14793652296066284, 0.07620564103126526, 0.17932629585266113, -0.22106745839118958, -0.13778959214687347, 0.10732465237379074, 0.15399691462516785, -0.10011985898017883, -0.3238985538482666, -0.024080438539385796, 0.27589932084083557, -0.18239837884902954, -0.27789437770843506, -0.0012110471725463867, 0.23261268436908722, 0.25467437505722046, -0.4855782389640808, -0.09683870524168015, -0.09242255985736847, 0.016481459140777588, -0.022732574492692947, 0.013905763626098633, -0.07383561134338379, 0.06540475785732269, 0.4454158544540405, 0.0733921155333519, -0.18540894985198975, -0.033704742789268494, 0.11845605075359344, 0.5983359813690186, -0.1625663936138153, 0.08369095623493195, -0.015960313379764557, -0.1564878225326538, -0.18649506568908691, -0.07073609530925751, -0.18563392758369446, 0.19952857494354248, 0.21147963404655457, 0.10252727568149567, 0.06602903455495834, -0.04432610422372818, 0.08398936688899994, -0.10582271963357925, 0.5690257549285889, 0.18411125242710114, -0.0632798969745636, -0.40199583768844604, 0.030803099274635315, -0.31758150458335876, 0.41624560952186584, 0.002083737635985017, 0.004755236208438873, 0.0505414754152298, 0.06474366784095764, 0.05850730836391449, 0.19708222150802612, 0.03528375178575516, 0.20715081691741943, 0.1280057728290558, 0.6355893611907959, -0.17886319756507874, -0.32841047644615173, -0.22657740116119385, -0.03616976737976074, 0.06627628207206726, -0.637870728969574, 0.07221458852291107, 0.1719021201133728, 0.16357307136058807, -0.21562570333480835, -0.28507208824157715, 0.2865738272666931, 0.2525624930858612, 0.2715286314487457, 0.17859502136707306, 0.337524950504303, -0.07499849051237106, 0.028241947293281555, -0.07320881634950638, -0.18722744286060333, 0.041922662407159805, -0.03613710030913353, 0.11766208708286285, 0.5018724799156189, 0.23552268743515015, 0.38275855779647827, -0.6064099073410034, 0.4519108831882477, -0.15671026706695557, 0.12790369987487793, -0.16731932759284973, 0.030454561114311218, -0.015218213200569153, 0.010580245405435562, 0.21476447582244873, 0.06612825393676758, -0.0573388896882534, 0.09558093547821045, -0.4455846846103668, -0.4113101363182068, 0.5964670777320862, -0.2314387410879135, -0.49460509419441223, -0.17647232115268707, 0.17003336548805237, 0.2688485085964203, -0.11808983981609344, -0.26485416293144226, 0.2150261104106903, 0.27969348430633545, -0.07718970626592636, -0.09888249635696411, 0.11346648633480072, 0.3041185736656189, 0.015104740858078003, 0.0968286395072937, 0.7117975354194641, -0.12917158007621765, -0.009090133011341095, 0.10136065632104874, -0.14994555711746216 ]
https://github.com/huggingface/datasets/issues/5818
In this case, I think we can avoid the `PermissionError` by unpacking the underlying `ConcatenationTable` and saving only the newly added data blocks (in new files).
Ability to update a dataset
### Feature request The ability to load a dataset, add or change something, and save it back to disk. Maybe it's possible, but I can't work out how to do it, e.g. this fails: ```py import datasets dataset = datasets.load_from_disk("data/test1") dataset = dataset.add_item({"text": "A new item"}) dataset.save_to_disk("data/test1") ``` With the error: ``` PermissionError: Tried to overwrite /mnt/c/Users/david/py/learning/mini_projects/data_sorting_and_filtering/data/test1 but a dataset can't overwrite itself. ``` ### Motivation My use case is that I want to process a dataset in a particular way but it doesn't fit in memory if I do it in one go. So I want to perform a loop and at each step in the loop, process one shard and append it to an ever-growing dataset. The code in the loop will load a dataset, add some rows, then save it again. Maybe I'm just thinking about things incorrectly and there's a better approach. FWIW I can't use `dataset.map()` to do the task because that doesn't work with `num_proc` when adding rows, so is confined to a single process which is too slow. The only other way I can think of is to create a new file each time, but surely that's not how people do this sort of thing. ### Your contribution na
26
Ability to update a dataset ### Feature request The ability to load a dataset, add or change something, and save it back to disk. Maybe it's possible, but I can't work out how to do it, e.g. this fails: ```py import datasets dataset = datasets.load_from_disk("data/test1") dataset = dataset.add_item({"text": "A new item"}) dataset.save_to_disk("data/test1") ``` With the error: ``` PermissionError: Tried to overwrite /mnt/c/Users/david/py/learning/mini_projects/data_sorting_and_filtering/data/test1 but a dataset can't overwrite itself. ``` ### Motivation My use case is that I want to process a dataset in a particular way but it doesn't fit in memory if I do it in one go. So I want to perform a loop and at each step in the loop, process one shard and append it to an ever-growing dataset. The code in the loop will load a dataset, add some rows, then save it again. Maybe I'm just thinking about things incorrectly and there's a better approach. FWIW I can't use `dataset.map()` to do the task because that doesn't work with `num_proc` when adding rows, so is confined to a single process which is too slow. The only other way I can think of is to create a new file each time, but surely that's not how people do this sort of thing. ### Your contribution na In this case, I think we can avoid the `PermissionError` by unpacking the underlying `ConcatenationTable` and saving only the newly added data blocks (in new files).
[ -0.19011037051677704, 0.4618924856185913, -0.11184918880462646, -0.0979379266500473, 0.02292514219880104, 0.2477240264415741, 0.10128538310527802, 0.007762257009744644, -0.31282854080200195, 0.20791491866111755, -0.032510872930288315, 0.15257567167282104, -0.3104686737060547, 0.3568274676799774, 0.0864700973033905, 0.07665683329105377, 0.18568138778209686, -0.08828289806842804, -0.0390140563249588, 0.1875370442867279, -0.23606686294078827, -0.3046472370624542, -0.06273018568754196, -0.4410855770111084, -0.18709522485733032, -0.17741508781909943, -0.5031972527503967, 0.19374722242355347, -0.22301211953163147, -0.2328782081604004, 0.1282682865858078, 0.7548127174377441, 0.18883773684501648, 0.347434401512146, -0.00011393626482458785, -0.07669422030448914, 0.003303961828351021, -0.01873307302594185, -0.6269689798355103, -0.04742205888032913, -0.08387627452611923, -0.5239887237548828, -0.16274940967559814, -0.2320559173822403, 0.33425307273864746, -0.08503425121307373, 0.1075010895729065, -0.08109810203313828, 0.2811310589313507, -0.13465239107608795, 0.12043668329715729, 0.2194448858499527, 0.2306671440601349, -0.021877117455005646, 0.13699471950531006, 0.3424464166164398, 0.02202446013689041, 0.2999931871891022, 0.3321370780467987, -0.18455840647220612, 0.29361429810523987, 0.025516554713249207, -0.306466281414032, -0.4371182322502136, 0.3950822055339813, -0.10157129913568497, -0.03847638890147209, -0.3566545248031616, 0.1144060492515564, -0.1792096495628357, 0.6088621020317078, -0.5434289574623108, -0.6927919983863831, -0.3522600531578064, 0.24549172818660736, -0.5042155981063843, -0.08523747324943542, 0.08318749815225601, -0.2749055027961731, 0.25442588329315186, 0.025160282850265503, -0.6957845091819763, -0.11798812448978424, 0.2731558382511139, 0.19047656655311584, -0.22147414088249207, 0.05168274790048599, 0.1238837018609047, -0.02333689108490944, -0.1667272448539734, 0.40946391224861145, -0.051095470786094666, -0.021002378314733505, 0.45358455181121826, -0.40966251492500305, -0.05030941963195801, 0.05385778099298477, -0.16769099235534668, 0.23784586787223816, 0.3750765919685364, 0.04029317572712898, 0.016810143366456032, -0.36661648750305176, 0.4387388229370117, 0.1301783174276352, 0.09354110062122345, 0.04846803843975067, 0.1508236974477768, 0.04957076162099838, -0.1287081241607666, 0.14578518271446228, -0.008676275610923767, -0.17961841821670532, 0.1818830370903015, 0.24245135486125946, -0.0016607865691184998, 0.18444441258907318, 0.18050776422023773, -0.010981857776641846, 0.12588709592819214, 0.18923142552375793, -0.09077542275190353, -0.16028954088687897, 0.38186708092689514, 0.16871072351932526, -0.10458569973707199, 0.043133676052093506, 0.16101431846618652, 0.22057080268859863, -0.1881161332130432, -0.09698807448148727, -0.06850530207157135, -0.15603980422019958, 0.3226390480995178, 0.199009507894516, -0.1501028835773468, -0.08368213474750519, -0.15667535364627838, -0.04864656925201416, -0.12405288964509964, -0.11738362908363342, -0.17290645837783813, 0.002553410828113556, 0.3289541006088257, -0.008822537958621979, -0.05017857998609543, -0.012753540650010109, -0.20530709624290466, -0.09752936661243439, 0.453754723072052, -0.062491439282894135, -0.23878377676010132, -0.21175320446491241, 0.07725116610527039, 0.0684577003121376, 0.03228767216205597, -0.43877094984054565, 0.08992031216621399, 0.22261792421340942, -0.41452980041503906, 0.04515532776713371, 0.23146407306194305, -0.054881248623132706, -0.5139151215553284, 0.12799060344696045, 0.46654754877090454, -0.46419280767440796, 0.13262662291526794, -0.2285425066947937, 0.007859403267502785, -0.03485001251101494, 0.25750574469566345, 0.012725654989480972, 0.15050983428955078, -0.0035984553396701813, -0.03738977760076523, 0.6398168802261353, 0.06819866597652435, -0.4046996235847473, -0.15389780700206757, -0.14569063484668732, -0.02754119038581848, 0.11907097697257996, 0.5928231477737427, 0.18763020634651184, -0.16264162957668304, 0.17732985317707062, 0.18286067247390747, 0.051551878452301025, -0.2723845839500427, -0.21232065558433533, -0.24382421374320984, 0.3549525737762451, 0.1432659924030304, 0.04034389182925224, 0.3763067424297333, 0.3862699866294861, -0.37769028544425964, 0.3532028794288635, -0.08755426108837128, 0.24851027131080627, 0.22389769554138184, 0.3797435164451599, 0.3454834520816803, -0.21152959764003754, -0.21397234499454498, -0.45014697313308716, 0.10258352756500244, 0.025089286267757416, -0.1423579603433609, -0.04490230605006218, -0.25212109088897705, -0.04296020045876503, 0.26537036895751953, -0.0037500690668821335, -0.01292969100177288, 0.02071177214384079, 0.1933632493019104, -0.11431937664747238, -0.19283190369606018, -0.4671214818954468, 0.3853437304496765, -0.3592776358127594, 0.0865766704082489, -0.3500557839870453, 0.2596365511417389, -0.032753005623817444, -0.21162648499011993, -0.20766809582710266, 0.02597692981362343, 0.05514763668179512, -0.05090451240539551, 0.09735490381717682, 0.3213692009449005, -0.20778176188468933, 0.05904524028301239, -0.12220712006092072, 0.23823100328445435, -0.09707726538181305, 0.30963629484176636, 0.18446829915046692, -0.3166731595993042, 0.1801450252532959, -0.16917234659194946, -0.24528798460960388, 0.3119220435619354, -0.33496081829071045, 0.07091087847948074, -0.02728106826543808, 0.0014106184244155884, 0.17502878606319427, -0.008232317864894867, -0.09889119118452072, -0.11719388514757156, 0.009561721235513687, 0.38143980503082275, 0.07663987576961517, -0.35880693793296814, -0.15228384733200073, 0.21392977237701416, 0.023775968700647354, -0.224971741437912, 0.13503989577293396, 0.21680980920791626, 0.01579233817756176, 0.05356606841087341, 0.01996154896914959, 0.5195736885070801, 0.5298656821250916, 0.09975467622280121, -0.0283658504486084, 0.1714232712984085, 0.220315620303154, 0.014784779399633408, -0.10739719867706299, -0.011216603219509125, 0.18143276870250702, 0.23958423733711243, 0.42912301421165466, 0.21153324842453003, -0.019903816282749176, 0.016617409884929657, 0.08034820109605789, 0.2919159531593323, -0.1072211042046547, -0.05931566655635834, 0.1203397735953331, -0.013283737003803253, 0.025189850479364395, -0.261382132768631, -0.293018102645874, -0.19741609692573547, -0.08569562435150146, 0.5449487566947937, -0.003750063478946686, 0.0327736958861351, -0.007111027836799622, 0.33227986097335815, -0.09608659148216248, -0.20073626935482025, 0.03324711322784424, -0.006603464484214783, 0.31561243534088135, 0.014205336570739746, 0.36127781867980957, 0.09977596253156662, 0.5891768336296082, 0.1589401215314865, 0.11126977950334549, -0.3191787898540497, -0.1089237853884697, -0.26230889558792114, -0.14652389287948608, 0.21272514760494232, 0.10097244381904602, 0.36137980222702026, 0.1007971242070198, -0.3407096266746521, -0.01088184118270874, -0.012016527354717255, -0.13507407903671265, -0.15215575695037842, 0.4901786148548126, -0.02743518352508545, -0.20198944211006165, 0.06871335208415985, -0.5529258251190186, -0.42307907342910767, 0.4330742061138153, 0.138567253947258, 0.24415694177150726, 0.007833365350961685, 0.11652977764606476, -0.034410133957862854, 0.1669308990240097, 0.06776566803455353, -0.20829622447490692, -0.277218759059906, 0.18407213687896729, -0.08391661196947098, -0.19573348760604858, 0.08564086258411407, -0.052359551191329956, -0.14585226774215698, 0.29752492904663086, -0.1359100043773651, -0.12160198390483856, -0.017709482461214066, 0.3242809772491455, -0.2832666337490082, 0.3825627565383911, 0.43645018339157104, 0.18078112602233887, 0.07939086854457855, -0.02362515777349472, -0.3924737274646759, -0.3280726671218872, 0.29176563024520874, 0.020370446145534515, 0.0069176312536001205, 0.22176730632781982, 0.17005011439323425, 0.3455980718135834, 0.09131631255149841, 0.19692319631576538, 0.3277156352996826, 0.11942213773727417, 0.47034260630607605, -0.14868126809597015, -0.5062028765678406, -0.13418062031269073, -0.3000423014163971, -0.4870699346065521, -0.08330684155225754, 0.11536889523267746, 0.044943876564502716, -0.0799950361251831, -0.41943517327308655, -0.12025978416204453, -0.2057562917470932, 0.2581406533718109, -0.04308800399303436, 0.403107225894928, 0.002297349274158478, -0.13772937655448914, -0.5625885128974915, -0.13216453790664673, -0.276541531085968, 0.5992717742919922, 0.1697763055562973, -0.04848431795835495, -0.49093854427337646, -0.06786099821329117, -0.4256340563297272, 0.3071827292442322, 0.14662835001945496, 0.2757401466369629, 0.1930643618106842, -0.024977296590805054, 0.07313523441553116, 0.013320229947566986, 0.793775200843811, -0.05818168818950653, -0.06260450929403305, 0.21287408471107483, 0.08433784544467926, 0.0009151026606559753, -0.040184687823057175, 0.04791705310344696, 0.2518998384475708, -0.13965532183647156, 0.31675854325294495, -0.05365532636642456, -0.03686344251036644, 0.011825580149888992, 0.33221298456192017, -0.31624484062194824, -0.09999556839466095, -0.08999498933553696, -0.25058645009994507, -0.6054537296295166, -0.27227991819381714, -0.1273367553949356, 0.02082037925720215, -0.006732508540153503, 0.3114798069000244, -0.27981632947921753, 0.10628542304039001, 0.1074485331773758, -0.17584741115570068, 0.16877716779708862, 0.27554354071617126, -0.016813181340694427, -0.17389515042304993, -0.2172507494688034, 0.44930875301361084, 0.416983425617218, -0.13058044016361237, -0.046070460230112076, -0.1979580968618393, 0.051526062190532684, 0.34761619567871094, 0.2140965461730957, 0.17542333900928497, 0.41475772857666016, 0.08631419390439987, -0.021665863692760468, -0.4087066650390625, -0.10865338146686554, 0.05158877372741699, -0.20575396716594696, -0.46072885394096375, -0.6562580466270447, 0.43997037410736084, -0.1868961751461029, -0.019568994641304016, 0.3372853994369507, -0.028727877885103226, -0.17754945158958435, 0.33988991379737854, 0.0105940792709589, 1.1329927444458008, -0.02961740270256996, 0.5176171064376831, -0.09840184450149536, 0.0036208629608154297, 0.29978320002555847, -0.03975524380803108, 0.26970818638801575, -0.2995012402534485, -0.2879481613636017, -0.16345304250717163, -0.00208108127117157, 0.09634163230657578, -0.13329599797725677, -0.28882214426994324, 0.33019429445266724, -0.28337007761001587, -0.13252143561840057, 0.19780991971492767, 0.0874108150601387, -0.2798198163509369, -0.030146241188049316, -0.17705678939819336, 0.09896474331617355, 0.10622435063123703, -0.12110570073127747, -0.1422191709280014, -0.008264942094683647, 0.11275254189968109, 0.00709196925163269, -0.45240074396133423, -0.31236743927001953, -0.12416915595531464, 0.25586795806884766, -0.1161615252494812, -0.21701490879058838, 0.02510007470846176, -0.07395406067371368, 0.06128736212849617, 0.3945457339286804, 0.12432233989238739, -0.2536788582801819, -0.02094501256942749, 0.19876763224601746, -0.1325054168701172, 0.04638208448886871, 0.5925469398498535, 0.058332107961177826, -0.1826702058315277, 0.2455662488937378, -0.14892077445983887, -0.6404784321784973, -0.40761226415634155, 0.16828276216983795, 0.247533917427063, -0.32082951068878174, -0.07569049298763275, 0.28764933347702026, -0.16072475910186768, -0.33426904678344727, 0.04673747718334198, 0.26129981875419617, -0.06828431040048599, 0.3867894113063812, -0.06486771255731583, 0.1034737229347229, -0.035620518028736115, 0.34610867500305176, 0.13769160211086273, -0.21123024821281433, 0.5143927931785583, 0.08737628161907196, -0.03573242574930191, -0.20780888199806213, 0.17001724243164062, -0.3116321861743927, 0.17230342328548431, 0.17392991483211517, -0.07250253856182098, 0.20282423496246338, 0.050266169011592865, 0.029138069599866867, 0.17667025327682495, 0.07171273231506348, -0.2888888120651245, -0.5773866176605225, -0.3607858717441559, 0.10267312824726105, 0.20006048679351807, 0.16031818091869354, 0.0593971312046051, 0.10117533802986145, -0.13922905921936035, 0.14355169236660004, -0.306417852640152, 0.11338108777999878, -0.17542454600334167, 0.0635303258895874, 0.40386372804641724, 0.20786423981189728, -0.12199680507183075, -0.23837611079216003, -0.01922859437763691, -0.06663412600755692, -0.20470358431339264, -0.11015528440475464, -0.12082010507583618, 0.13516592979431152, 0.0746336355805397, 0.08477767556905746, -0.23751795291900635, -0.37597769498825073, 0.03307163342833519, -0.08874711394309998, -0.036700185388326645, 0.26978766918182373, -0.1309494525194168, 0.10140824317932129, 0.2733275294303894, 0.4513365924358368, -0.13521164655685425, 0.07891350239515305, 0.22765964269638062, -0.14901375770568848, -0.1122395396232605, 0.24440273642539978, 0.007189739495515823, -0.052316173911094666, -0.2456614077091217, 0.18420563638210297, 0.2372455894947052, -0.057105228304862976, 0.28725558519363403, -0.21250757575035095, -0.05560877174139023, -0.3424421548843384, 0.42254963517189026, 0.4689481556415558, -0.08728454262018204, 0.1369234025478363, 0.5838560461997986, 0.13122427463531494, -0.16598725318908691, -0.17895205318927765, 0.1602095067501068, -0.15091530978679657, 0.007351957261562347, 0.23850232362747192, -0.17980480194091797, -0.028426505625247955, -0.29834359884262085, 0.17192178964614868, 0.15586185455322266, -0.30079877376556396, 0.07288546115159988, 0.2728774845600128, 0.025841981172561646, 0.0415041521191597, 0.14547604322433472, 0.3492850363254547, 0.0717451274394989, 0.44451233744621277, -0.11255058646202087, 0.30515575408935547, 0.12198248505592346, -0.38087737560272217, 0.001570824533700943, -0.3836158215999603, 0.17655658721923828, 0.21432684361934662, 0.25486519932746887, 0.3207588195800781, 0.039531175047159195, 0.1256127506494522, 0.08659487962722778, -0.09158769249916077, 0.12270883470773697, 0.351724773645401, 0.06802698224782944, -0.14561815559864044, 0.03606455773115158, -0.23555313050746918, 0.09159962832927704, -0.23288597166538239, -0.00034909683745354414, -0.4653714895248413, 0.20027147233486176, -0.0662311464548111, 0.07807420194149017, -0.21254681050777435, 0.26431792974472046, 0.19379359483718872, 0.04053656384348869, -0.23012417554855347, -0.13078685104846954, 0.21486271917819977, 0.054135940968990326, 0.09753289818763733, 0.07025890797376633, 0.3510313630104065, 0.25155898928642273, 0.13951079547405243, 0.4698778986930847, -0.25351813435554504, -0.0652272179722786, -0.07748442888259888, 0.1429724395275116, -0.19212666153907776, -0.1165304183959961, 0.17299947142601013, 0.09978298842906952, -0.1071353554725647, 0.2705509066581726, 0.17362625896930695, 0.1422218680381775, -0.5111643671989441, 0.3514980673789978, 0.20766738057136536, -0.539150059223175, 0.06739544123411179, -0.006356731057167053, -0.17779435217380524, 0.05009094998240471, 0.660541296005249, -0.22477789223194122, 0.18596208095550537, 0.10761755704879761, 0.06674057245254517, 0.034184593707323074, 0.5580539703369141, 0.6038419008255005, -0.10351037234067917, -0.005085643380880356, -0.013505205512046814, -0.5573237538337708, -0.14936646819114685, 0.1747022122144699, -0.2556217312812805, -0.12904036045074463, -0.14067547023296356, 0.23473067581653595, 0.19317910075187683, 0.1784532070159912, -0.4106978476047516, -0.14235511422157288, 0.44868049025535583, -0.277718722820282, -0.17706653475761414, 0.17971724271774292, 0.12424510717391968, 0.039100855588912964, -0.4191632866859436, 0.10763803124427795, -0.25983139872550964, 0.09891094267368317, 0.017145510762929916, 0.22226399183273315, 0.05104222893714905, 0.19265219569206238, 0.6084318161010742, 0.05714768171310425, 0.06149492785334587, -0.11391454190015793, -0.20264832675457, -0.3728824853897095, -0.120846226811409, -0.24676206707954407, 0.03350599482655525, 0.11155395209789276, 0.3811480402946472, -0.43300753831863403, -0.13465115427970886, -0.10885140299797058, 0.07546171545982361, -0.1294788271188736, 0.029682595282793045, -0.12376873940229416, 0.18443623185157776, 0.1861790269613266, 0.1571340560913086, 0.09672579914331436, 0.2098378688097, -0.007767444476485252, 0.49327385425567627, -0.43042582273483276, -0.0027299225330352783, 0.401051789522171, -0.2812313139438629, -0.41247713565826416, -0.03915147855877876, 0.1307746171951294, 0.011991414241492748, -0.252750426530838, -0.5909237861633301, -0.028482988476753235, 0.20421236753463745, -0.0027694422751665115, -0.1828359067440033, 0.5535244941711426, -0.2921381890773773, -0.23056423664093018, 0.03601234406232834, 0.05123893916606903, -0.1778896152973175, -0.2381184995174408, -0.09853937476873398, -0.2885737419128418 ]
https://github.com/huggingface/datasets/issues/5818
Thanks @stevhliu and @mariosasko , so saving to individual files then loading them later, concatenating again and saving again is the recommended way. Good to know. Question that I hope doesn't sound rude: is this sort of thing (processing a dataset that doesn't fit in memory) outside of `datasets`'s core area of focus? Are there other tools you would recommend to do this sort of thing that play nice with `datasets`? Or is it just that I've found myself in a niche situation that hasn't specifically been catered for?
Ability to update a dataset
### Feature request The ability to load a dataset, add or change something, and save it back to disk. Maybe it's possible, but I can't work out how to do it, e.g. this fails: ```py import datasets dataset = datasets.load_from_disk("data/test1") dataset = dataset.add_item({"text": "A new item"}) dataset.save_to_disk("data/test1") ``` With the error: ``` PermissionError: Tried to overwrite /mnt/c/Users/david/py/learning/mini_projects/data_sorting_and_filtering/data/test1 but a dataset can't overwrite itself. ``` ### Motivation My use case is that I want to process a dataset in a particular way but it doesn't fit in memory if I do it in one go. So I want to perform a loop and at each step in the loop, process one shard and append it to an ever-growing dataset. The code in the loop will load a dataset, add some rows, then save it again. Maybe I'm just thinking about things incorrectly and there's a better approach. FWIW I can't use `dataset.map()` to do the task because that doesn't work with `num_proc` when adding rows, so is confined to a single process which is too slow. The only other way I can think of is to create a new file each time, but surely that's not how people do this sort of thing. ### Your contribution na
89
Ability to update a dataset ### Feature request The ability to load a dataset, add or change something, and save it back to disk. Maybe it's possible, but I can't work out how to do it, e.g. this fails: ```py import datasets dataset = datasets.load_from_disk("data/test1") dataset = dataset.add_item({"text": "A new item"}) dataset.save_to_disk("data/test1") ``` With the error: ``` PermissionError: Tried to overwrite /mnt/c/Users/david/py/learning/mini_projects/data_sorting_and_filtering/data/test1 but a dataset can't overwrite itself. ``` ### Motivation My use case is that I want to process a dataset in a particular way but it doesn't fit in memory if I do it in one go. So I want to perform a loop and at each step in the loop, process one shard and append it to an ever-growing dataset. The code in the loop will load a dataset, add some rows, then save it again. Maybe I'm just thinking about things incorrectly and there's a better approach. FWIW I can't use `dataset.map()` to do the task because that doesn't work with `num_proc` when adding rows, so is confined to a single process which is too slow. The only other way I can think of is to create a new file each time, but surely that's not how people do this sort of thing. ### Your contribution na Thanks @stevhliu and @mariosasko , so saving to individual files then loading them later, concatenating again and saving again is the recommended way. Good to know. Question that I hope doesn't sound rude: is this sort of thing (processing a dataset that doesn't fit in memory) outside of `datasets`'s core area of focus? Are there other tools you would recommend to do this sort of thing that play nice with `datasets`? Or is it just that I've found myself in a niche situation that hasn't specifically been catered for?
[ -0.19202479720115662, 0.30247825384140015, -0.14454354345798492, -0.03796469420194626, 0.06152549013495445, 0.2540952265262604, -0.019155899062752724, -0.047730665653944016, -0.06347855180501938, 0.19598427414894104, 0.08385588228702545, 0.029836494475603104, -0.24973738193511963, 0.4215005338191986, 0.1772516965866089, 0.10909200459718704, 0.14556342363357544, -0.21569809317588806, 0.13335856795310974, 0.25883007049560547, -0.23768579959869385, -0.4364570379257202, 0.038755446672439575, -0.3942055404186249, -0.0690886601805687, -0.32301419973373413, -0.4436161518096924, 0.138731449842453, -0.09147407114505768, -0.17562253773212433, 0.027643516659736633, 0.5770072340965271, 0.18895284831523895, 0.42138245701789856, -0.00011761792120523751, -0.1890052855014801, 0.03012249618768692, 0.07687952369451523, -0.587205708026886, -0.008846774697303772, -0.08148201555013657, -0.47593656182289124, -0.1290731430053711, -0.2939711809158325, 0.2987406253814697, -0.13403001427650452, 0.2862856090068817, -0.1788274347782135, 0.31321078538894653, -0.04442381486296654, 0.1114601194858551, 0.25456154346466064, 0.16711558401584625, 0.0346074253320694, 0.33210211992263794, 0.3572143316268921, 0.06418444961309433, 0.05334670469164848, 0.37619370222091675, -0.02818712592124939, 0.431440532207489, -0.03370616212487221, -0.3976479768753052, -0.3841893672943115, 0.6081168055534363, -0.11108173429965973, -0.07001335918903351, -0.4316982328891754, 0.1608014553785324, -0.23983007669448853, 0.48693984746932983, -0.3638201951980591, -0.8263974189758301, -0.46890684962272644, 0.08503402769565582, -0.3409295082092285, -0.16897743940353394, 0.04749966412782669, -0.2383989691734314, 0.14594146609306335, -0.103558748960495, -0.7465386390686035, 0.03194800019264221, 0.24420234560966492, 0.17318403720855713, -0.2988678812980652, 0.08109641820192337, 0.1224718987941742, 0.056669607758522034, -0.05810178816318512, 0.3760824501514435, -0.21552670001983643, 0.050054170191287994, 0.45441386103630066, -0.393462598323822, -0.03317966312170029, 0.02217935211956501, 0.16372865438461304, 0.13090063631534576, 0.36411339044570923, 0.18253080546855927, 0.1291714608669281, -0.36306801438331604, 0.36896222829818726, 0.18398797512054443, -0.10001404583454132, -0.06724612414836884, 0.04907553642988205, 0.15436184406280518, -0.1762056201696396, 0.09379999339580536, -0.08276888728141785, -0.1125747486948967, 0.15814907848834991, 0.3311557173728943, -0.11751233786344528, 0.1763267070055008, 0.1272110790014267, -0.08906234055757523, 0.039748821407556534, 0.136125847697258, -0.06433768570423126, -0.20100119709968567, 0.16140155494213104, 0.1508616805076599, 0.021259605884552002, 0.03978674113750458, 0.059807147830724716, 0.19159764051437378, -0.02468085289001465, -0.004208112135529518, 0.020034097135066986, -0.10297568887472153, 0.34850263595581055, 0.12032487988471985, -0.1024913340806961, -0.12303491681814194, -0.10508925467729568, -0.13122448325157166, -0.19416306912899017, 0.024700231850147247, -0.20858031511306763, 0.04299386218190193, 0.35184526443481445, -0.0730544775724411, 0.17529869079589844, -0.2203134149312973, -0.03343246877193451, -0.017754636704921722, 0.44491708278656006, -0.14266234636306763, -0.1540755331516266, 0.07070322334766388, 0.056387584656476974, -0.03032590076327324, -0.07157997786998749, -0.5622167587280273, 0.05250773951411247, 0.17156007885932922, -0.4045298993587494, -0.06601445376873016, 0.28325995802879333, -0.07120603322982788, -0.43802690505981445, 0.06677257269620895, 0.400712788105011, -0.5817314386367798, 0.2039005160331726, -0.4983771741390228, 0.11637725681066513, -0.10130055248737335, 0.1535917967557907, 0.11832605302333832, 0.2634921669960022, 0.02824341505765915, -0.023158423602581024, 0.4303460717201233, -0.04902472347021103, -0.3863670825958252, -0.08138799667358398, -0.04604674130678177, -0.042532868683338165, 0.06676512211561203, 0.6932647824287415, 0.19147029519081116, -0.18484386801719666, -0.17000256478786469, 0.11635524034500122, -0.08766558766365051, -0.23230332136154175, -0.11414195597171783, -0.22465825080871582, 0.2537675201892853, 0.24207474291324615, 0.19909736514091492, 0.33899277448654175, 0.36048421263694763, -0.2426314651966095, 0.16425077617168427, -0.11486634612083435, 0.24764376878738403, 0.1561923325061798, 0.32165732979774475, 0.34431615471839905, -0.17238566279411316, -0.4336540102958679, -0.4379708766937256, 0.12106560170650482, 0.19236081838607788, -0.251891553401947, -0.0005282759666442871, -0.16045552492141724, -0.07648016512393951, 0.14247873425483704, 0.07569850981235504, -0.045668669044971466, -0.04816829785704613, 0.19844312965869904, -0.11651144921779633, -0.2409086525440216, -0.438521146774292, 0.22393570840358734, -0.30607640743255615, 0.010299306362867355, -0.255489319562912, 0.24457718431949615, 0.053348906338214874, -0.22804224491119385, -0.2513754367828369, -0.019036687910556793, -0.07324089109897614, -0.08212488889694214, 0.21652036905288696, 0.25198134779930115, 0.010486360639333725, 0.08809372782707214, 0.015782538801431656, 0.4307366609573364, 0.04072512686252594, 0.2817746102809906, 0.1916312575340271, -0.3339935839176178, 0.34020015597343445, -0.2313845455646515, -0.30889058113098145, 0.248653843998909, -0.23744016885757446, 0.19027544558048248, 0.07123523205518723, -0.018347017467021942, 0.043224215507507324, -0.03717940300703049, -0.04082748666405678, 0.06582817435264587, 0.00857978593558073, 0.2535144090652466, 0.27779191732406616, -0.3182951807975769, -0.0875759869813919, 0.17747139930725098, 0.013046433217823505, -0.20068037509918213, 0.09435968101024628, 0.13966329395771027, 0.03771569952368736, 0.11254452168941498, -0.020492831245064735, 0.5704818367958069, 0.39290958642959595, 0.0951240137219429, 0.006500546354800463, 0.10446913540363312, 0.3045324385166168, 0.012936647981405258, -0.14692096412181854, 0.26419028639793396, 0.2335738241672516, 0.16707047820091248, 0.36038506031036377, 0.2071177214384079, 0.03286389261484146, 0.12304964661598206, 0.048537641763687134, 0.18046928942203522, -0.07755585014820099, 0.06711066514253616, 0.20694831013679504, 0.06581681966781616, 0.07143442332744598, -0.007707327604293823, -0.29814472794532776, -0.3549109101295471, -0.17100146412849426, 0.46468883752822876, -0.06541682034730911, -0.0035923421382904053, 0.12807032465934753, 0.3286797106266022, -0.16356053948402405, -0.26566484570503235, -0.031292229890823364, -0.03339160606265068, 0.32716113328933716, -0.009652279317378998, 0.3896821141242981, 0.0555761456489563, 0.7338043451309204, 0.15591630339622498, 0.10685271769762039, -0.5590517520904541, -0.05311981588602066, -0.2590905725955963, -0.0020170556381344795, 0.29690954089164734, 0.07896216213703156, 0.37545424699783325, -0.0313054621219635, -0.1715853065252304, -0.07445845752954483, -0.20467275381088257, -0.09350739419460297, -0.28610873222351074, 0.3550271987915039, 0.01291549950838089, -0.10310747474431992, 0.18843857944011688, -0.5363206267356873, -0.3890268802642822, 0.3076254427433014, 0.11970927566289902, 0.1826622635126114, -0.058574944734573364, 0.07426580786705017, -0.08947566151618958, 0.07906437665224075, -0.010082704946398735, -0.10736950486898422, -0.2360626459121704, 0.18096411228179932, -0.0023691505193710327, -0.1734423190355301, 0.11930407583713531, -0.055630989372730255, -0.12921053171157837, 0.5382512211799622, -0.11878188699483871, -0.12902404367923737, -0.10651099681854248, 0.20629867911338806, -0.16014333069324493, 0.3915847837924957, 0.4221598207950592, -0.023823967203497887, 0.09528222680091858, 0.030930697917938232, -0.349187970161438, -0.27768993377685547, 0.19590680301189423, -0.009401649236679077, 0.07038317620754242, 0.220881849527359, 0.15252947807312012, 0.5467787384986877, -0.013208087533712387, 0.11297902464866638, 0.27239102125167847, 0.00709720142185688, 0.2583785355091095, -0.17969495058059692, -0.4429253935813904, -0.10944889485836029, -0.30287110805511475, -0.586902916431427, -0.044752612709999084, 0.07104673236608505, 0.0710524320602417, -0.06344742327928543, -0.23102113604545593, -0.2826739251613617, -0.11765961349010468, 0.17087556421756744, 0.011057534255087376, 0.5056291818618774, 0.05520666390657425, 0.046302855014801025, -0.4521028995513916, -0.29738959670066833, -0.2159954458475113, 0.4738079309463501, 0.31383201479911804, -0.03627946600317955, -0.5998818874359131, -0.025467969477176666, -0.37094318866729736, 0.38287776708602905, 0.1589445173740387, 0.1611124575138092, 0.09232887625694275, -0.09033121168613434, 0.11480772495269775, -0.11641794443130493, 0.751038134098053, -0.14303342998027802, -0.061435628682374954, 0.11408868432044983, -0.12077631056308746, -0.16179583966732025, 0.03531322628259659, 0.02166862040758133, 0.23516890406608582, -0.18090946972370148, 0.3084760904312134, -0.0694635808467865, 0.02947329357266426, -0.009168478660285473, 0.3580883741378784, -0.3180135488510132, -0.13175642490386963, 0.012769535183906555, -0.29285937547683716, -0.5271956920623779, -0.20485517382621765, 0.033648841083049774, -0.10213110595941544, 0.013677597045898438, 0.20596256852149963, -0.3562033474445343, 0.2519650161266327, 0.32660675048828125, -0.24910226464271545, 0.06258545815944672, 0.26837193965911865, -0.004404805600643158, -0.032599471509456635, -0.22553983330726624, 0.38963451981544495, 0.3498912751674652, -0.15122295916080475, 0.018014105036854744, -0.09129960834980011, -0.05953940376639366, 0.45219942927360535, 0.28702548146247864, 0.18433481454849243, 0.2717346251010895, 0.18088889122009277, -0.013943381607532501, -0.7061418890953064, -0.13672131299972534, 0.12150845676660538, -0.0615171380341053, -0.3816539943218231, -0.7696166038513184, 0.43887051939964294, 0.0053891390562057495, -0.010606750845909119, 0.19166706502437592, 0.05732797086238861, -0.1598254293203354, 0.23932260274887085, 0.12914863228797913, 1.070913553237915, -0.18377499282360077, 0.56476229429245, -0.11968160420656204, 0.08461637794971466, 0.3277157247066498, -0.024913117289543152, 0.175040140748024, -0.293316125869751, -0.15071435272693634, -0.15536746382713318, -0.051537662744522095, 0.16903077065944672, 0.13859447836875916, -0.06986948102712631, 0.4261232912540436, -0.13648052513599396, 0.04648618772625923, 0.18767544627189636, 0.13274171948432922, -0.24629123508930206, 0.01887962594628334, -0.12827517092227936, 0.10135018825531006, 0.08926301449537277, -0.09723375737667084, -0.17195211350917816, 0.0984056293964386, 0.0774361789226532, 0.09406554698944092, -0.3978953957557678, -0.3206673264503479, -0.02663520537316799, 0.0739547461271286, -0.2715270221233368, -0.22946253418922424, 0.020402707159519196, -0.07314236462116241, 0.012917213141918182, 0.41824015974998474, 0.1351729780435562, -0.15830761194229126, -0.222020223736763, 0.20249664783477783, -0.1993834674358368, -0.05833892896771431, 0.5208975076675415, -0.001394800841808319, -0.13545973598957062, 0.1536165028810501, -0.22087787091732025, -0.5512932538986206, -0.42948463559150696, 0.18940788507461548, 0.3463198244571686, -0.2624042332172394, -0.2298351228237152, 0.09804083406925201, -0.18710052967071533, -0.3089233636856079, 0.016591431573033333, 0.2118954062461853, 0.15120410919189453, 0.442810595035553, -0.1875385046005249, 0.12594285607337952, -0.030062051489949226, 0.3003637194633484, -0.017883919179439545, -0.20341047644615173, 0.5564752221107483, 0.07449669390916824, -0.04059860482811928, -0.25753313302993774, 0.2615196704864502, -0.23442572355270386, 0.2291855365037918, 0.31188318133354187, -0.12045593559741974, 0.22211319208145142, 0.03932800143957138, -0.11814744025468826, 0.24216294288635254, -0.19730938971042633, -0.2929196357727051, -0.6742916107177734, -0.19062140583992004, 0.12685854732990265, 0.41289639472961426, 0.21593356132507324, -0.02498559281229973, -0.10530638694763184, -0.05214052274823189, 0.08907541632652283, -0.24744418263435364, 0.14058950543403625, -0.09152545779943466, 0.13324902951717377, 0.4241596460342407, 0.22401192784309387, -0.20216983556747437, -0.21784734725952148, -0.04920119792222977, -0.15585365891456604, -0.20222285389900208, -0.10712109506130219, -0.10467192530632019, 0.17759299278259277, 0.09370963275432587, 0.07971104234457016, 0.08873975276947021, -0.3916715979576111, -0.024449503049254417, -0.15641386806964874, -0.0003468170762062073, 0.265069842338562, -0.06459683179855347, 0.18225321173667908, 0.2955234944820404, 0.4449879229068756, -0.10522038489580154, 0.22218282520771027, 0.08865819126367569, 0.12464020401239395, -0.032180458307266235, 0.31620925664901733, 0.363834410905838, -0.051990531384944916, -0.12278091907501221, 0.1357889473438263, 0.28562816977500916, -0.14494675397872925, 0.22818420827388763, -0.11884945631027222, -0.01179080456495285, -0.01154143363237381, 0.3947256803512573, 0.7123420834541321, -0.0878203958272934, 0.11173814535140991, 0.4415757954120636, 0.14377695322036743, -0.1070372462272644, -0.11978176981210709, 0.33276429772377014, -0.051299937069416046, -0.03043442964553833, 0.15781712532043457, -0.13286738097667694, -0.023007281124591827, -0.3723706007003784, 0.053673066198825836, 0.1769971251487732, -0.4311157464981079, 0.03434896841645241, 0.21120904386043549, 0.06808022409677505, -0.019652891904115677, 0.14169293642044067, 0.24220973253250122, -0.02497735619544983, 0.6909887194633484, -0.004148051142692566, 0.4673408567905426, 0.12299011647701263, -0.2048402577638626, 0.053068600594997406, -0.44394785165786743, 0.1266639679670334, 0.23076121509075165, 0.21323338150978088, 0.31045103073120117, 0.08171083778142929, 0.13786554336547852, 0.06776893138885498, -0.08152841031551361, 0.038212403655052185, 0.26947930455207825, 0.08394704014062881, -0.11807406693696976, 0.03929001837968826, -0.3389885425567627, 0.12750233709812164, -0.1265931874513626, -0.04950350895524025, -0.5334978103637695, 0.3745589852333069, -0.1055336594581604, 0.14922697842121124, -0.09231901913881302, 0.29253438115119934, -0.011563709005713463, 0.05630992352962494, -0.23538699746131897, -0.23856967687606812, 0.17950952053070068, 0.04188996180891991, 0.08772573620080948, 0.11576534807682037, 0.23450897634029388, 0.23987439274787903, -0.05227921903133392, 0.4809703528881073, -0.40549105405807495, -0.08204840123653412, -0.09512252360582352, 0.18552283942699432, -0.23216907680034637, 0.06604547798633575, 0.2209843099117279, 0.07919470220804214, -0.07191096991300583, 0.16381289064884186, -0.02230241522192955, 0.09629514813423157, -0.6249039769172668, 0.46456313133239746, 0.12667976319789886, -0.5058241486549377, 0.06780456006526947, 0.13704140484333038, -0.08673306554555893, -0.09996259212493896, 0.7039415836334229, -0.2864752411842346, 0.141680046916008, 0.1802162379026413, 0.03721784055233002, -0.15050166845321655, 0.5275223851203918, 0.5633056163787842, 0.00587511295452714, -0.001599431037902832, 0.10066075623035431, -0.6394636631011963, -0.15093381702899933, 0.09013219177722931, -0.21354135870933533, -0.1712372601032257, -0.09124018251895905, 0.18502363562583923, 0.20784667134284973, 0.26213163137435913, -0.541653037071228, -0.15850043296813965, 0.4085121154785156, -0.19710080325603485, -0.1397998034954071, 0.004585876129567623, 0.13579308986663818, 0.03746026009321213, -0.47592830657958984, 0.11831771582365036, -0.3038879632949829, 0.021850265562534332, -0.05541105568408966, 0.12414707243442535, 0.0584513396024704, 0.038747310638427734, 0.7497556805610657, 0.032080166041851044, 0.09590146690607071, -0.11054530739784241, -0.2187255322933197, -0.3841404914855957, -0.021667513996362686, -0.21576246619224548, 0.08635589480400085, 0.007028417661786079, 0.4182603061199188, -0.4882234036922455, -0.0411982387304306, -0.027996879070997238, -0.016689937561750412, -0.22400310635566711, -0.15316583216190338, -0.16905950009822845, 0.0418841615319252, 0.09100975841283798, 0.19315706193447113, 0.16525360941886902, 0.23918475210666656, -0.07101523131132126, 0.22902736067771912, -0.4710922837257385, 0.12525629997253418, 0.30358749628067017, -0.1808759868144989, -0.3894447386264801, -0.10838515311479568, 0.029690951108932495, -0.028551913797855377, -0.24530136585235596, -0.48925262689590454, -0.16171708703041077, 0.3163790702819824, -0.016409214586019516, -0.021692421287298203, 0.44127222895622253, -0.26489418745040894, -0.3407198190689087, 0.04690741002559662, 0.007683685049414635, -0.18947452306747437, -0.13986456394195557, -0.0801491066813469, -0.325115829706192 ]
https://github.com/huggingface/datasets/issues/5817
Hi ! Unfortunately I couldn't reproduce on my side locally and with datasets 2.11 and python 3.10.11 on colab. What version of `multiprocess` are you using ?
Setting `num_proc` errors when `.map` returns additional items.
### Describe the bug I'm using a map function that returns more rows than are passed in. If I try to use `num_proc` I get: ``` File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 563, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 528, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in iflatmap_unordered( File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1372, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 391, in _recv raise EOFError EOFError ``` ### Steps to reproduce the bug This is copied from the [Datasets docs](https://huggingface.co/docs/datasets/v2.12.0/en/process#batch-processing), with `num_proc` added, and will error. ```py import datasets dataset = ... # any old dataset def chunk_examples(examples): chunks = [] for sentence in examples["text"]: chunks += [sentence[i : i + 50] for i in range(0, len(sentence), 50)] return {"chunks": chunks} chunked_dataset = dataset.map( chunk_examples, batched=True, remove_columns=dataset.column_names, num_proc=2, # Remove and it works ) ``` ### Expected behavior Should work fine. On a related note, multi-processing also fails if there is a Meta class anywhere in scope (and there are plenty in the standard library). This is the fault of `dill` and is a long standing issue. Have you considered using Loky for multiprocessing? I've found that the built-in `datasets` multi-processing breaks more than it works so have written my own function using `loky`, for reference: ```py import datasets import loky def fast_loop(dataset: datasets.Dataset, func, num_proc=None): if num_proc is None: import os num_proc = len(os.sched_getaffinity(0)) shards = [ dataset.shard(num_shards=num_proc, index=i, contiguous=True) for i in range(num_proc) ] executor = loky.get_reusable_executor(max_workers=num_proc) results = executor.map(func, shards) return datasets.combine.concatenate_datasets(list(results)) ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1
27
Setting `num_proc` errors when `.map` returns additional items. ### Describe the bug I'm using a map function that returns more rows than are passed in. If I try to use `num_proc` I get: ``` File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 563, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 528, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in iflatmap_unordered( File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1372, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 391, in _recv raise EOFError EOFError ``` ### Steps to reproduce the bug This is copied from the [Datasets docs](https://huggingface.co/docs/datasets/v2.12.0/en/process#batch-processing), with `num_proc` added, and will error. ```py import datasets dataset = ... # any old dataset def chunk_examples(examples): chunks = [] for sentence in examples["text"]: chunks += [sentence[i : i + 50] for i in range(0, len(sentence), 50)] return {"chunks": chunks} chunked_dataset = dataset.map( chunk_examples, batched=True, remove_columns=dataset.column_names, num_proc=2, # Remove and it works ) ``` ### Expected behavior Should work fine. On a related note, multi-processing also fails if there is a Meta class anywhere in scope (and there are plenty in the standard library). This is the fault of `dill` and is a long standing issue. Have you considered using Loky for multiprocessing? I've found that the built-in `datasets` multi-processing breaks more than it works so have written my own function using `loky`, for reference: ```py import datasets import loky def fast_loop(dataset: datasets.Dataset, func, num_proc=None): if num_proc is None: import os num_proc = len(os.sched_getaffinity(0)) shards = [ dataset.shard(num_shards=num_proc, index=i, contiguous=True) for i in range(num_proc) ] executor = loky.get_reusable_executor(max_workers=num_proc) results = executor.map(func, shards) return datasets.combine.concatenate_datasets(list(results)) ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 Hi ! Unfortunately I couldn't reproduce on my side locally and with datasets 2.11 and python 3.10.11 on colab. What version of `multiprocess` are you using ?
[ 0.24224074184894562, -0.41235876083374023, -0.07637587189674377, 0.37606674432754517, 0.0636359453201294, -0.3487008810043335, -0.0032279640436172485, 0.3338972330093384, 0.023244023323059082, 0.30512771010398865, 0.4175057113170624, 0.4686207175254822, -0.2382592111825943, 0.15260010957717896, -0.07624384760856628, 0.3619661331176758, 0.06730867922306061, -0.07554703950881958, 0.43951690196990967, 0.13537341356277466, -0.5748607516288757, 0.4289441704750061, -0.22439438104629517, -0.17254436016082764, -0.16760556399822235, 0.1455993354320526, 0.051971614360809326, 0.2218014895915985, 0.16445830464363098, -0.32141754031181335, -0.11842072755098343, -0.43282607197761536, -0.08539356291294098, 0.3109798729419708, -0.00011485634604468942, -0.07343639433383942, -0.023738093674182892, -0.21344678103923798, 0.02389446645975113, -0.2386442869901657, -0.12986402213573456, -0.2159723937511444, -0.0569358691573143, -0.3214695453643799, -0.012033432722091675, 0.10651618242263794, -0.34043803811073303, -0.2789580225944519, -0.055710308253765106, 0.6855312585830688, 0.16761159896850586, 0.2789067029953003, 0.19426211714744568, -0.04732377082109451, 0.2217845916748047, -0.15288996696472168, 0.043224841356277466, 0.36690184473991394, 0.11861032247543335, 0.02005620300769806, 0.3217586278915405, 0.2206827700138092, -0.1281757801771164, 0.1811770796775818, 0.10133792459964752, 0.25618448853492737, 0.6905580759048462, -0.3305288553237915, 0.10739953815937042, -0.1390819251537323, -0.2660196125507355, 0.030855033546686172, 0.19868899881839752, -0.18628180027008057, -0.03858325630426407, -0.28144371509552, 0.09135794639587402, 0.0684412270784378, -0.15701264142990112, -0.05445440858602524, 0.028232164680957794, 0.13686509430408478, 0.14458855986595154, 0.2794165313243866, -0.14023998379707336, 0.17113694548606873, 0.05343104153871536, 0.35808637738227844, 0.47214823961257935, -0.07840559631586075, -0.1752568781375885, 0.19332027435302734, -0.0012059048749506474, 0.14240071177482605, 0.02773718163371086, -0.06798224151134491, 0.48782458901405334, 0.07145758718252182, -0.0028659701347351074, -0.1753230094909668, 0.2582513093948364, 0.14812850952148438, -0.1403244137763977, 0.22811099886894226, 0.13404840230941772, -0.12280680239200592, 0.2686443030834198, 0.5070664286613464, -0.24648872017860413, -0.13675007224082947, -0.02731819450855255, -0.022905796766281128, 0.3979395925998688, -0.1929904818534851, 0.17332366108894348, 0.45304474234580994, 0.15809306502342224, -0.24204488098621368, -0.0019216015934944153, 0.25668901205062866, -0.1228959932923317, 0.02593446522951126, 0.21336668729782104, 0.13120801746845245, 0.36965101957321167, 0.46975278854370117, -0.10693392902612686, -0.01990346796810627, -0.46097391843795776, -0.08964836597442627, -0.10818010568618774, 0.0380973294377327, -0.2865922152996063, 0.10773589462041855, 0.11481434851884842, -0.0031524673104286194, -0.0030431412160396576, -0.0641719326376915, 0.2768460512161255, -0.45988786220550537, -0.07618290185928345, -0.36918872594833374, 0.45203423500061035, 0.27176517248153687, -0.15843719244003296, -0.10818662494421005, 0.26117128133773804, -0.14424991607666016, -0.12316109240055084, 0.3534401059150696, -0.4958849847316742, -0.5573092103004456, -0.16478142142295837, 0.16103236377239227, 0.13298305869102478, 0.45709750056266785, -0.04721369221806526, 0.19473083317279816, 0.318670392036438, -0.5853917598724365, 0.022783420979976654, -0.4117061495780945, -0.530545711517334, -0.510227382183075, -0.15415143966674805, 0.21448850631713867, -0.013378895819187164, 0.1548386514186859, 0.20754258334636688, 0.18377509713172913, 0.2856627404689789, 0.15030068159103394, -0.1153963953256607, -0.059436071664094925, -0.2637633681297302, 0.18667767941951752, 0.19195295870304108, -0.12694711983203888, -0.49138209223747253, 0.02169114351272583, -0.18161624670028687, -0.09522756189107895, -0.052217744290828705, -0.08386444300413132, -0.03322991356253624, -0.27068108320236206, 0.5729301571846008, -0.25908640027046204, -0.09182962775230408, 0.0751100555062294, -0.29851508140563965, 0.25727659463882446, 0.2089892029762268, -0.21988335251808167, -0.09015031903982162, 0.10814473032951355, 0.13797421753406525, -0.5474519729614258, 0.19028766453266144, -0.01679370179772377, -0.09917914122343063, 0.09241136163473129, 0.12808378040790558, -0.021871991455554962, -0.08538515865802765, -0.1197054386138916, -0.2956763505935669, 0.13072733581066132, -0.5556293725967407, -0.010725272819399834, -0.21891260147094727, 0.04662773013114929, -0.025618601590394974, 0.09961733222007751, 0.15686166286468506, -0.08036640286445618, 0.10504242032766342, -0.0960710197687149, -0.01747451350092888, -0.20408448576927185, 0.14849801361560822, -0.06315737962722778, -0.027105238288640976, -0.08292631059885025, -0.2623387277126312, 0.36651498079299927, -0.11184436082839966, -0.35248443484306335, -0.28626230359077454, 0.3587793707847595, 0.5318778157234192, -0.004538878798484802, -0.01621614769101143, 0.29419606924057007, 0.31789782643318176, -0.4588382840156555, -0.37598466873168945, 0.07394903898239136, 0.27656880021095276, 0.093218594789505, -0.14448970556259155, 0.2459709346294403, 0.04277895763516426, -0.11832045018672943, -0.02306133136153221, 0.374442458152771, -0.03968901187181473, 0.20248180627822876, -0.10419923812150955, 0.019989654421806335, 0.14461475610733032, 0.18715032935142517, 0.04616273194551468, -0.4035787880420685, 0.1282813400030136, 0.6803484559059143, -0.174663245677948, -0.04776915907859802, 0.28156059980392456, 0.15790796279907227, 0.3505747318267822, 0.1374894082546234, 0.07009723782539368, -0.0283894594758749, 0.15776050090789795, -0.04141705855727196, 0.2771850526332855, -0.030257858335971832, 0.5697145462036133, 0.10072348266839981, -0.2297241985797882, -0.05999143421649933, -0.3036697804927826, -0.17851968109607697, -0.019168540835380554, 0.0440540611743927, 0.18813222646713257, 0.20513123273849487, 0.20995956659317017, -0.16907550394535065, 0.030392609536647797, -0.3038259744644165, -0.006851058453321457, 0.2147592306137085, -0.36886686086654663, -0.07850509881973267, -0.13343839347362518, 0.4167541563510895, -0.1742687225341797, -0.2700737416744232, -0.1383737474679947, -0.380878746509552, -0.00373679306358099, 0.169611856341362, -0.22442412376403809, -0.22967931628227234, -0.056924641132354736, -0.1923273801803589, 0.06871075928211212, 0.08729340881109238, 0.3149895966053009, -0.11100241541862488, -0.11557145416736603, -0.06737836450338364, -0.08857755362987518, -0.21879586577415466, 0.33120256662368774, 0.1969645768404007, -0.10498735308647156, 0.006672121584415436, -0.30558422207832336, 0.17208364605903625, -0.013564382679760456, -0.12298943847417831, -0.0024934038519859314, 0.018693577498197556, -0.029350414872169495, -0.17852634191513062, 0.30648502707481384, -0.2721499502658844, 0.22703412175178528, 0.250191867351532, 0.08627671748399734, -0.0650225579738617, -0.3334886431694031, -0.22559978067874908, -0.1632993370294571, -0.20076242089271545, 0.11502809822559357, 0.27068984508514404, 0.43322286009788513, -0.08106501400470734, 0.44581058621406555, 0.3190402388572693, 0.2722550630569458, -0.33839887380599976, -0.39015108346939087, 0.16965989768505096, 0.1238320916891098, -0.1633264720439911, -0.04678637161850929, -0.11409681290388107, 0.039580248296260834, -0.2223021686077118, 0.24327854812145233, -0.16807211935520172, -0.6237161755561829, 0.19949258863925934, 0.25715309381484985, -0.2906148433685303, -0.11274583637714386, 0.5605279803276062, 0.22127443552017212, -0.11106903851032257, -0.03592300042510033, -0.2797166109085083, 0.12179335951805115, 0.47141867876052856, 0.1491413414478302, 0.20946791768074036, 0.013248050585389137, 0.016340263187885284, 0.028208956122398376, 0.45901525020599365, -0.2112201452255249, 0.1808558702468872, -0.1596406102180481, 0.16968175768852234, 0.06936328858137131, -0.10740610957145691, -0.03500416502356529, -0.23699800670146942, 0.12782785296440125, 0.27542197704315186, 0.008021239191293716, -0.3034786581993103, -0.09352341294288635, 0.27659034729003906, -0.25921630859375, -0.31715643405914307, 0.1328602433204651, 0.005483515560626984, 0.23369848728179932, -0.1543847769498825, 0.18440914154052734, -0.4857298731803894, 0.0031875409185886383, -0.2928357720375061, -0.571464478969574, 0.05188827961683273, -0.1491982787847519, -0.3678826093673706, -0.39828625321388245, -0.4470686912536621, 0.6731699109077454, 0.4227455258369446, 0.016372807323932648, 0.1573392152786255, 0.006570413708686829, -0.057624511420726776, -0.01118980348110199, 0.6989369988441467, -0.3250543475151062, -0.07371079176664352, 0.027652211487293243, 0.28139162063598633, -0.3247980773448944, -0.0034092962741851807, -0.2616749405860901, 0.4991176724433899, 0.03102194145321846, 0.37756481766700745, -0.12290380150079727, 0.42553630471229553, 0.005531696602702141, -0.29713037610054016, 0.07537344098091125, -0.23158295452594757, -0.12256498634815216, -0.14941157400608063, -0.38048651814460754, 0.09343655407428741, 0.12371593713760376, 0.21292659640312195, 0.14262637495994568, -0.175542414188385, 0.6438823938369751, -0.2688509225845337, 0.11549217998981476, -0.15747395157814026, 0.4344140887260437, 0.3748031556606293, -0.24201619625091553, 0.32877299189567566, 0.04656006023287773, 0.16084438562393188, 0.4794711470603943, -0.2714574635028839, -0.04379168897867203, -0.037104181945323944, -0.3500891327857971, 0.1539604663848877, 0.26072365045547485, 0.12174083292484283, -0.003891497850418091, -0.13875535130500793, 0.3836859166622162, 0.15959571301937103, 0.055950820446014404, 0.16472068428993225, -0.09080520272254944, 0.06849220395088196, -0.08183027058839798, 0.11014890670776367, 0.0012786313891410828, -0.014055244624614716, 0.24445633590221405, -0.3659237027168274, -0.3396194875240326, 0.3311462998390198, 0.16665084660053253, 0.8520855903625488, 0.14329291880130768, -0.1268566995859146, -0.14394864439964294, -0.07468250393867493, 0.2583528757095337, -0.1586785763502121, 0.16006866097450256, -0.19449371099472046, -0.05282121151685715, -0.018136080354452133, -0.004085063934326172, -0.143638014793396, 0.20416322350502014, -0.3218264877796173, 0.2622624337673187, 0.07821275293827057, 0.15199801325798035, -0.08614003658294678, -0.07186096906661987, 0.37560662627220154, -0.1169726699590683, -0.21004636585712433, 0.06627689301967621, -0.12051906436681747, -0.2683928906917572, -0.11818921566009521, 0.19243663549423218, 0.09411859512329102, -0.5317253470420837, -0.17462235689163208, -0.03644229471683502, -0.5987056493759155, 0.32540491223335266, 0.38148385286331177, 0.011143848299980164, -0.3943959176540375, 0.19022727012634277, -0.24796906113624573, 0.18667972087860107, -0.1688135713338852, -0.4439546465873718, 0.5814927220344543, -0.006999857723712921, 0.10367397964000702, 0.037923164665699005, -0.009663858450949192, 0.05208580195903778, -0.2831087112426758, 0.23250454664230347, 0.012126382440328598, -0.26758289337158203, -0.5289586782455444, 0.25629350543022156, 0.24966174364089966, -0.11509495228528976, 0.10238960385322571, -0.06735679507255554, -0.38925471901893616, -0.09325427561998367, 0.054605334997177124, 0.011155880987644196, -0.23143930733203888, 0.3433046042919159, 0.0649464875459671, -0.43200263381004333, -0.018898069858551025, 0.34764182567596436, 0.058206457644701004, 0.012034319341182709, -0.040228892117738724, 0.039485663175582886, -0.11314420402050018, -0.14697548747062683, -0.16317489743232727, -0.31945064663887024, -0.16205841302871704, 0.1893444061279297, 0.21216273307800293, -0.04104636609554291, 0.1846875250339508, -0.01868848130106926, 0.10660217702388763, 0.348762571811676, -0.058150239288806915, -0.3954519033432007, -0.29545101523399353, -0.022067222744226456, -0.16138474643230438, 0.15897950530052185, 0.09262052178382874, 0.1523435413837433, 0.09196609258651733, 0.19726629555225372, -0.2881782650947571, -0.15197622776031494, -0.12325164675712585, 0.34456899762153625, 0.14036457240581512, -0.17183133959770203, -0.1082034707069397, 0.16744880378246307, 0.14611972868442535, 0.5503263473510742, -0.28109243512153625, -0.16345880925655365, 0.051105983555316925, 0.12557236850261688, 0.15720930695533752, -0.06686406582593918, -0.1814662665128708, -0.13371029496192932, 0.13466107845306396, -0.3512512445449829, -0.1586032509803772, 0.07544996589422226, 0.014599994756281376, 0.006603248417377472, 0.5441725850105286, 0.04113570600748062, 0.265067458152771, 0.3441685736179352, -0.29476043581962585, 0.12985415756702423, -0.06575855612754822, 0.22970309853553772, -0.09671033918857574, 0.09574086219072342, 0.09066098183393478, 0.08116663992404938, 0.11674870550632477, 0.11868223547935486, 0.16797947883605957, 0.02089579403400421, 0.1259884536266327, -0.05853481590747833, -0.03530983254313469, -0.0006956644356250763, -0.2806108891963959, 0.01902151107788086, -0.0010058246552944183, 0.17071257531642914, -0.1669299602508545, -0.18754777312278748, 0.2871575653553009, 0.3143708407878876, 0.11632968485355377, 0.4772007167339325, -0.0016383752226829529, -0.3936363458633423, 0.5358626842498779, 0.08815687894821167, -0.12167887389659882, -0.4921204447746277, -0.35066771507263184, 0.19920557737350464, -0.10765700787305832, -0.07562407106161118, 0.18568909168243408, -0.2984340786933899, 0.2868574261665344, 0.30692699551582336, 0.1362646371126175, 0.12960755825042725, 0.047802798449993134, -0.20149853825569153, 0.09733712673187256, -0.24320243299007416, -0.08116629719734192, 0.5970854163169861, -0.07326260209083557, 0.4555533230304718, 0.25148746371269226, 0.11828078329563141, -0.2693507671356201, 0.20633000135421753, 0.054103828966617584, 0.010392243042588234, -0.19875885546207428, 0.016975004225969315, -0.02615686133503914, -0.1028536856174469, -0.35768774151802063, -0.030504994094371796, 0.047222547233104706, -0.002102416008710861, 0.5765467286109924, 0.16604049503803253, -0.2493630051612854, 0.11994598060846329, -0.361240953207016, -0.19213944673538208, 0.21667270362377167, -0.5297717452049255, 0.156505286693573, 0.1038908138871193, 0.23297545313835144, 0.14835430681705475, -0.38041600584983826, 0.4363081157207489, 0.38138219714164734, -0.2455042004585266, -0.00739235058426857, 0.24761603772640228, 0.12665292620658875, -0.1769406497478485, 0.04409206658601761, 0.08960215747356415, 0.14479301869869232, 0.20773687958717346, 0.07156488299369812, -0.21594277024269104, 0.08686158061027527, 0.2860738933086395, 0.2732737958431244, 0.07636980712413788, 0.3911069631576538, 0.21343255043029785, -0.4520672857761383, -0.11640594899654388, -0.048568714410066605, -0.2897109091281891, -0.09824395924806595, -0.19775106012821198, -0.18843644857406616, 0.2767432928085327, 0.27121904492378235, 0.07117752730846405, 0.004231452941894531, 0.31944921612739563, -0.04779042676091194, -0.02926161140203476, -0.3746752142906189, -0.12751221656799316, -0.27915728092193604, 0.32509565353393555, -0.2699539065361023, 0.10542768985033035, -0.0173335000872612, -0.0552930012345314, 0.21486370265483856, 0.24951855838298798, 0.06450124830007553, -0.07514569908380508, 0.025382712483406067, -0.0024424074217677116, -0.33790111541748047, -0.07668809592723846, -0.017150525003671646, -0.35101258754730225, 0.3703460097312927, -0.32037490606307983, 0.17487429082393646, -0.1425074189901352, 0.11114965379238129, -0.29193735122680664, -0.23317265510559082, -0.20378701388835907, 0.5523321628570557, 0.5109078884124756, 0.3643907904624939, 0.33621108531951904, -0.26991838216781616, -0.0420556515455246, -0.029240518808364868, 0.2943665385246277, 0.032185617834329605, 0.23681405186653137, 0.06424251198768616, 0.15267232060432434, -0.29570358991622925, -0.04466063156723976, -0.014804599806666374, 0.08666982501745224, 0.08521910011768341, 0.18400874733924866, -0.08166524767875671, 0.08961443603038788, -0.07193498313426971, -0.16079667210578918, -0.32563135027885437, 0.07816280424594879, 0.17894752323627472, 0.04868631064891815, 0.13268879055976868, -0.24243491888046265, 0.34810590744018555, -0.08891502022743225, -0.1930660456418991, -0.05740094557404518, 0.4842178225517273, -0.5355758666992188, -0.18964602053165436, -0.2899770140647888, -0.3215556740760803, 0.39055103063583374, 0.1285020262002945, -0.6274672150611877, 0.003108493983745575, -0.4448772072792053, -0.3342164158821106, -0.01826496422290802, -0.01057320088148117, 0.15106350183486938, -0.10546151548624039, 0.2709760069847107, -0.21396592259407043 ]
https://github.com/huggingface/datasets/issues/5817
I've got `multiprocess` version `0.70.14`. I've done some more testing and the error only occurs in PyCharm's Python Console. It seems to be [this PyCharm bug](https://youtrack.jetbrains.com/issue/PY-51922/Multiprocessing-bug.-Can-only-run-in-debugger.), I'll close this.
Setting `num_proc` errors when `.map` returns additional items.
### Describe the bug I'm using a map function that returns more rows than are passed in. If I try to use `num_proc` I get: ``` File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 563, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 528, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in iflatmap_unordered( File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1372, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 391, in _recv raise EOFError EOFError ``` ### Steps to reproduce the bug This is copied from the [Datasets docs](https://huggingface.co/docs/datasets/v2.12.0/en/process#batch-processing), with `num_proc` added, and will error. ```py import datasets dataset = ... # any old dataset def chunk_examples(examples): chunks = [] for sentence in examples["text"]: chunks += [sentence[i : i + 50] for i in range(0, len(sentence), 50)] return {"chunks": chunks} chunked_dataset = dataset.map( chunk_examples, batched=True, remove_columns=dataset.column_names, num_proc=2, # Remove and it works ) ``` ### Expected behavior Should work fine. On a related note, multi-processing also fails if there is a Meta class anywhere in scope (and there are plenty in the standard library). This is the fault of `dill` and is a long standing issue. Have you considered using Loky for multiprocessing? I've found that the built-in `datasets` multi-processing breaks more than it works so have written my own function using `loky`, for reference: ```py import datasets import loky def fast_loop(dataset: datasets.Dataset, func, num_proc=None): if num_proc is None: import os num_proc = len(os.sched_getaffinity(0)) shards = [ dataset.shard(num_shards=num_proc, index=i, contiguous=True) for i in range(num_proc) ] executor = loky.get_reusable_executor(max_workers=num_proc) results = executor.map(func, shards) return datasets.combine.concatenate_datasets(list(results)) ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1
29
Setting `num_proc` errors when `.map` returns additional items. ### Describe the bug I'm using a map function that returns more rows than are passed in. If I try to use `num_proc` I get: ``` File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 563, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 528, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in iflatmap_unordered( File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1372, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 391, in _recv raise EOFError EOFError ``` ### Steps to reproduce the bug This is copied from the [Datasets docs](https://huggingface.co/docs/datasets/v2.12.0/en/process#batch-processing), with `num_proc` added, and will error. ```py import datasets dataset = ... # any old dataset def chunk_examples(examples): chunks = [] for sentence in examples["text"]: chunks += [sentence[i : i + 50] for i in range(0, len(sentence), 50)] return {"chunks": chunks} chunked_dataset = dataset.map( chunk_examples, batched=True, remove_columns=dataset.column_names, num_proc=2, # Remove and it works ) ``` ### Expected behavior Should work fine. On a related note, multi-processing also fails if there is a Meta class anywhere in scope (and there are plenty in the standard library). This is the fault of `dill` and is a long standing issue. Have you considered using Loky for multiprocessing? I've found that the built-in `datasets` multi-processing breaks more than it works so have written my own function using `loky`, for reference: ```py import datasets import loky def fast_loop(dataset: datasets.Dataset, func, num_proc=None): if num_proc is None: import os num_proc = len(os.sched_getaffinity(0)) shards = [ dataset.shard(num_shards=num_proc, index=i, contiguous=True) for i in range(num_proc) ] executor = loky.get_reusable_executor(max_workers=num_proc) results = executor.map(func, shards) return datasets.combine.concatenate_datasets(list(results)) ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 I've got `multiprocess` version `0.70.14`. I've done some more testing and the error only occurs in PyCharm's Python Console. It seems to be [this PyCharm bug](https://youtrack.jetbrains.com/issue/PY-51922/Multiprocessing-bug.-Can-only-run-in-debugger.), I'll close this.
[ 0.24224074184894562, -0.41235876083374023, -0.07637587189674377, 0.37606674432754517, 0.0636359453201294, -0.3487008810043335, -0.0032279640436172485, 0.3338972330093384, 0.023244023323059082, 0.30512771010398865, 0.4175057113170624, 0.4686207175254822, -0.2382592111825943, 0.15260010957717896, -0.07624384760856628, 0.3619661331176758, 0.06730867922306061, -0.07554703950881958, 0.43951690196990967, 0.13537341356277466, -0.5748607516288757, 0.4289441704750061, -0.22439438104629517, -0.17254436016082764, -0.16760556399822235, 0.1455993354320526, 0.051971614360809326, 0.2218014895915985, 0.16445830464363098, -0.32141754031181335, -0.11842072755098343, -0.43282607197761536, -0.08539356291294098, 0.3109798729419708, -0.00011485634604468942, -0.07343639433383942, -0.023738093674182892, -0.21344678103923798, 0.02389446645975113, -0.2386442869901657, -0.12986402213573456, -0.2159723937511444, -0.0569358691573143, -0.3214695453643799, -0.012033432722091675, 0.10651618242263794, -0.34043803811073303, -0.2789580225944519, -0.055710308253765106, 0.6855312585830688, 0.16761159896850586, 0.2789067029953003, 0.19426211714744568, -0.04732377082109451, 0.2217845916748047, -0.15288996696472168, 0.043224841356277466, 0.36690184473991394, 0.11861032247543335, 0.02005620300769806, 0.3217586278915405, 0.2206827700138092, -0.1281757801771164, 0.1811770796775818, 0.10133792459964752, 0.25618448853492737, 0.6905580759048462, -0.3305288553237915, 0.10739953815937042, -0.1390819251537323, -0.2660196125507355, 0.030855033546686172, 0.19868899881839752, -0.18628180027008057, -0.03858325630426407, -0.28144371509552, 0.09135794639587402, 0.0684412270784378, -0.15701264142990112, -0.05445440858602524, 0.028232164680957794, 0.13686509430408478, 0.14458855986595154, 0.2794165313243866, -0.14023998379707336, 0.17113694548606873, 0.05343104153871536, 0.35808637738227844, 0.47214823961257935, -0.07840559631586075, -0.1752568781375885, 0.19332027435302734, -0.0012059048749506474, 0.14240071177482605, 0.02773718163371086, -0.06798224151134491, 0.48782458901405334, 0.07145758718252182, -0.0028659701347351074, -0.1753230094909668, 0.2582513093948364, 0.14812850952148438, -0.1403244137763977, 0.22811099886894226, 0.13404840230941772, -0.12280680239200592, 0.2686443030834198, 0.5070664286613464, -0.24648872017860413, -0.13675007224082947, -0.02731819450855255, -0.022905796766281128, 0.3979395925998688, -0.1929904818534851, 0.17332366108894348, 0.45304474234580994, 0.15809306502342224, -0.24204488098621368, -0.0019216015934944153, 0.25668901205062866, -0.1228959932923317, 0.02593446522951126, 0.21336668729782104, 0.13120801746845245, 0.36965101957321167, 0.46975278854370117, -0.10693392902612686, -0.01990346796810627, -0.46097391843795776, -0.08964836597442627, -0.10818010568618774, 0.0380973294377327, -0.2865922152996063, 0.10773589462041855, 0.11481434851884842, -0.0031524673104286194, -0.0030431412160396576, -0.0641719326376915, 0.2768460512161255, -0.45988786220550537, -0.07618290185928345, -0.36918872594833374, 0.45203423500061035, 0.27176517248153687, -0.15843719244003296, -0.10818662494421005, 0.26117128133773804, -0.14424991607666016, -0.12316109240055084, 0.3534401059150696, -0.4958849847316742, -0.5573092103004456, -0.16478142142295837, 0.16103236377239227, 0.13298305869102478, 0.45709750056266785, -0.04721369221806526, 0.19473083317279816, 0.318670392036438, -0.5853917598724365, 0.022783420979976654, -0.4117061495780945, -0.530545711517334, -0.510227382183075, -0.15415143966674805, 0.21448850631713867, -0.013378895819187164, 0.1548386514186859, 0.20754258334636688, 0.18377509713172913, 0.2856627404689789, 0.15030068159103394, -0.1153963953256607, -0.059436071664094925, -0.2637633681297302, 0.18667767941951752, 0.19195295870304108, -0.12694711983203888, -0.49138209223747253, 0.02169114351272583, -0.18161624670028687, -0.09522756189107895, -0.052217744290828705, -0.08386444300413132, -0.03322991356253624, -0.27068108320236206, 0.5729301571846008, -0.25908640027046204, -0.09182962775230408, 0.0751100555062294, -0.29851508140563965, 0.25727659463882446, 0.2089892029762268, -0.21988335251808167, -0.09015031903982162, 0.10814473032951355, 0.13797421753406525, -0.5474519729614258, 0.19028766453266144, -0.01679370179772377, -0.09917914122343063, 0.09241136163473129, 0.12808378040790558, -0.021871991455554962, -0.08538515865802765, -0.1197054386138916, -0.2956763505935669, 0.13072733581066132, -0.5556293725967407, -0.010725272819399834, -0.21891260147094727, 0.04662773013114929, -0.025618601590394974, 0.09961733222007751, 0.15686166286468506, -0.08036640286445618, 0.10504242032766342, -0.0960710197687149, -0.01747451350092888, -0.20408448576927185, 0.14849801361560822, -0.06315737962722778, -0.027105238288640976, -0.08292631059885025, -0.2623387277126312, 0.36651498079299927, -0.11184436082839966, -0.35248443484306335, -0.28626230359077454, 0.3587793707847595, 0.5318778157234192, -0.004538878798484802, -0.01621614769101143, 0.29419606924057007, 0.31789782643318176, -0.4588382840156555, -0.37598466873168945, 0.07394903898239136, 0.27656880021095276, 0.093218594789505, -0.14448970556259155, 0.2459709346294403, 0.04277895763516426, -0.11832045018672943, -0.02306133136153221, 0.374442458152771, -0.03968901187181473, 0.20248180627822876, -0.10419923812150955, 0.019989654421806335, 0.14461475610733032, 0.18715032935142517, 0.04616273194551468, -0.4035787880420685, 0.1282813400030136, 0.6803484559059143, -0.174663245677948, -0.04776915907859802, 0.28156059980392456, 0.15790796279907227, 0.3505747318267822, 0.1374894082546234, 0.07009723782539368, -0.0283894594758749, 0.15776050090789795, -0.04141705855727196, 0.2771850526332855, -0.030257858335971832, 0.5697145462036133, 0.10072348266839981, -0.2297241985797882, -0.05999143421649933, -0.3036697804927826, -0.17851968109607697, -0.019168540835380554, 0.0440540611743927, 0.18813222646713257, 0.20513123273849487, 0.20995956659317017, -0.16907550394535065, 0.030392609536647797, -0.3038259744644165, -0.006851058453321457, 0.2147592306137085, -0.36886686086654663, -0.07850509881973267, -0.13343839347362518, 0.4167541563510895, -0.1742687225341797, -0.2700737416744232, -0.1383737474679947, -0.380878746509552, -0.00373679306358099, 0.169611856341362, -0.22442412376403809, -0.22967931628227234, -0.056924641132354736, -0.1923273801803589, 0.06871075928211212, 0.08729340881109238, 0.3149895966053009, -0.11100241541862488, -0.11557145416736603, -0.06737836450338364, -0.08857755362987518, -0.21879586577415466, 0.33120256662368774, 0.1969645768404007, -0.10498735308647156, 0.006672121584415436, -0.30558422207832336, 0.17208364605903625, -0.013564382679760456, -0.12298943847417831, -0.0024934038519859314, 0.018693577498197556, -0.029350414872169495, -0.17852634191513062, 0.30648502707481384, -0.2721499502658844, 0.22703412175178528, 0.250191867351532, 0.08627671748399734, -0.0650225579738617, -0.3334886431694031, -0.22559978067874908, -0.1632993370294571, -0.20076242089271545, 0.11502809822559357, 0.27068984508514404, 0.43322286009788513, -0.08106501400470734, 0.44581058621406555, 0.3190402388572693, 0.2722550630569458, -0.33839887380599976, -0.39015108346939087, 0.16965989768505096, 0.1238320916891098, -0.1633264720439911, -0.04678637161850929, -0.11409681290388107, 0.039580248296260834, -0.2223021686077118, 0.24327854812145233, -0.16807211935520172, -0.6237161755561829, 0.19949258863925934, 0.25715309381484985, -0.2906148433685303, -0.11274583637714386, 0.5605279803276062, 0.22127443552017212, -0.11106903851032257, -0.03592300042510033, -0.2797166109085083, 0.12179335951805115, 0.47141867876052856, 0.1491413414478302, 0.20946791768074036, 0.013248050585389137, 0.016340263187885284, 0.028208956122398376, 0.45901525020599365, -0.2112201452255249, 0.1808558702468872, -0.1596406102180481, 0.16968175768852234, 0.06936328858137131, -0.10740610957145691, -0.03500416502356529, -0.23699800670146942, 0.12782785296440125, 0.27542197704315186, 0.008021239191293716, -0.3034786581993103, -0.09352341294288635, 0.27659034729003906, -0.25921630859375, -0.31715643405914307, 0.1328602433204651, 0.005483515560626984, 0.23369848728179932, -0.1543847769498825, 0.18440914154052734, -0.4857298731803894, 0.0031875409185886383, -0.2928357720375061, -0.571464478969574, 0.05188827961683273, -0.1491982787847519, -0.3678826093673706, -0.39828625321388245, -0.4470686912536621, 0.6731699109077454, 0.4227455258369446, 0.016372807323932648, 0.1573392152786255, 0.006570413708686829, -0.057624511420726776, -0.01118980348110199, 0.6989369988441467, -0.3250543475151062, -0.07371079176664352, 0.027652211487293243, 0.28139162063598633, -0.3247980773448944, -0.0034092962741851807, -0.2616749405860901, 0.4991176724433899, 0.03102194145321846, 0.37756481766700745, -0.12290380150079727, 0.42553630471229553, 0.005531696602702141, -0.29713037610054016, 0.07537344098091125, -0.23158295452594757, -0.12256498634815216, -0.14941157400608063, -0.38048651814460754, 0.09343655407428741, 0.12371593713760376, 0.21292659640312195, 0.14262637495994568, -0.175542414188385, 0.6438823938369751, -0.2688509225845337, 0.11549217998981476, -0.15747395157814026, 0.4344140887260437, 0.3748031556606293, -0.24201619625091553, 0.32877299189567566, 0.04656006023287773, 0.16084438562393188, 0.4794711470603943, -0.2714574635028839, -0.04379168897867203, -0.037104181945323944, -0.3500891327857971, 0.1539604663848877, 0.26072365045547485, 0.12174083292484283, -0.003891497850418091, -0.13875535130500793, 0.3836859166622162, 0.15959571301937103, 0.055950820446014404, 0.16472068428993225, -0.09080520272254944, 0.06849220395088196, -0.08183027058839798, 0.11014890670776367, 0.0012786313891410828, -0.014055244624614716, 0.24445633590221405, -0.3659237027168274, -0.3396194875240326, 0.3311462998390198, 0.16665084660053253, 0.8520855903625488, 0.14329291880130768, -0.1268566995859146, -0.14394864439964294, -0.07468250393867493, 0.2583528757095337, -0.1586785763502121, 0.16006866097450256, -0.19449371099472046, -0.05282121151685715, -0.018136080354452133, -0.004085063934326172, -0.143638014793396, 0.20416322350502014, -0.3218264877796173, 0.2622624337673187, 0.07821275293827057, 0.15199801325798035, -0.08614003658294678, -0.07186096906661987, 0.37560662627220154, -0.1169726699590683, -0.21004636585712433, 0.06627689301967621, -0.12051906436681747, -0.2683928906917572, -0.11818921566009521, 0.19243663549423218, 0.09411859512329102, -0.5317253470420837, -0.17462235689163208, -0.03644229471683502, -0.5987056493759155, 0.32540491223335266, 0.38148385286331177, 0.011143848299980164, -0.3943959176540375, 0.19022727012634277, -0.24796906113624573, 0.18667972087860107, -0.1688135713338852, -0.4439546465873718, 0.5814927220344543, -0.006999857723712921, 0.10367397964000702, 0.037923164665699005, -0.009663858450949192, 0.05208580195903778, -0.2831087112426758, 0.23250454664230347, 0.012126382440328598, -0.26758289337158203, -0.5289586782455444, 0.25629350543022156, 0.24966174364089966, -0.11509495228528976, 0.10238960385322571, -0.06735679507255554, -0.38925471901893616, -0.09325427561998367, 0.054605334997177124, 0.011155880987644196, -0.23143930733203888, 0.3433046042919159, 0.0649464875459671, -0.43200263381004333, -0.018898069858551025, 0.34764182567596436, 0.058206457644701004, 0.012034319341182709, -0.040228892117738724, 0.039485663175582886, -0.11314420402050018, -0.14697548747062683, -0.16317489743232727, -0.31945064663887024, -0.16205841302871704, 0.1893444061279297, 0.21216273307800293, -0.04104636609554291, 0.1846875250339508, -0.01868848130106926, 0.10660217702388763, 0.348762571811676, -0.058150239288806915, -0.3954519033432007, -0.29545101523399353, -0.022067222744226456, -0.16138474643230438, 0.15897950530052185, 0.09262052178382874, 0.1523435413837433, 0.09196609258651733, 0.19726629555225372, -0.2881782650947571, -0.15197622776031494, -0.12325164675712585, 0.34456899762153625, 0.14036457240581512, -0.17183133959770203, -0.1082034707069397, 0.16744880378246307, 0.14611972868442535, 0.5503263473510742, -0.28109243512153625, -0.16345880925655365, 0.051105983555316925, 0.12557236850261688, 0.15720930695533752, -0.06686406582593918, -0.1814662665128708, -0.13371029496192932, 0.13466107845306396, -0.3512512445449829, -0.1586032509803772, 0.07544996589422226, 0.014599994756281376, 0.006603248417377472, 0.5441725850105286, 0.04113570600748062, 0.265067458152771, 0.3441685736179352, -0.29476043581962585, 0.12985415756702423, -0.06575855612754822, 0.22970309853553772, -0.09671033918857574, 0.09574086219072342, 0.09066098183393478, 0.08116663992404938, 0.11674870550632477, 0.11868223547935486, 0.16797947883605957, 0.02089579403400421, 0.1259884536266327, -0.05853481590747833, -0.03530983254313469, -0.0006956644356250763, -0.2806108891963959, 0.01902151107788086, -0.0010058246552944183, 0.17071257531642914, -0.1669299602508545, -0.18754777312278748, 0.2871575653553009, 0.3143708407878876, 0.11632968485355377, 0.4772007167339325, -0.0016383752226829529, -0.3936363458633423, 0.5358626842498779, 0.08815687894821167, -0.12167887389659882, -0.4921204447746277, -0.35066771507263184, 0.19920557737350464, -0.10765700787305832, -0.07562407106161118, 0.18568909168243408, -0.2984340786933899, 0.2868574261665344, 0.30692699551582336, 0.1362646371126175, 0.12960755825042725, 0.047802798449993134, -0.20149853825569153, 0.09733712673187256, -0.24320243299007416, -0.08116629719734192, 0.5970854163169861, -0.07326260209083557, 0.4555533230304718, 0.25148746371269226, 0.11828078329563141, -0.2693507671356201, 0.20633000135421753, 0.054103828966617584, 0.010392243042588234, -0.19875885546207428, 0.016975004225969315, -0.02615686133503914, -0.1028536856174469, -0.35768774151802063, -0.030504994094371796, 0.047222547233104706, -0.002102416008710861, 0.5765467286109924, 0.16604049503803253, -0.2493630051612854, 0.11994598060846329, -0.361240953207016, -0.19213944673538208, 0.21667270362377167, -0.5297717452049255, 0.156505286693573, 0.1038908138871193, 0.23297545313835144, 0.14835430681705475, -0.38041600584983826, 0.4363081157207489, 0.38138219714164734, -0.2455042004585266, -0.00739235058426857, 0.24761603772640228, 0.12665292620658875, -0.1769406497478485, 0.04409206658601761, 0.08960215747356415, 0.14479301869869232, 0.20773687958717346, 0.07156488299369812, -0.21594277024269104, 0.08686158061027527, 0.2860738933086395, 0.2732737958431244, 0.07636980712413788, 0.3911069631576538, 0.21343255043029785, -0.4520672857761383, -0.11640594899654388, -0.048568714410066605, -0.2897109091281891, -0.09824395924806595, -0.19775106012821198, -0.18843644857406616, 0.2767432928085327, 0.27121904492378235, 0.07117752730846405, 0.004231452941894531, 0.31944921612739563, -0.04779042676091194, -0.02926161140203476, -0.3746752142906189, -0.12751221656799316, -0.27915728092193604, 0.32509565353393555, -0.2699539065361023, 0.10542768985033035, -0.0173335000872612, -0.0552930012345314, 0.21486370265483856, 0.24951855838298798, 0.06450124830007553, -0.07514569908380508, 0.025382712483406067, -0.0024424074217677116, -0.33790111541748047, -0.07668809592723846, -0.017150525003671646, -0.35101258754730225, 0.3703460097312927, -0.32037490606307983, 0.17487429082393646, -0.1425074189901352, 0.11114965379238129, -0.29193735122680664, -0.23317265510559082, -0.20378701388835907, 0.5523321628570557, 0.5109078884124756, 0.3643907904624939, 0.33621108531951904, -0.26991838216781616, -0.0420556515455246, -0.029240518808364868, 0.2943665385246277, 0.032185617834329605, 0.23681405186653137, 0.06424251198768616, 0.15267232060432434, -0.29570358991622925, -0.04466063156723976, -0.014804599806666374, 0.08666982501745224, 0.08521910011768341, 0.18400874733924866, -0.08166524767875671, 0.08961443603038788, -0.07193498313426971, -0.16079667210578918, -0.32563135027885437, 0.07816280424594879, 0.17894752323627472, 0.04868631064891815, 0.13268879055976868, -0.24243491888046265, 0.34810590744018555, -0.08891502022743225, -0.1930660456418991, -0.05740094557404518, 0.4842178225517273, -0.5355758666992188, -0.18964602053165436, -0.2899770140647888, -0.3215556740760803, 0.39055103063583374, 0.1285020262002945, -0.6274672150611877, 0.003108493983745575, -0.4448772072792053, -0.3342164158821106, -0.01826496422290802, -0.01057320088148117, 0.15106350183486938, -0.10546151548624039, 0.2709760069847107, -0.21396592259407043 ]
https://github.com/huggingface/datasets/issues/5817
For other users facing this, my workaround is to conditionally set `num_proc` so I can work interactively in the PyCharm Python Console while developing, then when I'm ready to run on the whole dataset, run it as a script and use multiprocessing. ```py mapped_ds = ds.map( my_map_function, batched=True, remove_columns=ds.column_names, num_proc=1 if "PYCHARM_HOSTED" in os.environ else 8, ) ```
Setting `num_proc` errors when `.map` returns additional items.
### Describe the bug I'm using a map function that returns more rows than are passed in. If I try to use `num_proc` I get: ``` File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 563, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 528, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in iflatmap_unordered( File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1372, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 391, in _recv raise EOFError EOFError ``` ### Steps to reproduce the bug This is copied from the [Datasets docs](https://huggingface.co/docs/datasets/v2.12.0/en/process#batch-processing), with `num_proc` added, and will error. ```py import datasets dataset = ... # any old dataset def chunk_examples(examples): chunks = [] for sentence in examples["text"]: chunks += [sentence[i : i + 50] for i in range(0, len(sentence), 50)] return {"chunks": chunks} chunked_dataset = dataset.map( chunk_examples, batched=True, remove_columns=dataset.column_names, num_proc=2, # Remove and it works ) ``` ### Expected behavior Should work fine. On a related note, multi-processing also fails if there is a Meta class anywhere in scope (and there are plenty in the standard library). This is the fault of `dill` and is a long standing issue. Have you considered using Loky for multiprocessing? I've found that the built-in `datasets` multi-processing breaks more than it works so have written my own function using `loky`, for reference: ```py import datasets import loky def fast_loop(dataset: datasets.Dataset, func, num_proc=None): if num_proc is None: import os num_proc = len(os.sched_getaffinity(0)) shards = [ dataset.shard(num_shards=num_proc, index=i, contiguous=True) for i in range(num_proc) ] executor = loky.get_reusable_executor(max_workers=num_proc) results = executor.map(func, shards) return datasets.combine.concatenate_datasets(list(results)) ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1
58
Setting `num_proc` errors when `.map` returns additional items. ### Describe the bug I'm using a map function that returns more rows than are passed in. If I try to use `num_proc` I get: ``` File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 563, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 528, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in iflatmap_unordered( File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1372, in iflatmap_unordered yield queue.get(timeout=0.05) File "<string>", line 2, in get File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/managers.py", line 818, in _callmethod kind, result = conn.recv() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 258, in recv buf = self._recv_bytes() File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 422, in _recv_bytes buf = self._recv(4) File "/home/davidg/.virtualenvs/learning/lib/python3.10/site-packages/multiprocess/connection.py", line 391, in _recv raise EOFError EOFError ``` ### Steps to reproduce the bug This is copied from the [Datasets docs](https://huggingface.co/docs/datasets/v2.12.0/en/process#batch-processing), with `num_proc` added, and will error. ```py import datasets dataset = ... # any old dataset def chunk_examples(examples): chunks = [] for sentence in examples["text"]: chunks += [sentence[i : i + 50] for i in range(0, len(sentence), 50)] return {"chunks": chunks} chunked_dataset = dataset.map( chunk_examples, batched=True, remove_columns=dataset.column_names, num_proc=2, # Remove and it works ) ``` ### Expected behavior Should work fine. On a related note, multi-processing also fails if there is a Meta class anywhere in scope (and there are plenty in the standard library). This is the fault of `dill` and is a long standing issue. Have you considered using Loky for multiprocessing? I've found that the built-in `datasets` multi-processing breaks more than it works so have written my own function using `loky`, for reference: ```py import datasets import loky def fast_loop(dataset: datasets.Dataset, func, num_proc=None): if num_proc is None: import os num_proc = len(os.sched_getaffinity(0)) shards = [ dataset.shard(num_shards=num_proc, index=i, contiguous=True) for i in range(num_proc) ] executor = loky.get_reusable_executor(max_workers=num_proc) results = executor.map(func, shards) return datasets.combine.concatenate_datasets(list(results)) ``` ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 - Python version: 3.10.8 - Huggingface_hub version: 0.12.1 - PyArrow version: 11.0.0 - Pandas version: 2.0.1 For other users facing this, my workaround is to conditionally set `num_proc` so I can work interactively in the PyCharm Python Console while developing, then when I'm ready to run on the whole dataset, run it as a script and use multiprocessing. ```py mapped_ds = ds.map( my_map_function, batched=True, remove_columns=ds.column_names, num_proc=1 if "PYCHARM_HOSTED" in os.environ else 8, ) ```
[ 0.24224074184894562, -0.41235876083374023, -0.07637587189674377, 0.37606674432754517, 0.0636359453201294, -0.3487008810043335, -0.0032279640436172485, 0.3338972330093384, 0.023244023323059082, 0.30512771010398865, 0.4175057113170624, 0.4686207175254822, -0.2382592111825943, 0.15260010957717896, -0.07624384760856628, 0.3619661331176758, 0.06730867922306061, -0.07554703950881958, 0.43951690196990967, 0.13537341356277466, -0.5748607516288757, 0.4289441704750061, -0.22439438104629517, -0.17254436016082764, -0.16760556399822235, 0.1455993354320526, 0.051971614360809326, 0.2218014895915985, 0.16445830464363098, -0.32141754031181335, -0.11842072755098343, -0.43282607197761536, -0.08539356291294098, 0.3109798729419708, -0.00011485634604468942, -0.07343639433383942, -0.023738093674182892, -0.21344678103923798, 0.02389446645975113, -0.2386442869901657, -0.12986402213573456, -0.2159723937511444, -0.0569358691573143, -0.3214695453643799, -0.012033432722091675, 0.10651618242263794, -0.34043803811073303, -0.2789580225944519, -0.055710308253765106, 0.6855312585830688, 0.16761159896850586, 0.2789067029953003, 0.19426211714744568, -0.04732377082109451, 0.2217845916748047, -0.15288996696472168, 0.043224841356277466, 0.36690184473991394, 0.11861032247543335, 0.02005620300769806, 0.3217586278915405, 0.2206827700138092, -0.1281757801771164, 0.1811770796775818, 0.10133792459964752, 0.25618448853492737, 0.6905580759048462, -0.3305288553237915, 0.10739953815937042, -0.1390819251537323, -0.2660196125507355, 0.030855033546686172, 0.19868899881839752, -0.18628180027008057, -0.03858325630426407, -0.28144371509552, 0.09135794639587402, 0.0684412270784378, -0.15701264142990112, -0.05445440858602524, 0.028232164680957794, 0.13686509430408478, 0.14458855986595154, 0.2794165313243866, -0.14023998379707336, 0.17113694548606873, 0.05343104153871536, 0.35808637738227844, 0.47214823961257935, -0.07840559631586075, -0.1752568781375885, 0.19332027435302734, -0.0012059048749506474, 0.14240071177482605, 0.02773718163371086, -0.06798224151134491, 0.48782458901405334, 0.07145758718252182, -0.0028659701347351074, -0.1753230094909668, 0.2582513093948364, 0.14812850952148438, -0.1403244137763977, 0.22811099886894226, 0.13404840230941772, -0.12280680239200592, 0.2686443030834198, 0.5070664286613464, -0.24648872017860413, -0.13675007224082947, -0.02731819450855255, -0.022905796766281128, 0.3979395925998688, -0.1929904818534851, 0.17332366108894348, 0.45304474234580994, 0.15809306502342224, -0.24204488098621368, -0.0019216015934944153, 0.25668901205062866, -0.1228959932923317, 0.02593446522951126, 0.21336668729782104, 0.13120801746845245, 0.36965101957321167, 0.46975278854370117, -0.10693392902612686, -0.01990346796810627, -0.46097391843795776, -0.08964836597442627, -0.10818010568618774, 0.0380973294377327, -0.2865922152996063, 0.10773589462041855, 0.11481434851884842, -0.0031524673104286194, -0.0030431412160396576, -0.0641719326376915, 0.2768460512161255, -0.45988786220550537, -0.07618290185928345, -0.36918872594833374, 0.45203423500061035, 0.27176517248153687, -0.15843719244003296, -0.10818662494421005, 0.26117128133773804, -0.14424991607666016, -0.12316109240055084, 0.3534401059150696, -0.4958849847316742, -0.5573092103004456, -0.16478142142295837, 0.16103236377239227, 0.13298305869102478, 0.45709750056266785, -0.04721369221806526, 0.19473083317279816, 0.318670392036438, -0.5853917598724365, 0.022783420979976654, -0.4117061495780945, -0.530545711517334, -0.510227382183075, -0.15415143966674805, 0.21448850631713867, -0.013378895819187164, 0.1548386514186859, 0.20754258334636688, 0.18377509713172913, 0.2856627404689789, 0.15030068159103394, -0.1153963953256607, -0.059436071664094925, -0.2637633681297302, 0.18667767941951752, 0.19195295870304108, -0.12694711983203888, -0.49138209223747253, 0.02169114351272583, -0.18161624670028687, -0.09522756189107895, -0.052217744290828705, -0.08386444300413132, -0.03322991356253624, -0.27068108320236206, 0.5729301571846008, -0.25908640027046204, -0.09182962775230408, 0.0751100555062294, -0.29851508140563965, 0.25727659463882446, 0.2089892029762268, -0.21988335251808167, -0.09015031903982162, 0.10814473032951355, 0.13797421753406525, -0.5474519729614258, 0.19028766453266144, -0.01679370179772377, -0.09917914122343063, 0.09241136163473129, 0.12808378040790558, -0.021871991455554962, -0.08538515865802765, -0.1197054386138916, -0.2956763505935669, 0.13072733581066132, -0.5556293725967407, -0.010725272819399834, -0.21891260147094727, 0.04662773013114929, -0.025618601590394974, 0.09961733222007751, 0.15686166286468506, -0.08036640286445618, 0.10504242032766342, -0.0960710197687149, -0.01747451350092888, -0.20408448576927185, 0.14849801361560822, -0.06315737962722778, -0.027105238288640976, -0.08292631059885025, -0.2623387277126312, 0.36651498079299927, -0.11184436082839966, -0.35248443484306335, -0.28626230359077454, 0.3587793707847595, 0.5318778157234192, -0.004538878798484802, -0.01621614769101143, 0.29419606924057007, 0.31789782643318176, -0.4588382840156555, -0.37598466873168945, 0.07394903898239136, 0.27656880021095276, 0.093218594789505, -0.14448970556259155, 0.2459709346294403, 0.04277895763516426, -0.11832045018672943, -0.02306133136153221, 0.374442458152771, -0.03968901187181473, 0.20248180627822876, -0.10419923812150955, 0.019989654421806335, 0.14461475610733032, 0.18715032935142517, 0.04616273194551468, -0.4035787880420685, 0.1282813400030136, 0.6803484559059143, -0.174663245677948, -0.04776915907859802, 0.28156059980392456, 0.15790796279907227, 0.3505747318267822, 0.1374894082546234, 0.07009723782539368, -0.0283894594758749, 0.15776050090789795, -0.04141705855727196, 0.2771850526332855, -0.030257858335971832, 0.5697145462036133, 0.10072348266839981, -0.2297241985797882, -0.05999143421649933, -0.3036697804927826, -0.17851968109607697, -0.019168540835380554, 0.0440540611743927, 0.18813222646713257, 0.20513123273849487, 0.20995956659317017, -0.16907550394535065, 0.030392609536647797, -0.3038259744644165, -0.006851058453321457, 0.2147592306137085, -0.36886686086654663, -0.07850509881973267, -0.13343839347362518, 0.4167541563510895, -0.1742687225341797, -0.2700737416744232, -0.1383737474679947, -0.380878746509552, -0.00373679306358099, 0.169611856341362, -0.22442412376403809, -0.22967931628227234, -0.056924641132354736, -0.1923273801803589, 0.06871075928211212, 0.08729340881109238, 0.3149895966053009, -0.11100241541862488, -0.11557145416736603, -0.06737836450338364, -0.08857755362987518, -0.21879586577415466, 0.33120256662368774, 0.1969645768404007, -0.10498735308647156, 0.006672121584415436, -0.30558422207832336, 0.17208364605903625, -0.013564382679760456, -0.12298943847417831, -0.0024934038519859314, 0.018693577498197556, -0.029350414872169495, -0.17852634191513062, 0.30648502707481384, -0.2721499502658844, 0.22703412175178528, 0.250191867351532, 0.08627671748399734, -0.0650225579738617, -0.3334886431694031, -0.22559978067874908, -0.1632993370294571, -0.20076242089271545, 0.11502809822559357, 0.27068984508514404, 0.43322286009788513, -0.08106501400470734, 0.44581058621406555, 0.3190402388572693, 0.2722550630569458, -0.33839887380599976, -0.39015108346939087, 0.16965989768505096, 0.1238320916891098, -0.1633264720439911, -0.04678637161850929, -0.11409681290388107, 0.039580248296260834, -0.2223021686077118, 0.24327854812145233, -0.16807211935520172, -0.6237161755561829, 0.19949258863925934, 0.25715309381484985, -0.2906148433685303, -0.11274583637714386, 0.5605279803276062, 0.22127443552017212, -0.11106903851032257, -0.03592300042510033, -0.2797166109085083, 0.12179335951805115, 0.47141867876052856, 0.1491413414478302, 0.20946791768074036, 0.013248050585389137, 0.016340263187885284, 0.028208956122398376, 0.45901525020599365, -0.2112201452255249, 0.1808558702468872, -0.1596406102180481, 0.16968175768852234, 0.06936328858137131, -0.10740610957145691, -0.03500416502356529, -0.23699800670146942, 0.12782785296440125, 0.27542197704315186, 0.008021239191293716, -0.3034786581993103, -0.09352341294288635, 0.27659034729003906, -0.25921630859375, -0.31715643405914307, 0.1328602433204651, 0.005483515560626984, 0.23369848728179932, -0.1543847769498825, 0.18440914154052734, -0.4857298731803894, 0.0031875409185886383, -0.2928357720375061, -0.571464478969574, 0.05188827961683273, -0.1491982787847519, -0.3678826093673706, -0.39828625321388245, -0.4470686912536621, 0.6731699109077454, 0.4227455258369446, 0.016372807323932648, 0.1573392152786255, 0.006570413708686829, -0.057624511420726776, -0.01118980348110199, 0.6989369988441467, -0.3250543475151062, -0.07371079176664352, 0.027652211487293243, 0.28139162063598633, -0.3247980773448944, -0.0034092962741851807, -0.2616749405860901, 0.4991176724433899, 0.03102194145321846, 0.37756481766700745, -0.12290380150079727, 0.42553630471229553, 0.005531696602702141, -0.29713037610054016, 0.07537344098091125, -0.23158295452594757, -0.12256498634815216, -0.14941157400608063, -0.38048651814460754, 0.09343655407428741, 0.12371593713760376, 0.21292659640312195, 0.14262637495994568, -0.175542414188385, 0.6438823938369751, -0.2688509225845337, 0.11549217998981476, -0.15747395157814026, 0.4344140887260437, 0.3748031556606293, -0.24201619625091553, 0.32877299189567566, 0.04656006023287773, 0.16084438562393188, 0.4794711470603943, -0.2714574635028839, -0.04379168897867203, -0.037104181945323944, -0.3500891327857971, 0.1539604663848877, 0.26072365045547485, 0.12174083292484283, -0.003891497850418091, -0.13875535130500793, 0.3836859166622162, 0.15959571301937103, 0.055950820446014404, 0.16472068428993225, -0.09080520272254944, 0.06849220395088196, -0.08183027058839798, 0.11014890670776367, 0.0012786313891410828, -0.014055244624614716, 0.24445633590221405, -0.3659237027168274, -0.3396194875240326, 0.3311462998390198, 0.16665084660053253, 0.8520855903625488, 0.14329291880130768, -0.1268566995859146, -0.14394864439964294, -0.07468250393867493, 0.2583528757095337, -0.1586785763502121, 0.16006866097450256, -0.19449371099472046, -0.05282121151685715, -0.018136080354452133, -0.004085063934326172, -0.143638014793396, 0.20416322350502014, -0.3218264877796173, 0.2622624337673187, 0.07821275293827057, 0.15199801325798035, -0.08614003658294678, -0.07186096906661987, 0.37560662627220154, -0.1169726699590683, -0.21004636585712433, 0.06627689301967621, -0.12051906436681747, -0.2683928906917572, -0.11818921566009521, 0.19243663549423218, 0.09411859512329102, -0.5317253470420837, -0.17462235689163208, -0.03644229471683502, -0.5987056493759155, 0.32540491223335266, 0.38148385286331177, 0.011143848299980164, -0.3943959176540375, 0.19022727012634277, -0.24796906113624573, 0.18667972087860107, -0.1688135713338852, -0.4439546465873718, 0.5814927220344543, -0.006999857723712921, 0.10367397964000702, 0.037923164665699005, -0.009663858450949192, 0.05208580195903778, -0.2831087112426758, 0.23250454664230347, 0.012126382440328598, -0.26758289337158203, -0.5289586782455444, 0.25629350543022156, 0.24966174364089966, -0.11509495228528976, 0.10238960385322571, -0.06735679507255554, -0.38925471901893616, -0.09325427561998367, 0.054605334997177124, 0.011155880987644196, -0.23143930733203888, 0.3433046042919159, 0.0649464875459671, -0.43200263381004333, -0.018898069858551025, 0.34764182567596436, 0.058206457644701004, 0.012034319341182709, -0.040228892117738724, 0.039485663175582886, -0.11314420402050018, -0.14697548747062683, -0.16317489743232727, -0.31945064663887024, -0.16205841302871704, 0.1893444061279297, 0.21216273307800293, -0.04104636609554291, 0.1846875250339508, -0.01868848130106926, 0.10660217702388763, 0.348762571811676, -0.058150239288806915, -0.3954519033432007, -0.29545101523399353, -0.022067222744226456, -0.16138474643230438, 0.15897950530052185, 0.09262052178382874, 0.1523435413837433, 0.09196609258651733, 0.19726629555225372, -0.2881782650947571, -0.15197622776031494, -0.12325164675712585, 0.34456899762153625, 0.14036457240581512, -0.17183133959770203, -0.1082034707069397, 0.16744880378246307, 0.14611972868442535, 0.5503263473510742, -0.28109243512153625, -0.16345880925655365, 0.051105983555316925, 0.12557236850261688, 0.15720930695533752, -0.06686406582593918, -0.1814662665128708, -0.13371029496192932, 0.13466107845306396, -0.3512512445449829, -0.1586032509803772, 0.07544996589422226, 0.014599994756281376, 0.006603248417377472, 0.5441725850105286, 0.04113570600748062, 0.265067458152771, 0.3441685736179352, -0.29476043581962585, 0.12985415756702423, -0.06575855612754822, 0.22970309853553772, -0.09671033918857574, 0.09574086219072342, 0.09066098183393478, 0.08116663992404938, 0.11674870550632477, 0.11868223547935486, 0.16797947883605957, 0.02089579403400421, 0.1259884536266327, -0.05853481590747833, -0.03530983254313469, -0.0006956644356250763, -0.2806108891963959, 0.01902151107788086, -0.0010058246552944183, 0.17071257531642914, -0.1669299602508545, -0.18754777312278748, 0.2871575653553009, 0.3143708407878876, 0.11632968485355377, 0.4772007167339325, -0.0016383752226829529, -0.3936363458633423, 0.5358626842498779, 0.08815687894821167, -0.12167887389659882, -0.4921204447746277, -0.35066771507263184, 0.19920557737350464, -0.10765700787305832, -0.07562407106161118, 0.18568909168243408, -0.2984340786933899, 0.2868574261665344, 0.30692699551582336, 0.1362646371126175, 0.12960755825042725, 0.047802798449993134, -0.20149853825569153, 0.09733712673187256, -0.24320243299007416, -0.08116629719734192, 0.5970854163169861, -0.07326260209083557, 0.4555533230304718, 0.25148746371269226, 0.11828078329563141, -0.2693507671356201, 0.20633000135421753, 0.054103828966617584, 0.010392243042588234, -0.19875885546207428, 0.016975004225969315, -0.02615686133503914, -0.1028536856174469, -0.35768774151802063, -0.030504994094371796, 0.047222547233104706, -0.002102416008710861, 0.5765467286109924, 0.16604049503803253, -0.2493630051612854, 0.11994598060846329, -0.361240953207016, -0.19213944673538208, 0.21667270362377167, -0.5297717452049255, 0.156505286693573, 0.1038908138871193, 0.23297545313835144, 0.14835430681705475, -0.38041600584983826, 0.4363081157207489, 0.38138219714164734, -0.2455042004585266, -0.00739235058426857, 0.24761603772640228, 0.12665292620658875, -0.1769406497478485, 0.04409206658601761, 0.08960215747356415, 0.14479301869869232, 0.20773687958717346, 0.07156488299369812, -0.21594277024269104, 0.08686158061027527, 0.2860738933086395, 0.2732737958431244, 0.07636980712413788, 0.3911069631576538, 0.21343255043029785, -0.4520672857761383, -0.11640594899654388, -0.048568714410066605, -0.2897109091281891, -0.09824395924806595, -0.19775106012821198, -0.18843644857406616, 0.2767432928085327, 0.27121904492378235, 0.07117752730846405, 0.004231452941894531, 0.31944921612739563, -0.04779042676091194, -0.02926161140203476, -0.3746752142906189, -0.12751221656799316, -0.27915728092193604, 0.32509565353393555, -0.2699539065361023, 0.10542768985033035, -0.0173335000872612, -0.0552930012345314, 0.21486370265483856, 0.24951855838298798, 0.06450124830007553, -0.07514569908380508, 0.025382712483406067, -0.0024424074217677116, -0.33790111541748047, -0.07668809592723846, -0.017150525003671646, -0.35101258754730225, 0.3703460097312927, -0.32037490606307983, 0.17487429082393646, -0.1425074189901352, 0.11114965379238129, -0.29193735122680664, -0.23317265510559082, -0.20378701388835907, 0.5523321628570557, 0.5109078884124756, 0.3643907904624939, 0.33621108531951904, -0.26991838216781616, -0.0420556515455246, -0.029240518808364868, 0.2943665385246277, 0.032185617834329605, 0.23681405186653137, 0.06424251198768616, 0.15267232060432434, -0.29570358991622925, -0.04466063156723976, -0.014804599806666374, 0.08666982501745224, 0.08521910011768341, 0.18400874733924866, -0.08166524767875671, 0.08961443603038788, -0.07193498313426971, -0.16079667210578918, -0.32563135027885437, 0.07816280424594879, 0.17894752323627472, 0.04868631064891815, 0.13268879055976868, -0.24243491888046265, 0.34810590744018555, -0.08891502022743225, -0.1930660456418991, -0.05740094557404518, 0.4842178225517273, -0.5355758666992188, -0.18964602053165436, -0.2899770140647888, -0.3215556740760803, 0.39055103063583374, 0.1285020262002945, -0.6274672150611877, 0.003108493983745575, -0.4448772072792053, -0.3342164158821106, -0.01826496422290802, -0.01057320088148117, 0.15106350183486938, -0.10546151548624039, 0.2709760069847107, -0.21396592259407043 ]
https://github.com/huggingface/datasets/issues/5815
Hi @hrbigelow , I'm no expert for such a question so I'll ping @lhoestq from the `datasets` library (also this issue could be moved there if someone with permission can do it :) )
Easy way to create a Kaggle dataset from a Huggingface dataset?
I'm not sure whether this is more appropriately addressed with HuggingFace or Kaggle. I would like to somehow directly create a Kaggle dataset from a HuggingFace Dataset. While Kaggle does provide the option to create a dataset from a URI, that URI must point to a single file. For example: ![image](https://user-images.githubusercontent.com/5355286/235792394-7c559d07-4aff-45b7-ad2b-9c5280c88415.png) Is there some mechanism from huggingface to represent a dataset (such as that from `load_dataset('wmt14', 'de-en', split='train')` as a single file? Or, some other way to get that into a Kaggle dataset so that I can use the huggingface `datasets` module to process and consume it inside of a Kaggle notebook? Thanks in advance!
34
Easy way to create a Kaggle dataset from a Huggingface dataset? I'm not sure whether this is more appropriately addressed with HuggingFace or Kaggle. I would like to somehow directly create a Kaggle dataset from a HuggingFace Dataset. While Kaggle does provide the option to create a dataset from a URI, that URI must point to a single file. For example: ![image](https://user-images.githubusercontent.com/5355286/235792394-7c559d07-4aff-45b7-ad2b-9c5280c88415.png) Is there some mechanism from huggingface to represent a dataset (such as that from `load_dataset('wmt14', 'de-en', split='train')` as a single file? Or, some other way to get that into a Kaggle dataset so that I can use the huggingface `datasets` module to process and consume it inside of a Kaggle notebook? Thanks in advance! Hi @hrbigelow , I'm no expert for such a question so I'll ping @lhoestq from the `datasets` library (also this issue could be moved there if someone with permission can do it :) )
[ -0.06938397884368896, -0.46260684728622437, 0.07999630272388458, 0.14770963788032532, 0.29280203580856323, 0.1902616173028946, -0.006398454308509827, 0.14528387784957886, 0.09063258767127991, 0.10242429375648499, -0.20503051578998566, 0.23473498225212097, -0.21115469932556152, 0.7492237091064453, 0.42023172974586487, -0.11405278742313385, 0.2373056858778, -0.08937831223011017, 0.013372411951422691, 0.11419911682605743, 0.17086833715438843, -0.05533609539270401, 0.29012149572372437, -0.05848407372832298, -0.36170321702957153, -0.18423043191432953, -0.3221827745437622, 0.07035627961158752, -0.3191441595554352, -0.02218281477689743, 0.5626399517059326, -0.13221219182014465, 0.1541493982076645, 0.15780672430992126, -0.00011915267532458529, -0.10617770254611969, -0.03885318338871002, -0.21477949619293213, -0.1939748078584671, 0.06611260026693344, -0.2466292679309845, -0.3090112507343292, 0.19568899273872375, -0.06990726292133331, 0.20120808482170105, -0.1281312257051468, 0.15416601300239563, -0.2124347984790802, 0.6252847909927368, -0.06305297464132309, 0.07680150121450424, -0.04734573885798454, 0.011181190609931946, -0.027905084192752838, -0.004631098359823227, 0.41928449273109436, -0.2363368272781372, 0.30051055550575256, -0.020285990089178085, 0.015325643122196198, 0.18413525819778442, -0.02031329646706581, -0.05978024750947952, -0.23584714531898499, 0.5020567178726196, 0.18525734543800354, -0.35856127738952637, -0.38655081391334534, -0.005390005651861429, 0.4919867515563965, 0.30926841497421265, -0.4876459836959839, -0.6226426362991333, -0.3901837170124054, 0.10919608175754547, 0.11093650013208389, 0.001629423350095749, 0.5868263244628906, -0.15838876366615295, 0.0691797137260437, -0.0772307813167572, -0.43431201577186584, -0.08692601323127747, -0.06310653686523438, -0.07868604362010956, -0.07302531599998474, 0.031174149364233017, -0.010758418589830399, 0.383071631193161, 0.006754289381206036, -0.018903711810708046, -0.09398912638425827, 0.009622757323086262, 0.35467174649238586, -0.2905162274837494, -0.09395238757133484, -0.41567546129226685, 0.26434004306793213, 0.5495385527610779, 0.22346991300582886, 0.005136530846357346, -0.07134103029966354, -0.33700141310691833, -0.015952231362462044, 0.21638529002666473, 0.30263224244117737, 0.024823728948831558, -0.23329877853393555, 0.12789955735206604, 0.06351935118436813, 0.2437901496887207, -0.10353286564350128, -0.15257234871387482, -0.06622600555419922, -0.27046430110931396, -0.3533605635166168, -0.05761483311653137, 0.17658531665802002, -0.14739719033241272, -0.21627868711948395, -0.18993692100048065, 0.19581347703933716, -0.18335884809494019, 0.10783439874649048, -0.07473372668027878, 0.1781643182039261, 0.15642407536506653, 0.40913844108581543, -0.08137685805559158, -0.11987179517745972, -0.02399439364671707, 0.24156098067760468, 0.14843447506427765, 0.4370592534542084, -0.24024897813796997, -0.5184673070907593, 0.11757560074329376, 0.17556871473789215, 0.3095874786376953, -0.1841389536857605, 0.12200304865837097, 0.11561471223831177, -0.2528030574321747, 0.02761555090546608, 0.31862518191337585, 0.12167806923389435, 0.14889255166053772, -0.3639495372772217, -0.2028215080499649, -0.16625531017780304, 0.032748375087976456, -0.1256997287273407, 0.053292758762836456, 0.026587992906570435, -0.21422520279884338, 0.17957383394241333, -0.4936702251434326, 0.30109354853630066, -0.07994848489761353, 0.1324613392353058, -0.1102600172162056, 0.338528037071228, -0.06999564915895462, -0.24789759516716003, 0.433266282081604, 0.24302369356155396, 0.05781453102827072, -0.23623289167881012, 0.15565285086631775, -0.30691656470298767, -0.17235350608825684, 0.3528469502925873, 0.0005469582974910736, 0.3466392159461975, -0.19635337591171265, 0.1483515202999115, 0.2224753051996231, -0.25767993927001953, -0.07929852604866028, 0.30396339297294617, -0.26703882217407227, 0.1843331754207611, 0.02429770864546299, 0.3650245666503906, 0.030801955610513687, 0.13231894373893738, 0.16147692501544952, 0.16828298568725586, -0.16724805533885956, -0.02514851838350296, 0.0963023379445076, -0.6012470722198486, -0.02169889025390148, 0.04533156007528305, -0.3797945976257324, 0.010267026722431183, -0.15549638867378235, 0.05684489384293556, 0.4496419131755829, -0.14255686104297638, 0.18875668942928314, 0.01645682007074356, 0.16086718440055847, 0.0926409363746643, -0.33843913674354553, -0.007419794797897339, -0.3611930310726166, 0.14432743191719055, -0.13967767357826233, 0.12741926312446594, 0.12244760990142822, -0.5853896737098694, -0.036407776176929474, 0.07431177794933319, -0.05947713181376457, -0.20412908494472504, -0.03389386832714081, -0.1346644163131714, 0.16174986958503723, -0.0713827908039093, -0.34092408418655396, 0.5078473687171936, 0.17518335580825806, 0.09708602726459503, -0.6261910200119019, 0.04192075878381729, 0.10583782196044922, 0.18490256369113922, 0.21979869902133942, 0.17294681072235107, -0.19752611219882965, -0.01651141420006752, 0.3826931118965149, 0.16336342692375183, 0.3158281445503235, 0.45307591557502747, 0.19452396035194397, 0.021756745874881744, 0.21653056144714355, 0.002458631992340088, -0.11219757050275803, -0.11863349378108978, 0.08062583953142166, 0.0003863200545310974, -0.5190922021865845, 0.37120625376701355, -0.15444329380989075, 0.20176270604133606, 0.10450699180364609, 0.31780534982681274, 0.0574922040104866, 0.08616352826356888, -0.07865762710571289, -0.06355290114879608, 0.05218171328306198, -0.23303896188735962, 0.07854524254798889, 0.13029694557189941, -0.2465779334306717, 0.025882521644234657, -0.1954549252986908, -0.15248528122901917, 0.15636877715587616, 0.059035494923591614, -0.14383083581924438, -0.1074141263961792, 0.08327732980251312, 0.16112138330936432, -0.035772502422332764, -0.044724807143211365, 0.009088650345802307, 0.1551056057214737, 0.1783560961484909, -0.040665559470653534, 0.21907785534858704, -0.03330859914422035, 0.0024758949875831604, -0.021050292998552322, -0.11349336802959442, -0.1487877368927002, 0.030717849731445312, 0.3634505867958069, -0.26187485456466675, -0.057687677443027496, -0.25901713967323303, -0.10459545254707336, -0.010583341121673584, -0.21062031388282776, -0.5000717639923096, 0.1392766833305359, -0.41557908058166504, -0.18530622124671936, -0.1282360702753067, 0.10170704126358032, 0.31271886825561523, -0.21986404061317444, 0.0449107363820076, 0.4970841407775879, -0.22492435574531555, -0.03286656737327576, 0.041210711002349854, -0.24572142958641052, -0.005257600452750921, 0.043698497116565704, 0.18251854181289673, 0.2552419900894165, 0.30353590846061707, -0.21572056412696838, 0.1333501785993576, -0.47600769996643066, -0.03915423899888992, 0.14294524490833282, -0.04844939708709717, 0.11801484227180481, 0.24082954227924347, 0.3969668447971344, -0.24822667241096497, -0.10959964990615845, 0.008808694779872894, 0.1883566975593567, -0.3699466586112976, -0.2602017819881439, -0.04754447937011719, 0.16565997898578644, 0.03685615956783295, 0.11706431210041046, -0.19941803812980652, -0.035063039511442184, 0.5282397866249084, -0.10378208756446838, -0.0705445408821106, -0.175087571144104, 0.21087223291397095, 0.1704326868057251, -0.1603289246559143, -0.1521141231060028, -0.0013922490179538727, -0.2215985804796219, 0.18421682715415955, -0.05281306803226471, -0.3285982012748718, 0.21834789216518402, -0.1518705040216446, 0.1388009935617447, 0.10001550614833832, -0.4089542627334595, -0.1988086700439453, -0.0634135976433754, -0.0024142861366271973, -0.010327397845685482, 0.13329218327999115, 0.0805160403251648, -0.06606956571340561, 0.1761707216501236, -0.20977787673473358, -0.15523716807365417, 0.23040449619293213, -0.05753837525844574, 0.18215295672416687, -0.017815567553043365, 0.07060336321592331, -0.02103549987077713, 0.48868638277053833, 0.7456849813461304, 0.2853665053844452, -0.12074849009513855, -0.3730055093765259, 0.31640756130218506, 0.005822118371725082, 0.012110307812690735, 0.09956905245780945, -0.2333029955625534, -0.041702743619680405, 0.24447336792945862, 0.37709277868270874, 0.44825097918510437, -0.35445648431777954, 0.1130814179778099, 0.13257206976413727, -0.2254878282546997, -0.19976840913295746, -0.03091368079185486, 0.06648124754428864, -0.08995798230171204, -0.07118518650531769, 0.11658702790737152, 0.12380954623222351, 0.07539725303649902, 0.24281808733940125, 0.31153860688209534, 0.19226929545402527, -0.32640668749809265, -0.18288186192512512, -0.5133615136146545, 0.08346103131771088, 0.33965152502059937, -0.12531553208827972, 0.17043675482273102, -0.03284412622451782, 0.03651240095496178, -0.01642780937254429, 0.8709701895713806, 0.3074897527694702, -0.2966797649860382, -0.3086329400539398, 0.008189775049686432, -0.7800034284591675, 0.40483132004737854, 0.2720032334327698, 0.02770703285932541, -0.059787262231111526, 0.30242109298706055, -0.4954395890235901, 0.05030534788966179, -0.3562232553958893, 0.6451477408409119, -0.20453111827373505, 0.18004368245601654, -0.2287888526916504, -0.43668583035469055, -0.11313535273075104, -0.4607672095298767, -0.07303036004304886, -0.053522348403930664, 0.1835334300994873, 0.20396526157855988, -0.14679576456546783, 0.09021422266960144, 0.17663733661174774, -0.1039830893278122, 0.38454943895339966, -0.046948615461587906, 0.03509386628866196, 0.4290001392364502, 0.13041579723358154, -0.06905601918697357, 0.6894844770431519, -0.1880057454109192, -0.5204261541366577, -0.3000699579715729, 0.02549108862876892, 0.23828630149364471, 0.21293559670448303, 0.1882101148366928, 0.15399524569511414, 0.29686805605888367, -0.12335831671953201, -0.48219266533851624, 0.23537854850292206, 0.0824364498257637, -0.05592384934425354, -0.36707812547683716, -0.5597678422927856, 0.752927839756012, 0.2735167145729065, 0.1427960991859436, 0.2597530484199524, 0.4501349925994873, -0.1651565134525299, -0.04436779394745827, 0.22753873467445374, 0.804391622543335, -0.27376556396484375, 0.6101378202438354, 0.4021540582180023, -0.00034645944833755493, 0.6567182540893555, -0.11940403282642365, 0.0071526989340782166, -0.313437819480896, 0.08208106458187103, -0.22893545031547546, -0.0722818449139595, -0.13123765587806702, 0.04765891656279564, -0.22171056270599365, -0.08099875599145889, -0.16136524081230164, 0.2690674364566803, -0.033870041370391846, 0.21566873788833618, -0.49573156237602234, -0.23791496455669403, -0.294891893863678, 0.055268265306949615, -0.21277031302452087, 0.029732193797826767, 0.09199745953083038, -0.04420209676027298, -0.4200937747955322, 0.1718730330467224, -0.14601582288742065, -0.03677195683121681, -0.10557608306407928, 0.1099446564912796, -0.00667212437838316, -0.2590884268283844, -0.12767218053340912, 0.5665050148963928, 0.254564493894577, -0.23467019200325012, -0.3497256934642792, 0.2297927737236023, -0.1670849621295929, -0.19468189775943756, -0.1156819760799408, -0.09592672437429428, 0.028572959825396538, 0.09573756158351898, 0.005789667367935181, 0.04938525706529617, -0.03960191458463669, 0.07159282267093658, -0.18003562092781067, 0.06403926759958267, -0.2491089105606079, -0.12089475989341736, -0.12516969442367554, 0.23340028524398804, 0.276477575302124, -0.07161752134561539, -0.022336389869451523, 0.21153049170970917, 0.05670662596821785, -0.10386736690998077, 0.1914300173521042, 0.086281418800354, 0.1039084792137146, 0.3378256559371948, -0.23160696029663086, -0.17452257871627808, 0.10867932438850403, 0.00432635098695755, -0.0021788030862808228, -0.07014825940132141, 0.41622844338417053, 0.15517066419124603, 0.0015984326601028442, 0.07410536706447601, -0.026155387982726097, 0.17364966869354248, -0.35982611775398254, 0.25352656841278076, 0.2899119257926941, -0.17836283147335052, 0.22001641988754272, -0.16540652513504028, -0.39273086190223694, 0.4518284499645233, 0.07729832828044891, 0.2688276469707489, 0.17055568099021912, 0.040917325764894485, -0.157079815864563, 0.02442210353910923, -0.1252228319644928, -0.050387151539325714, 0.30161935091018677, -0.18700820207595825, 0.4204081892967224, 0.2087607979774475, 0.05927445366978645, -0.151026651263237, -0.05217088386416435, -0.0691056102514267, 0.007136866450309753, -0.033051997423172, -0.16391423344612122, 0.20082664489746094, 0.02257557213306427, -0.2271474301815033, 0.13858115673065186, -0.12699441611766815, -0.13961701095104218, -0.34968721866607666, 0.3492923974990845, 0.30176326632499695, -0.06929776817560196, -0.28365081548690796, -0.12054581940174103, 0.27835413813591003, -0.49302953481674194, -0.12030178308486938, 0.07604578882455826, 0.1074315533041954, 0.08186729997396469, -0.20847457647323608, -0.010844077914953232, -0.057827599346637726, 0.42103561758995056, 0.32878267765045166, 0.32691723108291626, -0.16366401314735413, 0.08187263458967209, -0.03166189789772034, 0.07704278826713562, -0.0036598555743694305, 0.49110665917396545, 0.38675910234451294, -0.14144358038902283, 0.48875606060028076, 0.3180280029773712, 0.011780817061662674, 0.0021290183067321777, 0.07586703449487686, 0.1986972838640213, -0.33653873205184937, -0.2525899410247803, 0.17054906487464905, -0.017586469650268555, 0.2360740602016449, -0.4962838292121887, -0.18067806959152222, 0.17626965045928955, -0.062096621841192245, 0.08649304509162903, 0.21360915899276733, 0.011885538697242737, 0.08683574199676514, -0.08180680871009827, 0.285297155380249, 0.4133686125278473, 0.22356408834457397, -0.3558011054992676, 0.3364356458187103, -0.17052055895328522, 0.1378001570701599, 0.41420817375183105, -0.3520250916481018, -0.3651503324508667, -0.10388422757387161, -0.23013395071029663, 0.047281913459300995, -0.07783553749322891, 0.6724230051040649, -0.30692702531814575, -0.22121240198612213, -0.13833650946617126, 0.24963614344596863, 0.14451183378696442, -0.12132064253091812, 0.024527497589588165, -0.264199435710907, 0.2509702444076538, 0.13288025557994843, 0.12544721364974976, -0.5600494146347046, 0.26313093304634094, 0.03129793331027031, 0.23546284437179565, 0.026247160509228706, 0.023917943239212036, 0.27517786622047424, 0.23451216518878937, 0.05578233301639557, -0.4078763425350189, 0.3893643915653229, -0.1779361367225647, -0.0630333349108696, 0.07374239712953568, 0.3571092188358307, 0.07889764755964279, -0.12419440597295761, 0.3294365108013153, -0.07918994128704071, 0.007771730422973633, 0.05199189484119415, -0.2216932773590088, 0.17357563972473145, -0.3479229211807251, 0.3184567391872406, 0.04572713375091553, 0.04330187663435936, -0.23235902190208435, 0.16092461347579956, 0.3348886966705322, -0.45567190647125244, 0.1212848424911499, -0.45446184277534485, 0.010514587163925171, -0.2143191397190094, 0.12157340347766876, -0.19091767072677612, 0.15062347054481506, 0.0437035970389843, 0.03231614828109741, -0.08685223013162613, 0.022287659347057343, 0.014269884675741196, 0.06116890534758568, 0.39045026898384094, 0.062266673892736435, 0.2802127003669739, 0.10430615395307541, -0.11345555633306503, -0.4844159781932831, -0.3148963451385498, -0.02849549613893032, -0.3417624831199646, -0.2681295871734619, -0.0710863545536995, -0.08225132524967194, 0.19811274111270905, -0.18558327853679657, -0.014758061617612839, 0.592154860496521, -0.12752869725227356, 0.06661859154701233, -0.341940313577652, 0.2808419167995453, 0.1595720648765564, 0.04022686183452606, -0.3111252784729004, 0.19619691371917725, -0.1424175500869751, -0.11019611358642578, 0.07273998856544495, 0.14719684422016144, -0.08743256330490112, -0.26795122027397156, 0.14231975376605988, 0.05593907833099365, 0.20030346512794495, 0.07416251301765442, -0.2241712510585785, -0.10953675210475922, 0.1711513102054596, -0.24300077557563782, -0.043965332210063934, -0.13695944845676422, 0.20593246817588806, -0.4512377977371216, -0.07347306609153748, -0.09448464214801788, 0.23248744010925293, 0.25215983390808105, 0.00834137573838234, -0.3379780650138855, 0.106473907828331, -0.3979252874851227, -0.13191965222358704, 0.2793810963630676, 0.5095044374465942, -0.3903351128101349, -0.07969294488430023, -0.07270379364490509, 0.04820037633180618, 0.29541337490081787, -0.276787668466568, 0.09626176953315735, 0.1956678330898285, -0.16440147161483765, 0.047035686671733856, -0.08816094696521759, -0.267416775226593, 0.13397952914237976, 0.14142994582653046, 0.08638497442007065, 0.07574416697025299, 0.12657800316810608, -0.022879336029291153, -0.2733477056026459, -0.0028631463646888733, 0.4288354516029358, 0.07494371384382248, -0.10910043120384216, 0.1893264800310135, -0.21752485632896423 ]
https://github.com/huggingface/datasets/issues/5815
Hi ! Many datasets are made of several files, and how they are parsed often requires a python script. Because of that, datasets like wmt14 are not available as a single file on HF. Though you can create this file using `datasets`: ```python from datasets import load_dataset ds = load_dataset("wmt14", "de-en", split="train") ds.to_json("wmt14-train.json") # OR to parquet, which is compressed: # ds.to_parquet("wmt14-train.parquet") ``` We are also working on providing parquet exports for all datasets, but wmt14 is not supported yet (we're rolling it out for datasets <1GB first). They're usually available in the `refs/convert/parquet` branch (empty for wmt14): <img width="267" alt="image" src="https://user-images.githubusercontent.com/42851186/235878909-7339f5a4-be19-4ada-85d8-8a50d23acf35.png">
Easy way to create a Kaggle dataset from a Huggingface dataset?
I'm not sure whether this is more appropriately addressed with HuggingFace or Kaggle. I would like to somehow directly create a Kaggle dataset from a HuggingFace Dataset. While Kaggle does provide the option to create a dataset from a URI, that URI must point to a single file. For example: ![image](https://user-images.githubusercontent.com/5355286/235792394-7c559d07-4aff-45b7-ad2b-9c5280c88415.png) Is there some mechanism from huggingface to represent a dataset (such as that from `load_dataset('wmt14', 'de-en', split='train')` as a single file? Or, some other way to get that into a Kaggle dataset so that I can use the huggingface `datasets` module to process and consume it inside of a Kaggle notebook? Thanks in advance!
102
Easy way to create a Kaggle dataset from a Huggingface dataset? I'm not sure whether this is more appropriately addressed with HuggingFace or Kaggle. I would like to somehow directly create a Kaggle dataset from a HuggingFace Dataset. While Kaggle does provide the option to create a dataset from a URI, that URI must point to a single file. For example: ![image](https://user-images.githubusercontent.com/5355286/235792394-7c559d07-4aff-45b7-ad2b-9c5280c88415.png) Is there some mechanism from huggingface to represent a dataset (such as that from `load_dataset('wmt14', 'de-en', split='train')` as a single file? Or, some other way to get that into a Kaggle dataset so that I can use the huggingface `datasets` module to process and consume it inside of a Kaggle notebook? Thanks in advance! Hi ! Many datasets are made of several files, and how they are parsed often requires a python script. Because of that, datasets like wmt14 are not available as a single file on HF. Though you can create this file using `datasets`: ```python from datasets import load_dataset ds = load_dataset("wmt14", "de-en", split="train") ds.to_json("wmt14-train.json") # OR to parquet, which is compressed: # ds.to_parquet("wmt14-train.parquet") ``` We are also working on providing parquet exports for all datasets, but wmt14 is not supported yet (we're rolling it out for datasets <1GB first). They're usually available in the `refs/convert/parquet` branch (empty for wmt14): <img width="267" alt="image" src="https://user-images.githubusercontent.com/42851186/235878909-7339f5a4-be19-4ada-85d8-8a50d23acf35.png">
[ -0.13704515993595123, -0.5377284288406372, 0.11752719432115555, 0.11216665804386139, 0.24724948406219482, 0.2054954171180725, -0.025303073227405548, 0.17020028829574585, 0.1390443593263626, 0.11979781091213226, -0.26239433884620667, 0.1523076444864273, -0.13135060667991638, 0.7215529680252075, 0.43426498770713806, -0.11478644609451294, 0.19012606143951416, -0.09550905972719193, 0.023376312106847763, 0.04488576948642731, 0.10574569553136826, -0.03180929645895958, 0.2577076852321625, -0.01939266175031662, -0.2767055630683899, -0.19801214337348938, -0.34010034799575806, 0.1362120658159256, -0.26051193475723267, -0.048735082149505615, 0.5686436891555786, -0.09738573431968689, 0.18550288677215576, 0.11112585663795471, -0.00012156025331933051, -0.09761488437652588, -0.024303890764713287, -0.22140395641326904, -0.24918991327285767, 0.04300824925303459, -0.24653872847557068, -0.3852660655975342, 0.12761366367340088, -0.008610695600509644, 0.1309114694595337, -0.30234766006469727, 0.11729989945888519, -0.17825107276439667, 0.6019285321235657, -0.061687882989645004, 0.041351769119501114, -0.04285845905542374, 0.04421895742416382, -0.010552369058132172, 0.08777454495429993, 0.4778905212879181, -0.2173890322446823, 0.18941789865493774, -0.09561722725629807, -0.07650471478700638, 0.17385032773017883, -0.042348768562078476, -0.05956991761922836, -0.18016542494297028, 0.5444305539131165, 0.21618929505348206, -0.38026997447013855, -0.316536009311676, 0.08128117769956589, 0.5409597158432007, 0.3012922406196594, -0.44457632303237915, -0.597558319568634, -0.3689507246017456, 0.09415172040462494, 0.10737457871437073, -0.03909831866621971, 0.6525733470916748, -0.15929876267910004, 0.0654996931552887, 0.01368977501988411, -0.44342684745788574, -0.09201724827289581, -0.02611936628818512, -0.09706026315689087, 0.0012532882392406464, 0.0064826421439647675, -0.02968505397439003, 0.34064969420433044, -0.0702114850282669, -0.03606298938393593, -0.20114152133464813, -0.010835584253072739, 0.341104120016098, -0.3116714656352997, -0.04634596034884453, -0.4190734028816223, 0.24318242073059082, 0.6015126705169678, 0.11514988541603088, -0.153122216463089, 0.030173026025295258, -0.2663426101207733, -0.013757113367319107, 0.17338913679122925, 0.2164822220802307, -0.00430481880903244, -0.20744803547859192, 0.10865820944309235, 0.06596916913986206, 0.23886480927467346, -0.09709949791431427, -0.05897552892565727, -0.03567907586693764, -0.28726816177368164, -0.3874512314796448, -0.09721345454454422, 0.1352655291557312, -0.1802721917629242, -0.15324871242046356, -0.23667073249816895, 0.1556706577539444, -0.2932795286178589, 0.2559981346130371, -0.15682567656040192, 0.10859935730695724, 0.18816038966178894, 0.43238595128059387, -0.1450580358505249, -0.1349087953567505, -0.018418442457914352, 0.22508618235588074, 0.21676680445671082, 0.4185871481895447, -0.25594937801361084, -0.4808942675590515, 0.07104571163654327, 0.1985900104045868, 0.39951956272125244, -0.092115618288517, 0.12879860401153564, 0.09532797336578369, -0.20271208882331848, 0.09799806773662567, 0.3008037805557251, 0.09222837537527084, 0.24983680248260498, -0.3677965998649597, -0.25912898778915405, -0.25354066491127014, -0.006134342402219772, -0.08206501603126526, 0.05949799716472626, -0.00468424940481782, -0.12444815039634705, 0.17285610735416412, -0.6080127954483032, 0.3408251702785492, -0.19185511767864227, 0.2357730120420456, -0.08366312086582184, 0.27939558029174805, -0.11908043920993805, -0.2148183137178421, 0.49820345640182495, 0.3308384418487549, 0.022111453115940094, -0.2546663284301758, 0.1318223923444748, -0.24579587578773499, -0.12724065780639648, 0.31471654772758484, -0.022256162017583847, 0.3126174211502075, -0.21417906880378723, 0.15365295112133026, 0.22901399433612823, -0.28574812412261963, -0.07034675776958466, 0.39354029297828674, -0.16839353740215302, 0.23612608015537262, 0.015704289078712463, 0.28466877341270447, 0.10198549926280975, 0.11126121133565903, 0.14522486925125122, 0.1899016797542572, -0.14757756888866425, 0.006168738007545471, 0.0927530825138092, -0.5796381235122681, -0.01259582955390215, 0.07327836751937866, -0.2619320750236511, 0.011680759489536285, -0.03583686426281929, 0.12240448594093323, 0.47318002581596375, -0.16375769674777985, 0.1963740885257721, 0.04261593520641327, 0.17754203081130981, 0.3184962868690491, -0.2988658547401428, -0.01273549348115921, -0.3818206787109375, 0.13976021111011505, -0.1903308928012848, 0.14697974920272827, 0.13184376060962677, -0.5588055849075317, -0.057691629976034164, 0.07917791604995728, -0.08461445569992065, -0.2553154230117798, -0.03144964948296547, -0.1014695018529892, 0.10312249511480331, -0.07431797683238983, -0.26739659905433655, 0.6404287219047546, 0.20577186346054077, 0.11582870781421661, -0.49828585982322693, 0.16560396552085876, 0.08424920588731766, 0.18847230076789856, 0.28413471579551697, 0.14886027574539185, -0.073974609375, -0.024652719497680664, 0.37946879863739014, 0.16671839356422424, 0.38261663913726807, 0.42853084206581116, 0.19782373309135437, 0.01755625754594803, 0.27102017402648926, -0.0947616770863533, -0.03165768086910248, -0.0787227600812912, 0.07607021927833557, 0.004166960716247559, -0.461076945066452, 0.38095027208328247, -0.013473487459123135, 0.2105465531349182, 0.12433074414730072, 0.3019316792488098, 0.02983536571264267, 0.16714854538440704, -0.04453364014625549, -0.03545796871185303, 0.00558963930234313, -0.2960815131664276, 0.05273538827896118, -0.008408337831497192, -0.2550126910209656, 0.09956777840852737, -0.05240088701248169, -0.12220001220703125, 0.17554542422294617, 0.13845497369766235, -0.16791552305221558, -0.09237472712993622, 0.12146417796611786, 0.06562180817127228, -0.11156794428825378, -0.010844368487596512, 0.005579372402280569, 0.24423591792583466, 0.04894572123885155, 0.037046805024147034, 0.2028614580631256, -0.03538571670651436, 0.056709326803684235, -0.005277315154671669, -0.0664159283041954, -0.1772007942199707, 0.033059172332286835, 0.30161476135253906, -0.2982467710971832, -0.11681406944990158, -0.28219959139823914, -0.038601189851760864, -0.15391471982002258, -0.13221733272075653, -0.4811004400253296, 0.1723482310771942, -0.44507136940956116, -0.2542097866535187, -0.13465097546577454, 0.12113124132156372, 0.3567962646484375, -0.1945199966430664, -0.019072115421295166, 0.4390947222709656, -0.2616507411003113, 0.003949113190174103, -0.031224913895130157, -0.3003600835800171, -0.06736041605472565, -0.016822021454572678, 0.13122081756591797, 0.2987164556980133, 0.29174506664276123, -0.2558615207672119, 0.07699669897556305, -0.5891889929771423, -0.1459936648607254, 0.2001548558473587, -0.05545666813850403, 0.1320635825395584, 0.29207199811935425, 0.3934728503227234, -0.29816198348999023, -0.08989012241363525, 0.053624462336301804, 0.1481207013130188, -0.3736729621887207, -0.17391231656074524, -0.10628920793533325, 0.19939886033535004, 0.08534938842058182, 0.1036241352558136, -0.22757591307163239, -0.05798908323049545, 0.48980504274368286, -0.07067815214395523, -0.09041927009820938, -0.15664902329444885, 0.16183677315711975, 0.1743001639842987, -0.12723955512046814, -0.10263001918792725, -0.03571341186761856, -0.1649947166442871, 0.18807697296142578, -0.0894412100315094, -0.3754369020462036, 0.23984470963478088, -0.16985878348350525, 0.024719104170799255, 0.12326120585203171, -0.4963681101799011, -0.17082002758979797, -0.06838356703519821, 0.06359896063804626, -0.059318386018276215, 0.1744994968175888, 0.04185580089688301, -0.05413304641842842, 0.18824443221092224, -0.25005292892456055, -0.2003665566444397, 0.2160540521144867, -0.07432674616575241, 0.15962247550487518, -0.03874817490577698, 0.1176779717206955, -0.022147715091705322, 0.5238840579986572, 0.6691626310348511, 0.2887539565563202, -0.002446599304676056, -0.35976675152778625, 0.3405522406101227, -0.029714427888393402, 0.03876330703496933, 0.1580982655286789, -0.21057677268981934, 0.09511527419090271, 0.25792616605758667, 0.34218284487724304, 0.43836021423339844, -0.3078535795211792, 0.0449247807264328, 0.07450607419013977, -0.2861826419830322, -0.19363807141780853, 0.08460526168346405, 0.09186477959156036, -0.05936994403600693, -0.054962001740932465, 0.06843976676464081, 0.04322639852762222, 0.2506271302700043, 0.31991809606552124, 0.2965216338634491, 0.27406007051467896, -0.24449245631694794, -0.19336792826652527, -0.3981970250606537, 0.1230165958404541, 0.2775397300720215, -0.05020833760499954, 0.11472456157207489, -0.02753257378935814, 0.0031619928777217865, -0.1025865375995636, 0.9660627245903015, 0.26487353444099426, -0.18193772435188293, -0.31137505173683167, -0.08884374052286148, -0.7529758810997009, 0.3708502948284149, 0.1801549643278122, -0.16445691883563995, -0.11887188255786896, 0.4089568257331848, -0.5809540152549744, -0.04860391467809677, -0.3246983587741852, 0.6258494257926941, -0.2433849573135376, 0.20286618173122406, -0.21142959594726562, -0.41534000635147095, -0.16950273513793945, -0.43797603249549866, -0.1138390600681305, -0.03250161558389664, 0.24066098034381866, 0.26363831758499146, -0.2120368927717209, 0.0753798633813858, 0.1435430496931076, -0.09110138565301895, 0.32782456278800964, 0.039999399334192276, 0.0521247535943985, 0.402108371257782, 0.14134804904460907, 0.08201907575130463, 0.6487583518028259, -0.1451864242553711, -0.5332017540931702, -0.2524779140949249, 0.11467796564102173, 0.21183539927005768, 0.1898188441991806, 0.1912156045436859, 0.19156844913959503, 0.3220366835594177, -0.023164469748735428, -0.6011101007461548, 0.21085412800312042, 0.10018885880708694, -0.08663579076528549, -0.26740938425064087, -0.556401789188385, 0.7168054580688477, 0.1985703706741333, 0.16685505211353302, 0.1901688128709793, 0.6563279628753662, -0.14017601311206818, 0.001619197428226471, 0.3085405230522156, 0.8218826651573181, -0.26904839277267456, 0.5753276944160461, 0.37735825777053833, -0.19776348769664764, 0.5936413407325745, -0.27639949321746826, -0.03394697606563568, -0.30727332830429077, 0.030324403196573257, -0.22520701587200165, -0.05536295101046562, -0.08451864123344421, 0.07794289290904999, -0.1854279488325119, -0.03700792416930199, -0.044022686779499054, 0.24968472123146057, -0.024566669017076492, 0.22091206908226013, -0.5243663191795349, -0.30522048473358154, -0.4079335033893585, 0.050057075917720795, -0.24808251857757568, 0.06192309409379959, 0.06352044641971588, -0.04340209811925888, -0.3060273826122284, 0.14807948470115662, -0.17047517001628876, 0.003242485225200653, -0.1665278971195221, 0.09757228195667267, 0.07845892012119293, -0.19618673622608185, -0.07069917023181915, 0.3612808883190155, 0.3073568344116211, -0.20092520117759705, -0.3205888271331787, 0.19139879941940308, -0.1806247979402542, -0.18389709293842316, -0.18182553350925446, -0.018395457416772842, 0.09713111817836761, 0.05123335123062134, -0.05911044776439667, 0.061498094350099564, -0.01815786212682724, 0.1131008118391037, -0.09188713133335114, -0.05404762178659439, -0.28830984234809875, 0.009520255029201508, -0.04140350967645645, 0.2630516290664673, 0.2694675624370575, -0.0861147865653038, -0.05524872988462448, 0.10948152840137482, 0.02239520475268364, -0.10880625247955322, 0.23085549473762512, 0.10271182656288147, 0.0403888076543808, 0.3325803577899933, -0.32601505517959595, -0.09857286512851715, 0.11639459431171417, 0.14065609872341156, -0.09843319654464722, -0.07505480945110321, 0.39097389578819275, 0.21590174734592438, 0.004193559288978577, 0.01589478924870491, -0.05207555741071701, 0.1071113646030426, -0.3426249623298645, 0.2939276695251465, 0.2996926009654999, -0.2330617606639862, 0.21969452500343323, -0.20017242431640625, -0.3432556390762329, 0.41854435205459595, -0.006076706573367119, 0.2048099786043167, 0.18790404498577118, 0.10949748754501343, -0.16318409144878387, 0.1132851392030716, -0.11809036880731583, -0.08631309866905212, 0.31573963165283203, -0.1549472212791443, 0.32062575221061707, 0.20919270813465118, 0.11196353286504745, -0.15557077527046204, -0.06957563012838364, -0.06513278931379318, -0.05259820073843002, -0.0020125210285186768, -0.2472221553325653, 0.2258366495370865, -0.00643500592559576, -0.18402323126792908, 0.1161748468875885, -0.13948452472686768, -0.16333213448524475, -0.39348557591438293, 0.47353336215019226, 0.30218151211738586, -0.08969472348690033, -0.15973949432373047, 0.03539884835481644, 0.17767195403575897, -0.4888746738433838, -0.20008671283721924, 0.21786433458328247, 0.10982432961463928, 0.0593034066259861, -0.2451191395521164, -0.007115010172128677, -0.050969235599040985, 0.3930187225341797, 0.38333967328071594, 0.29633164405822754, -0.19569584727287292, 0.20815140008926392, -0.0454823300242424, 0.0394880473613739, -0.04146501421928406, 0.46505510807037354, 0.29271093010902405, -0.032899267971515656, 0.40697047114372253, 0.358212411403656, -0.038667500019073486, -0.07575292140245438, 0.01294161006808281, 0.21084894239902496, -0.3534620702266693, -0.17516086995601654, 0.23300933837890625, -0.025842219591140747, 0.26868921518325806, -0.48522186279296875, -0.14674386382102966, 0.17755673825740814, -0.14825539290905, -0.006277088075876236, 0.2698056101799011, -0.02113836258649826, 0.1149507611989975, -0.05793827772140503, 0.3284279406070709, 0.3826160728931427, 0.1918477714061737, -0.2473343312740326, 0.32107114791870117, -0.16165998578071594, 0.16347214579582214, 0.4630802273750305, -0.3922777771949768, -0.2918384373188019, -0.04846736788749695, -0.16970773041248322, 0.03653040900826454, -0.13156315684318542, 0.47573789954185486, -0.12724454700946808, -0.24173621833324432, -0.10268478840589523, 0.2271995097398758, 0.16138803958892822, -0.12371741235256195, 0.0986097902059555, -0.24544543027877808, 0.13937239348888397, 0.08501172810792923, 0.18781889975070953, -0.6069349050521851, 0.2743612229824066, 0.09640489518642426, 0.32730674743652344, 0.0445784255862236, -0.0337287113070488, 0.20245932042598724, 0.22250492870807648, 0.060837700963020325, -0.407640665769577, 0.35988354682922363, -0.20137035846710205, -0.07813096046447754, 0.0380222424864769, 0.3109443783760071, 0.052717212587594986, -0.19020268321037292, 0.3317100703716278, 0.009349092841148376, 0.00495736300945282, 0.06261637061834335, -0.23795092105865479, 0.10287737846374512, -0.3787709176540375, 0.3681155741214752, 0.014271173626184464, 0.058269649744033813, -0.29805734753608704, 0.1134953498840332, 0.2564270496368408, -0.40746068954467773, 0.20885808765888214, -0.39645645022392273, 0.04237744212150574, -0.12892118096351624, 0.15709710121154785, -0.16862837970256805, 0.1907498836517334, 0.0538598895072937, 0.01664581522345543, -0.017869733273983, 0.034953128546476364, 0.00459308922290802, 0.0331045426428318, 0.40370413661003113, 0.11413359642028809, 0.2044375240802765, 0.13393928110599518, -0.06071510165929794, -0.5009371638298035, -0.3328169584274292, -0.07475665956735611, -0.41695651412010193, -0.09891586005687714, -0.022574078291654587, 0.058228105306625366, 0.2288656383752823, -0.1233687698841095, -0.07233485579490662, 0.6023433804512024, -0.09115031361579895, 0.11262594163417816, -0.36790090799331665, 0.2863285541534424, 0.1870395690202713, -0.003254186362028122, -0.31894978880882263, 0.16269280016422272, -0.09592112898826599, -0.12249985337257385, 0.06592912971973419, 0.14022374153137207, -0.11542119830846786, -0.4215414822101593, 0.044613149017095566, 0.06670993566513062, 0.15416386723518372, -0.03643157705664635, -0.23342519998550415, -0.07086223363876343, 0.15367302298545837, -0.19956983625888824, 0.013366526924073696, -0.2545977830886841, 0.24126452207565308, -0.36883461475372314, -0.26046109199523926, -0.1980576515197754, 0.23866908252239227, 0.31298795342445374, 0.002986915409564972, -0.33552923798561096, 0.25222715735435486, -0.4320554733276367, -0.1648891568183899, 0.24047550559043884, 0.5126265287399292, -0.35334524512290955, -0.06497066468000412, -0.02521384507417679, -0.007131442427635193, 0.34019166231155396, -0.3417538106441498, -0.014658525586128235, 0.11581568419933319, -0.0963970422744751, -0.011859029531478882, -0.11767718195915222, -0.2021794617176056, 0.22571876645088196, 0.16930679976940155, 0.07878917455673218, 0.056261301040649414, 0.07101273536682129, -0.057273171842098236, -0.3237033486366272, 0.011491231620311737, 0.3407180607318878, 0.04925883933901787, -0.07022856920957565, 0.13026320934295654, -0.20306067168712616 ]
https://github.com/huggingface/datasets/issues/5815
I've requested support for creating a Kaggle dataset from an imported HF dataset repo on their "forum" here: https://www.kaggle.com/discussions/product-feedback/427142 (upvotes appreciated 🙂)
Easy way to create a Kaggle dataset from a Huggingface dataset?
I'm not sure whether this is more appropriately addressed with HuggingFace or Kaggle. I would like to somehow directly create a Kaggle dataset from a HuggingFace Dataset. While Kaggle does provide the option to create a dataset from a URI, that URI must point to a single file. For example: ![image](https://user-images.githubusercontent.com/5355286/235792394-7c559d07-4aff-45b7-ad2b-9c5280c88415.png) Is there some mechanism from huggingface to represent a dataset (such as that from `load_dataset('wmt14', 'de-en', split='train')` as a single file? Or, some other way to get that into a Kaggle dataset so that I can use the huggingface `datasets` module to process and consume it inside of a Kaggle notebook? Thanks in advance!
22
Easy way to create a Kaggle dataset from a Huggingface dataset? I'm not sure whether this is more appropriately addressed with HuggingFace or Kaggle. I would like to somehow directly create a Kaggle dataset from a HuggingFace Dataset. While Kaggle does provide the option to create a dataset from a URI, that URI must point to a single file. For example: ![image](https://user-images.githubusercontent.com/5355286/235792394-7c559d07-4aff-45b7-ad2b-9c5280c88415.png) Is there some mechanism from huggingface to represent a dataset (such as that from `load_dataset('wmt14', 'de-en', split='train')` as a single file? Or, some other way to get that into a Kaggle dataset so that I can use the huggingface `datasets` module to process and consume it inside of a Kaggle notebook? Thanks in advance! I've requested support for creating a Kaggle dataset from an imported HF dataset repo on their "forum" here: https://www.kaggle.com/discussions/product-feedback/427142 (upvotes appreciated 🙂)
[ -0.035419732332229614, -0.4568637013435364, 0.09917373210191727, 0.09230312705039978, 0.2594352662563324, 0.19315201044082642, 0.0030980673618614674, 0.13281160593032837, 0.1477087438106537, 0.11196538805961609, -0.2770496904850006, 0.13192762434482574, -0.1619729995727539, 0.6953621506690979, 0.4106728732585907, -0.1257728636264801, 0.24331319332122803, -0.05451085790991783, 0.007498517632484436, 0.059039726853370667, 0.19145795702934265, -0.0685516893863678, 0.3311806619167328, -0.025599319487810135, -0.3391415774822235, -0.14087910950183868, -0.33854565024375916, 0.12961852550506592, -0.3025256395339966, -0.08068032562732697, 0.6222607493400574, -0.077884241938591, 0.19013410806655884, 0.18253079056739807, -0.00011809590796474367, -0.10325014591217041, -0.07364967465400696, -0.20780633389949799, -0.18808259069919586, 0.049455106258392334, -0.20907537639141083, -0.3351297974586487, 0.13535645604133606, -0.0006089955568313599, 0.2022857367992401, -0.17771999537944794, 0.1285942941904068, -0.16798855364322662, 0.6096907258033752, -0.04566989839076996, 0.0738285705447197, -0.024655833840370178, 0.025088034570217133, -0.04175233840942383, 0.04557967185974121, 0.4569232165813446, -0.21882778406143188, 0.3284784257411957, -0.05869949981570244, -0.04018254578113556, 0.1302940845489502, -0.020379530265927315, -0.03564124554395676, -0.18827100098133087, 0.5248444676399231, 0.1777932345867157, -0.3955391049385071, -0.40389710664749146, -0.008851563557982445, 0.5781385898590088, 0.273362398147583, -0.4808320999145508, -0.6200433373451233, -0.38526493310928345, 0.1007678210735321, 0.13591593503952026, -0.026733960956335068, 0.6143271923065186, -0.15646983683109283, 0.03438695892691612, 0.01869024708867073, -0.44902321696281433, -0.09791538119316101, -0.08312824368476868, -0.10919071733951569, -0.09812948852777481, 0.048485107719898224, -0.04974708333611488, 0.35601741075515747, -0.018187042325735092, -0.033194463700056076, -0.10788337886333466, -0.004907349590212107, 0.38783028721809387, -0.2800995707511902, -0.0818881094455719, -0.399885892868042, 0.1894405633211136, 0.5946609973907471, 0.1338312029838562, -0.0684574693441391, -0.053501881659030914, -0.34977084398269653, -0.00941610150039196, 0.19312605261802673, 0.2932925224304199, 0.004754563793540001, -0.2140650749206543, 0.13876217603683472, 0.06733590364456177, 0.27291378378868103, -0.11305005848407745, -0.13906177878379822, -0.013068150728940964, -0.2888254225254059, -0.3953101933002472, -0.11103759706020355, 0.13622011244297028, -0.16223542392253876, -0.14763736724853516, -0.2289668768644333, 0.15926262736320496, -0.23955489695072174, 0.1350773721933365, -0.09505249559879303, 0.16325068473815918, 0.1192815750837326, 0.4345705807209015, -0.14319869875907898, -0.10113366693258286, -0.017977770417928696, 0.2583138048648834, 0.18436861038208008, 0.40213263034820557, -0.22138263285160065, -0.5268836617469788, 0.10396715253591537, 0.179215669631958, 0.37904876470565796, -0.11821607500314713, 0.11228233575820923, 0.08822957426309586, -0.25003933906555176, 0.06872764229774475, 0.32992783188819885, 0.09526471793651581, 0.16727018356323242, -0.34736883640289307, -0.1738395392894745, -0.20421935617923737, 0.02976730279624462, -0.11772643774747849, -0.031234411522746086, 0.03221582993865013, -0.1909387707710266, 0.16086210310459137, -0.4932486414909363, 0.2856573760509491, -0.16997919976711273, 0.1780116856098175, -0.09814178198575974, 0.3130995035171509, -0.013893216848373413, -0.2383681833744049, 0.4366300106048584, 0.2939721345901489, 0.03745293617248535, -0.217485710978508, 0.15850627422332764, -0.30105698108673096, -0.16321814060211182, 0.3581843674182892, -0.027925292029976845, 0.35234305262565613, -0.1848507821559906, 0.1718873679637909, 0.2131912112236023, -0.29263412952423096, -0.0430893748998642, 0.3290114104747772, -0.20414647459983826, 0.20760583877563477, -0.0060821957886219025, 0.2866780757904053, 0.020704105496406555, 0.11943523585796356, 0.10036757588386536, 0.13949157297611237, -0.17846083641052246, -0.02875738963484764, 0.08386632055044174, -0.574578046798706, -0.06626495718955994, 0.067792147397995, -0.31221887469291687, -0.004490874707698822, -0.15479102730751038, 0.07594985514879227, 0.4479285478591919, -0.18861393630504608, 0.17848461866378784, 0.06873498857021332, 0.20927709341049194, 0.16708235442638397, -0.33259034156799316, 0.04195185750722885, -0.3523859977722168, 0.15120267868041992, -0.22477997839450836, 0.1907544732093811, 0.13957034051418304, -0.5535274147987366, -0.07598847150802612, 0.08201927691698074, -0.10177548229694366, -0.20235350728034973, -0.02224072627723217, -0.14288488030433655, 0.13881158828735352, -0.058836422860622406, -0.30052971839904785, 0.6137205958366394, 0.17502383887767792, 0.11840413510799408, -0.5597782731056213, 0.12214275449514389, 0.07527512311935425, 0.22311708331108093, 0.23034533858299255, 0.2019653022289276, -0.18724097311496735, -0.02329074777662754, 0.3639083802700043, 0.1457563042640686, 0.30537962913513184, 0.4225849211215973, 0.21164356172084808, 0.007868051528930664, 0.2642747461795807, 0.01119375228881836, -0.05218413472175598, -0.13649898767471313, 0.08051511645317078, -0.010512970387935638, -0.49345663189888, 0.3623630106449127, -0.11921849846839905, 0.1689159870147705, 0.11256889998912811, 0.289534330368042, 0.05761416256427765, 0.10923777520656586, -0.06100073829293251, -0.05270588770508766, 0.06990449130535126, -0.2752014100551605, 0.05476929247379303, 0.10167980939149857, -0.2528141736984253, 0.05119020491838455, -0.14287704229354858, -0.1447141468524933, 0.13348539173603058, 0.10239160060882568, -0.15978875756263733, -0.12289968132972717, 0.1357443481683731, 0.12164720892906189, -0.09356440603733063, -0.04446082189679146, 0.0030490895733237267, 0.18261852860450745, 0.08176891505718231, -0.003871079534292221, 0.1756184995174408, -0.04508474841713905, 0.032084330916404724, 0.007203667424619198, -0.08515720069408417, -0.12291072309017181, 0.0026138722896575928, 0.3051978349685669, -0.2778816819190979, -0.056028276681900024, -0.30074572563171387, -0.10258461534976959, -0.019260291010141373, -0.22260218858718872, -0.5137447118759155, 0.12191643565893173, -0.46191996335983276, -0.24911317229270935, -0.1506877839565277, 0.08821861445903778, 0.3097730875015259, -0.25479552149772644, -0.0057355985045433044, 0.43051818013191223, -0.25478413701057434, -0.03142531216144562, 0.03926198184490204, -0.21064910292625427, -0.06585380434989929, 0.04954056069254875, 0.1332559883594513, 0.2687991261482239, 0.3100561499595642, -0.18469418585300446, 0.12999144196510315, -0.4597901701927185, -0.09318630397319794, 0.15774285793304443, -0.06761209666728973, 0.11110875010490417, 0.24948273599147797, 0.3876540958881378, -0.27019253373146057, -0.09517662227153778, -0.0020973384380340576, 0.2045590877532959, -0.37896645069122314, -0.22014577686786652, -0.09171134233474731, 0.17092911899089813, 0.0651353970170021, 0.12370304763317108, -0.21004770696163177, -0.05983864888548851, 0.4737277626991272, -0.10513190180063248, -0.09477756917476654, -0.18915629386901855, 0.14643122255802155, 0.18917684257030487, -0.13729150593280792, -0.18388405442237854, -0.036772772669792175, -0.18248000741004944, 0.18440555036067963, -0.10534080862998962, -0.33446356654167175, 0.24136650562286377, -0.17235109210014343, 0.13714250922203064, 0.06038106977939606, -0.4382588565349579, -0.18835501372814178, -0.0524606853723526, 0.07372091710567474, -0.01893472671508789, 0.1264324188232422, 0.05728092044591904, -0.07501904666423798, 0.17879891395568848, -0.21773815155029297, -0.16418015956878662, 0.23103006184101105, 0.013197176158428192, 0.17652906477451324, -0.027339119464159012, 0.08726388216018677, -0.041008464992046356, 0.5367331504821777, 0.7182837724685669, 0.34832924604415894, -0.06525006890296936, -0.32445910573005676, 0.3424629271030426, -0.023751720786094666, 0.002152763307094574, 0.08446407318115234, -0.22215965390205383, 0.018129490315914154, 0.23408791422843933, 0.3608081340789795, 0.44666022062301636, -0.33913934230804443, 0.10040341317653656, 0.15706081688404083, -0.21870304644107819, -0.17720094323158264, -0.07825660705566406, 0.08062739670276642, -0.08596811443567276, -0.05104425176978111, 0.10105633735656738, 0.0765775740146637, 0.09100669622421265, 0.22137267887592316, 0.3103724718093872, 0.24992099404335022, -0.2843676507472992, -0.2288496345281601, -0.534303605556488, 0.08756925910711288, 0.3382486402988434, -0.0720478817820549, 0.15867355465888977, 0.027801930904388428, 0.009954404085874557, -0.06979729980230331, 0.8081023097038269, 0.29545858502388, -0.2827410101890564, -0.2544383406639099, -0.013015493750572205, -0.7595449090003967, 0.3680792450904846, 0.25432059168815613, -0.055075544863939285, -0.11208246648311615, 0.24210679531097412, -0.5631934404373169, -0.038826242089271545, -0.30113670229911804, 0.6265515089035034, -0.22169899940490723, 0.2197898030281067, -0.20422738790512085, -0.4508698582649231, -0.07244212925434113, -0.47461986541748047, -0.10446972399950027, -0.02842160500586033, 0.1624247431755066, 0.2557307481765747, -0.11998137831687927, 0.14491324126720428, 0.20797905325889587, -0.10871746391057968, 0.3435721695423126, -0.021810311824083328, 0.041120998561382294, 0.43532514572143555, 0.1499902904033661, 0.009995369240641594, 0.6999925374984741, -0.18610422313213348, -0.5316063165664673, -0.2957626283168793, 0.028500575572252274, 0.18798503279685974, 0.20027655363082886, 0.24404534697532654, 0.16601034998893738, 0.3367782235145569, -0.09503917396068573, -0.5144717693328857, 0.2291674017906189, 0.11313653737306595, -0.08579949289560318, -0.35276612639427185, -0.49629849195480347, 0.7637830376625061, 0.22813375294208527, 0.19027362763881683, 0.23221668601036072, 0.5677077174186707, -0.13112936913967133, 0.017482325434684753, 0.1984543800354004, 0.7485380172729492, -0.24957899749279022, 0.598042905330658, 0.43349123001098633, -0.10468973219394684, 0.6236640810966492, -0.20216575264930725, -0.03640161454677582, -0.3387026786804199, 0.1084701418876648, -0.2392728328704834, -0.06034843623638153, -0.09714632481336594, 0.03360997885465622, -0.17270642518997192, -0.033448025584220886, -0.12063423544168472, 0.29438307881355286, -0.049275510013103485, 0.2687961459159851, -0.49138203263282776, -0.27547916769981384, -0.2657948136329651, 0.07898375391960144, -0.19540436565876007, 0.06864190846681595, 0.05504615977406502, -0.0354887954890728, -0.40827786922454834, 0.20185217261314392, -0.17977279424667358, -0.029103722423315048, -0.10229913890361786, 0.07742281258106232, 0.04180439934134483, -0.23879528045654297, -0.08125430345535278, 0.4496481716632843, 0.2849465310573578, -0.26121652126312256, -0.3567523956298828, 0.23287436366081238, -0.13948845863342285, -0.18748420476913452, -0.10233858227729797, -0.05852044001221657, 0.08886300027370453, 0.0773228257894516, -0.043435998260974884, 0.04799211770296097, -0.05103278532624245, 0.08260686695575714, -0.1766226589679718, -0.010555319488048553, -0.29642581939697266, -0.10140792280435562, -0.04270593076944351, 0.2854231297969818, 0.30095118284225464, -0.04810165613889694, -0.01838534325361252, 0.20497892796993256, 0.07487379014492035, -0.12925414741039276, 0.21617765724658966, 0.11027532815933228, 0.03586728498339653, 0.29997164011001587, -0.22619959712028503, -0.1329168677330017, 0.11734992265701294, 0.04072858393192291, -0.029528412967920303, -0.06309984624385834, 0.3671610951423645, 0.21088118851184845, -0.035501256585121155, 0.02237933874130249, -0.02389230579137802, 0.14475928246974945, -0.3482871353626251, 0.2652823030948639, 0.2897416055202484, -0.2600453495979309, 0.24607309699058533, -0.14334532618522644, -0.3898879289627075, 0.43609657883644104, 0.04664112254977226, 0.2512678802013397, 0.16263435781002045, 0.11495169997215271, -0.14349380135536194, 0.06966035068035126, -0.14181718230247498, -0.06335428357124329, 0.27950066328048706, -0.19840899109840393, 0.3583867847919464, 0.20300260186195374, 0.10533532500267029, -0.1886468529701233, -0.05373883619904518, -0.061496008187532425, -0.0590280219912529, -0.026066144928336143, -0.2108897715806961, 0.204420804977417, 0.01666649430990219, -0.21215322613716125, 0.155557781457901, -0.1397630274295807, -0.17605037987232208, -0.32588714361190796, 0.3969038724899292, 0.3003122806549072, -0.0791826844215393, -0.21743711829185486, -0.08961854875087738, 0.2266973853111267, -0.4880019426345825, -0.12253521382808685, 0.19619672000408173, 0.12699991464614868, 0.0674576535820961, -0.22754347324371338, -0.02222384698688984, -0.08289223164319992, 0.38234496116638184, 0.37444400787353516, 0.2812657356262207, -0.22741112112998962, 0.1182129830121994, -0.08570374548435211, 0.0940362960100174, -0.0413236990571022, 0.5102893114089966, 0.3420190215110779, -0.12789936363697052, 0.4562583565711975, 0.3637436330318451, 0.006331771146506071, -0.03262777999043465, 0.05826988071203232, 0.15461556613445282, -0.33988356590270996, -0.22689588367938995, 0.18757890164852142, 0.0798908993601799, 0.2950986623764038, -0.44970837235450745, -0.1406199038028717, 0.1680636703968048, -0.08921563625335693, 0.03959796950221062, 0.24377907812595367, -0.012997336685657501, 0.13757741451263428, -0.04789891839027405, 0.28296104073524475, 0.3909153938293457, 0.15601858496665955, -0.2838970124721527, 0.3148638904094696, -0.11002632975578308, 0.13348205387592316, 0.4532177448272705, -0.4271213114261627, -0.37092170119285583, -0.10196280479431152, -0.19645950198173523, 0.0524684377014637, -0.10208509862422943, 0.653426468372345, -0.27700701355934143, -0.27911320328712463, -0.1566142588853836, 0.22204896807670593, 0.11814097315073013, -0.10527215898036957, 0.0773802250623703, -0.25739648938179016, 0.19487802684307098, 0.12990669906139374, 0.14656272530555725, -0.5776225328445435, 0.24209913611412048, -0.011344697326421738, 0.22777783870697021, 0.020187078043818474, 0.04558868333697319, 0.2072632759809494, 0.22709611058235168, 0.0837356373667717, -0.4137963652610779, 0.3589595556259155, -0.20676720142364502, -0.07856886088848114, 0.0678902417421341, 0.35137125849723816, 0.02990514412522316, -0.16959236562252045, 0.28840702772140503, -0.042175717651844025, 0.013495080173015594, 0.11615791916847229, -0.2151196002960205, 0.15062382817268372, -0.3874126672744751, 0.36363980174064636, 0.032515548169612885, 0.04064429551362991, -0.28673192858695984, 0.14656883478164673, 0.3289071321487427, -0.4142266511917114, 0.2254895567893982, -0.4399771988391876, 0.05440324544906616, -0.1751500517129898, 0.10593041777610779, -0.15067367255687714, 0.17844009399414062, 0.06360481679439545, 0.04563674330711365, -0.06253254413604736, -0.03933727368712425, 0.0224594883620739, 0.05740797892212868, 0.4152820110321045, 0.09845609962940216, 0.2734695076942444, 0.13329368829727173, -0.08171303570270538, -0.4792531728744507, -0.35383814573287964, -0.09158523380756378, -0.3171161115169525, -0.18717151880264282, -0.062418390065431595, -0.02055903524160385, 0.17124444246292114, -0.17491945624351501, -0.08785489201545715, 0.597398579120636, -0.13180160522460938, 0.08176476508378983, -0.3456648290157318, 0.2327447533607483, 0.13677860796451569, 0.009096972644329071, -0.31973782181739807, 0.21856394410133362, -0.12232804298400879, -0.11137044429779053, 0.08117574453353882, 0.14542685449123383, -0.014648467302322388, -0.3493107855319977, 0.12594261765480042, 0.03283456712961197, 0.14682544767856598, 0.07086317986249924, -0.2604723572731018, -0.07390125095844269, 0.16259223222732544, -0.24498118460178375, -0.07136711478233337, -0.18421883881092072, 0.2698238492012024, -0.35312390327453613, -0.1473376750946045, -0.09933111071586609, 0.24823179841041565, 0.2797214388847351, 0.07094275951385498, -0.35711392760276794, 0.1691003441810608, -0.39579272270202637, -0.1857757866382599, 0.29984399676322937, 0.4892597198486328, -0.3499031066894531, -0.07631339877843857, -0.07750974595546722, 0.042045705020427704, 0.295665979385376, -0.2365618199110031, 0.0885019600391388, 0.1741439253091812, -0.15680338442325592, 0.06487053632736206, -0.16005933284759521, -0.26725614070892334, 0.1781247854232788, 0.13733512163162231, 0.07001876831054688, 0.06933355331420898, 0.11475495249032974, -0.047323305159807205, -0.290912389755249, 0.010494105517864227, 0.42160269618034363, 0.009908827021718025, -0.10687963664531708, 0.15899550914764404, -0.16845327615737915 ]
https://github.com/huggingface/datasets/issues/5811
This error means a `DatasetBuilder` subclass that generates the dataset could not be found inside the script, so make sure `dushowxa-characters/dushowxa-characters.py `is a valid dataset script (assuming `path_or_dataset` is `dushowxa-characters`) Also, we should improve the error to make it more obvious what the problem is.
load_dataset: TypeError: 'NoneType' object is not callable, on local dataset filename changes
### Describe the bug I've adapted Databrick's [train_dolly.py](/databrickslabs/dolly/blob/master/train_dolly.py) to train using a local dataset, which has been working. Upon changing the filenames of the `.json` & `.py` files in my local dataset directory, `dataset = load_dataset(path_or_dataset)["train"]` throws the error: ```python 2023-04-30 09:10:52 INFO [training.trainer] Loading dataset from dushowxa-characters Traceback (most recent call last): File "/data/dushowxa-dolly/train_dushowxa.py", line 26, in <module> load_training_dataset() File "/data/dushowxa-dolly/training/trainer.py", line 89, in load_training_dataset dataset = load_dataset(path_or_dataset)["train"] File "/data/dushowxa-dolly/.venv/lib/python3.10/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/data/dushowxa-dolly/.venv/lib/python3.10/site-packages/datasets/load.py", line 1528, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( TypeError: 'NoneType' object is not callable ``` The local dataset filenames were of the form `dushowxa-characters/expanse-dushowxa-characters.json` and are now of the form `dushowxa-characters/dushowxa-characters.json` (the word `expanse-` was removed from the filenames). Is this perhaps a dataset caching issue? I have attempted to manually clear caches, but to no effect: ```sh rm -rfv ~/.cache/huggingface/datasets/* rm -rfv ~/.cache/huggingface/modules/* ``` ### Steps to reproduce the bug Run `python3 train_dushowxa.py` (adapted from Databrick's [train_dolly.py](/databrickslabs/dolly/blob/master/train_dolly.py)). ### Expected behavior Training succeeds as before local dataset filenames were changed. ### Environment info Ubuntu 22.04, Python 3.10.6, venv ```python accelerate>=0.16.0,<1 click>=8.0.4,<9 datasets>=2.10.0,<3 deepspeed>=0.9.0,<1 transformers[torch]>=4.28.1,<5 langchain>=0.0.139 ```
45
load_dataset: TypeError: 'NoneType' object is not callable, on local dataset filename changes ### Describe the bug I've adapted Databrick's [train_dolly.py](/databrickslabs/dolly/blob/master/train_dolly.py) to train using a local dataset, which has been working. Upon changing the filenames of the `.json` & `.py` files in my local dataset directory, `dataset = load_dataset(path_or_dataset)["train"]` throws the error: ```python 2023-04-30 09:10:52 INFO [training.trainer] Loading dataset from dushowxa-characters Traceback (most recent call last): File "/data/dushowxa-dolly/train_dushowxa.py", line 26, in <module> load_training_dataset() File "/data/dushowxa-dolly/training/trainer.py", line 89, in load_training_dataset dataset = load_dataset(path_or_dataset)["train"] File "/data/dushowxa-dolly/.venv/lib/python3.10/site-packages/datasets/load.py", line 1773, in load_dataset builder_instance = load_dataset_builder( File "/data/dushowxa-dolly/.venv/lib/python3.10/site-packages/datasets/load.py", line 1528, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( TypeError: 'NoneType' object is not callable ``` The local dataset filenames were of the form `dushowxa-characters/expanse-dushowxa-characters.json` and are now of the form `dushowxa-characters/dushowxa-characters.json` (the word `expanse-` was removed from the filenames). Is this perhaps a dataset caching issue? I have attempted to manually clear caches, but to no effect: ```sh rm -rfv ~/.cache/huggingface/datasets/* rm -rfv ~/.cache/huggingface/modules/* ``` ### Steps to reproduce the bug Run `python3 train_dushowxa.py` (adapted from Databrick's [train_dolly.py](/databrickslabs/dolly/blob/master/train_dolly.py)). ### Expected behavior Training succeeds as before local dataset filenames were changed. ### Environment info Ubuntu 22.04, Python 3.10.6, venv ```python accelerate>=0.16.0,<1 click>=8.0.4,<9 datasets>=2.10.0,<3 deepspeed>=0.9.0,<1 transformers[torch]>=4.28.1,<5 langchain>=0.0.139 ``` This error means a `DatasetBuilder` subclass that generates the dataset could not be found inside the script, so make sure `dushowxa-characters/dushowxa-characters.py `is a valid dataset script (assuming `path_or_dataset` is `dushowxa-characters`) Also, we should improve the error to make it more obvious what the problem is.
[ -0.03892234340310097, 0.3020404577255249, 0.15307991206645966, 0.35685789585113525, 0.4620305299758911, 0.17396527528762817, 0.6785809397697449, 0.33185064792633057, 0.2880825102329254, 0.2160206288099289, 0.2014547884464264, 0.34833091497421265, -0.26490601897239685, -0.11683293431997299, -0.1316303312778473, -0.0869615375995636, 0.08231498301029205, 0.017018381506204605, -0.10193392634391785, -0.1594424992799759, -0.40271908044815063, -0.07900100201368332, -0.023644253611564636, 0.05134415626525879, -0.4308812618255615, 0.08279939740896225, 0.03423897922039032, 0.2008693963289261, 0.14056530594825745, -0.3513990044593811, 0.5995017886161804, -0.10225138813257217, 0.1530691683292389, 0.762315034866333, -0.00012471176160033792, 0.1681516319513321, 0.49418318271636963, 0.10088975727558136, -0.45827198028564453, -0.35208696126937866, -0.05663282796740532, -0.09670060873031616, 0.48054957389831543, -0.17104609310626984, -0.13760912418365479, -0.2308528572320938, 0.06653644889593124, -0.5361933708190918, 0.31534889340400696, 0.2725768983364105, 0.09685716032981873, 0.2802475392818451, -0.057647112756967545, -0.00940752774477005, 0.32364627718925476, 0.5928134918212891, -0.19410571455955505, 0.20818842947483063, 0.3197595477104187, -0.057226214557886124, -0.005589060485363007, 0.09380456805229187, -0.18090632557868958, 0.031327325850725174, 0.18559084832668304, -0.012496106326580048, -0.07660458981990814, 0.06443807482719421, 0.06893095374107361, 0.29713401198387146, 0.6453992128372192, -0.27411872148513794, -0.48070651292800903, -0.15239885449409485, 0.10533834248781204, 0.0221560001373291, 0.45314061641693115, -0.11618314683437347, -0.1112847626209259, -0.1279822289943695, -0.40218037366867065, 0.06984639167785645, 0.02904188632965088, 0.13828441500663757, 0.06279503554105759, 0.06114187836647034, 0.13239112496376038, 0.27016788721084595, -0.11302648484706879, -0.22648921608924866, 0.7404735684394836, -0.06500323116779327, 0.14394746720790863, 0.10044443607330322, -0.3708350360393524, 0.11073324084281921, 0.1997460275888443, 0.24339407682418823, -0.19369196891784668, -0.18894141912460327, 0.17314742505550385, -0.041661832481622696, -0.29031792283058167, 0.4212544858455658, 0.1575181931257248, 0.2608824074268341, 0.16926631331443787, 0.06446012109518051, 0.20369379222393036, 0.08637511730194092, -0.4312576353549957, 0.19719034433364868, -0.4074532687664032, -0.12704305350780487, 0.12686286866664886, 0.07134535163640976, 0.3290267288684845, -0.16838805377483368, -0.09152696281671524, 0.07027092576026917, -0.19102007150650024, 0.028537940233945847, 0.3313782513141632, 0.14874406158924103, -0.005177460610866547, 0.28698891401290894, 0.011567682027816772, 0.12049632519483566, -0.086344413459301, -0.2630581557750702, -0.30670520663261414, -0.09816772490739822, -0.21132725477218628, 0.018670231103897095, 0.18523332476615906, 0.17728184163570404, 0.02134513109922409, -0.07726217061281204, -0.2698250710964203, 0.1305912733078003, -0.12714751064777374, -0.19718220829963684, -0.09286543726921082, 0.20061402022838593, -0.2744671106338501, 0.09364937245845795, 0.4162295460700989, -0.25852763652801514, -0.18884296715259552, 0.22885331511497498, -0.4582706093788147, -0.26046961545944214, -0.13200514018535614, 0.005497380159795284, -0.17557817697525024, -0.19691218435764313, -0.15596750378608704, -0.17995356023311615, 0.35149261355400085, -0.21924051642417908, -0.07853731513023376, -0.3669940233230591, -0.11344867944717407, -0.1641409993171692, -0.1529383361339569, 0.5695219039916992, -0.5955865383148193, -0.24454572796821594, -0.10747431963682175, 0.17151659727096558, 0.15339648723602295, 0.11233776062726974, -0.4041150212287903, 0.0841568112373352, -0.11189983785152435, -0.31369253993034363, 0.3080905079841614, -0.525516152381897, -0.18221914768218994, 0.38153275847435, -0.2227303683757782, 0.013522081077098846, 0.23715034127235413, -0.1006118655204773, -0.3821970820426941, -0.03662686049938202, 0.3969230353832245, 0.21913906931877136, -0.06979021430015564, 0.07031439244747162, -0.10600131750106812, -0.5454639196395874, 0.3436867594718933, 0.3289559483528137, 0.0514393150806427, 0.21811676025390625, -0.15793374180793762, -0.06641808897256851, 0.11594042181968689, -0.06648844480514526, 0.09688835591077805, 0.2888953685760498, 0.2781471014022827, 0.09514490514993668, 0.09984526038169861, -0.055706873536109924, -0.5965362787246704, 0.18141967058181763, -0.006689377129077911, 0.1206664890050888, -0.23016712069511414, -0.2372753918170929, -0.11489726603031158, -0.03922479227185249, -0.26550665497779846, 0.13057145476341248, -0.009614270180463791, 0.31100592017173767, -0.1754893958568573, -0.019280165433883667, -0.20295390486717224, 0.04981672018766403, -0.23036420345306396, 0.09657837450504303, -0.44889992475509644, 0.11029836535453796, 0.2776215672492981, -0.19661027193069458, -0.19809116423130035, 0.3595885634422302, 0.1616109013557434, -0.09790089726448059, -0.22499912977218628, 0.3749774396419525, 0.06809362769126892, 0.1790718138217926, 0.12264224886894226, -0.08798569440841675, 0.006388971582055092, 0.2533372938632965, 0.17430341243743896, 0.18136146664619446, 0.042705535888671875, -0.06777673959732056, -0.15014435350894928, 0.32786646485328674, 0.007280380465090275, 0.4203823506832123, -0.21283021569252014, -0.04072772338986397, 0.1698625385761261, -0.09138936549425125, -0.1053900197148323, -0.21426746249198914, 0.023157484829425812, 0.3810933530330658, 0.6293420195579529, 0.1721453219652176, -0.2719994783401489, -0.03709176555275917, 0.6215812563896179, 0.13882207870483398, 0.022707967087626457, 0.07426130771636963, -0.33518171310424805, -0.0865577757358551, 0.12029635161161423, 0.49221736192703247, 0.4622131288051605, 0.04801023006439209, -0.06350058317184448, -0.08014659583568573, -0.14850401878356934, -0.17384758591651917, -0.1871531903743744, 0.09740322828292847, 0.3470246195793152, 0.2408951371908188, 0.31730732321739197, 0.13315275311470032, -0.48373186588287354, -0.20022736489772797, 0.08564137667417526, 0.21038413047790527, -0.2801576852798462, 0.20687472820281982, -0.4797295033931732, 0.025676913559436798, -0.43013694882392883, -0.21813739836215973, -0.3161517381668091, -0.3282123804092407, -0.27379950881004333, 0.217644602060318, -0.1132126897573471, 0.28188419342041016, 0.00020964443683624268, 0.08195918053388596, -0.047300469130277634, -0.39266470074653625, -0.03689467906951904, -0.3686661422252655, -0.3396454453468323, -0.12503266334533691, 0.3494303524494171, -0.28169870376586914, -0.0014213761314749718, -0.2881491780281067, -0.01634269207715988, -0.17889916896820068, 0.012328758835792542, -0.1133079081773758, -0.05440161004662514, 0.17178799211978912, 0.13445743918418884, 0.16475413739681244, -0.16328439116477966, -0.35177794098854065, 0.4541735053062439, -0.21455222368240356, 0.05633772164583206, 0.09162075817584991, -0.11360742896795273, 0.09418050944805145, -0.07728133350610733, -0.1480761468410492, -0.30944764614105225, -0.2352881133556366, 0.2544845640659332, 0.15167224407196045, 0.14644615352153778, -0.008283454924821854, 0.16683097183704376, 0.327698290348053, 0.12014137953519821, 0.06155829876661301, -0.13567547500133514, -0.7488096952438354, 0.16071581840515137, -0.062218472361564636, -0.14602884650230408, 0.03054238110780716, -0.0820332020521164, 0.2813909947872162, 0.2469748556613922, -0.3077046275138855, -0.2088175266981125, 0.00710807740688324, 0.014399252831935883, 0.053573090583086014, -0.17153334617614746, 0.47828173637390137, 0.3366345465183258, -0.008961692452430725, -0.03312362730503082, -0.1218574121594429, 0.08928945660591125, 0.2984756529331207, 0.23550015687942505, 0.24231867492198944, 0.39657828211784363, -0.21005642414093018, 0.23815476894378662, -0.1802414059638977, -0.3256013095378876, 0.44143861532211304, -0.07906552404165268, 0.045727770775556564, -0.27379941940307617, -0.22376415133476257, 0.025163128972053528, -0.2017962634563446, -0.31658416986465454, -0.08815693855285645, -0.027864739298820496, -0.09522754698991776, -0.2602216601371765, 0.10322868824005127, -0.3125316798686981, -0.25383460521698, 0.132083460688591, -0.14285896718502045, 0.0034923097118735313, 0.01382477581501007, 0.15906251966953278, -0.40032562613487244, -0.025546230375766754, 0.03620017692446709, 0.09734134376049042, 0.20351403951644897, -0.10490930825471878, -0.44718146324157715, -0.024271918460726738, -0.03290071338415146, 0.30286628007888794, -0.030189605429768562, 0.40616294741630554, -0.11183061450719833, -0.19363358616828918, -0.04703521355986595, 0.05077660083770752, 0.6272121667861938, -0.12806865572929382, 0.15774011611938477, 0.38541316986083984, 0.019072040915489197, -0.42900392413139343, -0.20398323237895966, 0.09820357710123062, 0.11056386679410934, -0.3416990339756012, 0.5077475905418396, 0.05787047743797302, -0.19032765924930573, 0.1448117047548294, 0.3141293525695801, -0.2124784290790558, -0.16790887713432312, -0.014299854636192322, -0.0025338008999824524, -0.16795200109481812, -0.10663993656635284, -0.4241323173046112, 0.36459702253341675, -0.21663016080856323, -0.06012905389070511, -0.3536640703678131, 0.029897496104240417, 0.15632647275924683, -0.05062977969646454, 0.2884293794631958, 0.03502373397350311, 0.05044788867235184, 0.22131259739398956, 0.3235739469528198, 0.5275537967681885, 0.524459183216095, -0.1426786482334137, -0.21150727570056915, 0.07615891844034195, 0.03288159519433975, 0.1265672892332077, 0.4351818263530731, -0.10699637234210968, -0.06528879702091217, 0.17680920660495758, 0.0804087445139885, -0.29524537920951843, 0.10537532716989517, 0.4551147520542145, -0.18882542848587036, -0.2500448226928711, -0.5626127123832703, 0.5804992914199829, 0.2573118209838867, -0.0528009831905365, 0.2374943494796753, 0.026826009154319763, -0.32436618208885193, 0.6164824962615967, 0.11077427864074707, 0.828120231628418, -0.12782633304595947, 0.34050726890563965, 0.22762706875801086, 0.2574698030948639, 0.20753252506256104, -0.04244876280426979, 0.06719334423542023, -0.348346471786499, -0.009527359157800674, -0.16649805009365082, -0.11143021285533905, 0.35271158814430237, 0.2712298333644867, 0.09356477856636047, 0.3209892511367798, -0.3084298372268677, 0.4674207270145416, -0.07031785696744919, -0.2554222643375397, -0.12137798964977264, -0.17551575601100922, -0.20529751479625702, 0.007325660437345505, -0.11794976145029068, 0.2512630224227905, 0.12341301143169403, -0.03697412461042404, -0.2589271366596222, -0.07990366965532303, -0.03760383278131485, 0.05228349566459656, -0.28850671648979187, -0.02855740115046501, -0.016433101147413254, -0.29090195894241333, -0.11440423130989075, 0.5046533346176147, 0.300392210483551, 0.04865327104926109, -0.3509071469306946, 0.22269706428050995, 0.1650356501340866, 0.15620216727256775, -0.2278335839509964, -0.08246032893657684, 0.47452959418296814, 0.2019636631011963, -0.08207723498344421, -0.14035722613334656, -0.20266777276992798, -0.15311112999916077, -0.08986484259366989, 0.052703857421875, 0.07713530957698822, -0.4923016428947449, -0.36478957533836365, -0.1409260481595993, 0.3159419596195221, -0.23174096643924713, 0.04643097519874573, 0.06257019191980362, 0.0955704003572464, -0.15715916454792023, -0.18115851283073425, -0.1322518289089203, -0.0587889701128006, 0.69977867603302, 0.30384010076522827, 0.04090604931116104, 0.5677511096000671, 0.08454957604408264, 0.11089068651199341, -0.17881757020950317, 0.13716033101081848, 0.7440907955169678, -0.30158352851867676, 0.0925026535987854, 0.08303792774677277, -0.18569107353687286, 0.0904121845960617, 0.026017285883426666, 0.12392790615558624, 0.2324649542570114, -0.09283497184515, -0.16213759779930115, -0.5891733765602112, 0.32609039545059204, 0.150411918759346, 0.04641222208738327, 0.039156973361968994, 0.06254619359970093, 0.018748484551906586, -0.22031377255916595, -0.14451448619365692, 0.20277266204357147, -0.0659664198756218, 0.05766741558909416, -0.26833176612854004, -0.03302207961678505, 0.3784938156604767, -0.10614427179098129, 0.09743870794773102, -0.16626818478107452, -0.14058420062065125, -0.0892699733376503, -0.2210748791694641, 0.16600200533866882, 0.22301384806632996, 0.21076270937919617, -0.06069406494498253, -0.23803040385246277, 0.05768688768148422, -0.16725453734397888, 0.02822192758321762, 0.1668311506509781, -0.10253408551216125, 0.30186107754707336, 0.39448830485343933, 0.4711170792579651, 0.25721290707588196, 0.13686205446720123, -0.008413486182689667, 0.052748601883649826, -0.004727162420749664, -0.0028826522175222635, -0.02899155579507351, -0.05413266271352768, -0.30446210503578186, -0.03000374138355255, -0.18160590529441833, 0.2773178219795227, 0.06379121541976929, -0.3808189034461975, -0.05766197293996811, 0.024488940834999084, 0.37990570068359375, 0.4921437203884125, -0.1862136423587799, -0.18149174749851227, 0.2507159113883972, 0.07531129568815231, -0.06927204132080078, -0.3369019329547882, 0.43218061327934265, 0.012595493346452713, -0.05331747606396675, -0.03806137293577194, 0.08415776491165161, 0.06414459645748138, -0.3686389625072479, 0.05772002786397934, 0.36032408475875854, -0.333447128534317, 0.36755090951919556, 0.5985751152038574, -0.10043260455131531, -0.006600694730877876, 0.11142528802156448, 0.29023662209510803, 0.15355142951011658, 0.5729610919952393, -0.01994062215089798, 0.10583275556564331, 0.061663199216127396, 0.013118579052388668, 0.0022538453340530396, -0.4899999499320984, 0.3100299835205078, 0.3319568634033203, -0.0819617286324501, 0.11390748620033264, -0.17133983969688416, 0.604235827922821, -0.3191520869731903, -0.23603872954845428, -0.24429860711097717, -0.007748479954898357, -0.25708624720573425, -0.3306942582130432, -0.00014107674360275269, -0.2038198709487915, -0.2625972032546997, 0.08791513741016388, -0.3153707981109619, -0.10663218051195145, 0.15729862451553345, -0.14793241024017334, -0.08714748919010162, -0.39855217933654785, -0.0034986641258001328, 0.1019720509648323, 0.04618551582098007, -0.18979720771312714, 0.10885882377624512, 0.17555809020996094, -0.09393958747386932, 0.20119085907936096, -0.11951132118701935, 0.248661607503891, 0.43376246094703674, -0.22134166955947876, 0.030153688043355942, -0.14950239658355713, -0.11649039387702942, -0.07877616584300995, 0.04596732184290886, -0.16468167304992676, 0.09001825749874115, 0.306781530380249, 0.09820427745580673, -0.05579379200935364, 0.3396400809288025, -0.24012598395347595, 0.34636807441711426, -0.11547792702913284, 0.6115949749946594, -0.08182914555072784, -0.09648680686950684, 0.06383736431598663, 0.10027658939361572, -0.3769283592700958, -0.23536774516105652, 0.5371758937835693, 0.24997061491012573, 0.19387340545654297, -0.07399341464042664, -0.012949209660291672, -0.21424871683120728, 0.6013955473899841, 0.1780431568622589, -0.10042867064476013, -0.1628190279006958, -0.11895009875297546, -0.4828576147556305, 0.2658025920391083, -0.03650658205151558, 0.14723005890846252, 0.09350275993347168, -0.0835045576095581, -0.09532521665096283, -0.26922836899757385, -0.2339158058166504, -0.20085902512073517, 0.15259958803653717, 0.1529567986726761, -0.4295017123222351, -0.12915322184562683, -0.08556799590587616, -0.01972447708249092, 0.13919596374034882, -0.4197370409965515, 0.16734597086906433, -0.001989740878343582, -0.11047780513763428, -0.019453421235084534, -0.12385375052690506, 0.1190679669380188, 0.03251849114894867, 0.3975845277309418, -0.0016772355884313583, 0.17813363671302795, 0.22527974843978882, -0.0901135504245758, -0.33845454454421997, -0.4012773931026459, -0.20873476564884186, 0.3889995217323303, -0.05821733921766281, 0.5737128853797913, -0.21196366846561432, 0.33397698402404785, -0.28866517543792725, 0.07612007111310959, -0.1299741566181183, 0.011783253401517868, -0.20768244564533234, 0.06637949496507645, 0.010028727352619171, -0.05627700686454773, 0.1722022294998169, 0.08456113934516907, 0.26016438007354736, 0.41460302472114563, -0.1310597062110901, -0.19866639375686646, 0.7059061527252197, -0.30806469917297363, -0.23259148001670837, 0.08979884535074234, 0.0809064656496048, 0.036841683089733124, -0.1983303427696228, -0.557014524936676, 0.10300609469413757, 0.3750161826610565, -0.008213209919631481, -0.14020442962646484, 0.0124502032995224, -0.009198131039738655, -0.025671139359474182, -0.08652591705322266, 0.1621943712234497, -0.09372462332248688, 0.014321118593215942, -0.016399957239627838, -0.1966097354888916 ]
https://github.com/huggingface/datasets/issues/5809
Hi ! I don't remember exactly how it was done, but maybe you have to embed `f"{title}<sep>{text}"` ? Using a HF tokenizer it corresponds to doing ```python tokenized = tokenizer(titles, texts) ```
wiki_dpr details for Open Domain Question Answering tasks
Hey guys! Thanks for creating the wiki_dpr dataset! I am currently trying to combine wiki_dpr and my own datasets. but I don't know how to make the embedding value the same way as wiki_dpr. As an experiment, I embeds the text of id="7" of wiki_dpr, but this result was very different from wiki_dpr.
32
wiki_dpr details for Open Domain Question Answering tasks Hey guys! Thanks for creating the wiki_dpr dataset! I am currently trying to combine wiki_dpr and my own datasets. but I don't know how to make the embedding value the same way as wiki_dpr. As an experiment, I embeds the text of id="7" of wiki_dpr, but this result was very different from wiki_dpr. Hi ! I don't remember exactly how it was done, but maybe you have to embed `f"{title}<sep>{text}"` ? Using a HF tokenizer it corresponds to doing ```python tokenized = tokenizer(titles, texts) ```
[ 0.058335259556770325, -0.6291362643241882, 0.005163419991731644, 0.25820544362068176, -0.027563676238059998, 0.018641412258148193, 0.29902830719947815, 0.04544338211417198, 0.17212235927581787, 0.5337421894073486, -0.17683109641075134, 0.17993849515914917, 0.30286556482315063, 0.06368536502122879, -0.07691460847854614, -0.1705493927001953, 0.3004089593887329, 0.2540435791015625, 0.2589224576950073, -0.0298495814204216, -0.04910712689161301, -0.06780489534139633, -0.2753303050994873, -0.012134093791246414, 0.11878037452697754, 0.12049856781959534, -0.3134387135505676, -0.2685626149177551, -0.033089205622673035, -0.34487292170524597, 0.3357856571674347, 0.3175572454929352, 0.4803100824356079, 0.2052384912967682, -0.00011309184628771618, -0.15897239744663239, 0.20400872826576233, 0.07948288321495056, 0.12006361037492752, -0.048951998353004456, -0.34926357865333557, -0.2125362753868103, 0.18299663066864014, -0.2649226486682892, -0.1114092767238617, -0.45668041706085205, -0.2020629644393921, 0.10475140810012817, 0.31533169746398926, -0.2719646096229553, 0.09918975830078125, -0.21706846356391907, -0.2550199329853058, -0.04095422849059105, -0.2506963014602661, 0.18462209403514862, 0.08779816329479218, 0.08735634386539459, -0.08153823018074036, 0.03254427760839462, 0.24299442768096924, 0.009269576519727707, 0.0071867480874061584, 0.017119869589805603, 0.20223712921142578, 0.3168850541114807, 0.21809440851211548, -0.21858541667461395, 0.13466539978981018, 0.19333907961845398, 0.672798216342926, 0.05839463323354721, 0.15358315408229828, 0.1095573678612709, -0.011405501514673233, -0.10861822962760925, 0.046911031007766724, -0.13996621966362, 0.2492091953754425, 0.30529552698135376, 0.1438368260860443, 0.00031239166855812073, -0.5256787538528442, 0.37475666403770447, -0.29908138513565063, 0.5485211610794067, 0.07502772659063339, 0.05448423698544502, -0.31728628277778625, -0.3697768449783325, 0.009505566209554672, -0.3108840584754944, -0.06913229823112488, -0.26123929023742676, 0.22730369865894318, -0.22565698623657227, -0.49222463369369507, -0.12925226986408234, 0.14841048419475555, 0.17956753075122833, -0.1408579796552658, 0.15206743776798248, 0.08963650465011597, 0.29202112555503845, 0.024580925703048706, 0.007514063268899918, 0.21209484338760376, 0.4100450575351715, 0.11122160404920578, -0.3296457529067993, -0.30387210845947266, -0.15147629380226135, 0.06575292348861694, 0.2751396596431732, -0.004438385367393494, -0.2800639867782593, -0.028887320309877396, -0.21288147568702698, 0.13069835305213928, 0.3191116452217102, -0.3230019211769104, -0.07547604292631149, -0.36694008111953735, 0.23388440907001495, -0.27308154106140137, 0.37885650992393494, -0.07988793402910233, 0.25002676248550415, -0.02820926159620285, 0.153534397482872, 0.038849979639053345, -0.0020282082259655, 0.12582999467849731, 0.12096647173166275, -0.13152281939983368, 0.21182110905647278, 0.2578131854534149, 0.2040361911058426, 0.5805000066757202, -0.32173141837120056, 0.18142519891262054, 0.21679000556468964, 0.7499780654907227, -0.028570640832185745, 0.26458191871643066, 0.1189756840467453, 0.09958462417125702, -0.45098134875297546, -0.3143376111984253, 0.0727899968624115, 0.005169060081243515, -0.19589993357658386, -0.4873060882091522, 0.14884307980537415, 0.06148703396320343, -0.06611358374357224, -0.02665049582719803, 0.25841081142425537, 0.06402570754289627, -0.13513115048408508, 0.2614765167236328, 0.06680864095687866, -0.23509079217910767, -0.32124248147010803, 0.45783722400665283, 0.039623845368623734, -0.2177358865737915, 0.02147599309682846, 0.21330919861793518, 0.0892927423119545, -0.08647887408733368, 0.09430798888206482, -0.09533300995826721, 0.07969924807548523, -0.048956431448459625, 0.4969291090965271, 0.2583351135253906, -0.7557860612869263, -0.27431362867355347, 0.43176376819610596, 0.16933183372020721, -0.04093708470463753, 0.19764885306358337, -0.03632558137178421, 0.5561724305152893, 0.08684679120779037, 0.29098689556121826, 0.43554264307022095, -0.09162036329507828, -0.0012395307421684265, -0.028602294623851776, 0.10970856249332428, 0.06491509079933167, -0.14099186658859253, -0.21998971700668335, -0.07572992146015167, 0.062287867069244385, 0.06054208055138588, 0.32054403424263, -0.10646960139274597, 0.023320533335208893, 0.027194011956453323, 0.3432142436504364, 0.13421937823295593, -0.044965460896492004, 0.110013447701931, 0.15138092637062073, -0.25004711747169495, -0.036702100187540054, 0.1778806746006012, 0.0532657615840435, -0.5056289434432983, -0.42545127868652344, 0.08659521490335464, -0.11860503256320953, -0.3398267924785614, 0.10909564793109894, 0.21024638414382935, 0.02006930112838745, -0.03490108251571655, 0.06936610490083694, -0.13021065294742584, 0.2582215666770935, -0.03171008080244064, -0.10239952057600021, 0.13128428161144257, -0.22920453548431396, 0.20702867209911346, -0.0833975225687027, 0.3621941804885864, 0.410023957490921, 0.21131394803524017, 0.11497663706541061, 0.07831369340419769, -0.28465259075164795, 0.21343860030174255, 0.1329689919948578, 0.14737704396247864, 0.384348601102829, -0.5112824440002441, 0.20690259337425232, 0.15850812196731567, -0.038384705781936646, 0.013726085424423218, -0.05443548411130905, 0.49461132287979126, 0.23034077882766724, 0.22645936906337738, -0.3138279914855957, -0.12895861268043518, -0.02570118010044098, -0.11213421821594238, 0.032684311270713806, -0.38945823907852173, -0.1757373958826065, 0.1297042965888977, -0.2836921513080597, -0.135629802942276, 0.07982663065195084, 0.3556714951992035, -0.18126459419727325, -0.4298734664916992, 0.1457287073135376, -0.17266026139259338, -0.4003720283508301, -0.327532023191452, 0.1931547224521637, -0.1589958667755127, 0.10580823570489883, 0.2819547653198242, 0.3393712341785431, 0.11186320334672928, -0.034486304968595505, -0.15729932487010956, 0.4268375337123871, 0.15569397807121277, -0.7400050759315491, 0.3129628300666809, 0.2762824594974518, 0.22323961555957794, 0.10917011648416519, 0.20371706783771515, -0.1333601474761963, -0.14939697086811066, -0.24687603116035461, 0.03614775091409683, -0.35400253534317017, 0.048544496297836304, -0.10111655294895172, -0.17363595962524414, -0.11220410466194153, -0.5662320852279663, 0.11715009063482285, -0.21637827157974243, 0.12384112179279327, 0.2347486913204193, -0.024393122643232346, 0.05845383554697037, -0.4174061119556427, -0.10936937481164932, 0.08245301991701126, -0.21723811328411102, -0.3410477638244629, -0.07552723586559296, -0.27143537998199463, 0.3811452090740204, 0.5730994939804077, 0.33886831998825073, 0.12018127739429474, -0.3312251567840576, -0.5019934773445129, 0.2652227580547333, 0.14303503930568695, 0.22436687350273132, -0.1253337264060974, -0.06892980635166168, -0.1950276494026184, -0.2361353039741516, 0.05502788722515106, 0.0669790506362915, -0.055252909660339355, -0.3299574851989746, -0.11053630709648132, 0.09831171482801437, 0.03532341867685318, -0.26420512795448303, -0.46309998631477356, -0.18385715782642365, -0.18198686838150024, -0.058269523084163666, -0.02412833273410797, -0.10579799115657806, -0.0708831325173378, -0.2896316647529602, 0.24218812584877014, -0.055390410125255585, -0.392045795917511, 0.01718255877494812, 0.4728088080883026, -0.6290163397789001, -0.16388627886772156, 0.021339043974876404, -0.27646350860595703, -0.0710473507642746, -0.1185462698340416, -0.1533922702074051, -0.11220011115074158, 0.0738549456000328, 0.3935365080833435, -0.006513182073831558, 0.36758318543434143, -0.09278866648674011, 0.09660743921995163, -0.1268961876630783, -0.12665121257305145, -0.08142873644828796, 0.15967749059200287, -0.06912446767091751, 0.03204188123345375, 0.28754061460494995, 0.0037519335746765137, -0.30591461062431335, 0.4741716682910919, 0.34047746658325195, -0.046636272221803665, 0.33724138140678406, -0.39247170090675354, 0.18083474040031433, 0.2108020782470703, -0.06490930169820786, -0.14843657612800598, 0.23761503398418427, 0.2086377739906311, 0.6472613215446472, 0.30645641684532166, 0.1703851819038391, -0.07340167462825775, -0.6028181910514832, -0.47872820496559143, -0.26071029901504517, -0.008268538862466812, -0.029500432312488556, 0.04444418102502823, -0.2621852159500122, -0.29970988631248474, -0.2404966801404953, -0.3704989552497864, 0.40461266040802, -0.007301304489374161, -0.19060459733009338, -0.1889074146747589, -0.17015227675437927, 0.09961512684822083, -0.5037344098091125, 0.5779474377632141, 0.2142767459154129, -0.13423803448677063, 0.055927351117134094, 0.14482933282852173, 0.26554661989212036, 0.005715787410736084, 0.4472840130329132, -0.6226272583007812, -0.03969727084040642, -0.2012488842010498, -0.17781201004981995, 0.1850605309009552, 0.1739494651556015, -0.07636961340904236, -0.2645512819290161, -0.21946248412132263, 0.25441110134124756, -0.4802722930908203, 0.06290256977081299, 0.3760583698749542, -0.060886405408382416, -0.3895849585533142, -0.3549290895462036, 0.10672140121459961, -0.280971884727478, -0.13446646928787231, -0.5069916248321533, 0.21699278056621552, 0.48196548223495483, 0.03810655325651169, -0.19283364713191986, -0.2135099619626999, 0.13596105575561523, 0.5396823883056641, 0.23015744984149933, 0.10062482208013535, 0.07462061941623688, 0.04772725701332092, 0.06429891288280487, 0.25677645206451416, 0.3475389778614044, 0.08208826184272766, 0.059611644595861435, 0.027314236387610435, -0.3196445107460022, -0.09756234288215637, 0.5276679396629333, 0.23632997274398804, 0.16519783437252045, 0.35588425397872925, -0.2348875105381012, -0.0851951390504837, -0.31100741028785706, -0.06943545490503311, -0.14465494453907013, -0.13409480452537537, -0.45943358540534973, -0.1622210592031479, 0.47173023223876953, 0.09836754947900772, -0.33022499084472656, 0.007773709017783403, 0.41963160037994385, -0.36990636587142944, 0.3403904139995575, 0.16592538356781006, 1.0586000680923462, 0.15044119954109192, 0.2819693684577942, 0.16302171349525452, -0.14469163119792938, 0.3235737085342407, -0.3671616017818451, -0.2524317502975464, -0.38686829805374146, 0.06199308857321739, -0.18921929597854614, 0.10702526569366455, -0.042188435792922974, 0.1655750572681427, -0.49920666217803955, -0.0684092566370964, 0.14459587633609772, 0.04174712300300598, -0.2395220696926117, 0.44587820768356323, 0.03728208690881729, -0.14224515855312347, -0.2434292435646057, 0.03394190967082977, 0.3423287868499756, -0.0019254731014370918, 0.037568334490060806, -0.23850448429584503, -0.1283581405878067, -0.10568051040172577, -0.155389204621315, -0.027389414608478546, 0.25055432319641113, 0.28155848383903503, 0.06257924437522888, -0.35637086629867554, 0.0341956689953804, 0.4019809365272522, 0.571570873260498, 0.07873168587684631, -0.2632850110530853, 0.256043016910553, -0.3449365496635437, -0.005246248096227646, -0.14649145305156708, -0.059187568724155426, 0.017738038673996925, 0.1009577065706253, -0.34834861755371094, 0.15433374047279358, 0.39099931716918945, -0.20215710997581482, -0.6699047088623047, 0.04504946991801262, 0.05648257955908775, -0.3511531352996826, -0.03488535434007645, -0.12656128406524658, -0.14443737268447876, -0.002840593457221985, 0.05016030743718147, -0.14630118012428284, -0.2615637481212616, 0.007753279060125351, 0.511759877204895, -0.1132318377494812, 0.13681109249591827, 0.07875822484493256, 0.014316877350211143, -0.3526594340801239, 0.295990914106369, -0.03862462192773819, -0.18804150819778442, -0.008279025554656982, 0.3300400972366333, 0.30169612169265747, 0.228230819106102, -0.37642598152160645, 0.07446525990962982, -0.1632794290781021, 0.0007125809788703918, 0.3740658760070801, 0.2990404963493347, 0.13162057101726532, 0.033701516687870026, -0.08682265877723694, -0.2087944895029068, 0.02204870618879795, -0.05393171310424805, 0.32941246032714844, 0.030462712049484253, -0.21998189389705658, -0.20841987431049347, 0.3511810600757599, -0.25352808833122253, -0.137386292219162, -0.10054156184196472, 0.09079898148775101, -0.23749497532844543, -0.0661267340183258, 0.11903905868530273, 0.17034292221069336, -0.0005462020635604858, 0.03701533377170563, 0.0147499218583107, -0.06308217346668243, -0.3229873478412628, 0.24608135223388672, 0.14816929399967194, -0.016502488404512405, -0.3137437701225281, -0.04205894097685814, -0.12018425762653351, -0.2481592744588852, 0.10282871127128601, 0.025232575833797455, 0.09185752272605896, -0.023756999522447586, 0.041915781795978546, 0.2645348608493805, -0.3776097297668457, 0.03466866910457611, 0.24732068181037903, 0.6480720043182373, 0.08470044285058975, -0.29825931787490845, -0.16813525557518005, -0.1312171220779419, 0.040870726108551025, 0.42556309700012207, 0.5283044576644897, -0.30973032116889954, 0.1993766725063324, 0.2469640076160431, -0.17233002185821533, 0.041242845356464386, 0.32600727677345276, -0.03684009239077568, -0.21914096176624298, 0.3177674412727356, 0.11416789144277573, 0.11642124503850937, 0.12351773679256439, 0.04325681924819946, 0.4532977342605591, -0.5416856408119202, -0.1838959902524948, 0.3614864945411682, 0.17863227427005768, 0.17977114021778107, -0.3241966962814331, -0.015288177877664566, 0.21716469526290894, -0.4267921447753906, -0.2759571671485901, 0.17896777391433716, -0.040588848292827606, 0.10059169679880142, 0.09570781886577606, 0.38548290729522705, 0.3380453288555145, -0.15440261363983154, 0.021506408229470253, 0.33546698093414307, 0.10943856835365295, -0.13783550262451172, 0.2483312338590622, 0.1107029914855957, 0.2727246582508087, -0.032955676317214966, 0.41829994320869446, 0.16707810759544373, 0.2593472898006439, -0.22442156076431274, 0.21300143003463745, 0.0839322954416275, -0.04299527034163475, 0.28583282232284546, 0.055829666554927826, -0.38018983602523804, -0.050127822905778885, 0.05270478129386902, -0.26453256607055664, -0.04748503491282463, 0.22208142280578613, -0.3943249583244324, -0.08750848472118378, 0.21426115930080414, -0.1745738685131073, -0.059366971254348755, 0.3426085114479065, 0.07095029205083847, 0.1668059229850769, -0.1643981635570526, -0.061309754848480225, -0.025169964879751205, 0.18501034379005432, 0.32427436113357544, 0.24633817374706268, 0.2259879857301712, 0.15294748544692993, -0.5209603309631348, 0.02505139261484146, 0.04827249050140381, -0.08640117943286896, 0.14023320376873016, 0.04901919886469841, 0.05882234871387482, 0.216250941157341, -0.04923062026500702, 0.04557128995656967, -0.17560535669326782, -0.3015422224998474, 0.38994282484054565, -0.025826741009950638, -0.03864801302552223, 0.013461410999298096, 0.14505460858345032, -0.2661811411380768, 0.16584467887878418, -0.15385469794273376, -0.5415464639663696, 0.09438842535018921, 0.2938510775566101, 0.23189431428909302, 0.08406145870685577, -0.10127335041761398, 0.07811646908521652, -0.16895416378974915, 0.24978139996528625, 0.46038830280303955, -0.018113531172275543, -0.04807426035404205, 0.18007031083106995, -0.4454604685306549, 0.32297706604003906, 0.4382559061050415, -0.4824891984462738, -0.020849712193012238, -0.06592895090579987, 0.3210543096065521, 0.20278285443782806, -0.27462899684906006, -0.18825578689575195, 0.2600230574607849, 0.23109006881713867, -0.0577833466231823, -0.13653095066547394, 0.2908083200454712, 0.11308808624744415, 0.0015587285161018372, 0.10174169391393661, -0.05167044326663017, -0.0016778744757175446, -0.06627190858125687, -0.06408965587615967, 0.18158133327960968, -0.06256930530071259, -0.16578184068202972, 0.27397042512893677, 0.05218513309955597, 0.42517906427383423, -0.3262713551521301, 0.21286238729953766, 0.607498288154602, 0.12528792023658752, -0.12186120450496674, 0.49327924847602844, -0.13076907396316528, 0.1088404506444931, -0.16815891861915588, -0.2258487045764923, 0.0019422359764575958, -0.4405665397644043, -0.09613056480884552, -0.08374205231666565, 0.02495303750038147, 0.03351709991693497, 0.04037584364414215, -0.2756009101867676, 0.07999224960803986, 0.19996310770511627, -0.11279364675283432, 0.1959308683872223, -0.03070155531167984, -0.454983651638031, 0.17850664258003235, -0.5832865834236145, -0.2051968276500702, -0.00041706860065460205, 0.2059345692396164, -0.11399728059768677, 0.10144457221031189, -0.7203043699264526, 0.15423282980918884, 0.3863065838813782, -0.17439548671245575, -0.11125795543193817, 0.17717242240905762, 0.2856459617614746, 0.08522056043148041, -0.18112441897392273, 0.1909443587064743, 0.2552889287471771, -0.0002693086862564087, -0.22986596822738647, -0.2340559959411621 ]
https://github.com/huggingface/datasets/issues/5806
Implementing this makes sense (e.g., `tensorflow_datasets`' imagefolder returns image filenames). Also, in Datasets 3.0, we plan only to store the bytes of an image/audio, not its path, so this feature would be useful when the path info is still needed.
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
40
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. Implementing this makes sense (e.g., `tensorflow_datasets`' imagefolder returns image filenames). Also, in Datasets 3.0, we plan only to store the bytes of an image/audio, not its path, so this feature would be useful when the path info is still needed.
[ -0.4825645089149475, -0.09418713301420212, -0.04889893904328346, 0.03705478087067604, 0.03574010729789734, -0.14645807445049286, 0.4693204164505005, 0.45564034581184387, 0.10660460591316223, 0.17320871353149414, 0.07409103214740753, 0.5581418871879578, -0.41195744276046753, 0.3097176253795624, 0.3713466227054596, 0.05345575511455536, -0.04924200102686882, 0.21698936820030212, -0.036284979432821274, -0.106478750705719, -0.3848728835582733, 0.26446714997291565, 0.2620776295661926, 0.14021605253219604, -0.36209094524383545, 0.1290523111820221, 0.18729513883590698, 0.23485872149467468, -0.0989215075969696, -0.197783425450325, 0.25548768043518066, 0.13440875709056854, 0.10574977844953537, 0.12710027396678925, -0.00011982204159721732, 0.020401589572429657, 0.2021847665309906, -0.43546828627586365, -0.5708070993423462, -0.5315521955490112, -0.34529533982276917, -0.21495658159255981, -0.005129486322402954, -0.5724736452102661, 0.15425896644592285, -0.1720280945301056, 0.19313383102416992, 0.032859139144420624, 0.2610081434249878, 0.1295924335718155, 0.08572995662689209, -0.08991547673940659, -0.4170883893966675, 0.045934997498989105, 0.19170646369457245, 0.5420656204223633, -0.12287382036447525, 0.15226127207279205, 0.019534550607204437, 0.0018760338425636292, -0.02589549869298935, 0.5520896911621094, 0.030250295996665955, -0.0401180237531662, 0.16916266083717346, 0.24260635673999786, -0.10895475745201111, 0.22950607538223267, -0.012354367412626743, 0.4550250172615051, 0.4940696954727173, -0.378732293844223, -0.26348018646240234, -0.5980196595191956, 0.138358935713768, -0.40042200684547424, 0.13930225372314453, -0.002904031425714493, -0.295138955116272, 0.05558212101459503, -0.1474035084247589, -0.31604984402656555, -0.08829835802316666, -0.01063985750079155, 0.09724856913089752, -0.39185404777526855, -0.07774992287158966, 0.05485382676124573, 0.30211567878723145, 0.009454723447561264, -0.0008726343512535095, -0.18002066016197205, 0.12823472917079926, 0.05613551288843155, -0.24751663208007812, -0.29371148347854614, 0.26002928614616394, -0.2299865484237671, -0.03215223178267479, 0.11445283889770508, 0.21392777562141418, -0.23376336693763733, -0.2827683389186859, 0.3562619686126709, -0.0013299696147441864, 0.01994238793849945, 0.44054272770881653, -0.11587777733802795, 0.19677886366844177, 0.28906282782554626, -0.07702384144067764, -0.23398546874523163, -0.2744542360305786, 0.3662065267562866, 0.09167728573083878, 0.04680931568145752, 0.16146275401115417, 0.017615050077438354, -0.19783484935760498, 0.21808874607086182, 0.07045681774616241, -0.24004480242729187, 0.07743752002716064, 0.33122479915618896, -0.02544746920466423, 0.23016956448554993, 0.0507587194442749, -0.3241519331932068, 0.005962282419204712, -0.2518271207809448, 0.08051244169473648, -0.17115791141986847, -0.3809027075767517, 0.23124495148658752, 0.21400569379329681, -0.02251419983804226, 0.2528511881828308, -0.4354247450828552, -0.09941215813159943, -0.004954032599925995, 0.1178748682141304, -0.17198055982589722, 0.5345028042793274, 0.024995561689138412, -0.12823733687400818, -0.14513258635997772, -0.14638027548789978, -0.09258595108985901, -0.2174384444952011, 0.06131574511528015, -0.40403980016708374, -0.4176938533782959, 0.07728543877601624, 0.031476229429244995, -0.2600640058517456, 0.2571139931678772, -0.47487860918045044, 0.3059174120426178, -0.2332620918750763, -0.10246846824884415, 0.07869942486286163, -0.09628608822822571, -0.4707084000110626, -0.10875394940376282, 0.20606054365634918, 0.3538540005683899, -0.5343413949012756, -0.30711454153060913, 0.06744512915611267, -0.33574795722961426, -0.2959960997104645, -0.049502741545438766, -0.08659529685974121, 0.21421831846237183, -0.26917243003845215, 0.1437932550907135, 0.5205675959587097, -0.131529301404953, -0.1678086221218109, -0.03501911088824272, 0.04347093403339386, 0.26471763849258423, 0.21099278330802917, 0.055826347321271896, 0.23612047731876373, -0.041967395693063736, 0.04841089993715286, 0.4600021243095398, 0.005792861804366112, -0.03046359494328499, 0.33632558584213257, -0.2286781370639801, -0.21450422704219818, 0.36760586500167847, -0.06907305121421814, -0.0075674764811992645, 0.274629145860672, 0.1587277352809906, 0.40513092279434204, -0.011647803708910942, -0.0307557862251997, 0.13433672487735748, 0.23576700687408447, 0.11518560349941254, 0.049916159361600876, -0.36462390422821045, -0.41182205080986023, 0.11032120883464813, 0.24583369493484497, -0.6023521423339844, -0.25877028703689575, -0.24015489220619202, 0.09637654572725296, 0.19513258337974548, -0.08151688426733017, 0.12009476125240326, -0.005166694521903992, 0.28215324878692627, -0.11029233038425446, 0.23202641308307648, -0.36123213171958923, 0.37993425130844116, -0.6292921304702759, -0.07661166787147522, -0.3235672116279602, 0.2589308023452759, 0.6618511080741882, -0.040319837629795074, -0.14591723680496216, 0.3860095143318176, -0.00333968922495842, 0.023256022483110428, 0.19383394718170166, 0.26936203241348267, 0.38347670435905457, 0.4982282519340515, 0.12432315945625305, 0.31720471382141113, -0.13317826390266418, 0.28069400787353516, -0.0683053508400917, -0.2500475347042084, -0.1426505744457245, 0.02137991040945053, -0.15701906383037567, 0.39080965518951416, 0.12927599251270294, 0.2179509997367859, 0.19158971309661865, -0.3046841025352478, -0.07651510089635849, -0.13142627477645874, -0.33493369817733765, -0.2280454933643341, 0.28043851256370544, 0.10103170573711395, -0.021755646914243698, -0.05513677000999451, -0.37504202127456665, -0.269883930683136, 1.139327883720398, -0.19420507550239563, 0.10457678139209747, 0.27870896458625793, 0.008794080466032028, -0.003842279314994812, 0.18081194162368774, 0.43401145935058594, 0.30093732476234436, 0.09042295068502426, -0.09962600469589233, -0.1032528281211853, -0.043957412242889404, -0.03372841328382492, 0.02864779531955719, 0.018309835344552994, 0.4529682993888855, 0.3721124827861786, -0.043551966547966, -0.41995754837989807, -0.4359185993671417, -0.20718851685523987, 0.1694178730249405, -0.08786113560199738, 0.006277814507484436, 0.03768859803676605, -0.0761653482913971, -0.28932225704193115, -0.3719916343688965, 0.05570643022656441, -0.10849075019359589, -0.013656027615070343, -0.2083721160888672, 0.2667594850063324, -0.08793487399816513, 0.0840713307261467, 0.03036727011203766, 0.5020135641098022, -0.09676884114742279, -0.23745401203632355, -0.15826907753944397, -0.21853995323181152, 0.11806482076644897, 0.002451155334711075, -0.16225388646125793, -0.32780733704566956, 0.44363147020339966, -0.003996364772319794, 0.15372531116008759, -0.4861446022987366, 0.11845056712627411, 0.4299187660217285, -0.013423336669802666, -0.019478222355246544, 0.3183211386203766, 0.30621951818466187, -0.052097249776124954, -0.27117079496383667, 0.12602469325065613, -0.0766959935426712, -0.16020238399505615, -0.21926191449165344, 0.11283601820468903, 0.27012836933135986, -0.08162915706634521, 0.008012490347027779, -0.17022667825222015, -0.21570998430252075, 0.4373844861984253, -0.1555691361427307, 0.3568097651004791, 0.22771373391151428, -0.20304833352565765, 0.26052311062812805, -0.26605474948883057, -0.06291258335113525, -0.2786865234375, -0.6218832731246948, 0.1390191912651062, -0.14163176715373993, 0.2479652464389801, -0.14011019468307495, 0.0458308607339859, 0.028063174337148666, 0.26362913846969604, -0.31205207109451294, -0.47707539796829224, 0.3363402485847473, 0.2397514283657074, -0.2270670384168625, -0.06558648496866226, 0.08664606511592865, 0.14718735218048096, 0.020371533930301666, -0.24297799170017242, 0.023256860673427582, 0.09908732026815414, 0.16355466842651367, 0.4580587148666382, 0.4727281928062439, 0.4336043894290924, 0.28039926290512085, 0.6111080646514893, 0.05118555575609207, -0.17542828619480133, 0.16958311200141907, 0.037417732179164886, 0.06922125816345215, 0.06017564982175827, -0.06924550235271454, -0.17261284589767456, -0.20536424219608307, 0.052709273993968964, 0.047123901546001434, 0.030671648681163788, 0.09324340522289276, -0.06248177960515022, 0.2535107433795929, -0.276295930147171, -0.20329326391220093, 0.13645519316196442, -0.029261993244290352, 0.3287590444087982, -0.03755578026175499, 0.22600741684436798, -0.16908861696720123, -0.05043599382042885, 0.1950663924217224, 0.38967445492744446, 0.5584920644760132, -0.07975797355175018, -0.16080930829048157, -0.10438501834869385, -0.2916443943977356, -0.014760591089725494, 0.24476924538612366, -0.1438429355621338, -0.13874782621860504, -0.12851294875144958, -0.11549952626228333, 0.11643044650554657, 0.9901668429374695, -0.03947902470827103, 0.05686485767364502, -0.16359907388687134, -0.08743179589509964, -0.022927097976207733, -0.029641296714544296, 0.14551213383674622, -0.10945162177085876, -0.015437774360179901, 0.4981265664100647, -0.02221778780221939, -0.1424102634191513, 0.16294431686401367, 0.10504688322544098, -0.3395042419433594, -0.1777205467224121, -0.06064462661743164, 0.16427625715732574, -0.13372531533241272, -0.21928870677947998, -0.30833005905151367, -0.021547459065914154, -0.028945446014404297, -0.12796108424663544, 0.13025882840156555, -0.03193443641066551, 0.14974072575569153, 0.036248497664928436, 0.4864668548107147, 0.22377125918865204, 0.08980931341648102, 0.36239302158355713, 0.2663570046424866, 0.36251968145370483, 0.33619987964630127, -0.20392060279846191, -0.16830205917358398, 0.07772372663021088, -0.14901545643806458, 0.37168967723846436, 0.4156252443790436, -0.26837074756622314, 0.23777258396148682, -0.1988542079925537, 0.0466093048453331, -0.44690701365470886, 0.23463106155395508, 0.260000079870224, 0.15630307793617249, -0.21740415692329407, -0.5433976650238037, 0.3576166033744812, -0.22426658868789673, -0.11963406205177307, 0.39988309144973755, -0.2878754138946533, -0.2804202139377594, 0.07744317501783371, -0.14800311625003815, 0.725174069404602, -0.09877658635377884, 0.3468042016029358, 0.08636985719203949, 0.052917324006557465, 0.3015453517436981, -0.49719250202178955, -0.03167004883289337, -0.13217541575431824, -0.24138672649860382, -0.2133469581604004, -0.18143126368522644, 0.04150858893990517, 0.21357659995555878, 0.11429142951965332, -0.019777044653892517, 0.5614765286445618, 0.08276235312223434, -0.10430359840393066, 0.4572712182998657, 0.06108924001455307, -0.2823026776313782, -0.31776970624923706, -0.07034090161323547, -0.08034348487854004, -0.0416920967400074, -0.039175067096948624, -0.0414789617061615, 0.3001643419265747, 0.01163984090089798, -0.06606179475784302, -0.007171891629695892, -0.04468546062707901, 0.21334928274154663, 0.013160251080989838, -0.5925529599189758, -0.2956995964050293, 0.19215840101242065, -0.2712864279747009, 0.10673172771930695, -0.062177933752536774, 0.32866770029067993, 0.02604617550969124, 0.4201187789440155, -0.28887131810188293, -0.2119668871164322, 0.6049650311470032, 0.08602647483348846, 0.13387396931648254, 0.1547086387872696, 0.030682332813739777, -0.4158095121383667, -0.07738347351551056, -0.13031896948814392, 0.1725025177001953, -0.07729948312044144, -0.25209206342697144, -0.06012846156954765, -0.011956408619880676, -0.013171456754207611, -0.012772045098245144, 0.244435653090477, -0.1954258382320404, -0.06965037435293198, 0.11672055721282959, -0.2840612530708313, -0.023384857922792435, 0.46352267265319824, -0.06600859016180038, -0.16576001048088074, 0.37490350008010864, 0.14307312667369843, -0.032752666622400284, 0.011707648634910583, 0.2911514937877655, 0.31450241804122925, -0.21971383690834045, 0.18482592701911926, 0.2476893663406372, 0.28032785654067993, -0.19789981842041016, -0.01369989849627018, -0.0700821653008461, -0.08031778037548065, -0.28024768829345703, -0.27384334802627563, -0.05926823988556862, 0.229702889919281, -0.10556834936141968, 0.3293522000312805, 0.2709870934486389, -0.10220763087272644, 0.0464320108294487, -0.1897483766078949, -0.19032634794712067, 0.04500430077314377, 0.07257024198770523, 0.15782643854618073, 0.12331382185220718, 0.13994833827018738, 0.38601434230804443, -0.21288393437862396, -0.03957127034664154, -0.05301065370440483, -0.183649942278862, -0.08267910778522491, -0.46153366565704346, 0.19796523451805115, -0.008309471420943737, 0.3457184433937073, -0.19154927134513855, -0.3322559595108032, 0.08318215608596802, -0.2887861728668213, 0.14742374420166016, 0.13017502427101135, -0.052186403423547745, 0.2926337420940399, 0.17772960662841797, -0.02515983209013939, 0.03844473510980606, -0.07358524203300476, -0.10639685392379761, 0.3876902163028717, 0.0128994882106781, 0.1432993859052658, -0.3607511520385742, 0.18068256974220276, -0.307580828666687, 0.2987217903137207, 0.13997066020965576, 0.003809913992881775, 0.2173030823469162, 0.1774078607559204, -0.2135152518749237, -0.13106223940849304, 0.4105544686317444, 0.14533060789108276, -0.34882810711860657, -0.1812097430229187, 0.38398706912994385, 0.0998886376619339, -0.024096008390188217, -0.13319377601146698, 0.20864011347293854, -0.12384556233882904, -0.02604268491268158, 0.01741805300116539, -0.06892619282007217, 0.18328487873077393, 0.178171306848526, -0.26778438687324524, -0.0150225181132555, -0.19564113020896912, 0.33954185247421265, 0.5101814866065979, 0.24211929738521576, 0.21384982764720917, 0.14172223210334778, 0.36679279804229736, 0.2203167974948883, 0.5870133638381958, -0.008089613169431686, 0.12659527361392975, -0.018308395519852638, -0.039183903485536575, 0.021827448159456253, -0.47729259729385376, -0.21471284329891205, -0.1483246088027954, -0.5302683115005493, 0.6267791390419006, -0.05152464285492897, 0.26437950134277344, 0.10182143747806549, 0.0668756365776062, -0.40327101945877075, 0.01616905815899372, -0.12399907410144806, -0.1541246920824051, -0.3149469792842865, -0.1059664860367775, -0.0912008285522461, 0.20001797378063202, 0.10982382297515869, -0.0060792285948991776, -0.011209752410650253, 0.2218208611011505, 0.34363383054733276, 0.15269255638122559, 0.004459194839000702, -0.07462652772665024, 0.3011985719203949, -0.36012667417526245, -0.12715908885002136, -0.13309435546398163, 0.4269086420536041, 0.20044760406017303, -0.24218718707561493, -0.1530018448829651, -0.04304768145084381, 0.2693082094192505, 0.09594488143920898, -0.13466206192970276, 0.03576841950416565, -0.13628140091896057, 0.12097522616386414, 0.21059180796146393, 0.11621839553117752, 0.5142873525619507, 0.09064804762601852, -0.05326801910996437, 0.049612436443567276, 0.17277362942695618, -0.07886593788862228, -0.536638617515564, 0.11662072688341141, 0.3215615153312683, -0.07167481631040573, -0.29081991314888, 0.21108290553092957, -0.34485793113708496, 0.06245234236121178, 0.457183837890625, 0.27229970693588257, 0.05786333233118057, 0.16411267220973969, 0.05239441618323326, -0.36993440985679626, -0.03536267206072807, 0.14107035100460052, 0.11133021861314774, -0.041040658950805664, -0.28519079089164734, -0.16549226641654968, -0.16995848715305328, 0.11091703176498413, 0.11524762958288193, 0.09523191303014755, -0.026086028665304184, 0.2508600056171417, -0.019155170768499374, -0.09081407636404037, -0.275429368019104, -0.0787111446261406, 0.12550289928913116, -0.4126037657260895, -0.6888830661773682, -0.04233328998088837, 0.11348071694374084, -0.13519051671028137, -0.10256735980510712, -0.11334644258022308, 0.049786705523729324, -0.1067923977971077, -0.20682263374328613, -0.12852562963962555, -0.11634603142738342, 0.24926376342773438, 0.49319326877593994, -0.22173504531383514, 0.010789822787046432, -0.1180703267455101, -0.06500005722045898, -0.0016569308936595917, -0.1054777055978775, 0.14513514935970306, 0.07006098330020905, -0.20251847803592682, 0.6449159383773804, 0.02385641634464264, 0.04538265988230705, -0.2529376149177551, 0.15958955883979797, -0.031964946538209915, -0.00611099973320961, -0.12319719791412354, -0.14223767817020416, 0.036398522555828094, 0.10997261106967926, 0.04561492055654526, 0.3513519763946533, -0.009687095880508423, 0.19902324676513672, -0.15193255245685577, 0.05158426612615585, 0.3855154514312744, -0.3652261793613434, -0.19312599301338196, 0.0037899650633335114, 0.2937285900115967, -0.23872590065002441, 0.1812388300895691, -0.8658813238143921, -0.0363185852766037, 0.4421561360359192, -0.09550584107637405, -0.2099667489528656, 0.13770808279514313, 0.059670332819223404, 0.3643525242805481, -0.16642078757286072, 0.2642149031162262, 0.18626311421394348, -0.46969813108444214, -0.08012470602989197, -0.32746776938438416 ]
https://github.com/huggingface/datasets/issues/5806
Hey @mariosasko, Can I work on this issue, this one seems interesting to implement. I have contributed to jupyterlab recently, and would love to contribute here as well.
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
28
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. Hey @mariosasko, Can I work on this issue, this one seems interesting to implement. I have contributed to jupyterlab recently, and would love to contribute here as well.
[ -0.2670653462409973, -0.030552253127098083, -0.017161186784505844, -0.03512344881892204, 0.018165092915296555, -0.20466110110282898, 0.4512977600097656, 0.540688157081604, 0.20236021280288696, 0.15843483805656433, 0.05343162268400192, 0.5594682097434998, -0.34587737917900085, 0.4969968795776367, 0.3524354100227356, -0.0163156446069479, -0.07497595250606537, 0.1799241006374359, -0.014511331915855408, -0.10455907136201859, -0.36450326442718506, 0.2410859614610672, 0.22038164734840393, 0.11309029906988144, -0.3509906828403473, 0.15748651325702667, 0.1899424046278, 0.3477906882762909, -0.06132955849170685, -0.3308787941932678, 0.2198093831539154, 0.13587920367717743, -0.03817924112081528, 0.027460364624857903, -0.00011990705388598144, 0.01906721293926239, 0.23369011282920837, -0.462639182806015, -0.6033883094787598, -0.3040393590927124, 0.004089966416358948, -0.2541734278202057, 0.03888321667909622, -0.6265418529510498, -0.002996206283569336, -0.2998073399066925, 0.0952257513999939, 0.056342750787734985, 0.297066867351532, 0.03821799159049988, 0.07341347634792328, -0.002873234450817108, -0.28968676924705505, 0.036455344408750534, 0.10151655972003937, 0.43480464816093445, -0.00853409618139267, 0.20572718977928162, 0.08512093871831894, -0.019949346780776978, -0.06478142738342285, 0.4856361150741577, 0.045804329216480255, -0.16327401995658875, -0.02498144656419754, 0.1602805107831955, 0.03933286294341087, 0.2759329676628113, -0.04843636602163315, 0.3084110617637634, 0.5007556676864624, -0.4175410270690918, -0.19949164986610413, -0.5762293934822083, 0.13188835978507996, -0.26529189944267273, 0.05454637482762337, -0.11553387343883514, -0.30991512537002563, 0.13760891556739807, 0.16113226115703583, -0.2852371633052826, -0.06005564332008362, -0.05618266016244888, 0.1286735087633133, -0.31058818101882935, -0.004298122599720955, 0.07767575979232788, 0.2862880825996399, -0.008090383373200893, -0.09303957223892212, -0.04764010012149811, 0.11514440178871155, 0.0399702824652195, -0.2023378163576126, -0.3579235374927521, 0.310908704996109, -0.2331017106771469, 0.08697547018527985, 0.16743750870227814, 0.17384594678878784, -0.31252962350845337, -0.22676777839660645, 0.35868972539901733, 0.0328417606651783, 0.06322939693927765, 0.5354547500610352, -0.11278404295444489, 0.23560811579227448, 0.15139220654964447, -0.14643524587154388, -0.06066632270812988, -0.18951502442359924, 0.3281657099723816, 0.13715767860412598, 0.11708115041255951, 0.16858568787574768, -0.1393088400363922, -0.25792431831359863, 0.23043251037597656, -0.0922141820192337, -0.24894337356090546, 0.01593128591775894, 0.41080722212791443, 0.021464776247739792, 0.2622825503349304, 0.07629363238811493, -0.3280227780342102, -0.03428507223725319, -0.4063459038734436, 0.03442782908678055, -0.040626153349876404, -0.4176553189754486, 0.127041757106781, 0.3346059322357178, 0.026169858872890472, 0.31591975688934326, -0.4232866168022156, -0.014083724468946457, -0.1388626992702484, 0.041955672204494476, -0.08441029489040375, 0.4472179710865021, 0.0660405158996582, -0.15525874495506287, -0.28634557127952576, 0.025313962250947952, -0.21566526591777802, -0.30666226148605347, 0.10287093371152878, -0.2569263279438019, -0.4037889838218689, 0.22142218053340912, 0.01425220351666212, -0.35324767231941223, 0.20506876707077026, -0.4210137128829956, 0.3366996645927429, -0.27576494216918945, -0.15099740028381348, 0.01897856593132019, -0.12276686728000641, -0.15968438982963562, -0.17557194828987122, 0.16230547428131104, 0.4218254089355469, -0.7013237476348877, -0.41255101561546326, 0.24582931399345398, -0.3576924204826355, -0.19229283928871155, -0.0765548050403595, -0.10244597494602203, 0.2751644253730774, -0.0952104926109314, 0.10332693159580231, 0.49039334058761597, -0.18002894520759583, -0.2529628276824951, -0.10322408378124237, -0.0035006701946258545, 0.3516850173473358, 0.29536283016204834, 0.02772107720375061, 0.17069905996322632, 0.0032921135425567627, 0.09438110888004303, 0.5020938515663147, 0.05565132945775986, -0.08451630920171738, 0.14393413066864014, -0.13712210953235626, -0.11809736490249634, 0.49243903160095215, -0.12866142392158508, -0.009915769100189209, 0.3321531414985657, 0.08692741394042969, 0.42163094878196716, 0.020301438868045807, -0.05412213131785393, 0.108686164021492, 0.0899224802851677, 0.12345747649669647, 0.12771841883659363, -0.2350964993238449, -0.3741907477378845, 0.07286003232002258, 0.22721734642982483, -0.5388072729110718, -0.1053604781627655, -0.2580896019935608, -0.0669090524315834, 0.22429901361465454, -0.043912675231695175, 0.018298789858818054, 0.010904129594564438, 0.2147078514099121, -0.004384681582450867, 0.1493813544511795, -0.3079449236392975, 0.48350247740745544, -0.48769670724868774, -0.03039429895579815, -0.4537844955921173, 0.32844966650009155, 0.5919110774993896, -0.1189594715833664, -0.04138091951608658, 0.41490882635116577, 0.08789494633674622, 0.011770859360694885, 0.1724555343389511, 0.1861874759197235, 0.4611961841583252, 0.2773156464099884, 0.23239941895008087, 0.10914421826601028, -0.265729159116745, 0.3599906265735626, -0.013677496463060379, -0.03412362560629845, -0.09638846665620804, -0.07122735679149628, -0.099598228931427, 0.5409346222877502, 0.06319369375705719, 0.12296639382839203, 0.11791925132274628, -0.2344030737876892, 0.05176466703414917, -0.20038023591041565, -0.43292078375816345, -0.11020807176828384, 0.40921270847320557, 0.07565605640411377, -0.05696853622794151, -0.0890142172574997, -0.505599856376648, -0.2604729235172272, 1.050144076347351, -0.29176557064056396, 0.07908346503973007, 0.1753828525543213, -0.042497966438531876, 0.0570172518491745, 0.16252754628658295, 0.34536272287368774, 0.3724997341632843, 0.14508895576000214, -0.23552709817886353, -0.12326027452945709, -0.015470761805772781, -0.04934282600879669, -0.06477397680282593, -0.05334348976612091, 0.4079454243183136, 0.4224170744419098, 0.06625650823116302, -0.40000882744789124, -0.3689224421977997, -0.2163383960723877, 0.04782959818840027, -0.13774879276752472, 0.03316229581832886, 0.042460277676582336, -0.04196978360414505, -0.28266650438308716, -0.3430039882659912, 0.017191410064697266, -0.009283189661800861, -0.06593134999275208, -0.14573833346366882, 0.21303115785121918, -0.11297924816608429, 0.13062681257724762, 0.06760281324386597, 0.624622642993927, -0.14675697684288025, -0.2820592522621155, -0.1272180676460266, -0.3372185230255127, 0.08530902862548828, -0.005980495363473892, -0.2132299542427063, -0.13707345724105835, 0.49892857670783997, 0.02168690413236618, 0.12734879553318024, -0.29985886812210083, 0.14781330525875092, 0.34654682874679565, -0.011683128774166107, 0.14797846972942352, 0.2510351240634918, 0.31334587931632996, -0.04809186980128288, -0.24138838052749634, 0.1297069489955902, -0.19268572330474854, -0.15460652112960815, -0.16730809211730957, 0.18222925066947937, 0.25870224833488464, -0.04063287377357483, -0.07905234396457672, -0.3640170693397522, -0.2156541794538498, 0.5413028001785278, -0.08228078484535217, 0.33368566632270813, -0.09588505327701569, -0.33381640911102295, 0.21193835139274597, -0.09496007859706879, -0.10194113850593567, -0.27132323384284973, -0.5207861661911011, 0.11040744930505753, -0.24609334766864777, 0.19756430387496948, -0.11691293120384216, 0.05686890333890915, 0.0022963453084230423, -0.01601114496588707, -0.2858158349990845, -0.4666175842285156, 0.366129070520401, 0.35929417610168457, -0.32450881600379944, -0.030908796936273575, 0.08180499076843262, 0.25254741311073303, 0.003960695117712021, -0.24794748425483704, -0.08642391860485077, 0.2222473919391632, 0.06327763944864273, 0.42387738823890686, 0.3790137767791748, 0.4008072018623352, 0.10173965990543365, 0.4840018153190613, 0.10773704946041107, -0.057625748217105865, 0.0668938010931015, 0.2058299034833908, -0.05135650560259819, -0.0050579942762851715, -0.13515815138816833, -0.1937006413936615, -0.30639490485191345, 0.014884188771247864, 0.057036880403757095, -0.018980611115694046, 0.10068824887275696, -0.11481689661741257, 0.06659278273582458, -0.26052209734916687, -0.2190254181623459, 0.17311866581439972, 0.0047454917803406715, 0.1651017963886261, -0.036552589386701584, 0.13728433847427368, -0.2874087989330292, 0.028119847178459167, 0.08247628808021545, 0.4678754508495331, 0.529435932636261, -0.03396106883883476, -0.3393397033214569, -0.16683393716812134, -0.30435848236083984, 0.034246135503053665, 0.17804867029190063, -0.17899005115032196, -0.06354602426290512, -0.12331107258796692, -0.04483112692832947, 0.11102238297462463, 1.0131739377975464, 0.0705484002828598, 0.0711667388677597, -0.001600809395313263, -0.011035680770874023, -0.02411501854658127, -0.01767072081565857, 0.11940151453018188, 0.0016195550560951233, 0.19786472618579865, 0.4184049963951111, -0.14810185134410858, -0.0866166427731514, 0.2634071111679077, 0.23539963364601135, -0.44261783361434937, -0.28290000557899475, -0.14378517866134644, 0.051694780588150024, -0.21237745881080627, -0.13708347082138062, -0.20437881350517273, 0.06574826687574387, -0.07964619249105453, -0.06902611255645752, 0.03821498900651932, -0.14612969756126404, 0.20377181470394135, 0.16224664449691772, 0.5107799768447876, -0.03158123046159744, 0.1147412359714508, 0.30960604548454285, 0.31174910068511963, 0.4522457718849182, 0.4252079129219055, -0.35711973905563354, -0.11719806492328644, 0.021433979272842407, -0.18195214867591858, 0.47702473402023315, 0.44391554594039917, -0.27110302448272705, 0.35297083854675293, -0.44330230355262756, 0.0010956358164548874, -0.32962411642074585, 0.1310621201992035, 0.0997258871793747, 0.1583116352558136, -0.3078020215034485, -0.530818521976471, 0.30968421697616577, -0.3056933879852295, -0.15975403785705566, 0.3579603433609009, -0.31972047686576843, -0.2212296426296234, 0.21866749227046967, -0.25979819893836975, 0.9039714336395264, -0.029030367732048035, 0.28524360060691833, 0.058049123734235764, 0.16910839080810547, 0.27097612619400024, -0.5338308811187744, 0.10940177738666534, -0.2955716550350189, -0.3355846703052521, -0.1099657490849495, -0.2273264080286026, 0.043985992670059204, 0.22189059853553772, -0.03973373770713806, 0.08764906227588654, 0.39251184463500977, -0.11429518461227417, -0.09123919904232025, 0.5614952445030212, 0.18076325953006744, -0.16632327437400818, -0.5608903169631958, -0.09073498100042343, -0.13052253425121307, 0.026464741677045822, -0.02961977943778038, -0.09665512293577194, 0.25894346833229065, 0.003248073160648346, -0.05435195565223694, 0.057789675891399384, -0.03121786192059517, 0.2145485281944275, 0.18592442572116852, -0.44037961959838867, -0.4078434109687805, 0.1104453057050705, -0.209083691239357, 0.24870343506336212, 0.05892929434776306, 0.2502245604991913, 0.04797902703285217, 0.38131117820739746, -0.3272297978401184, -0.09855817258358002, 0.6700150370597839, 0.01291116327047348, -0.06494714319705963, 0.2416323721408844, -0.0650743767619133, -0.6242122650146484, -0.18539831042289734, -0.10509270429611206, 0.1010991781949997, -0.1915123462677002, -0.17591263353824615, 0.07635536789894104, 0.010197453200817108, -0.16771818697452545, -0.011491736397147179, 0.3274276554584503, -0.3049057424068451, 0.006434166803956032, 0.10984666645526886, -0.2692672610282898, -0.0755976140499115, 0.30887123942375183, 0.03391319140791893, -0.07344966381788254, 0.3885255753993988, 0.13528046011924744, -0.0822693258523941, -0.05140796676278114, 0.3153998851776123, 0.4784236550331116, -0.2567882537841797, 0.2956378757953644, 0.16833022236824036, 0.2643073797225952, -0.13677111268043518, 0.04225648194551468, 0.10953474044799805, 0.05852409824728966, -0.24844402074813843, -0.3240606188774109, -0.13318276405334473, 0.27642109990119934, 0.001530646812170744, 0.21507097780704498, 0.3836144804954529, 0.24073578417301178, -0.13680694997310638, 0.04831690341234207, -0.22576791048049927, 0.016019757837057114, -0.020811893045902252, 0.17873743176460266, 0.29941651225090027, 0.08100716769695282, 0.3454745411872864, -0.09014639258384705, -0.02571672573685646, 0.01721728965640068, -0.10524401068687439, -0.09150858223438263, -0.45169776678085327, 0.19046856462955475, -0.16074331104755402, 0.45247599482536316, -0.2847324311733246, -0.2557752728462219, 0.10500786453485489, -0.19179706275463104, 0.19014553725719452, 0.08544851094484329, 0.02893112041056156, 0.33328771591186523, 0.3767268657684326, 0.07779857516288757, 0.07494879513978958, 0.03896912932395935, -0.03581113740801811, 0.2618865370750427, 0.03356167674064636, 0.09069827198982239, -0.3833358585834503, 0.15638256072998047, -0.35880887508392334, 0.23404647409915924, 0.044761303812265396, 0.177747905254364, 0.1543758362531662, 0.14469310641288757, -0.2574373185634613, -0.20955440402030945, 0.3098186254501343, 0.2758985161781311, -0.35125821828842163, -0.06253290176391602, 0.41925132274627686, 0.0863192081451416, -0.11696838587522507, -0.21427254378795624, 0.3494364619255066, -0.10060140490531921, -0.00003886967897415161, 0.1709858477115631, -0.08355193585157394, 0.20621758699417114, 0.27145683765411377, -0.2312532514333725, -0.08480225503444672, -0.0364069789648056, 0.24514000117778778, 0.6374908685684204, 0.2773935794830322, 0.12652187049388885, 0.2168334424495697, 0.4198099374771118, 0.22030138969421387, 0.46963706612586975, -0.0357210710644722, 0.1325991153717041, 0.033217206597328186, -0.07870002090930939, -0.11310599744319916, -0.33250853419303894, -0.0916784331202507, -0.017878547310829163, -0.46613624691963196, 0.5838595032691956, -0.02709347754716873, 0.42550715804100037, 0.03552383556962013, -0.034158702939748764, -0.3603413999080658, 0.08526834845542908, -0.09779787808656693, -0.21815934777259827, -0.20130924880504608, -0.19223232567310333, -0.19215090572834015, 0.16758178174495697, 0.0022771854419261217, 0.09493307769298553, -0.0005730576813220978, 0.15256528556346893, 0.31392425298690796, 0.10634735226631165, 0.0385129414498806, -0.12284696102142334, 0.34037965536117554, -0.34039026498794556, -0.1569211483001709, -0.15375789999961853, 0.5017820000648499, 0.18420636653900146, -0.36375221610069275, -0.12954139709472656, -0.01699572056531906, 0.16591379046440125, -0.11844556778669357, -0.12549251317977905, -0.003526143729686737, -0.12056684494018555, 0.15517917275428772, 0.276221364736557, -0.07531037926673889, 0.5372925400733948, 0.0806104764342308, -0.06574959307909012, 0.09141302108764648, 0.3002535104751587, -0.15954098105430603, -0.5195874571800232, 0.20872730016708374, 0.4042654037475586, -0.15600360929965973, -0.2987624406814575, 0.16288045048713684, -0.33702367544174194, 0.01915004476904869, 0.24212944507598877, 0.2670125663280487, 0.04248233512043953, 0.10834099352359772, 0.0679955780506134, -0.3576428294181824, 0.019080806523561478, 0.09781806170940399, 0.018165413290262222, -0.04840896278619766, -0.2255074381828308, -0.17536577582359314, -0.12111944705247879, 0.03808655962347984, -0.024435516446828842, 0.09616672992706299, -0.14457644522190094, 0.2944372296333313, 0.12959350645542145, -0.12960167229175568, -0.30786412954330444, -0.10465221107006073, 0.08369824290275574, -0.45159631967544556, -0.6649692058563232, 0.14902305603027344, 0.09329853951931, -0.06952105462551117, -0.12971144914627075, -0.12628374993801117, 0.09929873049259186, -0.07432959228754044, -0.18780386447906494, -0.2993195354938507, -0.08720291405916214, 0.33751100301742554, 0.3544413149356842, -0.12363877147436142, 0.08461134135723114, -0.10684159398078918, -0.21455791592597961, 0.05954396724700928, -0.16512009501457214, 0.046993184834718704, 0.049464963376522064, -0.13976243138313293, 0.6103659868240356, 0.020655877888202667, 0.06497251987457275, -0.22600916028022766, 0.19625386595726013, -0.05177067965269089, 0.013336054980754852, -0.10249440371990204, -0.18978747725486755, 0.11553959548473358, 0.03630246967077255, 0.03166178986430168, 0.49285921454429626, -0.04938092082738876, 0.30836737155914307, -0.1824834793806076, 0.18795174360275269, 0.3891768157482147, -0.34006279706954956, -0.2544746696949005, 0.010723091661930084, 0.3220880627632141, -0.21123112738132477, 0.10858120024204254, -0.8031654357910156, -0.04145737737417221, 0.37687814235687256, -0.05016690120100975, -0.23485694825649261, 0.28991076350212097, 0.04077623784542084, 0.2630700170993805, -0.11037099361419678, 0.028765583410859108, 0.24704554677009583, -0.373019814491272, -0.13956376910209656, -0.352245032787323 ]
https://github.com/huggingface/datasets/issues/5806
@tsabbir96 if you are planning to start working on this, you can take on this issue by writing a comment with only the keyword: #self-assign
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
25
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. @tsabbir96 if you are planning to start working on this, you can take on this issue by writing a comment with only the keyword: #self-assign
[ -0.4191776216030121, -0.1814727783203125, -0.030569300055503845, -0.01647360995411873, 0.07291547954082489, -0.13672377169132233, 0.4060405492782593, 0.4840847849845886, 0.2491959035396576, 0.09856682270765305, 0.07769029587507248, 0.5259687304496765, -0.29867953062057495, 0.47859397530555725, 0.38083213567733765, 0.02497376874089241, -0.06603013724088669, 0.13600167632102966, -0.031707171350717545, -0.09048637747764587, -0.3786861300468445, 0.28415563702583313, 0.3121282458305359, 0.14225071668624878, -0.37443721294403076, 0.06953895092010498, 0.21714535355567932, 0.30108824372291565, -0.011165164411067963, -0.2972836196422577, 0.1471797227859497, 0.1558583527803421, 0.0004637688398361206, 0.021094653755426407, -0.00011223920591874048, 0.0006046965718269348, 0.15499061346054077, -0.45028120279312134, -0.6010749340057373, -0.398177832365036, -0.1177058070898056, -0.27956923842430115, 0.07111856341362, -0.5962454080581665, -0.049047186970710754, -0.22468596696853638, 0.12082035094499588, 0.1617342233657837, 0.31418460607528687, 0.08583567291498184, 0.1636509746313095, -0.04503435641527176, -0.2402406483888626, -0.08224236220121384, 0.06471125781536102, 0.3501856327056885, -0.01977596804499626, 0.2042478770017624, -0.06667573750019073, 0.002678249031305313, -0.024976670742034912, 0.47827765345573425, 0.000505305826663971, -0.1357295662164688, 0.06963417679071426, 0.21263958513736725, -0.049322664737701416, 0.3455227017402649, 0.017705470323562622, 0.32596153020858765, 0.3883507251739502, -0.37473419308662415, -0.2225521206855774, -0.5403833389282227, 0.09579811990261078, -0.34470808506011963, 0.061029765754938126, -0.0009641125798225403, -0.2584976553916931, 0.18757250905036926, 0.07667191326618195, -0.3115890920162201, -0.01280231773853302, -0.0944678783416748, 0.07325345277786255, -0.3186429440975189, -0.05985601618885994, 0.0246020145714283, 0.3447279930114746, -0.0062040602788329124, -0.26882705092430115, -0.019719475880265236, 0.007699434645473957, 0.0029669851064682007, -0.2928254008293152, -0.3067396283149719, 0.3130812346935272, -0.11433824896812439, 0.11037158221006393, 0.2700539231300354, 0.22687079012393951, -0.11586183309555054, -0.20757046341896057, 0.32597339153289795, -0.044883184134960175, 0.09505660086870193, 0.5055044293403625, -0.26839444041252136, 0.22693760693073273, 0.30441927909851074, -0.11385694146156311, -0.13318878412246704, -0.18381841480731964, 0.30589559674263, 0.14630451798439026, 0.043967172503471375, 0.1765432059764862, -0.06820313632488251, -0.2978146970272064, 0.23524531722068787, 0.027749091386795044, -0.17184662818908691, 0.00688682496547699, 0.5118336081504822, -0.03301536291837692, 0.19444060325622559, 0.08223412930965424, -0.3089092969894409, -0.10471606254577637, -0.31115520000457764, -0.03612285479903221, -0.0638151541352272, -0.43670108914375305, 0.20827272534370422, 0.2151288092136383, -0.07287447154521942, 0.24499595165252686, -0.3783086836338043, -0.19330719113349915, -0.09515897184610367, 0.002423293888568878, -0.10879474878311157, 0.4275517463684082, -0.018913736566901207, -0.13016143441200256, -0.21075022220611572, 0.011658035218715668, -0.17821040749549866, -0.2794562578201294, 0.01261388510465622, -0.32452017068862915, -0.38672858476638794, 0.16476064920425415, 0.1318305879831314, -0.25048553943634033, 0.18651753664016724, -0.3674447536468506, 0.3959752023220062, -0.1909017711877823, -0.11367839574813843, 0.02228270098567009, -0.0892600566148758, -0.2787441611289978, -0.16781868040561676, 0.22001948952674866, 0.4181925654411316, -0.5339791178703308, -0.340348482131958, 0.26831209659576416, -0.45613178610801697, -0.3034379482269287, 0.01994166523218155, -0.0955917090177536, 0.16809023916721344, -0.13398796319961548, 0.16462232172489166, 0.44610217213630676, -0.0531296469271183, -0.21842625737190247, -0.06962224841117859, -0.10550162941217422, 0.2843153476715088, 0.2280186414718628, 0.038537442684173584, 0.156455859541893, 0.0007166340947151184, 0.21629735827445984, 0.4088449478149414, 0.1411365270614624, -0.01725934073328972, 0.13621467351913452, -0.1872202455997467, -0.21919548511505127, 0.37764009833335876, -0.15028893947601318, -0.01616721600294113, 0.2891930639743805, 0.10918362438678741, 0.42374202609062195, -0.025682583451271057, -0.026658974587917328, 0.10848937928676605, 0.2058533877134323, 0.12398117035627365, 0.08912277221679688, -0.29122525453567505, -0.4731191098690033, 0.07854858040809631, 0.26386839151382446, -0.49754008650779724, -0.14227896928787231, -0.3185266852378845, -0.05065644532442093, 0.23248691856861115, -0.08810991048812866, 0.07627758383750916, 0.09850490838289261, 0.2168288230895996, -0.04114282503724098, 0.13512249290943146, -0.34991827607154846, 0.470584511756897, -0.6174529790878296, -0.03962191939353943, -0.42443251609802246, 0.1973828673362732, 0.542113184928894, -0.02051711454987526, -0.09117548167705536, 0.4209926128387451, 0.016171501949429512, 0.04377688094973564, 0.22375309467315674, 0.21423053741455078, 0.3410007357597351, 0.343144953250885, 0.17833028733730316, 0.19758377969264984, -0.2331232726573944, 0.27035993337631226, -0.10264476388692856, -0.10229763388633728, -0.0869368463754654, -0.015477150678634644, -0.21103133261203766, 0.501083493232727, 0.13991272449493408, 0.1367226094007492, 0.1884683072566986, -0.2761414349079132, 0.1033165380358696, -0.2462622970342636, -0.260175883769989, -0.22530095279216766, 0.36865949630737305, 0.09484364092350006, 0.0019543692469596863, -0.08078992366790771, -0.5356358289718628, -0.1714220941066742, 1.0351272821426392, -0.23737908899784088, 0.15611045062541962, 0.2109411060810089, -0.044947221875190735, 0.012712135910987854, 0.07397109270095825, 0.3225278854370117, 0.2669200599193573, 0.1955447494983673, -0.1134066954255104, -0.07701830565929413, -0.042705222964286804, -0.13711583614349365, 0.016853146255016327, -0.04452095553278923, 0.25505688786506653, 0.4538692235946655, 0.07641098648309708, -0.4525741636753082, -0.4629440903663635, -0.1362207680940628, 0.05641516298055649, -0.06076379865407944, -0.016131296753883362, 0.02992461621761322, -0.08036039769649506, -0.1593393087387085, -0.367673397064209, 0.04514209181070328, -0.10418902337551117, -0.08575074374675751, -0.0801999419927597, 0.21776053309440613, -0.11831343173980713, 0.10063402354717255, 0.01496937870979309, 0.497131884098053, -0.1503823846578598, -0.2434845119714737, -0.1753789633512497, -0.4057397246360779, 0.05725301429629326, 0.06522803008556366, -0.18012398481369019, -0.17752350866794586, 0.530591607093811, -0.008240748196840286, 0.07803982496261597, -0.37157872319221497, 0.12792173027992249, 0.3561209738254547, -0.033511266112327576, 0.09118523448705673, 0.2860427796840668, 0.32244089245796204, 0.020588591694831848, -0.17981770634651184, 0.1977289319038391, -0.20041006803512573, -0.18270757794380188, -0.15356813371181488, 0.0962233617901802, 0.23493441939353943, -0.12480930984020233, -0.13503310084342957, -0.18984200060367584, -0.32989123463630676, 0.5402407050132751, -0.07108070701360703, 0.3382505774497986, 0.10239894688129425, -0.2991699278354645, 0.20349755883216858, -0.1949542760848999, -0.058783259242773056, -0.3256988525390625, -0.4597279131412506, 0.14507712423801422, -0.24646295607089996, 0.12740185856819153, -0.0767795741558075, 0.06773009151220322, -0.026072030887007713, 0.1283125877380371, -0.2499791830778122, -0.4665774405002594, 0.3198987543582916, 0.2505194842815399, -0.3005436956882477, -0.02509160339832306, 0.12293023616075516, 0.1746986210346222, -0.08536317199468613, -0.1676599085330963, -0.04982601851224899, 0.2665088176727295, 0.0695493221282959, 0.3978442847728729, 0.3101375699043274, 0.49407777190208435, 0.13691017031669617, 0.5826218724250793, 0.09276576340198517, -0.09413888305425644, 0.1715376079082489, 0.06876040995121002, 0.0033079171553254128, -0.05543462187051773, -0.097003273665905, -0.2630385160446167, -0.26994943618774414, 0.040846630930900574, 0.14017531275749207, -0.033340249210596085, 0.11231435835361481, -0.11246567219495773, 0.06942293047904968, -0.3186100423336029, -0.28854644298553467, 0.1915847510099411, 0.09029271453619003, 0.18724991381168365, -0.05827506631612778, 0.17813338339328766, -0.18589255213737488, -0.05217251181602478, 0.23456844687461853, 0.4320618808269501, 0.40594616532325745, -0.09980528056621552, -0.36683666706085205, -0.0920400395989418, -0.3684629201889038, 0.11876054853200912, 0.13090944290161133, -0.2057020366191864, -0.10074581950902939, -0.25384193658828735, -0.05195941403508186, 0.01547747477889061, 0.8509013056755066, 0.07544251531362534, 0.03831959515810013, -0.036785613745450974, -0.03354683518409729, 0.06461779773235321, 0.013959713280200958, 0.16855184733867645, -0.012714646756649017, 0.10247087478637695, 0.45288392901420593, -0.2298126518726349, -0.15725137293338776, 0.19912934303283691, 0.1286453753709793, -0.4293944537639618, -0.18718232214450836, -0.16832971572875977, 0.05465245246887207, -0.23754046857357025, -0.012152712792158127, -0.26461338996887207, 0.0769491046667099, -0.05725043639540672, -0.02484721690416336, 0.06173215061426163, -0.06312791258096695, 0.21220998466014862, 0.13725565373897552, 0.508756160736084, 0.10119549930095673, 0.06925597786903381, 0.3147139847278595, 0.3594011962413788, 0.3200438916683197, 0.49490514397621155, -0.19006678462028503, -0.12534832954406738, -0.002238282933831215, -0.13812154531478882, 0.46689343452453613, 0.38614094257354736, -0.19676457345485687, 0.36025840044021606, -0.24605561792850494, 0.024842243641614914, -0.34098339080810547, 0.09990943968296051, 0.08439572900533676, 0.0842360109090805, -0.33498817682266235, -0.5456364750862122, 0.3663737177848816, -0.3202669620513916, -0.12636812031269073, 0.30910524725914, -0.301954060792923, -0.240346759557724, 0.22515806555747986, -0.18614768981933594, 0.80465167760849, -0.072299525141716, 0.3128971457481384, 0.10824531316757202, 0.15912188589572906, 0.29005762934684753, -0.629850447177887, 0.06279748678207397, -0.3685302436351776, -0.21531692147254944, -0.11995269358158112, -0.09402761608362198, 0.02638232707977295, 0.20583385229110718, 0.07969914376735687, 0.06563277542591095, 0.4026419520378113, -0.017038948833942413, -0.11712049692869186, 0.4131317138671875, 0.04588416963815689, -0.23471727967262268, -0.5880351066589355, -0.0005265846848487854, -0.07081452757120132, -0.013383117504417896, -0.07491931319236755, -0.04181242734193802, 0.30607718229293823, -0.04622955992817879, 0.06571042537689209, 0.09478574991226196, -0.030420837923884392, 0.1897726058959961, 0.07243736833333969, -0.47490209341049194, -0.39812761545181274, 0.05469566956162453, -0.18844322860240936, 0.16482388973236084, 0.03988036513328552, 0.26703938841819763, -0.08234556019306183, 0.3660743832588196, -0.378124475479126, -0.11207202076911926, 0.6457808613777161, 0.04494348168373108, -0.010833323001861572, 0.20746967196464539, -0.018739137798547745, -0.46076107025146484, -0.1563054770231247, -0.07591874897480011, 0.10629774630069733, -0.14307543635368347, -0.2786467969417572, 0.05419061332941055, 0.04705771058797836, -0.1809537708759308, 0.05136182904243469, 0.25585755705833435, -0.2939506769180298, -0.10885798931121826, 0.18187876045703888, -0.26688873767852783, -0.04188567027449608, 0.4476047158241272, -0.016884665936231613, -0.1632196456193924, 0.38538211584091187, 0.1761314868927002, -0.099248968064785, -0.12331314384937286, 0.15498492121696472, 0.4331982731819153, -0.296262264251709, 0.1750802844762802, 0.27148061990737915, 0.1953098475933075, -0.05980502441525459, 0.18607890605926514, 0.013395443558692932, -0.035974472761154175, -0.22381675243377686, -0.2958347201347351, -0.0847756415605545, 0.2691938281059265, 0.02526390738785267, 0.24251215159893036, 0.41369616985321045, 0.09195923805236816, -0.054303593933582306, 0.03734831511974335, -0.3057316541671753, -0.018580811098217964, -0.05549751967191696, 0.17200124263763428, 0.16872161626815796, 0.05317207798361778, 0.3953869044780731, -0.08407069742679596, 0.07395151257514954, 0.010035116225481033, -0.19820813834667206, -0.19484829902648926, -0.46331721544265747, 0.15689979493618011, -0.15518885850906372, 0.5004459619522095, -0.287351131439209, -0.19870170950889587, 0.11451934278011322, -0.2622433304786682, 0.25309908390045166, 0.10993547737598419, -0.0242031030356884, 0.2542145550251007, 0.33855751156806946, 0.06660939753055573, -0.04205965995788574, 0.0020994748920202255, 0.00043497607111930847, 0.24106556177139282, 0.05714143440127373, -0.050368938595056534, -0.5281540751457214, 0.19664841890335083, -0.24120503664016724, 0.311649888753891, 0.21950484812259674, 0.12614008784294128, 0.1039467602968216, 0.1263117790222168, -0.3074761629104614, -0.13480035960674286, 0.3610782027244568, 0.2181718647480011, -0.2861410081386566, -0.11814248561859131, 0.41108912229537964, 0.19424939155578613, -0.15508447587490082, -0.07400932908058167, 0.43745216727256775, -0.23563726246356964, 0.08117327094078064, 0.10955144464969635, 0.015541411936283112, 0.10660077631473541, 0.22922345995903015, -0.2094314992427826, -0.12296469509601593, -0.1675703227519989, 0.22755536437034607, 0.4565095603466034, 0.330377459526062, 0.16851042211055756, 0.29639145731925964, 0.3775606155395508, 0.3491360545158386, 0.48007410764694214, 0.00008686631917953491, 0.15686868131160736, -0.050365667790174484, 0.07094386219978333, -0.13821741938591003, -0.4906553626060486, -0.108629509806633, -0.11910393834114075, -0.4566955268383026, 0.5352833271026611, -0.059813469648361206, 0.38508766889572144, 0.12011557817459106, 0.010929904878139496, -0.42732614278793335, 0.1087767630815506, -0.1826341450214386, -0.22745829820632935, -0.16277572512626648, -0.15816737711429596, -0.15800489485263824, 0.16158637404441833, 0.06275643408298492, 0.09368355572223663, 0.07062484323978424, 0.1434154063463211, 0.3823803663253784, 0.13074710965156555, -0.031151888892054558, -0.12361658364534378, 0.37084758281707764, -0.3764148950576782, -0.11266092211008072, -0.0890771672129631, 0.4317368268966675, 0.15972836315631866, -0.3204721212387085, -0.15999747812747955, -0.043915245682001114, 0.20157848298549652, 0.022338129580020905, -0.1382109671831131, 0.0748194232583046, -0.19746871292591095, 0.14598287642002106, 0.25729015469551086, 0.0626903772354126, 0.5964579582214355, 0.1653442084789276, -0.163224995136261, 0.10338761657476425, 0.18641386926174164, -0.10205136239528656, -0.47834983468055725, 0.16774633526802063, 0.3651120364665985, -0.1902834177017212, -0.3946368098258972, 0.19831930100917816, -0.39552900195121765, 0.11476218700408936, 0.2907198369503021, 0.29051631689071655, 0.08930537104606628, 0.06897775828838348, 0.11605267226696014, -0.2220490276813507, 0.04975056275725365, 0.07629173994064331, -0.010350769385695457, -0.03711048513650894, -0.22431641817092896, -0.28625860810279846, -0.0006974153220653534, 0.08368420600891113, 0.20754334330558777, 0.07036472856998444, -0.010736167430877686, 0.29983723163604736, 0.060297366231679916, -0.204293891787529, -0.32062414288520813, -0.055553682148456573, 0.11022432148456573, -0.3548382818698883, -0.5940881371498108, -0.0352400541305542, -0.02834489941596985, -0.03731942176818848, -0.06700707972049713, -0.19955570995807648, 0.04513417184352875, -0.025700192898511887, -0.20677050948143005, -0.2138032615184784, -0.09515221416950226, 0.09050162136554718, 0.519078254699707, -0.21048668026924133, 0.08541695773601532, -0.13518936932086945, -0.09823030233383179, -0.01371723785996437, -0.17022722959518433, 0.051912471652030945, 0.09724591672420502, -0.15055204927921295, 0.5934218168258667, 0.11675944179296494, 0.06823693215847015, -0.21007139980793, 0.16312569379806519, -0.04273929446935654, -0.035699088126420975, -0.09822624176740646, -0.1180482804775238, 0.12289272248744965, -0.016969941556453705, 0.04414156824350357, 0.5435734391212463, 0.048302117735147476, 0.263401597738266, -0.16856354475021362, 0.06497450917959213, 0.3667210340499878, -0.3345162570476532, -0.23241153359413147, 0.030626658350229263, 0.39945852756500244, -0.17432406544685364, 0.02495003305375576, -0.8829912543296814, 0.012466132640838623, 0.36969268321990967, -0.05332279950380325, -0.20628447830677032, 0.27350783348083496, -0.024658530950546265, 0.22427116334438324, -0.12742577493190765, 0.19242733716964722, 0.227339506149292, -0.3657878637313843, -0.11286087334156036, -0.3542443513870239 ]
https://github.com/huggingface/datasets/issues/5806
@albertvillanova thank you for letting me contribute here. @albertvillanova @mariosasko As I am totally new to this repo, could you tell me something more about this issue or perhaps give me some idea on how I can proceed with it? Thanks!
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
41
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. @albertvillanova thank you for letting me contribute here. @albertvillanova @mariosasko As I am totally new to this repo, could you tell me something more about this issue or perhaps give me some idea on how I can proceed with it? Thanks!
[ -0.3265039920806885, -0.2647354006767273, -0.01758318766951561, 0.07004538178443909, 0.0992976576089859, -0.13961559534072876, 0.3466265797615051, 0.4475677013397217, 0.22081124782562256, 0.09441199153661728, 0.06968678534030914, 0.4536360204219818, -0.23294107615947723, 0.467743843793869, 0.3841303586959839, -0.08619209378957748, -0.027418799698352814, 0.11920314282178879, -0.020695704966783524, -0.1360395848751068, -0.32602658867836, 0.3539695143699646, 0.27625852823257446, 0.1516008973121643, -0.3346203565597534, 0.08545789122581482, 0.18151497840881348, 0.3567007780075073, -0.07909437268972397, -0.22326704859733582, 0.24863120913505554, 0.16426071524620056, -0.06109887734055519, 0.11314524710178375, -0.00011935557267861441, 0.014157071709632874, 0.19416162371635437, -0.44727379083633423, -0.5595417022705078, -0.41717177629470825, -0.0733284205198288, -0.25725889205932617, 0.07543332874774933, -0.6093016862869263, -0.007618986070156097, -0.2165459394454956, 0.04925791174173355, 0.13318930566310883, 0.38839131593704224, 0.0665488988161087, 0.09696194529533386, -0.020452868193387985, -0.24691331386566162, -0.007240612059831619, 0.12401056289672852, 0.5028367638587952, -0.058595024049282074, 0.26035794615745544, 0.07522966712713242, 0.024533890187740326, 0.06836333125829697, 0.5032662153244019, 0.0001846402883529663, -0.16768184304237366, 0.05897347629070282, 0.17038440704345703, -0.07324421405792236, 0.3135058879852295, 0.08147022128105164, 0.2450820654630661, 0.39443227648735046, -0.3688780665397644, -0.22260841727256775, -0.548066258430481, 0.11112857609987259, -0.3362148404121399, 0.09161585569381714, -0.03261373192071915, -0.2767452895641327, 0.15878525376319885, -0.06505417823791504, -0.3691525459289551, -0.03399909287691116, -0.09897259622812271, 0.1462755799293518, -0.3230467736721039, -0.08251317590475082, 0.056662172079086304, 0.3144530653953552, -0.01592152938246727, -0.3830188512802124, -0.015233772806823254, 0.019913550466299057, 0.003270115703344345, -0.26843857765197754, -0.35926055908203125, 0.32166141271591187, -0.11365441977977753, 0.21085578203201294, 0.3147428333759308, 0.04608636349439621, -0.1685645878314972, -0.22274136543273926, 0.2678757905960083, -0.04585244134068489, 0.14467209577560425, 0.5362116098403931, -0.24054080247879028, 0.23210018873214722, 0.3277534544467926, -0.07477128505706787, -0.1332811862230301, -0.1877281814813614, 0.3611656725406647, 0.05390016734600067, 0.037587061524391174, 0.23991842567920685, -0.16959857940673828, -0.23602965474128723, 0.2240067422389984, -0.0835920050740242, -0.24221140146255493, 0.03906016796827316, 0.5219593048095703, -0.045164477080106735, 0.18790984153747559, 0.06529506295919418, -0.2387012541294098, -0.072061687707901, -0.313879132270813, -0.019557081162929535, -0.07970927655696869, -0.42273539304733276, 0.23607560992240906, 0.25873813033103943, -0.1642015129327774, 0.31986650824546814, -0.37147849798202515, -0.05901044234633446, -0.14170534908771515, -0.02161804586648941, -0.045622747391462326, 0.3351365327835083, 0.033661529421806335, -0.11919431388378143, -0.14995551109313965, 0.09631510823965073, -0.15686076879501343, -0.24745675921440125, 0.012248564511537552, -0.364552766084671, -0.4772639870643616, 0.1758723258972168, 0.04409405589103699, -0.34609806537628174, 0.1823558211326599, -0.5248993039131165, 0.34439629316329956, -0.18502390384674072, -0.07405561208724976, 0.052557285875082016, 0.024583585560321808, -0.25527268648147583, -0.1674606204032898, 0.23239386081695557, 0.4475982189178467, -0.5338131785392761, -0.4184744358062744, 0.3160669803619385, -0.40471553802490234, -0.23837582767009735, 0.036535829305648804, -0.12818856537342072, 0.13532786071300507, -0.14080730080604553, 0.16237497329711914, 0.39103779196739197, -0.126651793718338, -0.215925395488739, -0.016728650778532028, -0.09060601890087128, 0.29119041562080383, 0.30579787492752075, -0.12259002029895782, 0.11918288469314575, 0.02196054905653, 0.1525689959526062, 0.3742929697036743, 0.0767240971326828, -0.04133368656039238, 0.1346682906150818, -0.23138129711151123, -0.15001696348190308, 0.4500025510787964, -0.15755844116210938, 0.0028813332319259644, 0.2535269856452942, 0.03888356685638428, 0.45526957511901855, -0.037165507674217224, -0.051339078694581985, 0.13832291960716248, 0.20112542808055878, 0.16951076686382294, 0.12572690844535828, -0.2590925991535187, -0.5089341998100281, 0.08440747112035751, 0.2757251262664795, -0.43344271183013916, -0.25128716230392456, -0.28152817487716675, -0.13729916512966156, 0.2106582224369049, -0.07778972387313843, 0.04757961630821228, -0.0024568550288677216, 0.2087915986776352, -0.010224245488643646, 0.12720397114753723, -0.34031838178634644, 0.5025938153266907, -0.6518393158912659, -0.01165960356593132, -0.5060417056083679, 0.32994046807289124, 0.4972163438796997, -0.019982509315013885, -0.08974359184503555, 0.4175247251987457, 0.11745475232601166, -0.07537009567022324, 0.19119666516780853, 0.21400463581085205, 0.26216745376586914, 0.41001129150390625, 0.3059917986392975, 0.2175920009613037, -0.18286825716495514, 0.24567067623138428, -0.026574604213237762, -0.11524871736764908, -0.08645336329936981, -0.07692327350378036, -0.18432201445102692, 0.4960208833217621, 0.13038499653339386, 0.18655961751937866, 0.15040312707424164, -0.2601865530014038, 0.12405777722597122, -0.24232938885688782, -0.31568971276283264, -0.15151965618133545, 0.43077170848846436, 0.08401930332183838, -0.07250664383172989, -0.16316425800323486, -0.5325043201446533, -0.18363988399505615, 1.067844271659851, -0.2859165668487549, 0.07186561822891235, 0.18802741169929504, -0.040428999811410904, -0.017128579318523407, 0.14028193056583405, 0.30519768595695496, 0.3322533369064331, 0.1253623217344284, -0.2024785578250885, -0.07576292008161545, 0.03380819782614708, -0.10550672560930252, 0.030646108090877533, -0.010577045381069183, 0.2428397238254547, 0.42468369007110596, 0.07259729504585266, -0.43325120210647583, -0.4448646306991577, -0.18123003840446472, 0.15198665857315063, -0.050963353365659714, 0.012820743024349213, 0.0498666986823082, -0.07121782004833221, -0.25677549839019775, -0.3403857350349426, -0.007334809750318527, -0.1536211371421814, -0.08378929644823074, -0.12581570446491241, 0.19683974981307983, -0.059349969029426575, 0.15397076308727264, 0.10147165507078171, 0.5438314080238342, -0.17059066891670227, -0.22814761102199554, -0.25536149740219116, -0.31667956709861755, 0.058607205748558044, -0.017404843121767044, -0.1839272826910019, -0.17748045921325684, 0.5723996162414551, -0.06623716652393341, 0.0748266726732254, -0.4207478165626526, 0.09810183942317963, 0.37986624240875244, -0.1328667551279068, 0.08783411979675293, 0.28858333826065063, 0.3436291813850403, -0.014609336853027344, -0.1882239133119583, 0.26015737652778625, -0.1851908564567566, -0.23426669836044312, -0.15663157403469086, 0.11049486696720123, 0.2796073257923126, -0.11083977669477463, -0.10528025031089783, -0.1956673562526703, -0.26407405734062195, 0.5546518564224243, -0.10960076749324799, 0.32649415731430054, 0.11327993869781494, -0.29493406414985657, 0.2595187723636627, -0.17749831080436707, -0.07679601013660431, -0.36614370346069336, -0.6068581342697144, 0.14258526265621185, -0.21331483125686646, 0.15358930826187134, -0.009342648088932037, 0.1444205492734909, -0.026226066052913666, 0.10076871514320374, -0.3202092945575714, -0.5417924523353577, 0.3491919934749603, 0.23846805095672607, -0.30317574739456177, 0.0481690838932991, 0.1199236735701561, 0.14207439124584198, 0.006678268313407898, -0.21540693938732147, -0.20267823338508606, 0.22584372758865356, 0.11685986816883087, 0.4324420094490051, 0.29708921909332275, 0.5921684503555298, 0.12040039151906967, 0.7244664430618286, 0.14836907386779785, -0.02158701978623867, 0.14957106113433838, 0.1605345457792282, 0.02808479778468609, -0.01402750238776207, -0.17875343561172485, -0.25689804553985596, -0.27797597646713257, 0.08216064423322678, 0.1596621721982956, 0.05433337017893791, 0.15358301997184753, -0.11388175189495087, 0.023736797273159027, -0.26209720969200134, -0.27804288268089294, 0.13997843861579895, 0.13243448734283447, 0.19166292250156403, -0.07056674361228943, 0.15041068196296692, -0.22791211307048798, 0.008488219231367111, 0.24478773772716522, 0.5242391228675842, 0.417732298374176, -0.05082129314541817, -0.42452532052993774, -0.1612933725118637, -0.3661310076713562, 0.09211555123329163, 0.13806870579719543, -0.23608583211898804, -0.11278052628040314, -0.11840115487575531, 0.04180340841412544, 0.0281372033059597, 0.9458729028701782, 0.09407805651426315, 0.08455763757228851, -0.045553989708423615, -0.12727542221546173, 0.09320391714572906, -0.012348607182502747, 0.16789455711841583, 0.06736330687999725, 0.19256478548049927, 0.529798686504364, -0.31781843304634094, -0.2439538836479187, 0.24129807949066162, 0.11953979730606079, -0.4011211395263672, -0.21287594735622406, -0.12037522345781326, -0.025453783571720123, -0.28395846486091614, -0.07771843671798706, -0.21552616357803345, 0.13115960359573364, -0.11341545730829239, -0.016222648322582245, 0.15184269845485687, -0.047763001173734665, 0.19747287034988403, 0.07113860547542572, 0.49000659584999084, 0.12824593484401703, 0.04141252487897873, 0.3549981713294983, 0.36643290519714355, 0.32599854469299316, 0.5386425852775574, -0.14888769388198853, -0.132631316781044, 0.010979101061820984, -0.16513247787952423, 0.4524807631969452, 0.5028504729270935, -0.2142813503742218, 0.37217268347740173, -0.20507770776748657, 0.07235018908977509, -0.3386526107788086, 0.08037925511598587, 0.15492203831672668, 0.13180527091026306, -0.3393004238605499, -0.5051835775375366, 0.3580828905105591, -0.3385845720767975, -0.119558185338974, 0.3320678174495697, -0.11542171239852905, -0.23107564449310303, 0.17024043202400208, -0.29713577032089233, 0.9781752228736877, -0.004209825769066811, 0.27651700377464294, 0.12993721663951874, 0.10166861116886139, 0.3137434720993042, -0.6382907629013062, 0.04861822724342346, -0.2980055809020996, -0.1962757557630539, -0.0757843628525734, -0.13326096534729004, 0.047557007521390915, 0.12002575397491455, 0.049920178949832916, 0.0781608372926712, 0.41114872694015503, 0.01637374609708786, -0.12371300160884857, 0.43374380469322205, 0.08241203427314758, -0.21973174810409546, -0.623705267906189, -0.07533109188079834, -0.07102451473474503, 0.0473996065557003, -0.08577099442481995, -0.10925549268722534, 0.2704128324985504, -0.07083118706941605, -0.05020682513713837, 0.05460596829652786, -0.011535901576280594, 0.15551050007343292, 0.1627333164215088, -0.514519214630127, -0.2957305312156677, 0.02655852772295475, -0.12211015820503235, 0.15554584562778473, -0.05439554154872894, 0.2727513015270233, -0.14836493134498596, 0.28192800283432007, -0.3843310475349426, -0.06537988036870956, 0.6009595990180969, 0.003721103072166443, -0.031031206250190735, 0.15446291863918304, -0.06789388507604599, -0.5286707282066345, -0.18973790109157562, -0.12238173931837082, 0.08402705192565918, -0.20804350078105927, -0.227087140083313, 0.09320598095655441, 0.06614352762699127, -0.19041863083839417, -0.010660414583981037, 0.34921523928642273, -0.3048439919948578, -0.13689406216144562, 0.15014109015464783, -0.23514175415039062, -0.08122138679027557, 0.3995174467563629, -0.005953996442258358, -0.25932660698890686, 0.42633476853370667, 0.22479748725891113, -0.07753163576126099, -0.07500280439853668, 0.10626959800720215, 0.442855566740036, -0.3866608440876007, 0.16551272571086884, 0.268168181180954, 0.2227131575345993, -0.07460839301347733, 0.15796133875846863, 0.04673241451382637, 0.0013324003666639328, -0.1421765685081482, -0.37703293561935425, -0.1319282352924347, 0.29585981369018555, -0.009096360765397549, 0.20355376601219177, 0.3786047101020813, 0.09137384593486786, -0.032608672976493835, 0.04561567306518555, -0.23309841752052307, 0.11026857793331146, -0.05887322127819061, 0.19685080647468567, 0.26507002115249634, 0.04073074087500572, 0.4579401910305023, -0.0575755350291729, -0.005692623555660248, 0.006287064403295517, -0.24646061658859253, -0.09360574185848236, -0.41569244861602783, 0.20301085710525513, -0.09314937889575958, 0.4131583869457245, -0.23823414742946625, -0.19689765572547913, 0.11731058359146118, -0.1934877336025238, 0.27518394589424133, 0.12566903233528137, 0.07079453766345978, 0.2217327505350113, 0.40576088428497314, 0.07970041036605835, -0.052324119955301285, -0.013704758137464523, 0.0643845796585083, 0.3128996789455414, 0.06017086282372475, -0.09115305542945862, -0.4956417977809906, 0.11930374801158905, -0.26408350467681885, 0.28305965662002563, 0.2313624769449234, 0.1790645718574524, 0.2035878449678421, 0.0725538581609726, -0.27115491032600403, -0.11627031862735748, 0.35603368282318115, 0.2311900556087494, -0.35255342721939087, -0.02077280730009079, 0.4001939296722412, 0.10616195201873779, -0.10344676673412323, -0.10942906141281128, 0.487929105758667, -0.17059718072414398, -0.01863715797662735, 0.11718134582042694, -0.0009952783584594727, 0.15003682672977448, 0.34654495120048523, -0.19890806078910828, -0.020407846197485924, -0.07958705723285675, 0.2348957657814026, 0.4155102074146271, 0.24423915147781372, 0.13756626844406128, 0.30444687604904175, 0.4503615200519562, 0.29372215270996094, 0.39261823892593384, -0.03191341832280159, 0.16597343981266022, -0.05930174142122269, 0.04242023080587387, -0.08170758187770844, -0.4558753967285156, -0.1951952874660492, -0.07111828029155731, -0.43146029114723206, 0.49477633833885193, -0.1250743567943573, 0.503459095954895, 0.10187549889087677, 0.016510330140590668, -0.3964872360229492, 0.1366940289735794, -0.1415601670742035, -0.20950809121131897, -0.16293159127235413, -0.17716249823570251, -0.17883318662643433, 0.18732307851314545, 0.009102029725909233, 0.04229084774851799, 0.13914981484413147, 0.06457449495792389, 0.29787370562553406, 0.08576487749814987, -0.07364417612552643, -0.09402104467153549, 0.3713512122631073, -0.33996760845184326, -0.08893044292926788, -0.03544768691062927, 0.390648752450943, 0.15134970843791962, -0.2934548258781433, -0.11439712345600128, -0.09246194362640381, 0.23497337102890015, 0.047782354056835175, -0.05135054886341095, 0.04495733976364136, -0.08950479328632355, 0.20302748680114746, 0.27677345275878906, 0.034721460193395615, 0.48432034254074097, 0.09144893288612366, -0.11942796409130096, 0.04884156212210655, 0.1867828667163849, -0.1282631903886795, -0.4876762926578522, 0.22188833355903625, 0.25051912665367126, -0.19696244597434998, -0.4220729470252991, 0.158564031124115, -0.38406580686569214, 0.10099665820598602, 0.2692723870277405, 0.3499350845813751, 0.029686853289604187, 0.01511949673295021, 0.06392757594585419, -0.34716734290122986, 0.04804626479744911, 0.1643068790435791, -0.00196731835603714, -0.08436252176761627, -0.28763318061828613, -0.175682932138443, -0.032314643263816833, 0.14459124207496643, 0.19658386707305908, 0.1124836876988411, -0.014455616474151611, 0.3265925943851471, 0.030608192086219788, -0.17854776978492737, -0.3807213604450226, -0.009623009711503983, 0.06842303276062012, -0.4120683968067169, -0.5806670188903809, 0.005006806924939156, 0.01827567256987095, -0.018080420792102814, -0.024601906538009644, -0.07833169400691986, 0.07726909220218658, -0.11257094144821167, -0.25309130549430847, -0.16075399518013, -0.12128084897994995, 0.07371382415294647, 0.45571720600128174, -0.19303923845291138, 0.03848598897457123, -0.06961305439472198, -0.15864142775535583, 0.00923918280750513, -0.19175361096858978, 0.06254314631223679, 0.10184972733259201, -0.16473713517189026, 0.6039213538169861, 0.03147559612989426, 0.07444995641708374, -0.23498208820819855, 0.16586610674858093, -0.08158509433269501, -0.059346754103899, -0.09226910769939423, -0.11341361701488495, 0.10004745423793793, -0.06569326668977737, 0.05116292089223862, 0.5176115036010742, 0.020762374624609947, 0.25921162962913513, -0.28337228298187256, 0.11656580120325089, 0.4932921826839447, -0.3751613199710846, -0.2432200163602829, 0.0606229342520237, 0.38301634788513184, -0.1066952794790268, -0.04688359797000885, -0.9677253365516663, 0.012876302003860474, 0.3318110704421997, -0.03147313371300697, -0.20755061507225037, 0.3030974566936493, -0.01795249804854393, 0.2115052193403244, -0.09331917017698288, 0.19736504554748535, 0.22798340022563934, -0.3574874699115753, -0.05183900147676468, -0.3202008306980133 ]
https://github.com/huggingface/datasets/issues/5806
Hello there, is this issue resolved? @tsabbir96 are you still working on it? Otherwise I would love to give it a try
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
22
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. Hello there, is this issue resolved? @tsabbir96 are you still working on it? Otherwise I would love to give it a try
[ -0.39790356159210205, -0.22820815443992615, -0.02644972875714302, 0.023000480607151985, 0.09245386719703674, -0.1665101945400238, 0.3990684747695923, 0.49507105350494385, 0.22137081623077393, 0.0845126062631607, 0.08824421465396881, 0.504729151725769, -0.2669532895088196, 0.48414555191993713, 0.35026559233665466, -0.00966271385550499, -0.04786738008260727, 0.1376056969165802, -0.02716526761651039, -0.11943139135837555, -0.35684242844581604, 0.30961430072784424, 0.26541727781295776, 0.1385987102985382, -0.37568503618240356, 0.07541452348232269, 0.2164124697446823, 0.34853971004486084, -0.040939781814813614, -0.2562565505504608, 0.17853087186813354, 0.11012256890535355, -0.026158232241868973, 0.060089558362960815, -0.00011369211279088631, 0.008949130773544312, 0.18709096312522888, -0.4497174024581909, -0.5938026905059814, -0.4174667000770569, -0.07614630460739136, -0.2660145163536072, 0.06365666538476944, -0.5823923945426941, -0.02696278691291809, -0.25492653250694275, 0.07163660228252411, 0.16791585087776184, 0.33017969131469727, 0.09773007035255432, 0.1524122804403305, -0.042443420737981796, -0.25997036695480347, -0.029286272823810577, 0.05516635626554489, 0.39697349071502686, -0.029147665947675705, 0.18805669248104095, -0.03001883625984192, 0.01710132509469986, -0.004286374896764755, 0.49687904119491577, 0.004614800214767456, -0.1592874974012375, 0.031083969399333, 0.17648327350616455, -0.07734432816505432, 0.3334202170372009, 0.06519868969917297, 0.2884334325790405, 0.4103800356388092, -0.34264934062957764, -0.2226584553718567, -0.5369277596473694, 0.10137271136045456, -0.3398609459400177, 0.10433748364448547, -0.029495541006326675, -0.2670750617980957, 0.18087728321552277, 0.020099949091672897, -0.3350221812725067, -0.005404829978942871, -0.10168857872486115, 0.09224210679531097, -0.3548424243927002, -0.07258269190788269, 0.040280796587467194, 0.30249524116516113, -0.029753001406788826, -0.2821660339832306, -0.018429255113005638, -0.003217878518626094, -0.007619993761181831, -0.3038460612297058, -0.3192133903503418, 0.3543454110622406, -0.09778726100921631, 0.11950996518135071, 0.28827762603759766, 0.16201362013816833, -0.12107142806053162, -0.20654211938381195, 0.31556081771850586, -0.04752209782600403, 0.11613669991493225, 0.5572815537452698, -0.29169636964797974, 0.24360822141170502, 0.31644126772880554, -0.11739485710859299, -0.14450721442699432, -0.18393073976039886, 0.29257506132125854, 0.10199427604675293, 0.03579377382993698, 0.21045748889446259, -0.12409546971321106, -0.2937663495540619, 0.2381136417388916, -0.02129022777080536, -0.1950307935476303, 0.04215342923998833, 0.4969966411590576, -0.03373512998223305, 0.213913232088089, 0.07295724749565125, -0.297433465719223, -0.09607966244220734, -0.3440868556499481, -0.03697088360786438, -0.07911825180053711, -0.4271663725376129, 0.20742878317832947, 0.24685677886009216, -0.100770004093647, 0.27220600843429565, -0.36263343691825867, -0.16295848786830902, -0.09564661979675293, 0.006514839828014374, -0.11138515919446945, 0.42043110728263855, 0.00876417476683855, -0.09857702255249023, -0.17527389526367188, 0.06883156299591064, -0.14675471186637878, -0.24517028033733368, 0.02634427696466446, -0.34569865465164185, -0.423850953578949, 0.18557997047901154, 0.11450536549091339, -0.2891234755516052, 0.20415973663330078, -0.4135301113128662, 0.3728148937225342, -0.17262446880340576, -0.12711305916309357, 0.013529513031244278, -0.06736911833286285, -0.3187469244003296, -0.1739599108695984, 0.21652913093566895, 0.41165435314178467, -0.5725584030151367, -0.3593274652957916, 0.28290989995002747, -0.43109700083732605, -0.2869735360145569, 0.0431116558611393, -0.14537744224071503, 0.17946432530879974, -0.1561284363269806, 0.17119525372982025, 0.4165642261505127, -0.05291077494621277, -0.21596026420593262, -0.01827174983918667, -0.08247949182987213, 0.2941170930862427, 0.23494072258472443, -0.06360973417758942, 0.14130577445030212, 0.006916571408510208, 0.1869923174381256, 0.40547165274620056, 0.1370224505662918, -0.0009965598583221436, 0.10954141616821289, -0.17775994539260864, -0.1570543348789215, 0.39453205466270447, -0.15812867879867554, -0.029957562685012817, 0.2888049781322479, 0.09315814077854156, 0.44545724987983704, -0.031729307025671005, -0.029969103634357452, 0.1508253514766693, 0.20606322586536407, 0.11149679124355316, 0.13581964373588562, -0.2838459312915802, -0.47184380888938904, 0.08122032135725021, 0.26518020033836365, -0.47724252939224243, -0.1862333118915558, -0.27545827627182007, -0.08547332137823105, 0.21171876788139343, -0.09699882566928864, 0.06395938992500305, 0.08031527698040009, 0.18042060732841492, -0.03048068657517433, 0.1489192098379135, -0.325629860162735, 0.4868260324001312, -0.6240901350975037, -0.058644797652959824, -0.46946677565574646, 0.26904600858688354, 0.5054119229316711, -0.03266246244311333, -0.08529698103666306, 0.39958107471466064, 0.06678226590156555, 0.010888185352087021, 0.17129293084144592, 0.2272592931985855, 0.32182222604751587, 0.35919803380966187, 0.217862069606781, 0.20198702812194824, -0.20836961269378662, 0.2618493437767029, -0.050753891468048096, -0.0969427153468132, -0.08764813840389252, -0.044976264238357544, -0.21305632591247559, 0.49025726318359375, 0.16360968351364136, 0.1634313315153122, 0.21176543831825256, -0.261898934841156, 0.12370045483112335, -0.24206924438476562, -0.27433136105537415, -0.20710547268390656, 0.41161999106407166, 0.09256677329540253, -0.038005102425813675, -0.112345390021801, -0.5166528224945068, -0.18208715319633484, 1.0852628946304321, -0.22064554691314697, 0.13696935772895813, 0.20091088116168976, -0.03704904764890671, -0.02487713098526001, 0.1251375824213028, 0.28259408473968506, 0.29354435205459595, 0.17294679582118988, -0.1748599112033844, -0.0867684856057167, -0.017472609877586365, -0.1323862224817276, 0.05413688346743584, -0.05295737087726593, 0.2684492766857147, 0.4629286825656891, 0.08492595702409744, -0.46245208382606506, -0.49647408723831177, -0.15276563167572021, 0.1200527474284172, -0.06821271032094955, -0.010159768164157867, 0.036465369164943695, -0.11277881264686584, -0.19273900985717773, -0.36123257875442505, 0.044813044369220734, -0.130510151386261, -0.09462369978427887, -0.11065387725830078, 0.21306337416172028, -0.10025563836097717, 0.13719412684440613, 0.04784243553876877, 0.5021737813949585, -0.12729133665561676, -0.2027604579925537, -0.19954624772071838, -0.364202082157135, 0.01877507194876671, 0.04395126551389694, -0.18084773421287537, -0.1645449697971344, 0.5170480012893677, -0.02563410997390747, 0.07508876919746399, -0.3990635871887207, 0.11014467477798462, 0.38102856278419495, -0.059916794300079346, 0.10358086973428726, 0.3048112094402313, 0.3345169425010681, -0.02569088339805603, -0.16675812005996704, 0.24336518347263336, -0.20229098200798035, -0.20715320110321045, -0.1286466419696808, 0.09584096074104309, 0.26103004813194275, -0.10953786969184875, -0.14003121852874756, -0.17819105088710785, -0.2946940064430237, 0.5137341618537903, -0.11810442805290222, 0.3284001648426056, 0.13022814691066742, -0.25643283128738403, 0.21769537031650543, -0.17460313439369202, -0.06931565701961517, -0.35165104269981384, -0.4991515874862671, 0.1306157410144806, -0.2626292109489441, 0.10969984531402588, -0.05706571415066719, 0.1393614262342453, -0.019693804904818535, 0.10774791985750198, -0.27918878197669983, -0.48715847730636597, 0.3332284092903137, 0.2414361536502838, -0.3231867849826813, -0.016938740387558937, 0.10626216232776642, 0.15584349632263184, -0.053980931639671326, -0.20146949589252472, -0.09604504704475403, 0.23772558569908142, 0.07184089720249176, 0.44972625374794006, 0.30068230628967285, 0.5559688806533813, 0.1687517762184143, 0.5972548127174377, 0.09257117658853531, -0.05522719770669937, 0.1597803831100464, 0.125015988945961, 0.03320378065109253, -0.07086767256259918, -0.12898948788642883, -0.24745482206344604, -0.2864720821380615, 0.03134588897228241, 0.13190603256225586, -0.014386642724275589, 0.12800073623657227, -0.10947497189044952, 0.05247357487678528, -0.2746570110321045, -0.2610015273094177, 0.19051682949066162, 0.0845785140991211, 0.19593138992786407, -0.01208285242319107, 0.1827087253332138, -0.20574484765529633, -0.016115177422761917, 0.23816247284412384, 0.4491495192050934, 0.4260866641998291, -0.09189774841070175, -0.408195823431015, -0.12328445911407471, -0.3633018732070923, 0.09300268441438675, 0.14095091819763184, -0.16760092973709106, -0.11574164032936096, -0.20645777881145477, -0.03785219416022301, 0.03128226473927498, 0.915878415107727, 0.05477912724018097, 0.060175374150276184, -0.021976657211780548, -0.05865556746721268, 0.035933323204517365, -0.007796533405780792, 0.1785963624715805, 0.04259335994720459, 0.1506851464509964, 0.48328566551208496, -0.22626006603240967, -0.1786143183708191, 0.17412634193897247, 0.15695707499980927, -0.43149471282958984, -0.20297440886497498, -0.16928210854530334, 0.01777801662683487, -0.24761483073234558, -0.07427898049354553, -0.2474934160709381, 0.10929886996746063, -0.12161440402269363, -0.02460743486881256, 0.09668750315904617, -0.0813857913017273, 0.1780390739440918, 0.12822675704956055, 0.5270543694496155, 0.06494013965129852, 0.08268317580223083, 0.30161553621292114, 0.38934236764907837, 0.3201604187488556, 0.5082030296325684, -0.16832934319972992, -0.1291041076183319, 0.027391064912080765, -0.18008111417293549, 0.44711387157440186, 0.43299442529678345, -0.24656346440315247, 0.37184491753578186, -0.24139562249183655, 0.048222459852695465, -0.3062026798725128, 0.08094441890716553, 0.11315871775150299, 0.1137440875172615, -0.3309018611907959, -0.5013669729232788, 0.3313509523868561, -0.33238309621810913, -0.10699477791786194, 0.29919761419296265, -0.26583001017570496, -0.24549371004104614, 0.22675175964832306, -0.24261510372161865, 0.8362969160079956, -0.016018975526094437, 0.2892382740974426, 0.1252225935459137, 0.15664426982402802, 0.2717037498950958, -0.6151962876319885, 0.0804549902677536, -0.3584708571434021, -0.2560705840587616, -0.08189408481121063, -0.0980716273188591, 0.02327461913228035, 0.19569237530231476, 0.07426384091377258, 0.08821666240692139, 0.4164469242095947, 0.0017715739086270332, -0.12198419868946075, 0.44640231132507324, 0.07994958758354187, -0.22274406254291534, -0.602380096912384, -0.016338378190994263, -0.05622655898332596, -0.01033846102654934, -0.09656427800655365, -0.059414319694042206, 0.31237971782684326, -0.08458978682756424, 0.02149704098701477, 0.09382811188697815, -0.02310344949364662, 0.20685967803001404, 0.10899095237255096, -0.5104357600212097, -0.3585919141769409, 0.04885691776871681, -0.1854073852300644, 0.18286937475204468, -0.004487261176109314, 0.28044167160987854, -0.07601200044155121, 0.32438820600509644, -0.3983185589313507, -0.09018991142511368, 0.6233593821525574, 0.02467634528875351, -0.026570454239845276, 0.17528316378593445, -0.0507565476000309, -0.4743479788303375, -0.15967462956905365, -0.0869692862033844, 0.06928373873233795, -0.1654355227947235, -0.2688780725002289, 0.043246589601039886, 0.05591166019439697, -0.2051529586315155, 0.03880409151315689, 0.2813909351825714, -0.27897822856903076, -0.11160087585449219, 0.1835261881351471, -0.24850183725357056, -0.05299879238009453, 0.47099390625953674, -0.004323855973780155, -0.19922474026679993, 0.42848891019821167, 0.2304999828338623, -0.10727246850728989, -0.10703130811452866, 0.15124589204788208, 0.43526220321655273, -0.32693642377853394, 0.16885539889335632, 0.25887998938560486, 0.24345099925994873, -0.07664155960083008, 0.16130957007408142, -0.002921338891610503, 0.0008632242679595947, -0.20475786924362183, -0.3368736207485199, -0.07502394169569016, 0.2821946144104004, 0.023246515542268753, 0.19163432717323303, 0.38982635736465454, 0.08305103331804276, -0.022641662508249283, 0.027578080072999, -0.2859220802783966, 0.034128278493881226, -0.02426309883594513, 0.19408799707889557, 0.16767261922359467, 0.034398142248392105, 0.420136034488678, -0.06260094046592712, 0.056376561522483826, 0.02374771237373352, -0.19998998939990997, -0.1675451248884201, -0.42914435267448425, 0.1686137318611145, -0.10334411263465881, 0.4454571306705475, -0.28245222568511963, -0.21056634187698364, 0.10520964115858078, -0.22694426774978638, 0.2205827385187149, 0.12249433249235153, 0.0057707298547029495, 0.21719644963741302, 0.33844083547592163, 0.07236304879188538, -0.02188406139612198, -0.007806915789842606, 0.011383138597011566, 0.2678426504135132, 0.05522182583808899, -0.06505218148231506, -0.47902557253837585, 0.179926797747612, -0.26929396390914917, 0.27970463037490845, 0.17784623801708221, 0.15418598055839539, 0.1529446542263031, 0.09217672049999237, -0.28116530179977417, -0.13068456947803497, 0.36746400594711304, 0.2513824701309204, -0.327589213848114, -0.08944316953420639, 0.41389840841293335, 0.17334336042404175, -0.13903091847896576, -0.11293144524097443, 0.43235164880752563, -0.19658014178276062, 0.035053372383117676, 0.0917367935180664, 0.028876081109046936, 0.09668764472007751, 0.2948521375656128, -0.200053870677948, -0.09106474369764328, -0.1547599732875824, 0.20203955471515656, 0.448917955160141, 0.2856851816177368, 0.15344837307929993, 0.29341310262680054, 0.37386125326156616, 0.308117538690567, 0.5027295351028442, 0.009876087307929993, 0.15575692057609558, -0.04757237434387207, 0.06880702078342438, -0.14275142550468445, -0.5009869337081909, -0.15768007934093475, -0.10877299308776855, -0.4826628267765045, 0.5134897232055664, -0.1113368347287178, 0.40905287861824036, 0.10793597996234894, 0.01616756245493889, -0.4229876697063446, 0.10282213240861893, -0.18639937043190002, -0.20612485706806183, -0.17876774072647095, -0.1617460548877716, -0.15632224082946777, 0.18434223532676697, 0.033587485551834106, 0.12406587600708008, 0.07360014319419861, 0.11697012186050415, 0.3152635097503662, 0.11160656064748764, -0.057204727083444595, -0.11234201490879059, 0.35822972655296326, -0.3769068419933319, -0.09286269545555115, -0.06982255727052689, 0.4125709533691406, 0.13800954818725586, -0.32278722524642944, -0.1452551931142807, -0.027834303677082062, 0.21303173899650574, 0.007396377623081207, -0.09661830961704254, 0.06477512419223785, -0.15936988592147827, 0.20005923509597778, 0.2681756615638733, 0.07630052417516708, 0.5751054286956787, 0.14596624672412872, -0.1539781391620636, 0.11345486342906952, 0.21229207515716553, -0.11231975257396698, -0.4667114019393921, 0.16383177042007446, 0.32180890440940857, -0.17260053753852844, -0.4212886393070221, 0.18273323774337769, -0.3717048466205597, 0.10725578665733337, 0.3087289333343506, 0.3257667124271393, 0.0935056060552597, 0.016447123140096664, 0.10184180736541748, -0.2921263873577118, 0.05974796414375305, 0.11115063726902008, -0.016010869294404984, -0.05874992534518242, -0.2520691752433777, -0.2582954168319702, -0.0162370465695858, 0.07483390718698502, 0.2424159049987793, 0.07707493007183075, 0.006836742162704468, 0.29867416620254517, 0.03712417185306549, -0.1959567368030548, -0.3270583152770996, -0.046031348407268524, 0.0814443975687027, -0.3916032314300537, -0.5968416333198547, -0.018161650747060776, -0.0016110632568597794, -0.05144345015287399, -0.074808768928051, -0.12406444549560547, 0.0793224424123764, -0.04432325065135956, -0.24884173274040222, -0.20834331214427948, -0.12354329228401184, 0.1093529611825943, 0.4974917769432068, -0.18318141996860504, 0.057847071439027786, -0.1229894757270813, -0.12760016322135925, -0.022313520312309265, -0.17958790063858032, 0.05413955822587013, 0.12819227576255798, -0.1317240595817566, 0.593562662601471, 0.09640271961688995, 0.07793478667736053, -0.23126401007175446, 0.19075822830200195, -0.05886736884713173, -0.040698010474443436, -0.1147417426109314, -0.1222979724407196, 0.12101317942142487, -0.026546888053417206, 0.0356716550886631, 0.5272723436355591, 0.01481720432639122, 0.25339215993881226, -0.20465733110904694, 0.04665283113718033, 0.4088513255119324, -0.34312573075294495, -0.23914246261119843, 0.03392751142382622, 0.4027973413467407, -0.1584722399711609, -0.008304165676236153, -0.8927260637283325, -0.008124023675918579, 0.35854634642601013, -0.0418960303068161, -0.1989167481660843, 0.2673112452030182, -0.004117872565984726, 0.2423498034477234, -0.12274093180894852, 0.1900152713060379, 0.23451872169971466, -0.37071409821510315, -0.07038210332393646, -0.32843655347824097 ]
https://github.com/huggingface/datasets/issues/5806
Hey @mariosasko, I've taken the time to take a look at how we load the datasets usually. My main question now is about the final solution. So the idea is that whenever we load the datasets we also add a new column in the _generate_tables() method from the builders called filename (or file_name) that should be related files contained in each split, right? Do you have any suggestions of where I could add that?
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
74
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. Hey @mariosasko, I've taken the time to take a look at how we load the datasets usually. My main question now is about the final solution. So the idea is that whenever we load the datasets we also add a new column in the _generate_tables() method from the builders called filename (or file_name) that should be related files contained in each split, right? Do you have any suggestions of where I could add that?
[ -0.36966389417648315, -0.047463566064834595, -0.025749318301677704, 0.20428672432899475, 0.03717111051082611, -0.0648699551820755, 0.35760340094566345, 0.4892924427986145, 0.23243914544582367, 0.0483609102666378, 0.0418221578001976, 0.4462888538837433, -0.24884460866451263, 0.47401052713394165, 0.3855251669883728, -0.1376202553510666, 0.0756029337644577, 0.22592148184776306, -0.04344174265861511, -0.02540464699268341, -0.4471510350704193, 0.23153533041477203, 0.3032843768596649, 0.14416806399822235, -0.4090876877307892, 0.09869620949029922, 0.050309255719184875, 0.3743574023246765, -0.061300259083509445, -0.23346412181854248, 0.03922698646783829, 0.2968541085720062, -0.018736504018306732, 0.08540691435337067, -0.00012088476796634495, 0.059504374861717224, 0.0714479386806488, -0.46494239568710327, -0.5437195301055908, -0.37174534797668457, -0.2089569866657257, -0.2737010717391968, -0.03172695264220238, -0.5715310573577881, -0.04395320639014244, -0.365689218044281, 0.05998649448156357, 0.06448107957839966, 0.3420681655406952, -0.07527650147676468, 0.0619296133518219, -0.15708735585212708, -0.17001035809516907, 0.02224428951740265, 0.1645027995109558, 0.4409015476703644, -0.10947544872760773, 0.17159327864646912, 0.09345260262489319, -0.04849541559815407, -0.07968626916408539, 0.4234828054904938, 0.09904134273529053, -0.2213856428861618, 0.2370026856660843, 0.26395002007484436, -0.20048320293426514, 0.15256398916244507, -0.023764360696077347, 0.2249441146850586, 0.4102567136287689, -0.3578685522079468, -0.2602163553237915, -0.6119904518127441, 0.08739796280860901, -0.3911404609680176, 0.08947989344596863, 0.025405190885066986, -0.2138623297214508, 0.14393961429595947, 0.0048358254134655, -0.41862285137176514, -0.1507895439863205, -0.11498376727104187, 0.2480250746011734, -0.3012184500694275, -0.0013814456760883331, 0.11573652923107147, 0.24003735184669495, 0.05053764209151268, -0.10442416369915009, -0.15358880162239075, 0.021534282714128494, 0.07350346446037292, -0.19517476856708527, -0.3181570768356323, 0.3144553005695343, -0.08067993819713593, 0.13599342107772827, 0.23620137572288513, -0.008573837578296661, -0.2349274754524231, -0.17620614171028137, 0.19367842376232147, -0.041424572467803955, -0.01470547541975975, 0.5395600199699402, -0.1813003569841385, 0.18844565749168396, 0.3133993446826935, -0.19767823815345764, -0.14672556519508362, -0.22837397456169128, 0.31685227155685425, -0.06256510317325592, 0.07838959991931915, 0.06413877010345459, -0.04372840374708176, -0.18028700351715088, 0.20368850231170654, 0.06223292648792267, -0.3092353045940399, 0.0875249058008194, 0.4553176164627075, -0.03723681718111038, 0.1878119707107544, 0.04329921305179596, -0.20955286920070648, -0.0784192830324173, -0.353638231754303, 0.0036429427564144135, -0.032600026577711105, -0.41927891969680786, 0.37782809138298035, 0.208000048995018, -0.0027608349919319153, 0.2070680558681488, -0.2730334997177124, -0.10800474882125854, -0.1971873939037323, 0.10988204926252365, -0.09985680878162384, 0.34635746479034424, 0.07981980592012405, -0.07040219008922577, -0.2768596410751343, -0.029193619266152382, -0.20915775001049042, -0.311533123254776, 0.13499753177165985, -0.3175513446331024, -0.5343532562255859, 0.09982619434595108, 0.01579207181930542, -0.35647448897361755, 0.27171799540519714, -0.3979448974132538, 0.4574526846408844, -0.06744153052568436, -0.15479546785354614, -0.11627626419067383, 0.08054357767105103, -0.2978075444698334, -0.1789475679397583, 0.27549368143081665, 0.46818292140960693, -0.6635359525680542, -0.3193718492984772, 0.2107788622379303, -0.36847802996635437, -0.23944400250911713, -0.03355395793914795, -0.06221597641706467, 0.3800898492336273, -0.14109022915363312, 0.13218024373054504, 0.4812028408050537, 0.13903775811195374, -0.08490810543298721, -0.014555409550666809, -0.04898285120725632, 0.23656271398067474, 0.45678097009658813, -0.0230904258787632, 0.21936896443367004, 0.04551348462700844, 0.1779891848564148, 0.38598373532295227, -0.1187349259853363, -0.09872633963823318, 0.11141592264175415, -0.18779638409614563, -0.18155837059020996, 0.4103231132030487, -0.09799569845199585, 0.061193421483039856, 0.30468136072158813, 0.035449132323265076, 0.37815234065055847, -0.12093731760978699, -0.009518641978502274, 0.047338999807834625, 0.19473880529403687, 0.19120469689369202, 0.12419795989990234, -0.16120871901512146, -0.5636398196220398, 0.12226511538028717, 0.15720011293888092, -0.42159855365753174, -0.327551007270813, -0.32230913639068604, -0.020526360720396042, 0.256236732006073, -0.14154177904129028, 0.20830903947353363, -0.027306782081723213, 0.1632038652896881, -0.023466937243938446, -0.07513889670372009, -0.3620372414588928, 0.37970975041389465, -0.6449131965637207, 0.013034209609031677, -0.6044859290122986, 0.4319128692150116, 0.414893239736557, -0.03263765200972557, -0.17955458164215088, 0.48299992084503174, 0.003590189851820469, -0.093345046043396, 0.21954718232154846, 0.2880687713623047, 0.34510478377342224, 0.37543919682502747, 0.30191659927368164, 0.279102623462677, -0.17462588846683502, 0.30921947956085205, 0.01969136856496334, -0.43852698802948, -0.08284968882799149, -0.05612357705831528, -0.15936817228794098, 0.5271254777908325, -0.009069311432540417, 0.2930334806442261, 0.18920759856700897, -0.26407256722450256, 0.06666159629821777, -0.13637113571166992, -0.14142921566963196, -0.22900941967964172, 0.19031764566898346, 0.23803579807281494, -0.10827838629484177, -0.02562737837433815, -0.39093995094299316, 0.004895493388175964, 1.0677677392959595, -0.3356810510158539, -0.024249017238616943, 0.1471768021583557, 0.06772039830684662, -0.09228477627038956, 0.12379055470228195, 0.3477739989757538, 0.4283995032310486, 0.10815301537513733, -0.14245855808258057, -0.10349944978952408, -0.06683649122714996, -0.16245010495185852, 0.1004081666469574, 0.03709670528769493, 0.20383913815021515, 0.5310098528862, -0.1090821623802185, -0.4331221580505371, -0.42756524682044983, -0.17644290626049042, 0.22488734126091003, -0.00010498426854610443, -0.05024632811546326, 0.07067763060331345, 0.1110902801156044, -0.13730813562870026, -0.47071558237075806, 0.029484882950782776, -0.0876091718673706, -0.09500269591808319, 0.004532491788268089, 0.1452481597661972, -0.12902048230171204, 0.11165294051170349, 0.1555856317281723, 0.5932814478874207, -0.269012451171875, -0.1301642805337906, -0.2784542739391327, -0.3840920627117157, 0.12696696817874908, -0.0349065363407135, -0.04572458192706108, -0.12820807099342346, 0.5013185143470764, -0.19853010773658752, 0.09212301671504974, -0.2860640585422516, 0.013414308428764343, 0.25832805037498474, -0.2067573219537735, 0.17851601541042328, 0.32056236267089844, 0.3416409194469452, 0.15916253626346588, -0.3656405806541443, 0.19901707768440247, -0.08305872976779938, -0.13907164335250854, -0.10575513541698456, 0.03177274763584137, 0.2456863522529602, -0.03771784156560898, -0.32610172033309937, -0.20242416858673096, -0.25640738010406494, 0.5723687410354614, -0.09092024713754654, 0.36217737197875977, 0.052444908767938614, -0.2263427972793579, 0.09978494048118591, -0.1813327670097351, 0.01767602190375328, -0.2791162133216858, -0.5025876760482788, 0.15512314438819885, -0.2947545051574707, 0.23332057893276215, 0.01945646107196808, -0.005934335291385651, 0.05641377344727516, 0.00878455862402916, -0.19248440861701965, -0.3252522647380829, 0.32867807149887085, 0.17346343398094177, -0.18296512961387634, 0.10544917732477188, 0.05449306592345238, 0.2210058569908142, 0.04053352400660515, -0.21255749464035034, -0.04415488988161087, 0.3080698847770691, 0.11982123553752899, 0.3715032935142517, 0.33551836013793945, 0.57768315076828, 0.039881184697151184, 0.7087745666503906, 0.12748050689697266, -0.04105166718363762, 0.10249684751033783, 0.18326014280319214, 0.055747538805007935, 0.014932455494999886, -0.10045477747917175, -0.2034195065498352, -0.22719553112983704, -0.030681174248456955, 0.20053677260875702, 0.0456596240401268, 0.20664694905281067, -0.10385819524526596, 0.16693098843097687, -0.23480159044265747, -0.26093459129333496, 0.24446026980876923, 0.05527013912796974, 0.27686038613319397, -0.093528151512146, 0.046340882778167725, -0.23106823861598969, 0.021745197474956512, 0.13368164002895355, 0.4463196396827698, 0.4776618778705597, -0.11358068883419037, -0.39256593585014343, -0.2836953401565552, -0.24363233149051666, 0.08237756788730621, 0.24615025520324707, -0.23269836604595184, -0.05978652089834213, -0.22039814293384552, 0.028154592961072922, 0.13133709132671356, 0.8817031383514404, -0.04628334194421768, -0.1272469460964203, -0.08642963320016861, -0.014166094362735748, 0.20184467732906342, -0.007565662264823914, 0.19564498960971832, 0.024116050451993942, 0.046270303428173065, 0.5334643125534058, -0.32695597410202026, -0.2644943594932556, 0.33956605195999146, 0.23626601696014404, -0.3691563606262207, -0.19647996127605438, -0.11905325949192047, 0.10985053330659866, -0.24317842721939087, -0.09940668195486069, -0.2243645191192627, 0.20501857995986938, -0.16774453222751617, -0.18856197595596313, 0.2057504653930664, -0.1042107567191124, 0.15882858633995056, 0.22745278477668762, 0.45022469758987427, 0.16201426088809967, 0.1709045022726059, 0.35673728585243225, 0.2711719870567322, 0.3467593193054199, 0.548310399055481, -0.4709761440753937, -0.022775106132030487, 0.0630129724740982, -0.2799614667892456, 0.4934314489364624, 0.5003853440284729, -0.2345518171787262, 0.3201988935470581, -0.2877444624900818, 0.008901732042431831, -0.3331616222858429, 0.06478600203990936, 0.08958445489406586, 0.017021644860506058, -0.3139011263847351, -0.6737974882125854, 0.35901689529418945, -0.27670156955718994, -0.17196902632713318, 0.2960226535797119, -0.14535877108573914, -0.2597341239452362, 0.2986360192298889, -0.2025458663702011, 0.9456997513771057, -0.11026615649461746, 0.3041098713874817, 0.02304258570075035, 0.04434572160243988, 0.3350642919540405, -0.7949821949005127, 0.06978994607925415, -0.3264024257659912, -0.3655504584312439, -0.11017709970474243, -0.12853281199932098, 0.03977260738611221, 0.3672288954257965, 0.10507246851921082, 0.14111168682575226, 0.4271339774131775, 0.09052857756614685, -0.14871644973754883, 0.38639748096466064, 0.1302688717842102, -0.27951839566230774, -0.5396127700805664, -0.1466236710548401, -0.04918946698307991, -0.15563145279884338, -0.10203669220209122, -0.09508750587701797, 0.249245285987854, 0.025582201778888702, 0.02849416434764862, -0.031426262110471725, -0.017568759620189667, 0.15818065404891968, 0.11131297051906586, -0.4564433991909027, -0.24759094417095184, 0.13244657218456268, -0.1825008988380432, 0.08854265511035919, 0.0945507362484932, 0.24054338037967682, -0.10540789365768433, 0.33692556619644165, -0.30169951915740967, -0.09145987033843994, 0.6163240075111389, 0.14338628947734833, 0.05945584177970886, 0.14577627182006836, -0.12271197140216827, -0.45931386947631836, -0.28069764375686646, -0.15649208426475525, 0.059717290103435516, -0.2814621329307556, -0.2565164864063263, 0.09499220550060272, 0.01079220324754715, -0.13664112985134125, -0.020727749913930893, 0.3210773766040802, -0.3753061890602112, 0.016940360888838768, -0.10245750844478607, -0.25145816802978516, -0.02153070643544197, 0.23834100365638733, 0.01887369155883789, -0.11777406930923462, 0.24849291145801544, 0.23984394967556, -0.10819990932941437, -0.037366703152656555, 0.21209093928337097, 0.5308532118797302, -0.48693394660949707, 0.08439457416534424, 0.33658087253570557, 0.14811305701732635, -0.02958378940820694, 0.16714683175086975, 0.11474791169166565, 0.08135958015918732, -0.15505240857601166, -0.2666769027709961, -0.09902313351631165, 0.3716580271720886, 0.06877841055393219, 0.3166983723640442, 0.3704814016819, 0.05374655872583389, -0.13472464680671692, 0.09906161576509476, -0.19698652625083923, 0.01749591901898384, -0.048078007996082306, 0.26063448190689087, 0.1560676246881485, 0.06836245208978653, 0.3094395399093628, -0.1217317208647728, -0.02397945150732994, -0.11865493655204773, -0.22575996816158295, -0.023448292165994644, -0.35079464316368103, 0.22070537507534027, -0.024040842428803444, 0.45001375675201416, -0.35319653153419495, -0.22054064273834229, 0.02719004824757576, -0.23060250282287598, 0.2610052525997162, -0.10857059061527252, 0.008506469428539276, 0.22678139805793762, 0.35856378078460693, 0.06839555501937866, -0.19635608792304993, 0.10430805385112762, 0.006212741136550903, 0.46720463037490845, 0.07524559646844864, 0.020112229511141777, -0.5034797191619873, 0.03317105025053024, -0.22868415713310242, 0.3635808229446411, 0.10700400173664093, 0.13124066591262817, 0.28763073682785034, 0.18977439403533936, -0.1777927428483963, -0.05802997574210167, 0.3724892735481262, 0.41303250193595886, -0.1643146574497223, -0.05161144584417343, 0.28445300459861755, 0.09081213176250458, -0.05453729256987572, -0.1531931459903717, 0.35140904784202576, -0.2655998170375824, 0.052667707204818726, 0.22661645710468292, 0.1831952929496765, 0.23928487300872803, 0.173165425658226, -0.14189162850379944, -0.1407492458820343, -0.0014463532716035843, 0.26068833470344543, 0.6287813782691956, 0.3133416771888733, 0.2521226406097412, 0.21464790403842926, 0.39781737327575684, 0.24055908620357513, 0.4778592884540558, -0.1309257596731186, 0.22565624117851257, -0.06950922310352325, 0.02959030121564865, 0.03136321157217026, -0.42946192622184753, -0.10841280221939087, -0.11775939166545868, -0.2552725076675415, 0.3951623737812042, -0.1604820042848587, 0.4905906319618225, 0.008519701659679413, -0.05446293577551842, -0.2388247549533844, 0.13985146582126617, -0.09592118859291077, -0.17856453359127045, -0.2565966844558716, -0.1994834691286087, -0.3422972857952118, 0.10824717581272125, 0.02405557967722416, 0.06607839465141296, 0.02791816182434559, 0.12951737642288208, 0.41210123896598816, 0.10218758881092072, 0.08910833299160004, -0.05374731495976448, 0.33382347226142883, -0.35933172702789307, 0.07374732196331024, -0.03863950073719025, 0.3187456429004669, 0.25496822595596313, -0.3855433464050293, -0.14809295535087585, -0.056633953005075455, 0.17623062431812286, 0.012121923267841339, -0.03236612305045128, -0.0020243749022483826, -0.11915615200996399, 0.18183119595050812, 0.09057242423295975, 0.07564084976911545, 0.4303780198097229, 0.058780886232852936, -0.06714008003473282, -0.08032926917076111, 0.31160610914230347, -0.13468506932258606, -0.41944143176078796, 0.2986471652984619, 0.35567978024482727, -0.3090869188308716, -0.2393161803483963, 0.186762273311615, -0.4206872582435608, -0.016197528690099716, 0.3110089898109436, 0.17673172056674957, -0.01764586567878723, 0.03843044117093086, 0.031125184148550034, -0.2428670972585678, 0.1826392412185669, 0.05438292399048805, -0.017441781237721443, -0.22355890274047852, -0.34543710947036743, -0.1687663048505783, -0.13005031645298004, 0.20869065821170807, 0.16436168551445007, 0.11049491167068481, 0.011245295405387878, 0.2932872176170349, 0.04863019660115242, -0.2518978714942932, -0.33507612347602844, -0.08950523287057877, 0.18855665624141693, -0.40526658296585083, -0.5963612794876099, -0.025065995752811432, 0.09229715168476105, -0.185518279671669, 0.04380568861961365, -0.05787333473563194, 0.20220667123794556, -0.20174936950206757, -0.23966918885707855, -0.10791322588920593, 0.10864584892988205, 0.04516211152076721, 0.321750670671463, -0.23572787642478943, 0.19342124462127686, -0.1305183321237564, -0.10974304378032684, 0.02598121576011181, -0.2860044836997986, 0.000024430453777313232, 0.22762024402618408, -0.0890655368566513, 0.5911722183227539, 0.07068028301000595, 0.07268859446048737, -0.27421510219573975, 0.02035057172179222, -0.10698563605546951, 0.08634531497955322, -0.20367097854614258, -0.12547443807125092, -0.03968796879053116, 0.039721839129924774, 0.22124221920967102, 0.49080756306648254, 0.011007839813828468, 0.2513534128665924, -0.1844918578863144, 0.10445082187652588, 0.2819491922855377, -0.1860024780035019, -0.23608987033367157, 0.10377147793769836, 0.3083555996417999, -0.09876665472984314, 0.019732443615794182, -0.8013706803321838, -0.020282134413719177, 0.3590454161167145, -0.13981691002845764, -0.08427358418703079, 0.26188933849334717, 0.1809646040201187, 0.21200759708881378, -0.1265215426683426, 0.04875214397907257, 0.21528473496437073, -0.4013957381248474, -0.09592389315366745, -0.34158778190612793 ]
https://github.com/huggingface/datasets/issues/5806
> Is this issue still open? If yes, I'd like to work upon on it. Thanks Definitely still open. I gave it a try, but then didn't get any feedback on my last question so I stopped . Feel free to work on it.
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
44
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. > Is this issue still open? If yes, I'd like to work upon on it. Thanks Definitely still open. I gave it a try, but then didn't get any feedback on my last question so I stopped . Feel free to work on it.
[ -0.34719961881637573, -0.22424393892288208, -0.027185918763279915, 0.005224757827818394, 0.11257457733154297, -0.18082734942436218, 0.39576083421707153, 0.47865381836891174, 0.22163629531860352, 0.09539312869310379, 0.11878401041030884, 0.5177738070487976, -0.2579129934310913, 0.48360809683799744, 0.34779518842697144, -0.006185526493936777, -0.038856297731399536, 0.12453743815422058, -0.004608117043972015, -0.12164306640625, -0.3944823741912842, 0.3117258548736572, 0.27067041397094727, 0.14368592202663422, -0.34931036829948425, 0.09485431015491486, 0.21309438347816467, 0.3420106768608093, -0.05093611031770706, -0.2754386365413666, 0.20347517728805542, 0.13726651668548584, -0.05175201967358589, 0.06736826151609421, -0.00011565569002414122, -0.01727163791656494, 0.21071946620941162, -0.44720950722694397, -0.5901864171028137, -0.425817608833313, -0.04629725217819214, -0.2618712782859802, 0.09023099392652512, -0.5685825943946838, 0.012299075722694397, -0.26210078597068787, 0.07033684849739075, 0.17575152218341827, 0.3370540738105774, 0.10391763597726822, 0.1313629150390625, -0.050391390919685364, -0.29425784945487976, -0.03346709907054901, 0.0702919214963913, 0.4285668134689331, -0.06287462264299393, 0.20773251354694366, 0.011682132259011269, -0.02031959965825081, 0.006064131855964661, 0.4960513710975647, 0.009097382426261902, -0.15146797895431519, 0.08322515338659286, 0.14769268035888672, -0.08719957619905472, 0.299615740776062, 0.053692080080509186, 0.29901933670043945, 0.45225581526756287, -0.3058778941631317, -0.23417262732982635, -0.537490963935852, 0.10030928254127502, -0.3426874279975891, 0.11691967397928238, -0.06399007886648178, -0.29055166244506836, 0.18591946363449097, 0.040041495114564896, -0.3553200364112854, -0.011231392621994019, -0.10455051064491272, 0.08804946392774582, -0.35606902837753296, -0.045714423060417175, 0.06188301742076874, 0.30315813422203064, -0.003833980765193701, -0.24703837931156158, -0.02286781184375286, 0.03020371124148369, -0.009035134688019753, -0.29126104712486267, -0.3054317831993103, 0.3731667101383209, -0.11064217239618301, 0.13101015985012054, 0.2977062463760376, 0.15766355395317078, -0.13600654900074005, -0.25265851616859436, 0.31343722343444824, -0.03573892265558243, 0.0865010917186737, 0.5306599736213684, -0.27563998103141785, 0.24185770750045776, 0.288479208946228, -0.09605223685503006, -0.1587148755788803, -0.18179021775722504, 0.2982451319694519, 0.12116767466068268, 0.04783770069479942, 0.220606729388237, -0.16558896005153656, -0.2506226897239685, 0.23957806825637817, 0.02371932566165924, -0.1996554583311081, 0.0185873880982399, 0.5038374066352844, -0.03384856879711151, 0.25518599152565, 0.08453358709812164, -0.27109402418136597, -0.07654407620429993, -0.3571528494358063, -0.013004058972001076, -0.10648302733898163, -0.46701955795288086, 0.22153154015541077, 0.2384919673204422, -0.11148297041654587, 0.2726031243801117, -0.36354678869247437, -0.14148776233196259, -0.08484963327646255, 0.015235371887683868, -0.08576234430074692, 0.45201390981674194, 0.04265058413147926, -0.13714732229709625, -0.15303754806518555, 0.08172766864299774, -0.12151448428630829, -0.257717490196228, 0.06403309106826782, -0.34566929936408997, -0.4621153473854065, 0.1453036069869995, 0.09150915592908859, -0.2961951494216919, 0.20268751680850983, -0.3862946033477783, 0.35229697823524475, -0.17203886806964874, -0.14926180243492126, 0.021938100457191467, -0.08478046208620071, -0.3265671730041504, -0.19840362668037415, 0.21145248413085938, 0.42860081791877747, -0.581718921661377, -0.3381456732749939, 0.2419445514678955, -0.41767117381095886, -0.2852242588996887, 0.03287314996123314, -0.16087034344673157, 0.19007298350334167, -0.17304627597332, 0.14287684857845306, 0.433195024728775, -0.05581310763955116, -0.21988993883132935, -0.0029954947531223297, -0.06842836737632751, 0.28554123640060425, 0.2682020962238312, -0.07431748509407043, 0.10515555739402771, -0.007741563022136688, 0.1757344901561737, 0.3927856385707855, 0.08925319463014603, -0.007392704486846924, 0.09317252039909363, -0.193672776222229, -0.09629684686660767, 0.39546629786491394, -0.13887174427509308, 0.0062949880957603455, 0.2840534448623657, 0.06697678565979004, 0.4330587685108185, -0.026047606021165848, -0.0573882982134819, 0.11668547242879868, 0.23546868562698364, 0.11661550402641296, 0.13890394568443298, -0.2593840956687927, -0.45165860652923584, 0.08477354049682617, 0.23678679764270782, -0.464018315076828, -0.18625734746456146, -0.27393975853919983, -0.08414566516876221, 0.214074969291687, -0.08844880759716034, 0.060300473123788834, 0.04092755913734436, 0.17977473139762878, -0.07085099071264267, 0.15457779169082642, -0.3316528797149658, 0.4774444103240967, -0.6557368636131287, -0.07541090995073318, -0.431156188249588, 0.25774914026260376, 0.5221785306930542, -0.03729649633169174, -0.09820320457220078, 0.3728986084461212, 0.08758508414030075, 0.028384409844875336, 0.13922537863254547, 0.2284109741449356, 0.330657035112381, 0.3482592701911926, 0.21262453496456146, 0.22138981521129608, -0.2117709219455719, 0.2582617998123169, -0.055498212575912476, -0.08507981896400452, -0.10564602166414261, -0.06364789605140686, -0.21909090876579285, 0.48232734203338623, 0.1464773714542389, 0.17366153001785278, 0.20497916638851166, -0.2529164254665375, 0.11989808082580566, -0.22425401210784912, -0.2965880036354065, -0.14760349690914154, 0.3890689015388489, 0.09180554747581482, -0.04846696928143501, -0.10970611870288849, -0.5228344202041626, -0.18863140046596527, 1.085085153579712, -0.22096684575080872, 0.10253896564245224, 0.2222118079662323, -0.0011429917067289352, -0.049575209617614746, 0.16208453476428986, 0.2653786540031433, 0.34477946162223816, 0.16348615288734436, -0.20310086011886597, -0.10117970407009125, -0.020389964804053307, -0.12469916045665741, 0.0671369805932045, -0.02437630295753479, 0.27056363224983215, 0.46988651156425476, 0.06330691277980804, -0.4550899565219879, -0.4677306115627289, -0.1658647507429123, 0.12461201846599579, -0.0939897820353508, -0.019968383014202118, 0.034444212913513184, -0.08610425889492035, -0.19104212522506714, -0.35077619552612305, 0.03997437283396721, -0.1425180733203888, -0.1259576380252838, -0.0977945625782013, 0.22645846009254456, -0.10779821872711182, 0.16288095712661743, 0.00771968811750412, 0.5378208160400391, -0.1719275414943695, -0.21026620268821716, -0.1965816169977188, -0.35353994369506836, 0.042290542274713516, 0.0229729562997818, -0.1779661923646927, -0.17873255908489227, 0.5287199020385742, -0.013730451464653015, 0.07541926205158234, -0.40766510367393494, 0.08823986351490021, 0.36766210198402405, -0.05068260431289673, 0.11170991510152817, 0.32276421785354614, 0.34474799036979675, -0.006946302950382233, -0.18205785751342773, 0.2295805662870407, -0.21454878151416779, -0.18564587831497192, -0.12406449019908905, 0.09299804270267487, 0.2586531639099121, -0.10814038664102554, -0.15312977135181427, -0.17307724058628082, -0.2923562526702881, 0.5171831250190735, -0.14677196741104126, 0.3270542323589325, 0.16009196639060974, -0.25339990854263306, 0.1945638656616211, -0.17663171887397766, -0.07674919813871384, -0.36300259828567505, -0.540473461151123, 0.1322665810585022, -0.25483715534210205, 0.11247646063566208, -0.041096724569797516, 0.14232154190540314, -0.016206517815589905, 0.09554325044155121, -0.268300861120224, -0.4884861707687378, 0.36175537109375, 0.2495942860841751, -0.34024477005004883, -0.006301401183009148, 0.10562442988157272, 0.17060931026935577, -0.0414016991853714, -0.2084711194038391, -0.13252142071723938, 0.23448550701141357, 0.10289683938026428, 0.4906136095523834, 0.32924917340278625, 0.5198497176170349, 0.14723537862300873, 0.6056592464447021, 0.097834512591362, -0.02564254216849804, 0.1756291389465332, 0.14951550960540771, 0.05368999391794205, -0.0754099041223526, -0.15013323724269867, -0.2479000985622406, -0.29472947120666504, 0.0222131609916687, 0.1425541788339615, -0.00993650034070015, 0.11708857119083405, -0.10066180676221848, 0.040954068303108215, -0.26096951961517334, -0.2417423576116562, 0.19808396697044373, 0.09047739207744598, 0.1873837113380432, -0.030527476221323013, 0.1754074990749359, -0.2325606644153595, -0.001146312803030014, 0.23859155178070068, 0.47643986344337463, 0.4546160101890564, -0.08605970442295074, -0.3967655897140503, -0.14485427737236023, -0.3366670608520508, 0.05015755444765091, 0.13363777101039886, -0.17106573283672333, -0.12627187371253967, -0.1843605935573578, -0.029841650277376175, 0.06635560095310211, 0.9578642249107361, 0.016716310754418373, 0.014073269441723824, -0.011638883501291275, -0.04683919623494148, 0.06602108478546143, -0.03915310651063919, 0.20668697357177734, 0.05291619524359703, 0.11427939683198929, 0.44450733065605164, -0.2159823775291443, -0.16867032647132874, 0.19617684185504913, 0.15416839718818665, -0.4277479648590088, -0.22719024121761322, -0.1677687168121338, 0.029354862868785858, -0.23247405886650085, -0.08334729075431824, -0.22618931531906128, 0.0818229541182518, -0.11338866502046585, -0.051857057958841324, 0.13732516765594482, -0.08729859441518784, 0.19964496791362762, 0.10328443348407745, 0.5203263163566589, 0.07356256991624832, 0.08328084647655487, 0.29598575830459595, 0.36918771266937256, 0.3141680657863617, 0.5162665247917175, -0.19394592940807343, -0.11244024336338043, 0.037664007395505905, -0.192434161901474, 0.46764910221099854, 0.4702923893928528, -0.2542065978050232, 0.37018439173698425, -0.25476402044296265, 0.0600777342915535, -0.2959757149219513, 0.07243997603654861, 0.13789956271648407, 0.08198507130146027, -0.33967751264572144, -0.5325895547866821, 0.33042991161346436, -0.36067426204681396, -0.1373746544122696, 0.3732215166091919, -0.26799559593200684, -0.2316596508026123, 0.24119451642036438, -0.2732977271080017, 0.9028047323226929, -0.02371484413743019, 0.28854984045028687, 0.08519498258829117, 0.16000965237617493, 0.27201443910598755, -0.6180691123008728, 0.055268723517656326, -0.3440288305282593, -0.2814446687698364, -0.08264787495136261, -0.12066718935966492, 0.016774365678429604, 0.1644969880580902, 0.05897596478462219, 0.10562083125114441, 0.4321216344833374, 0.02230173721909523, -0.1163083016872406, 0.49614471197128296, 0.08311475068330765, -0.22273282706737518, -0.5802090167999268, -0.04236162081360817, -0.05289037898182869, -0.008878643624484539, -0.10258186608552933, -0.08758991956710815, 0.3138718008995056, -0.06972673535346985, 0.0023507922887802124, 0.07781968265771866, -0.031823594123125076, 0.20180363953113556, 0.12238791584968567, -0.49242842197418213, -0.3111715316772461, 0.05343247205018997, -0.20648543536663055, 0.17195351421833038, -0.02966371923685074, 0.2839650809764862, -0.07150974869728088, 0.3319769501686096, -0.3741346597671509, -0.08771054446697235, 0.6548570990562439, 0.016434676945209503, -0.04413759708404541, 0.17505940794944763, -0.06016312167048454, -0.4958798289299011, -0.17844104766845703, -0.11914636194705963, 0.11065524071455002, -0.19772227108478546, -0.2998320162296295, 0.0436428003013134, 0.04287019371986389, -0.2029893696308136, 0.02195337601006031, 0.299906849861145, -0.26252973079681396, -0.0977582037448883, 0.17941689491271973, -0.23991891741752625, -0.06364653259515762, 0.4360828995704651, -0.004984857514500618, -0.2136959731578827, 0.4045053720474243, 0.22014516592025757, -0.09399550408124924, -0.0831623524427414, 0.1613258719444275, 0.4280637204647064, -0.33590197563171387, 0.16760532557964325, 0.2840348780155182, 0.2442384958267212, -0.10311195999383926, 0.17354869842529297, 0.010377437807619572, 0.0025514811277389526, -0.20267333090305328, -0.31849396228790283, -0.10467472672462463, 0.2817677855491638, -0.022855810821056366, 0.20808300375938416, 0.3554193377494812, 0.08437308669090271, 0.010266847908496857, 0.002992827445268631, -0.2713014483451843, 0.01877598464488983, 0.008483797311782837, 0.1854565441608429, 0.16301864385604858, 0.07055896520614624, 0.4183938503265381, -0.08396759629249573, 0.02311433106660843, 0.02260555699467659, -0.2058635652065277, -0.1374574899673462, -0.4115530848503113, 0.19158177077770233, -0.08053599298000336, 0.433594286441803, -0.25620007514953613, -0.24201056361198425, 0.09766791015863419, -0.221547931432724, 0.19391471147537231, 0.13166014850139618, -0.002247193828225136, 0.2314712405204773, 0.33077260851860046, 0.07685829699039459, -0.024424172937870026, 0.0013130130246281624, 0.0019627362489700317, 0.2775212824344635, 0.061973001807928085, -0.08025287091732025, -0.48391789197921753, 0.1536988466978073, -0.24889108538627625, 0.28095343708992004, 0.135101780295372, 0.14954769611358643, 0.16471654176712036, 0.11699570715427399, -0.27631354331970215, -0.15448977053165436, 0.35342833399772644, 0.26805591583251953, -0.3381587862968445, -0.04971226304769516, 0.41608086228370667, 0.15016911923885345, -0.1389794945716858, -0.08935719728469849, 0.40128201246261597, -0.18634670972824097, 0.009261742234230042, 0.08935557305812836, 0.0561043843626976, 0.10256241261959076, 0.3411027193069458, -0.19398929178714752, -0.08137007057666779, -0.1664254069328308, 0.22295674681663513, 0.45461517572402954, 0.27321553230285645, 0.17020609974861145, 0.32236453890800476, 0.38880833983421326, 0.3056560754776001, 0.5042733550071716, 0.020486559718847275, 0.15369533002376556, -0.045510321855545044, 0.04917832836508751, -0.13485705852508545, -0.48136013746261597, -0.15547813475131989, -0.11155334115028381, -0.4809044301509857, 0.5247514843940735, -0.077847421169281, 0.4083419144153595, 0.0874226987361908, 0.008580859750509262, -0.4080480635166168, 0.08536773175001144, -0.16782554984092712, -0.1954144984483719, -0.1826871931552887, -0.17511528730392456, -0.15330199897289276, 0.18474605679512024, 0.009220365434885025, 0.10219091176986694, 0.10199583321809769, 0.1270703822374344, 0.324224591255188, 0.13367627561092377, -0.07048439979553223, -0.11525438725948334, 0.38710013031959534, -0.3708549737930298, -0.11629049479961395, -0.07575718313455582, 0.4083380103111267, 0.16775304079055786, -0.3242338001728058, -0.1117217168211937, -0.006803245283663273, 0.21010801196098328, 0.006740078330039978, -0.07081297785043716, 0.0661647841334343, -0.1064206138253212, 0.2017807513475418, 0.2784930169582367, 0.09015850722789764, 0.5429467558860779, 0.12408137321472168, -0.14119768142700195, 0.1072167456150055, 0.2053956687450409, -0.13052670657634735, -0.5054123401641846, 0.18657271564006805, 0.3571305274963379, -0.20621180534362793, -0.4241601824760437, 0.1991741955280304, -0.3605998456478119, 0.09056246280670166, 0.3210873603820801, 0.3632526099681854, 0.0689416378736496, 0.012639105319976807, 0.0919836163520813, -0.2898048162460327, 0.023432664573192596, 0.11259554326534271, -0.010722078382968903, -0.09515108168125153, -0.2475023716688156, -0.2721221446990967, -0.027569379657506943, 0.09748314321041107, 0.25322169065475464, 0.12239000201225281, -0.028951335698366165, 0.31664860248565674, 0.041574638336896896, -0.16374114155769348, -0.32266533374786377, -0.023149196058511734, 0.09751343727111816, -0.39305514097213745, -0.6249602437019348, -0.015612564980983734, 0.010806465521454811, -0.06568827480077744, -0.06056040897965431, -0.11336712539196014, 0.07357388734817505, -0.07327842712402344, -0.26699337363243103, -0.22127121686935425, -0.0954412966966629, 0.1573503315448761, 0.5230408310890198, -0.18137980997562408, 0.07137623429298401, -0.11072015762329102, -0.13709992170333862, 0.006560939829796553, -0.18557053804397583, 0.06073398515582085, 0.12322922050952911, -0.14567658305168152, 0.5823677182197571, 0.09306630492210388, 0.05816873162984848, -0.264957994222641, 0.18904803693294525, -0.10377763211727142, -0.04056050628423691, -0.14927402138710022, -0.10436779260635376, 0.13744184374809265, -0.02103353478014469, 0.02465847134590149, 0.5033797025680542, -0.0013285381719470024, 0.25673243403434753, -0.23235172033309937, 0.05614355951547623, 0.4192940592765808, -0.33685776591300964, -0.2323484718799591, 0.05100765451788902, 0.4275200366973877, -0.16378581523895264, 0.012268723919987679, -0.9254615306854248, -0.03343340754508972, 0.34753182530403137, -0.039589181542396545, -0.20004475116729736, 0.27345922589302063, -0.02595704421401024, 0.2676999270915985, -0.11485260725021362, 0.1832236647605896, 0.21078509092330933, -0.3859787583351135, -0.08727573603391647, -0.3321652114391327 ]
https://github.com/huggingface/datasets/issues/5806
It's still open, so feel free to work on it. This can be implemented by adding a param to the packaged builders' configs that inserts a column with file names (in `_generate_tables`) when `True`. Naming this column `file_name` sounds good to me.
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
42
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. It's still open, so feel free to work on it. This can be implemented by adding a param to the packaged builders' configs that inserts a column with file names (in `_generate_tables`) when `True`. Naming this column `file_name` sounds good to me.
[ -0.5077106952667236, -0.14263205230236053, -0.03315097838640213, 0.036459363996982574, 0.05918165296316147, -0.1509508490562439, 0.38432031869888306, 0.5087962746620178, 0.21042674779891968, 0.11009090393781662, 0.16244655847549438, 0.5358562469482422, -0.33372265100479126, 0.48705339431762695, 0.43210405111312866, 0.03998693823814392, 0.006653729826211929, 0.17788848280906677, -0.054185155779123306, -0.05750444158911705, -0.410372257232666, 0.27143988013267517, 0.30087411403656006, 0.16161121428012848, -0.3669891357421875, 0.10259982943534851, 0.21596825122833252, 0.30166691541671753, -0.07271173596382141, -0.28897786140441895, 0.17592072486877441, 0.2341146469116211, -0.016568142920732498, -0.032004933804273605, -0.0001165748544735834, 0.04670887440443039, 0.16358865797519684, -0.47424471378326416, -0.6604280471801758, -0.3822551965713501, -0.07950001955032349, -0.30782872438430786, -0.002858217805624008, -0.5883986949920654, -0.04467720910906792, -0.3235195279121399, 0.1179797351360321, 0.14165925979614258, 0.22091960906982422, 0.045195698738098145, 0.10996943712234497, -0.10952992737293243, -0.29118555784225464, -0.03941358998417854, 0.040499329566955566, 0.426850825548172, -0.08214345574378967, 0.17202720046043396, 0.018987195566296577, 0.035597749054431915, 0.008212760090827942, 0.47830846905708313, 0.01270315796136856, -0.1284199208021164, 0.19530601799488068, 0.2257886528968811, -0.12196935713291168, 0.3543756604194641, 0.03901783376932144, 0.366842657327652, 0.4254547953605652, -0.349369615316391, -0.21589484810829163, -0.5888036489486694, 0.09168195724487305, -0.3986521363258362, 0.11241133511066437, -0.020322348922491074, -0.2553173899650574, 0.15016993880271912, -0.008235488086938858, -0.35984498262405396, -0.03725803643465042, -0.1317056566476822, 0.09711606800556183, -0.3311384320259094, -0.06772241741418839, 0.06128368526697159, 0.24727319180965424, -0.024002481251955032, -0.2338111400604248, -0.11696609854698181, -0.0401809923350811, 0.013073835521936417, -0.17864957451820374, -0.3025597333908081, 0.37593507766723633, -0.11794190108776093, 0.11963610351085663, 0.22394752502441406, 0.16065235435962677, -0.19286760687828064, -0.20065292716026306, 0.3086773753166199, -0.05068962648510933, 0.03545384854078293, 0.5428858995437622, -0.22873903810977936, 0.21894939243793488, 0.3564481735229492, -0.09638281911611557, -0.13533948361873627, -0.20714356005191803, 0.31468498706817627, 0.058285415172576904, 0.01635099947452545, 0.16615892946720123, -0.042380012571811676, -0.25347810983657837, 0.21267077326774597, 0.08757318556308746, -0.19695593416690826, 0.03343559801578522, 0.419044554233551, -0.05966218560934067, 0.18028602004051208, 0.09321464598178864, -0.30829933285713196, -0.038115695118904114, -0.3496825098991394, 0.00017582252621650696, -0.13007979094982147, -0.42936593294143677, 0.21940964460372925, 0.2643449902534485, -0.08403252065181732, 0.22326195240020752, -0.3368486166000366, -0.17416678369045258, -0.12018095701932907, 0.04473476856946945, -0.018510669469833374, 0.46577948331832886, 0.04504570737481117, -0.16684532165527344, -0.24538475275039673, -0.00960517954081297, -0.18274369835853577, -0.3036543130874634, 0.08241137862205505, -0.3311065435409546, -0.44206225872039795, 0.1399117261171341, 0.07523350417613983, -0.31724727153778076, 0.19814911484718323, -0.3721502721309662, 0.38098540902137756, -0.17523300647735596, -0.10010814666748047, -0.014588739722967148, -0.022092707455158234, -0.305478036403656, -0.13920992612838745, 0.20582720637321472, 0.42064112424850464, -0.6145431399345398, -0.36730682849884033, 0.2553079128265381, -0.4215232729911804, -0.363669216632843, -0.11400683224201202, -0.11349637806415558, 0.24600550532341003, -0.14697447419166565, 0.02214697003364563, 0.5164785385131836, -0.014017768204212189, -0.13923418521881104, -0.03745650872588158, -0.059000786393880844, 0.28979265689849854, 0.3468973934650421, -0.044269442558288574, 0.1319606602191925, 0.004060611128807068, 0.18542791903018951, 0.3727973997592926, 0.04877203702926636, -0.028809361159801483, 0.2078237533569336, -0.22494514286518097, -0.17508810758590698, 0.39248019456863403, -0.12181098759174347, 0.0006483681499958038, 0.23399606347084045, 0.1218646913766861, 0.4313647150993347, -0.005594170652329922, -0.060628533363342285, 0.062265943735837936, 0.12617410719394684, 0.12128715217113495, 0.12568087875843048, -0.2863498330116272, -0.49149903655052185, 0.13912330567836761, 0.18369103968143463, -0.496525377035141, -0.24643905460834503, -0.315254807472229, 0.05300772190093994, 0.25369250774383545, -0.05649711936712265, 0.04520467296242714, 0.033839695155620575, 0.20379334688186646, -0.10151712596416473, 0.07617239654064178, -0.3608636260032654, 0.43542012572288513, -0.6318129897117615, -0.0545274056494236, -0.40683168172836304, 0.18897634744644165, 0.5635039806365967, -0.03525964915752411, -0.11366219818592072, 0.3651711940765381, 0.012003887444734573, -0.00014180690050125122, 0.21400053799152374, 0.2285178005695343, 0.29208484292030334, 0.3601866662502289, 0.2267611026763916, 0.26806366443634033, -0.21242065727710724, 0.32694578170776367, -0.033046141266822815, -0.2046825885772705, -0.14603909850120544, 0.02727273851633072, -0.23294022679328918, 0.5275062322616577, 0.13994674384593964, 0.20831727981567383, 0.17140507698059082, -0.27762898802757263, 0.07803762704133987, -0.22862917184829712, -0.24942249059677124, -0.2568259835243225, 0.2862308621406555, 0.13594283163547516, -0.08439338207244873, -0.05644109100103378, -0.4154541492462158, -0.13130983710289001, 1.12104070186615, -0.23987732827663422, 0.06372973322868347, 0.18076640367507935, 0.045295678079128265, -0.013630472123622894, 0.11468219012022018, 0.2983998656272888, 0.31192612648010254, 0.1468271017074585, -0.179447203874588, -0.1162593811750412, -0.08362440764904022, -0.10062204301357269, 0.08304081857204437, -0.025193840265274048, 0.19165557622909546, 0.45686301589012146, -0.023525547236204147, -0.45742419362068176, -0.5056696534156799, -0.1578845977783203, 0.17021790146827698, -0.10922997444868088, 0.026431262493133545, 0.059896066784858704, -0.06108330190181732, -0.1568661481142044, -0.40672144293785095, 0.0976153314113617, -0.11616111546754837, -0.06695803254842758, -0.04261806607246399, 0.19920095801353455, -0.1370447874069214, 0.12801259756088257, 0.02537836879491806, 0.5692964792251587, -0.17835569381713867, -0.3185628652572632, -0.22662203013896942, -0.3259093165397644, 0.09467445313930511, 0.027279533445835114, -0.19933545589447021, -0.2362867295742035, 0.5247775912284851, -0.07207086682319641, 0.10122236609458923, -0.4490293860435486, 0.12063778936862946, 0.4008621573448181, -0.07034853100776672, 0.09207276254892349, 0.3496685326099396, 0.28427979350090027, 0.12250812351703644, -0.20229734480381012, 0.23931552469730377, -0.12330137193202972, -0.134285569190979, -0.13253657519817352, 0.09576114267110825, 0.19497686624526978, -0.14862102270126343, -0.15122699737548828, -0.08949403464794159, -0.27308422327041626, 0.45832324028015137, -0.09694862365722656, 0.3247731029987335, 0.12973225116729736, -0.2366744428873062, 0.18996933102607727, -0.18689845502376556, -0.0394323505461216, -0.2840467691421509, -0.5045775771141052, 0.09413939714431763, -0.2249644249677658, 0.2155120074748993, -0.0878877341747284, 0.09441495686769485, -0.040857791900634766, 0.11892597377300262, -0.24126166105270386, -0.3801860213279724, 0.3450984060764313, 0.2929283380508423, -0.22579145431518555, -0.036770306527614594, 0.13654477894306183, 0.2541864514350891, -0.05504557862877846, -0.23974260687828064, -0.05905930697917938, 0.2940673530101776, 0.08714893460273743, 0.4460640847682953, 0.40100446343421936, 0.4952339828014374, 0.11324907094240189, 0.5901675820350647, 0.10545718669891357, -0.12053602933883667, 0.13905097544193268, 0.09647022187709808, 0.11181820929050446, -0.01024966686964035, -0.03982126712799072, -0.24922707676887512, -0.23209628462791443, 0.050063617527484894, 0.12376964092254639, 0.0093771331012249, 0.17176786065101624, -0.09870654344558716, 0.16640913486480713, -0.20299537479877472, -0.2490481585264206, 0.20559516549110413, 0.019963787868618965, 0.24613460898399353, -0.04203140363097191, 0.1208878830075264, -0.193629652261734, -0.012977931648492813, 0.2531403601169586, 0.44849836826324463, 0.4953308701515198, -0.09164170175790787, -0.260975182056427, -0.13447628915309906, -0.2993985414505005, 0.04330947995185852, 0.17308910191059113, -0.2634519040584564, -0.11888600885868073, -0.2034766972064972, -0.03820749744772911, 0.03425789251923561, 0.9164217114448547, 0.017653321847319603, 0.07508160173892975, -0.024613365530967712, -0.0023429319262504578, 0.1331879198551178, -0.05540858954191208, 0.1668967753648758, -0.01313653215765953, 0.044219646602869034, 0.5232887268066406, -0.216298907995224, -0.2377518117427826, 0.2513870596885681, 0.16211216151714325, -0.4318380057811737, -0.17393076419830322, -0.17625166475772858, 0.09356305003166199, -0.21775557100772858, -0.09340588748455048, -0.2212119698524475, 0.11128520220518112, -0.10555509477853775, -0.11843305081129074, 0.1010432243347168, -0.05627274513244629, 0.1646728515625, 0.11207902431488037, 0.5314188003540039, 0.07952696084976196, 0.10641033202409744, 0.3342229425907135, 0.35752198100090027, 0.32055991888046265, 0.48731687664985657, -0.2546350359916687, -0.05026930198073387, 0.03188347443938255, -0.20619308948516846, 0.43914783000946045, 0.4251011610031128, -0.3221701383590698, 0.3034372627735138, -0.2716161608695984, 0.05678672716021538, -0.3619091212749481, 0.09773050248622894, 0.16532370448112488, 0.08396705985069275, -0.30936235189437866, -0.5613244771957397, 0.4052249789237976, -0.2888790965080261, -0.15941385924816132, 0.3474593460559845, -0.26932477951049805, -0.2797459661960602, 0.18065029382705688, -0.18124952912330627, 0.7807628512382507, -0.0666477158665657, 0.31100526452064514, 0.034169528633356094, 0.12057960033416748, 0.24573861062526703, -0.6918441653251648, 0.05433102324604988, -0.28853166103363037, -0.2799989581108093, -0.11701704561710358, -0.11833648383617401, 0.03422503545880318, 0.27398693561553955, 0.06391628086566925, 0.08124629408121109, 0.39392122626304626, 0.03298730403184891, -0.14526253938674927, 0.43776416778564453, 0.05355342477560043, -0.22899967432022095, -0.5111039876937866, -0.06651067733764648, -0.002594701014459133, -0.04014059901237488, -0.11187741160392761, -0.03270687535405159, 0.39535439014434814, -0.06054893881082535, 0.0017627477645874023, 0.021798640489578247, 0.047971852123737335, 0.1763027012348175, 0.161663219332695, -0.43263012170791626, -0.36641204357147217, 0.12635238468647003, -0.23027709126472473, 0.20847509801387787, 0.057347193360328674, 0.30268964171409607, -0.07516300678253174, 0.37542054057121277, -0.3418489396572113, -0.09167651832103729, 0.6765305399894714, 0.05634123086929321, 0.051587626338005066, 0.1590050607919693, -0.10676591098308563, -0.4281022548675537, -0.1133955717086792, -0.10796383023262024, 0.12291941046714783, -0.19369706511497498, -0.2389271855354309, 0.0009891055524349213, 0.06866902858018875, -0.14955444633960724, 0.007088946644216776, 0.283553808927536, -0.2827361822128296, -0.10161781311035156, 0.0820593535900116, -0.28944846987724304, -0.06055838614702225, 0.35697832703590393, -0.009679723531007767, -0.20691829919815063, 0.3163380026817322, 0.11802539229393005, -0.09576572477817535, -0.0791393592953682, 0.18991470336914062, 0.38971760869026184, -0.33274194598197937, 0.2171909213066101, 0.3947465121746063, 0.15524742007255554, -0.05506965145468712, 0.21655958890914917, 0.008835608139634132, 0.024706538766622543, -0.28967174887657166, -0.2479925900697708, -0.03452741727232933, 0.27330151200294495, 0.0017225779592990875, 0.279779851436615, 0.38814717531204224, 0.02903154119849205, 0.021444231271743774, -0.04874517396092415, -0.2504652738571167, -0.025669895112514496, 0.011756591498851776, 0.19532112777233124, 0.12828750908374786, 0.14387139678001404, 0.3844788074493408, -0.03930862620472908, 0.015880439430475235, -0.0590069405734539, -0.23425833880901337, -0.12877120077610016, -0.47739171981811523, 0.1874653398990631, -0.10958731174468994, 0.5041306614875793, -0.2691197693347931, -0.2187059223651886, 0.08180054277181625, -0.2508670687675476, 0.26782602071762085, 0.020788781344890594, 0.0022464320063591003, 0.2031518518924713, 0.35120195150375366, 0.07047802209854126, -0.07281002402305603, 0.023975692689418793, -0.014701258391141891, 0.3406578600406647, 0.02103712409734726, -0.02951839193701744, -0.5443741083145142, 0.13449731469154358, -0.2216612696647644, 0.3504798114299774, 0.12866416573524475, 0.16143444180488586, 0.2115117311477661, 0.18101562559604645, -0.28985872864723206, -0.15036888420581818, 0.3482710123062134, 0.2889935374259949, -0.254801481962204, -0.13740138709545135, 0.3685925006866455, 0.1309947818517685, -0.13296523690223694, -0.14364221692085266, 0.34377530217170715, -0.2154282033443451, 0.03640960901975632, 0.10047248005867004, 0.05463174730539322, 0.1011781245470047, 0.3364018499851227, -0.22385941445827484, -0.09497690200805664, -0.14924222230911255, 0.24036574363708496, 0.5331140756607056, 0.31190526485443115, 0.24349626898765564, 0.29392048716545105, 0.374445378780365, 0.2863534092903137, 0.5185892581939697, -0.008336324244737625, 0.07636760175228119, -0.036191411316394806, 0.03433489054441452, -0.10052784532308578, -0.4295840859413147, -0.1033962145447731, -0.13462495803833008, -0.4155196249485016, 0.5835056900978088, -0.09189435094594955, 0.3933159112930298, 0.05372360348701477, 0.021587982773780823, -0.42500609159469604, 0.08927321434020996, -0.13710583746433258, -0.22132807970046997, -0.17644289135932922, -0.1500488966703415, -0.198899507522583, 0.1892327517271042, 0.07129348069429398, 0.10626281797885895, 0.016324318945407867, 0.16241750121116638, 0.41483303904533386, 0.11178700625896454, 0.00510709173977375, -0.14672379195690155, 0.3135073184967041, -0.3714229464530945, -0.06986917555332184, -0.08558288216590881, 0.4504169225692749, 0.2140168994665146, -0.31760546565055847, -0.1624039113521576, -0.06075998768210411, 0.25682106614112854, 0.04462084174156189, -0.13651785254478455, 0.09770941734313965, -0.21402522921562195, 0.1624421328306198, 0.18956221640110016, 0.03557519242167473, 0.5442670583724976, 0.11491715908050537, -0.12496857345104218, 0.020419586449861526, 0.17972250282764435, -0.12213674932718277, -0.4610011577606201, 0.22379103302955627, 0.38300076127052307, -0.19045966863632202, -0.4041341245174408, 0.20738472044467926, -0.33690881729125977, 0.04647244140505791, 0.3471653461456299, 0.3306504487991333, 0.03103375807404518, 0.08781763166189194, 0.08289475739002228, -0.2444475144147873, 0.05515532195568085, 0.023897839710116386, -0.00829484686255455, -0.06767439097166061, -0.27112409472465515, -0.2167506217956543, -0.0830017626285553, 0.14956587553024292, 0.23644430935382843, 0.11901986598968506, -0.05839729309082031, 0.301545649766922, 0.012421946972608566, -0.16719067096710205, -0.2803409993648529, -0.04073839634656906, 0.11955591291189194, -0.3687320947647095, -0.6673360466957092, -0.020593158900737762, 0.062281519174575806, -0.11688446998596191, -0.0661952942609787, -0.14650729298591614, 0.03037729114294052, -0.09292732179164886, -0.23284442722797394, -0.2124989926815033, -0.042424701154232025, 0.115459144115448, 0.5178129076957703, -0.22241072356700897, 0.0476132407784462, -0.10136532783508301, -0.11971737444400787, -0.006671328097581863, -0.13606572151184082, 0.018160846084356308, 0.10582055151462555, -0.15602901577949524, 0.5317429304122925, 0.06525898724794388, 0.13161906599998474, -0.22883392870426178, 0.14064116775989532, -0.019067823886871338, -0.04294352978467941, -0.13499322533607483, -0.16636928915977478, 0.048197075724601746, 0.02099616453051567, 0.0929560661315918, 0.5058727264404297, 0.03267194330692291, 0.21620750427246094, -0.18194541335105896, 0.060300566256046295, 0.39007341861724854, -0.27943259477615356, -0.25720134377479553, 0.05511532351374626, 0.3705214262008667, -0.17569023370742798, 0.04307233542203903, -0.8303146958351135, 0.009145081043243408, 0.3672730624675751, -0.06486599892377853, -0.15031102299690247, 0.21257030963897705, 0.04848422110080719, 0.33881035447120667, -0.15453986823558807, 0.1969967782497406, 0.21152667701244354, -0.3925522565841675, -0.14713150262832642, -0.3197369873523712 ]
https://github.com/huggingface/datasets/issues/5806
Hi is the issues still open, is see no activity since September but it shows that it is still assigned to tsabbir96. If tsabbir96 is not planning to continue, can i get it assigned to me.
Return the name of the currently loaded file in the load_dataset function.
### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92.
36
Return the name of the currently loaded file in the load_dataset function. ### Feature request Add an optional parameter return_file_name in the load_dataset function. When it is set to True, the function will include the name of the file corresponding to the current line as a feature in the returned output. ### Motivation When training large language models, machine problems may interrupt the training process. In such cases, it is common to load a previously saved checkpoint to resume training. I would like to be able to obtain the names of the previously trained data shards, so that I can skip these parts of the data during continued training to avoid overfitting and redundant training time. ### Your contribution I currently use a dataset in jsonl format, so I am primarily interested in the json format. I suggest adding the file name to the returned table here https://github.com/huggingface/datasets/blob/main/src/datasets/packaged_modules/json/json.py#L92. Hi is the issues still open, is see no activity since September but it shows that it is still assigned to tsabbir96. If tsabbir96 is not planning to continue, can i get it assigned to me.
[ -0.3106291592121124, -0.2386893630027771, -0.05924660339951515, 0.1655980348587036, 0.0021553095430135727, -0.18083323538303375, 0.4046478271484375, 0.4016396105289459, 0.20308026671409607, 0.03709171339869499, 0.07435110956430435, 0.4502989649772644, -0.344589501619339, 0.49168360233306885, 0.2949928939342499, 0.07500487565994263, -0.025719046592712402, 0.0002669990062713623, 0.11778824031352997, -0.12729476392269135, -0.3798186480998993, 0.3529975116252899, 0.1813475340604782, 0.17486484348773956, -0.4261111915111542, 0.008632630109786987, 0.24721986055374146, 0.2788231372833252, -0.05875728279352188, -0.29476186633110046, 0.16715267300605774, 0.21715432405471802, 0.04370000958442688, 0.24418595433235168, -0.00011881245882250369, -0.0839633122086525, 0.2579939067363739, -0.39660629630088806, -0.5682616233825684, -0.37118321657180786, -0.09402582049369812, -0.22744598984718323, 0.09718675166368484, -0.5559598207473755, 0.024113774299621582, -0.21231341361999512, 0.0757402777671814, 0.11234162747859955, 0.4679935872554779, 0.12799090147018433, 0.09660890698432922, -0.013585355132818222, -0.20552760362625122, -0.011538546532392502, 0.10431084036827087, 0.43255072832107544, -0.015958059579133987, 0.2659855782985687, 0.10015418380498886, 0.02882232517004013, 0.1203504279255867, 0.4452446699142456, 0.026488058269023895, -0.19959360361099243, 0.005691142752766609, 0.12213943898677826, -0.16126792132854462, 0.24211545288562775, 0.19269207119941711, 0.29780226945877075, 0.5165677070617676, -0.2384014129638672, -0.23482368886470795, -0.48428136110305786, 0.12110807001590729, -0.27867311239242554, 0.08587032556533813, -0.03908811882138252, -0.1764342188835144, 0.2104160189628601, 0.09708138555288315, -0.3841518759727478, -0.04938449710607529, -0.14801637828350067, -0.038832806050777435, -0.36204004287719727, -0.11818695068359375, 0.07529541850090027, 0.27461573481559753, -0.04429150000214577, -0.2061307728290558, 0.05539504438638687, 0.06525225937366486, 0.040843501687049866, -0.37948358058929443, -0.2834870219230652, 0.3495607078075409, -0.09478851407766342, 0.002759404480457306, 0.22287939488887787, 0.14619114995002747, -0.023840468376874924, -0.31690263748168945, 0.2576935887336731, 0.0127674899995327, 0.04229457303881645, 0.5693634748458862, -0.23421044647693634, 0.29149189591407776, 0.36537423729896545, -0.12264957278966904, -0.11042021960020065, -0.2850033640861511, 0.25471892952919006, 0.06818713992834091, 0.08085672557353973, 0.2666395902633667, -0.1646449863910675, -0.2868988811969757, 0.33875706791877747, 0.016411572694778442, -0.2798246145248413, 0.0278397798538208, 0.5876217484474182, -0.07530727982521057, 0.19112008810043335, 0.11000683158636093, -0.3393760323524475, -0.0694083422422409, -0.30454221367836, 0.00016441941261291504, -0.13452711701393127, -0.46919506788253784, 0.1808846890926361, 0.15262052416801453, -0.06789671629667282, 0.22720465064048767, -0.43570831418037415, -0.11703243851661682, -0.06895032525062561, -0.011058297008275986, -0.13724669814109802, 0.40326857566833496, 0.05767826363444328, -0.23938781023025513, -0.07240314781665802, -0.04876365140080452, -0.08757895231246948, -0.23577851057052612, 0.07162612676620483, -0.32854941487312317, -0.3900228440761566, 0.13908395171165466, 0.06927517056465149, -0.39374300837516785, 0.2325681447982788, -0.46319544315338135, 0.3181935250759125, -0.1943678855895996, -0.12445811927318573, 0.11076079308986664, -0.1467168629169464, -0.3014564514160156, -0.2009149044752121, 0.17846298217773438, 0.517078161239624, -0.557216465473175, -0.2996862232685089, 0.26273706555366516, -0.4596526026725769, -0.3154759407043457, 0.014801640063524246, -0.07599849998950958, 0.1833341121673584, -0.12885653972625732, 0.07901372015476227, 0.34361326694488525, -0.09085129201412201, -0.27533406019210815, -0.1493004709482193, -0.031050220131874084, 0.16683050990104675, 0.22762733697891235, -0.06958447396755219, 0.12979963421821594, 0.00600317120552063, 0.11330397427082062, 0.2724270820617676, 0.15124282240867615, -0.13177943229675293, 0.08762931823730469, -0.25404563546180725, -0.15270043909549713, 0.46927356719970703, -0.04773799329996109, -0.08300605416297913, 0.2841436266899109, 0.1505144238471985, 0.4193176329135895, 0.07098302245140076, -0.00397554412484169, 0.09814685583114624, 0.2717655897140503, 0.12646906077861786, 0.17146176099777222, -0.29545465111732483, -0.5676679611206055, 0.09858028590679169, 0.30289143323898315, -0.4925810396671295, -0.1565776765346527, -0.22460202872753143, -0.16508746147155762, 0.18812507390975952, -0.1094103455543518, 0.05288958549499512, -0.005439184606075287, 0.19892863929271698, -0.10968894511461258, 0.1603928953409195, -0.49550366401672363, 0.3980286717414856, -0.663017749786377, -0.05681852623820305, -0.4986686110496521, 0.33942604064941406, 0.549714982509613, -0.063862144947052, -0.09611443430185318, 0.36505770683288574, 0.09035828709602356, -0.06616538017988205, 0.22324958443641663, 0.10878919810056686, 0.36878737807273865, 0.4304502010345459, 0.19846852123737335, 0.24972370266914368, -0.1759728640317917, 0.2787497043609619, -0.11323820054531097, 0.04467804729938507, -0.09340362250804901, -0.029877223074436188, -0.17353351414203644, 0.4468992054462433, 0.0611550435423851, 0.14238253235816956, 0.17738136649131775, -0.25402936339378357, 0.10472071915864944, -0.24898871779441833, -0.30793190002441406, -0.1276961863040924, 0.37723174691200256, 0.12300118803977966, 0.002937234938144684, -0.050736017525196075, -0.527518630027771, -0.1594712883234024, 1.0797683000564575, -0.2581114172935486, 0.03603913635015488, 0.26130926609039307, 0.012507710605859756, 0.0057832300662994385, 0.10055200010538101, 0.3029477596282959, 0.30445432662963867, 0.06679011881351471, -0.1753142774105072, -0.06949734687805176, 0.14793017506599426, -0.1350092887878418, 0.04989853873848915, 0.005998503416776657, 0.31855472922325134, 0.5399942994117737, 0.05087658762931824, -0.3481367528438568, -0.39386600255966187, -0.24820008873939514, 0.15257474780082703, -0.017943819984793663, -0.05287035182118416, -0.03556418791413307, -0.07342548668384552, -0.1577128767967224, -0.32701873779296875, 0.054965246468782425, -0.08917775005102158, -0.06164442002773285, -0.10842108726501465, 0.13071314990520477, -0.08202856034040451, 0.08252087980508804, -0.029448382556438446, 0.5480440855026245, -0.2223738431930542, -0.047739364206790924, -0.2520938515663147, -0.41363149881362915, 0.02280283346772194, 0.0009663738310337067, -0.07241055369377136, -0.22239497303962708, 0.4936702251434326, -0.04084424674510956, -0.005094051361083984, -0.38262391090393066, 0.06125113368034363, 0.3426847457885742, -0.05718600004911423, 0.07655377686023712, 0.301768034696579, 0.44233572483062744, -0.06369206309318542, -0.1879611313343048, 0.19305579364299774, -0.2723490595817566, -0.256591260433197, -0.22527015209197998, 0.09247668087482452, 0.28676673769950867, -0.04510144516825676, -0.177461177110672, -0.2883884608745575, -0.33676475286483765, 0.6482639908790588, -0.10170689225196838, 0.33990442752838135, 0.15131007134914398, -0.3443707823753357, 0.2516637444496155, -0.15563076734542847, -0.072186179459095, -0.3659316301345825, -0.6176451444625854, 0.1238204836845398, -0.17325237393379211, 0.03269777446985245, -0.037503503262996674, 0.13285468518733978, 0.05711990222334862, 0.08370590209960938, -0.2632598876953125, -0.470988005399704, 0.4188464879989624, 0.24127677083015442, -0.2940249443054199, 0.015952514484524727, 0.1354936957359314, 0.13353963196277618, -0.028189031407237053, -0.23321384191513062, -0.11092304438352585, 0.19029490649700165, 0.16288655996322632, 0.42867255210876465, 0.4396331012248993, 0.45343631505966187, 0.08018072694540024, 0.6050738096237183, 0.18785759806632996, -0.05773484706878662, 0.18723343312740326, 0.1893320530653, -0.03145216777920723, 0.004724809899926186, -0.16115301847457886, -0.1966480314731598, -0.2676597535610199, -0.05822475999593735, 0.19831036031246185, -0.0053699444979429245, 0.1918066143989563, -0.15187396109104156, -0.04589950665831566, -0.38536199927330017, -0.25552088022232056, 0.15474902093410492, 0.14368484914302826, 0.21542297303676605, -0.15986037254333496, 0.09948045015335083, -0.16291841864585876, -0.022246289998292923, 0.25311729311943054, 0.4821237027645111, 0.42387861013412476, -0.16354097425937653, -0.5851961374282837, -0.10684922337532043, -0.253252774477005, 0.10134654492139816, 0.049214188009500504, -0.13444334268569946, -0.13432089984416962, -0.17189732193946838, 0.10143671929836273, -0.004425574094057083, 0.8452197909355164, 0.02077295444905758, 0.09707047790288925, 0.03883199393749237, -0.08167858421802521, 0.11463704705238342, -0.06909213960170746, 0.1362050473690033, 0.03632260859012604, 0.21956653892993927, 0.5333026051521301, -0.282859742641449, -0.17341715097427368, 0.16031326353549957, 0.12879502773284912, -0.45476436614990234, -0.16549968719482422, -0.1666075587272644, -0.044951532036066055, -0.2040466070175171, -0.0758039653301239, -0.19697272777557373, 0.10010063648223877, -0.08694659173488617, -0.005293726921081543, 0.01851498894393444, -0.06654731929302216, 0.23452404141426086, 0.12028941512107849, 0.47742539644241333, 0.14728763699531555, 0.10300341248512268, 0.41971006989479065, 0.31179776787757874, 0.4529581665992737, 0.5613030195236206, -0.22345727682113647, -0.16632923483848572, 0.07082359492778778, -0.1712702065706253, 0.5130797028541565, 0.5377813577651978, -0.2668682336807251, 0.3775895833969116, -0.1835373491048813, 0.07605171948671341, -0.3108551502227783, 0.11120342463254929, 0.17244873940944672, 0.14433687925338745, -0.3919448256492615, -0.5245879888534546, 0.31782448291778564, -0.3216989040374756, -0.20438112318515778, 0.3376671373844147, -0.23504863679409027, -0.16942836344242096, 0.18095359206199646, -0.2235497385263443, 1.0229800939559937, -0.08022589236497879, 0.2560462951660156, 0.0984106957912445, 0.16572485864162445, 0.30352267622947693, -0.6429541110992432, -0.04023221135139465, -0.3759990930557251, -0.18877559900283813, -0.08263392746448517, -0.14249488711357117, -0.012338394299149513, 0.14108529686927795, 0.09220197796821594, 0.07261356711387634, 0.400152325630188, 0.11374734342098236, -0.09475818276405334, 0.4975939095020294, 0.1862560510635376, -0.10177047550678253, -0.6926393508911133, -0.08531369268894196, -0.07454963773488998, 0.07087887823581696, -0.1319880187511444, -0.07257115840911865, 0.27372363209724426, -0.006009317934513092, -0.003605455160140991, -0.03893822059035301, -0.05960043519735336, 0.19233039021492004, 0.19055059552192688, -0.4930526614189148, -0.2946127653121948, 0.12139652669429779, -0.1436765193939209, 0.1540050357580185, 0.04005904495716095, 0.3048804998397827, -0.10521216690540314, 0.29757454991340637, -0.30583763122558594, -0.09822526574134827, 0.6572084426879883, -0.05112992599606514, -0.0539216473698616, 0.30276280641555786, -0.024622710421681404, -0.4178158640861511, -0.21395280957221985, -0.012600157409906387, 0.08488859236240387, -0.1681591421365738, -0.25081735849380493, 0.06749437749385834, 0.009470678865909576, -0.15819679200649261, 0.005996302235871553, 0.34139004349708557, -0.23828589916229248, 0.02160041779279709, 0.16872850060462952, -0.24254834651947021, -0.0879589095711708, 0.48532170057296753, 0.011601971462368965, -0.25883352756500244, 0.44230419397354126, 0.22114644944667816, -0.09647034108638763, -0.09988716244697571, 0.1847362518310547, 0.4284886121749878, -0.34484028816223145, 0.22409409284591675, 0.24178291857242584, 0.1744183748960495, -0.051948077976703644, 0.23665940761566162, 0.014672445133328438, -0.12992919981479645, -0.24337153136730194, -0.39255595207214355, -0.14785262942314148, 0.3235083818435669, 0.038449209183454514, 0.236719012260437, 0.31338557600975037, 0.03297049179673195, -0.04157846421003342, 0.005804950371384621, -0.2418128252029419, 0.11599580198526382, -0.08153289556503296, 0.1881583333015442, 0.1984676718711853, -0.02343153953552246, 0.3693823516368866, -0.05708951875567436, -0.015385175123810768, -0.022227462381124496, -0.1438940465450287, -0.09912459552288055, -0.44299018383026123, 0.20939074456691742, -0.14531788229942322, 0.4366285800933838, -0.2537388503551483, -0.28238555788993835, 0.1424771249294281, -0.14205710589885712, 0.1660519540309906, 0.0945252925157547, 0.07301021367311478, 0.2775120437145233, 0.35398924350738525, 0.0632811188697815, -0.05819116160273552, 0.1322345733642578, 0.12117485702037811, 0.2611671984195709, 0.10441078245639801, -0.05066414922475815, -0.3823496401309967, 0.14439524710178375, -0.2911889851093292, 0.2837752401828766, 0.22874018549919128, 0.043186888098716736, 0.1998874843120575, 0.08644171059131622, -0.24655035138130188, -0.15280602872371674, 0.344464510679245, 0.39066609740257263, -0.29269009828567505, -0.07478827238082886, 0.3989362418651581, 0.09128483384847641, -0.16739016771316528, 0.006954096257686615, 0.40738651156425476, -0.18065056204795837, -0.03670285642147064, 0.06606344878673553, 0.06841175258159637, 0.020330756902694702, 0.24908748269081116, -0.17398735880851746, -0.0384632870554924, -0.11514908075332642, 0.26865655183792114, 0.4245041310787201, 0.27342933416366577, 0.16375640034675598, 0.3898729681968689, 0.4292394816875458, 0.25428563356399536, 0.3427421450614929, 0.039514899253845215, 0.20751996338367462, 0.02214425429701805, 0.1263735592365265, -0.03517165780067444, -0.5206704139709473, -0.11574116349220276, -0.09076420962810516, -0.48477527499198914, 0.3928666114807129, -0.08691670000553131, 0.4726784825325012, 0.15473073720932007, -0.028084654361009598, -0.3359518051147461, 0.094200998544693, -0.1850673258304596, -0.19886387884616852, -0.13619598746299744, -0.27312636375427246, -0.1961013823747635, 0.1715286374092102, -0.051671940833330154, 0.10570934414863586, 0.16885854303836823, 0.2186909317970276, 0.27256548404693604, 0.12771053612232208, -0.10448755323886871, -0.1175536960363388, 0.44684311747550964, -0.36316704750061035, -0.07386685162782669, -0.09090694785118103, 0.44867122173309326, 0.1628783643245697, -0.1659112572669983, -0.10203181207180023, -0.054766688495874405, 0.12187565863132477, -0.005098108202219009, -0.05498415231704712, 0.05774444341659546, -0.16383673250675201, 0.30151066184043884, 0.2673243284225464, 0.10256843268871307, 0.48758360743522644, 0.08824276924133301, -0.12199905514717102, 0.12193258851766586, 0.096840500831604, -0.11482027173042297, -0.5000496506690979, 0.16767369210720062, 0.19691458344459534, -0.2960487902164459, -0.3681124150753021, 0.11416289955377579, -0.40227386355400085, 0.1554441601037979, 0.2627190947532654, 0.3173980712890625, 0.13865311443805695, -0.0160275399684906, 0.07232307642698288, -0.30608826875686646, 0.02268202230334282, 0.13343994319438934, 0.03310263156890869, -0.01648126356303692, -0.2654168903827667, -0.3043651580810547, -0.007722724229097366, 0.2412455677986145, 0.2476826012134552, 0.10233666002750397, -0.030223920941352844, 0.32805395126342773, 0.019799446687102318, -0.09994730353355408, -0.3732910752296448, -0.05704495683312416, 0.17927832901477814, -0.45689040422439575, -0.41925209760665894, 0.0920381247997284, 0.07023046910762787, -0.04421374946832657, 0.010547272861003876, -0.10510565340518951, -0.07868223637342453, -0.12932096421718597, -0.31181949377059937, -0.34887588024139404, -0.10852590203285217, 0.09801535308361053, 0.5570783615112305, -0.23216137290000916, 0.07640521973371506, -0.14400455355644226, -0.14659884572029114, -0.10480513423681259, -0.18618860840797424, 0.15737274289131165, 0.18503758311271667, -0.11298089474439621, 0.5335554480552673, 0.08170618116855621, 0.13554373383522034, -0.20595788955688477, 0.07855739444494247, -0.20458830893039703, -0.00337948277592659, -0.15095609426498413, -0.2621266841888428, 0.11793188005685806, -0.03103405050933361, 0.11193263530731201, 0.5671955347061157, -0.02641773223876953, 0.20249372720718384, -0.3276023268699646, 0.037443339824676514, 0.4283125102519989, -0.39542633295059204, -0.16007712483406067, 0.01861979439854622, 0.3552650213241577, -0.15155304968357086, 0.06031658500432968, -0.9260085821151733, 0.01884301006793976, 0.3661702871322632, -0.11591875553131104, -0.17134180665016174, 0.251332551240921, 0.06417637318372726, 0.15996310114860535, -0.09389005601406097, 0.153342604637146, 0.2085379958152771, -0.33277738094329834, -0.08071023225784302, -0.2523382902145386 ]
https://github.com/huggingface/datasets/issues/5805
I can work on this. The link to the tutorial seems to be broken though @polinaeterna.
Improve `Create a dataset` tutorial
Our [tutorial on how to create a dataset](https://huggingface.co/docs/datasets/create_dataset) is a bit misleading. 1. In **Folder-based builders** section it says that we have two folder-based builders as standard builders, but we also have similar builders (that can be created from directory with data of required format) for `csv`, `json/jsonl`, `parquet` and `txt` files. We have info about these loaders in separate [guide for loading](https://huggingface.co/docs/datasets/loading#local-and-remote-files) but it's worth briefly mentioning them in the beginning tutorial because they are more common and for consistency. Would be helpful to add the link to the full guide. 2. **From local files** section lists methods for creating a dataset from in-memory data which are also described in [loading guide](https://huggingface.co/docs/datasets/loading#inmemory-data). Maybe we should actually rethink and restructure this tutorial somehow.
16
Improve `Create a dataset` tutorial Our [tutorial on how to create a dataset](https://huggingface.co/docs/datasets/create_dataset) is a bit misleading. 1. In **Folder-based builders** section it says that we have two folder-based builders as standard builders, but we also have similar builders (that can be created from directory with data of required format) for `csv`, `json/jsonl`, `parquet` and `txt` files. We have info about these loaders in separate [guide for loading](https://huggingface.co/docs/datasets/loading#local-and-remote-files) but it's worth briefly mentioning them in the beginning tutorial because they are more common and for consistency. Would be helpful to add the link to the full guide. 2. **From local files** section lists methods for creating a dataset from in-memory data which are also described in [loading guide](https://huggingface.co/docs/datasets/loading#inmemory-data). Maybe we should actually rethink and restructure this tutorial somehow. I can work on this. The link to the tutorial seems to be broken though @polinaeterna.
[ -0.19121858477592468, -0.2695015072822571, -0.04800918698310852, 0.5280870199203491, 0.23932234942913055, -0.03763539344072342, 0.004639771301299334, 0.024110592901706696, -0.0192304328083992, 0.25799429416656494, -0.025773076340556145, 0.08891582489013672, -0.12057146430015564, 0.3201325535774231, 0.2317470759153366, -0.34792694449424744, 0.11532540619373322, 0.22827614843845367, -0.40938517451286316, -0.0866190493106842, 0.039223216474056244, 0.1650518774986267, 0.056943342089653015, -0.0462079681456089, -0.17949920892715454, 0.022890908643603325, -0.18562594056129456, 0.37001562118530273, -0.5240867733955383, -0.3260065019130707, 0.19259695708751678, 0.08921396732330322, 0.08633387088775635, 0.41181740164756775, -0.00010463610669830814, 0.014425903558731079, 0.1511707603931427, -0.20296646654605865, -0.3103261888027191, -0.057831279933452606, 0.11648896336555481, -0.16870051622390747, 0.18010811507701874, -0.06460360437631607, -0.23573356866836548, -0.08854758739471436, 0.025299763306975365, 0.10135678201913834, 0.6811689734458923, 0.2979278266429901, 0.24800479412078857, 0.146184042096138, 0.21898725628852844, 0.04207124561071396, -0.04890747740864754, 0.6290948987007141, -0.4456253945827484, 0.48678430914878845, 0.2676487863063812, 0.16744664311408997, -0.2193264216184616, 0.1928234100341797, 0.07351470738649368, -0.09622307121753693, 0.5945613980293274, 0.0692654475569725, -0.21182820200920105, -0.3803519010543823, -0.17805251479148865, 0.16965816915035248, 0.45784640312194824, -0.15885135531425476, -0.2835013270378113, -0.3919171094894409, 0.15122249722480774, -0.12215903401374817, 0.10632427036762238, 0.29392480850219727, -0.22566717863082886, 0.1823287010192871, -0.3175666034221649, -0.385032057762146, -0.2741468548774719, -0.041974905878305435, 0.5168656706809998, -0.1664848029613495, -0.33866190910339355, 0.016474377363920212, 0.15828314423561096, 0.08744943141937256, 0.008358653634786606, -0.15967747569084167, -0.11056472361087799, 0.22195500135421753, 0.020316490903496742, -0.207269087433815, 0.13381913304328918, 0.5173431038856506, 0.3277796804904938, 0.09655477106571198, 0.130906879901886, -0.07717098295688629, -0.042039863765239716, -0.007074195891618729, 0.055604737251996994, 0.10373597592115402, 0.30097708106040955, -0.12383566796779633, 0.07641837000846863, 0.32484370470046997, 0.1339888870716095, -0.0394885279238224, -0.06736079603433609, -0.09082910418510437, -0.2204461693763733, -0.16411197185516357, -0.00428665429353714, -0.04270622879266739, -0.008195318281650543, -0.09100392460823059, 0.12623311579227448, -0.20765811204910278, 0.14180102944374084, 0.2922247648239136, -0.14458012580871582, -0.2886391878128052, -0.044660113751888275, 0.19420094788074493, -0.14427177608013153, -0.29512470960617065, -0.1192510575056076, 0.19975925981998444, -0.2797938585281372, 0.2135293185710907, 0.14064104855060577, -0.2983737289905548, 0.17685431241989136, 0.2031269669532776, 0.08713692426681519, -0.05247992277145386, 0.08912814408540726, 0.18273842334747314, 0.138907790184021, 0.048914290964603424, -0.16277815401554108, -0.1371084600687027, 0.021266819909214973, -0.14054974913597107, -0.20870284736156464, -0.14210720360279083, -0.21931219100952148, -0.4226991534233093, -0.33712533116340637, 0.17559814453125, 0.09938090294599533, 0.18998420238494873, -0.3862365484237671, 0.38945454359054565, -0.1776740998029709, 0.04759654402732849, -0.1534574180841446, 0.34135040640830994, -0.1679469794034958, -0.24548053741455078, 0.4480511248111725, 0.5526570081710815, -0.17422455549240112, -0.19100695848464966, -0.07464143633842468, -0.22212332487106323, 0.000719711184501648, 0.2384800761938095, -0.32609349489212036, 0.5181965231895447, -0.3705710470676422, -0.1838766485452652, 0.2687494158744812, -0.06782747805118561, 0.1206391379237175, 0.5424387454986572, -0.048590242862701416, -0.03998259827494621, 0.25310489535331726, -0.11485890299081802, 0.035369738936424255, -0.10175642371177673, -0.05710405111312866, 0.23195645213127136, -0.19586755335330963, 0.11747116595506668, -0.155026376247406, -0.2224254012107849, 0.028811722993850708, 0.13312110304832458, -0.3576693832874298, 0.07642675936222076, -0.08521293103694916, -0.21691912412643433, 0.2921443581581116, -0.36782175302505493, 0.19609567523002625, 0.27495962381362915, 0.30032050609588623, -0.014918796718120575, -0.13452959060668945, 0.06944461166858673, -0.6457347273826599, 0.1158200353384018, 0.03619278222322464, 0.46645188331604004, -0.04359748214483261, -0.21291033923625946, -0.09289763867855072, -0.09522046148777008, -0.14938391745090485, -0.38003039360046387, 0.18534819781780243, -0.06177666410803795, 0.16259127855300903, -0.28072696924209595, -0.1934700608253479, 0.19524693489074707, -0.2856940031051636, 0.2141326665878296, -0.39422371983528137, 0.245278000831604, -0.18416036665439606, -0.01142437569797039, 0.14468610286712646, 0.06758719682693481, -0.0648656040430069, -0.34121984243392944, 0.05535117909312248, 0.32710081338882446, -0.05727164074778557, 0.19052010774612427, 0.2612341642379761, 0.2077961266040802, 0.30693233013153076, -0.12209030985832214, 0.13619926571846008, -0.18581613898277283, 0.08338340371847153, -0.030303120613098145, -0.33651411533355713, 0.35869884490966797, -0.015041034668684006, 0.17401669919490814, 0.23491954803466797, -0.06593649089336395, 0.20244619250297546, 0.0682748481631279, -0.07881898432970047, 0.0005470588803291321, 0.2864129841327667, 0.10354842245578766, 0.289122998714447, 0.20759442448616028, -0.4556691348552704, 0.17771680653095245, 0.04795246571302414, -0.1169089525938034, -0.10053280740976334, 0.2760818600654602, 0.10363300144672394, -0.24840253591537476, 0.18170639872550964, 0.07385940849781036, 0.1771756410598755, 0.1961461454629898, -0.043130043894052505, 0.22381818294525146, -0.08941076695919037, -0.16857245564460754, 0.2112114131450653, -0.12319864332675934, -0.04658593237400055, 0.0898246020078659, -0.3324078917503357, -0.04630810394883156, -0.5048431754112244, -0.08209241181612015, -0.080998994410038, 0.21661794185638428, -0.33341509103775024, -0.07621431350708008, 0.24757671356201172, -0.20563146471977234, -0.23333625495433807, -0.00586746446788311, -0.32349130511283875, -0.1287754327058792, 0.008262697607278824, 0.20414601266384125, -0.1332845538854599, 0.019885819405317307, 0.17892998456954956, 0.4015771150588989, -0.252439022064209, 0.19263900816440582, -0.2847483158111572, 0.05227265506982803, -0.11355119943618774, 0.14851048588752747, 0.3422396779060364, 0.1444450169801712, 0.4138711988925934, -0.47298216819763184, 0.014997966587543488, -0.41566652059555054, -0.21231818199157715, 0.4062308371067047, -0.2862902879714966, 0.5089908838272095, 0.40044933557510376, 0.3346363306045532, -0.12992839515209198, -0.31058111786842346, 0.1600203961133957, -0.18084841966629028, -0.2580081820487976, -0.19832588732242584, -0.17688456177711487, -0.08238083124160767, -0.28545889258384705, -0.35809364914894104, 0.06694408506155014, -0.3756861984729767, 0.4430766701698303, 0.1820439100265503, 0.18572895228862762, 0.021634362637996674, 0.22481197118759155, 0.1675909161567688, -0.33949267864227295, 0.42587903141975403, -0.12457537651062012, -0.7050275206565857, 0.03443170338869095, -0.30345529317855835, -0.31714755296707153, -0.02244739979505539, 0.07095424830913544, 0.2332841455936432, -0.298475444316864, -0.44375792145729065, -0.16580308973789215, -0.07558737695217133, 0.14548763632774353, -0.007865369319915771, 0.3153657615184784, 0.15891019999980927, 0.09394360333681107, -0.051424507051706314, 0.10548777878284454, -0.23809118568897247, 0.031684353947639465, -0.0817176103591919, 0.16754141449928284, -0.11848700046539307, 0.3434048593044281, -0.28108304738998413, 0.665191650390625, 0.25414079427719116, 0.0771988183259964, 0.24716639518737793, 0.0016185548156499863, 0.557488203048706, -0.23508581519126892, -0.17963214218616486, 0.42386674880981445, 0.04764857515692711, -0.19024276733398438, 0.19034531712532043, 0.36303189396858215, 0.2832432985305786, -0.1938512772321701, -0.04223691672086716, -0.24619430303573608, -0.28871244192123413, 0.2494337111711502, 0.06517382711172104, 0.07778520882129669, -0.2467372715473175, -0.05671379342675209, -0.032286424189805984, 0.04412011057138443, 0.10427471995353699, 0.35883307456970215, 0.5236541628837585, 0.007352545857429504, -0.40895166993141174, 0.052240267395973206, -0.6030254364013672, -0.09429463744163513, 0.06869727373123169, -0.1818888783454895, -0.23709167540073395, -0.0009729862213134766, 0.07710015773773193, 0.13216954469680786, 0.4521716237068176, -0.057967618107795715, -0.2699074447154999, -0.010940484702587128, -0.14962443709373474, -0.3486200273036957, 0.2750858664512634, -0.034814346581697464, 0.11309217661619186, -0.047288671135902405, 0.5188053250312805, -0.6074941158294678, -0.5181432962417603, 0.19649870693683624, 0.3289453685283661, -0.0791468471288681, -0.12811973690986633, -0.05031697079539299, -0.24275951087474823, -0.28363263607025146, -0.04468265920877457, -0.040629781782627106, -0.11200335621833801, 0.2014424055814743, 0.17286719381809235, 0.07194098830223083, 0.19391027092933655, 0.059661202132701874, -0.04083579406142235, 0.37789174914360046, -0.03694787621498108, 0.128475621342659, 0.22186636924743652, 0.27093181014060974, 0.04257725924253464, 0.46318814158439636, -0.27331432700157166, 0.06079249829053879, 0.05117166042327881, -0.07067301869392395, 0.24112069606781006, 0.31618472933769226, 0.05091830715537071, -0.12460251152515411, 0.06423908472061157, 0.17277753353118896, -0.6101536154747009, 0.02628443017601967, 0.15816858410835266, -0.03381933271884918, -0.16718325018882751, -0.3321181833744049, 0.535102367401123, -0.20870931446552277, -0.08713133633136749, 0.24707573652267456, 0.5171176195144653, -0.1736513078212738, 0.29296189546585083, 0.14010484516620636, 0.917883574962616, 0.11476778984069824, 0.4344860017299652, 0.40385136008262634, -0.13718442618846893, 0.3397092819213867, -0.20475342869758606, -0.1359868049621582, -0.28131526708602905, -0.15671221911907196, 0.00693945586681366, -0.05645289644598961, 0.05939162150025368, 0.08598268777132034, -0.1552291214466095, 0.16565638780593872, -0.01886075735092163, 0.20834192633628845, -0.20814332365989685, 0.41700994968414307, -0.20928843319416046, -0.401299387216568, -0.30862316489219666, 0.16663029789924622, 0.14014029502868652, -0.028315192088484764, -0.13231664896011353, -0.08896203339099884, 0.03415094316005707, -0.00486406683921814, -0.09359754621982574, -0.14444419741630554, -0.211027130484581, -0.03863515704870224, 0.3170599043369293, -0.1361479014158249, 0.19093161821365356, 0.3694169521331787, 0.25713294744491577, -0.009075609967112541, -0.35395893454551697, 0.14773596823215485, -0.35758745670318604, 0.021228447556495667, -0.1327357441186905, -0.05734046548604965, 0.22928424179553986, -0.091572605073452, 0.03686203062534332, -0.2383568286895752, -0.30670666694641113, -0.0910690426826477, -0.17689107358455658, -0.27431637048721313, -0.1964082270860672, -0.37216293811798096, -0.3195238709449768, 0.019904980435967445, -0.1731979101896286, -0.12913364171981812, 0.19376862049102783, 0.2999887764453888, -0.11354808509349823, -0.1312762051820755, 0.26954585313796997, -0.10119497776031494, -0.29428568482398987, 0.17026682198047638, 0.030215218663215637, -0.15531569719314575, 0.07555624097585678, 0.176057830452919, -0.2276451736688614, -0.31652379035949707, 0.21911218762397766, 0.6505625247955322, -0.24469156563282013, 0.05486009269952774, 0.11941463500261307, -0.053359583020210266, -0.08412380516529083, 0.28168609738349915, 0.42757320404052734, -0.07503184676170349, -0.026199184358119965, 0.09013956040143967, -0.39227306842803955, 0.3662848472595215, 0.03037191927433014, 0.18944010138511658, -0.08215194195508957, 0.08322826027870178, 0.35241520404815674, 0.11003538966178894, -0.4123680889606476, -0.12811456620693207, -0.06653443723917007, -0.047816626727581024, 0.4097672700881958, 0.16347205638885498, 0.23024925589561462, -0.0808204859495163, 0.11949868500232697, -0.18300625681877136, -0.39335283637046814, -0.17903056740760803, -0.03364180028438568, 0.12454761564731598, 0.13496790826320648, 0.038486234843730927, 0.18887895345687866, 0.10220837593078613, -0.17862829566001892, -0.25039777159690857, 0.10923625528812408, -0.06835498660802841, -0.006763074547052383, 0.07479535043239594, -0.008871573954820633, 0.03678196668624878, -0.1569119095802307, -0.08203484117984772, -0.03219441697001457, 0.48155832290649414, 0.055967509746551514, -0.1899525672197342, -0.23378828167915344, -0.28902050852775574, 0.23044952750205994, 0.4468241333961487, 0.07312242686748505, 0.21346575021743774, 0.07664234936237335, 0.09166009724140167, -0.05439823493361473, 0.030550695955753326, 0.5009873509407043, 0.14718149602413177, -0.039626143872737885, 0.15498922765254974, 0.26162201166152954, 0.2392556369304657, 0.02446485310792923, -0.08125914633274078, -0.08358213305473328, -0.20631851255893707, 0.192518413066864, 0.11979515105485916, 0.012861035764217377, 0.08632665872573853, -0.2422410398721695, 0.02888542413711548, 0.27563124895095825, -0.15034329891204834, 0.048550136387348175, 0.014742190949618816, -0.23328319191932678, 0.10480760782957077, 0.4651254117488861, 0.02269671857357025, 0.19102156162261963, 0.16260723769664764, -0.11822862923145294, 0.3368319869041443, -0.1435595452785492, 0.3685050904750824, 0.22795958817005157, -0.022677715867757797, 0.16587486863136292, 0.31614458560943604, -0.02172766998410225, -0.09695418179035187, -0.17381536960601807, 0.47976893186569214, -0.2574164569377899, -0.34400367736816406, -0.190557599067688, 0.22969336807727814, -0.12311606109142303, -0.18054135143756866, -0.1603730320930481, -0.2714349627494812, -0.11109602451324463, 0.03875797986984253, -0.10461178421974182, -0.27691394090652466, 0.19649258255958557, -0.13199706375598907, 0.09909218549728394, -0.24090977013111115, 0.07103933393955231, 0.11394335329532623, 0.14298655092716217, -0.13771021366119385, 0.21767422556877136, -0.03331126272678375, -0.22078125178813934, -0.2924917936325073, 0.49881651997566223, 0.3943544626235962, 0.15421073138713837, 0.07880941033363342, -0.001057952642440796, -0.09502243250608444, 0.055251941084861755, -0.11427347362041473, 0.13920800387859344, -0.13518685102462769, -0.07874573767185211, 0.2964242994785309, 0.19672879576683044, -0.2560923099517822, -0.05392461642622948, 0.0708148330450058, -0.03891880065202713, -0.08491986989974976, -0.04601691663265228, -0.12849821150302887, -0.10049659758806229, -0.004588122013956308, 0.026722785085439682, -0.4408084750175476, 0.07830923050642014, 0.31643545627593994, -0.18690413236618042, 0.0917496383190155, -0.19294515252113342, 0.13185177743434906, 0.1831287443637848, 0.6948015093803406, 0.1945713609457016, 0.11612364649772644, -0.3460770845413208, -0.4341842830181122, -0.5792756080627441, -0.22726838290691376, 0.11037340760231018, 0.16977229714393616, -0.015396445989608765, 0.24272751808166504, 0.15452374517917633, 0.3504602909088135, -0.09661199897527695, 0.15653444826602936, 0.11627727001905441, -0.17284151911735535, -0.20882543921470642, -0.042215779423713684, 0.08259235322475433, 0.36029428243637085, -0.013955075293779373, -0.15278838574886322, 0.23752333223819733, -0.1459130346775055, 0.06104232370853424, 0.027536530047655106, 0.38152554631233215, 0.06704128533601761, -0.09267169237136841, 0.12296581268310547, 0.12139643728733063, 0.028612501919269562, -0.24140892922878265, -0.45997560024261475, -0.02696748450398445, -0.21629655361175537, -0.08693850040435791, 0.21742740273475647, 0.045574065297842026, 0.3085625171661377, -0.2338196337223053, -0.11891516298055649, -0.504008948802948, 0.07923787087202072, 0.2577974796295166, 0.07034693658351898, -0.4727110266685486, 0.21693958342075348, 0.05441519618034363, -0.18556779623031616, 0.09893128275871277, 0.321208655834198, -0.13680171966552734, -0.04150567948818207, -0.0810551643371582, -0.18076422810554504, 0.48404639959335327, -0.05211199074983597, 0.0024211257696151733, 0.10029579699039459, 0.013552866876125336, 0.3435291647911072, -0.2139529585838318, -0.5839563608169556, 0.17781439423561096, 0.10760907828807831, -0.04533546417951584, -0.09532614052295685, 0.3052172064781189, 0.005030099302530289, 0.044878050684928894, -0.10083344578742981, 0.4144032895565033, 0.14699366688728333, -0.2815703749656677, 0.19661512970924377, -0.23262660205364227 ]
https://github.com/huggingface/datasets/issues/5805
@isunitha98selvan would be great, thank you! which link are you talking about? I think it should work: https://huggingface.co/docs/datasets/create_dataset
Improve `Create a dataset` tutorial
Our [tutorial on how to create a dataset](https://huggingface.co/docs/datasets/create_dataset) is a bit misleading. 1. In **Folder-based builders** section it says that we have two folder-based builders as standard builders, but we also have similar builders (that can be created from directory with data of required format) for `csv`, `json/jsonl`, `parquet` and `txt` files. We have info about these loaders in separate [guide for loading](https://huggingface.co/docs/datasets/loading#local-and-remote-files) but it's worth briefly mentioning them in the beginning tutorial because they are more common and for consistency. Would be helpful to add the link to the full guide. 2. **From local files** section lists methods for creating a dataset from in-memory data which are also described in [loading guide](https://huggingface.co/docs/datasets/loading#inmemory-data). Maybe we should actually rethink and restructure this tutorial somehow.
18
Improve `Create a dataset` tutorial Our [tutorial on how to create a dataset](https://huggingface.co/docs/datasets/create_dataset) is a bit misleading. 1. In **Folder-based builders** section it says that we have two folder-based builders as standard builders, but we also have similar builders (that can be created from directory with data of required format) for `csv`, `json/jsonl`, `parquet` and `txt` files. We have info about these loaders in separate [guide for loading](https://huggingface.co/docs/datasets/loading#local-and-remote-files) but it's worth briefly mentioning them in the beginning tutorial because they are more common and for consistency. Would be helpful to add the link to the full guide. 2. **From local files** section lists methods for creating a dataset from in-memory data which are also described in [loading guide](https://huggingface.co/docs/datasets/loading#inmemory-data). Maybe we should actually rethink and restructure this tutorial somehow. @isunitha98selvan would be great, thank you! which link are you talking about? I think it should work: https://huggingface.co/docs/datasets/create_dataset
[ -0.18374519050121307, -0.2780703604221344, -0.04612888768315315, 0.5162710547447205, 0.23995791375637054, -0.013876698911190033, 0.030477095395326614, 0.017136752605438232, -0.026692785322666168, 0.2696177363395691, 0.022135674953460693, 0.08110903203487396, -0.13184525072574615, 0.3071809709072113, 0.23920275270938873, -0.3400844931602478, 0.1233753114938736, 0.26453733444213867, -0.39713868498802185, -0.06361691653728485, 0.04633624851703644, 0.16437813639640808, 0.042320817708969116, -0.05856027081608772, -0.18582624197006226, 0.07572070509195328, -0.19899705052375793, 0.35227805376052856, -0.5263347625732422, -0.35222843289375305, 0.235871821641922, 0.10536733269691467, 0.09622611105442047, 0.39308467507362366, -0.00010470519919181243, 0.029536858201026917, 0.16607794165611267, -0.22324219346046448, -0.3338995575904846, -0.0666031688451767, 0.08243116736412048, -0.18751110136508942, 0.17938178777694702, -0.06399700790643692, -0.24874015152454376, -0.0835457295179367, 0.052990175783634186, 0.11419874429702759, 0.6440032720565796, 0.292814701795578, 0.24570320546627045, 0.11975450068712234, 0.21710656583309174, 0.022679727524518967, -0.07801003754138947, 0.6397926211357117, -0.443175733089447, 0.5058454275131226, 0.22354650497436523, 0.18671315908432007, -0.20292681455612183, 0.21204838156700134, 0.10196872055530548, -0.09627527743577957, 0.5839267373085022, 0.09580489993095398, -0.18550316989421844, -0.37487632036209106, -0.17450252175331116, 0.1779450625181198, 0.47182929515838623, -0.1309969127178192, -0.26459383964538574, -0.38640373945236206, 0.14259500801563263, -0.10777062177658081, 0.11999405920505524, 0.3038599491119385, -0.22208742797374725, 0.18976564705371857, -0.33007878065109253, -0.4221304953098297, -0.2809012532234192, -0.0017020124942064285, 0.504909098148346, -0.16540780663490295, -0.3465554118156433, 0.00563812255859375, 0.1604091376066208, 0.11384016275405884, 0.035967860370874405, -0.16471417248249054, -0.11374661326408386, 0.24247793853282928, 0.058477696031332016, -0.22289486229419708, 0.11962214857339859, 0.49428364634513855, 0.32037729024887085, 0.11106517910957336, 0.18458597362041473, -0.09261173009872437, -0.05692556872963905, 0.022791629657149315, 0.03445732593536377, 0.11112362891435623, 0.3023599684238434, -0.1404232233762741, 0.09902387857437134, 0.3509178161621094, 0.1539488434791565, -0.05631222948431969, -0.09773783385753632, -0.0835023820400238, -0.2288651466369629, -0.16135373711585999, -0.011379551142454147, -0.004815995693206787, -0.03893059492111206, -0.09514652192592621, 0.10656658560037613, -0.2067514955997467, 0.15356290340423584, 0.2889261841773987, -0.11787828803062439, -0.2559117078781128, -0.025222748517990112, 0.1747119128704071, -0.1572912633419037, -0.2928505837917328, -0.10794410854578018, 0.2205953299999237, -0.30573129653930664, 0.2171877920627594, 0.13882581889629364, -0.2967451512813568, 0.17822089791297913, 0.18837754428386688, 0.09868121892213821, -0.08914216607809067, 0.09388455003499985, 0.19621767103672028, 0.15524931252002716, 0.060013603419065475, -0.18534398078918457, -0.11703721433877945, 0.02315572462975979, -0.1399528980255127, -0.22578150033950806, -0.12945790588855743, -0.26684844493865967, -0.41851145029067993, -0.31953445076942444, 0.1734320968389511, 0.13053826987743378, 0.17815329134464264, -0.4232959747314453, 0.3726896047592163, -0.18909969925880432, 0.03000783920288086, -0.14139826595783234, 0.34932181239128113, -0.14540785551071167, -0.2529635429382324, 0.44059067964553833, 0.5196589231491089, -0.1966332197189331, -0.21118614077568054, -0.1159403994679451, -0.23464518785476685, 0.0005003027617931366, 0.2519356608390808, -0.36266887187957764, 0.5230555534362793, -0.41153717041015625, -0.1749381124973297, 0.31203508377075195, -0.08770020306110382, 0.15119636058807373, 0.5493912100791931, -0.054413340985774994, -0.06014319509267807, 0.2563149333000183, -0.07809118926525116, 0.004204809665679932, -0.105353944003582, -0.05594522878527641, 0.2079697549343109, -0.1692359894514084, 0.12364184111356735, -0.12970003485679626, -0.25719839334487915, 0.05853499099612236, 0.11150984466075897, -0.3687317967414856, 0.08103276044130325, -0.08112094551324844, -0.19817203283309937, 0.2861659824848175, -0.38388592004776, 0.1975940763950348, 0.2786020338535309, 0.30316656827926636, -0.005153298377990723, -0.14340443909168243, 0.07459831237792969, -0.6275426149368286, 0.11057468503713608, 0.019811712205410004, 0.4413526654243469, 0.010684404522180557, -0.213284432888031, -0.10442415624856949, -0.13162562251091003, -0.1336071491241455, -0.39108291268348694, 0.17989414930343628, -0.04628078639507294, 0.16663672029972076, -0.29986998438835144, -0.21093344688415527, 0.18647685647010803, -0.2697305977344513, 0.2185325026512146, -0.3757757544517517, 0.24528911709785461, -0.1917952001094818, 0.01096319779753685, 0.1260339319705963, 0.03850986808538437, -0.05365802347660065, -0.3312966823577881, 0.06615440547466278, 0.35256585478782654, -0.043585918843746185, 0.17173179984092712, 0.2732674777507782, 0.20233985781669617, 0.3054391145706177, -0.11948658525943756, 0.14166483283042908, -0.15536189079284668, 0.0667627602815628, -0.007010027766227722, -0.337869256734848, 0.34370478987693787, -0.007639218121767044, 0.17938143014907837, 0.23804590106010437, -0.06533818691968918, 0.20168867707252502, 0.0664815902709961, -0.0735444501042366, -0.04501620680093765, 0.2585240304470062, 0.12842223048210144, 0.2652119994163513, 0.21481505036354065, -0.4759228527545929, 0.14733268320560455, 0.037139493972063065, -0.11667342483997345, -0.10874566435813904, 0.274156391620636, 0.10023526847362518, -0.2527850568294525, 0.16186319291591644, 0.0947490930557251, 0.19814804196357727, 0.19870808720588684, -0.022393841296434402, 0.21433258056640625, -0.09259653091430664, -0.18498705327510834, 0.22853682935237885, -0.1391090452671051, -0.031716566532850266, 0.08752196282148361, -0.3104360103607178, -0.06311555206775665, -0.4929651618003845, -0.06034347414970398, -0.08637219667434692, 0.17727574706077576, -0.3322702646255493, -0.07696468383073807, 0.2268238663673401, -0.21835598349571228, -0.28168192505836487, -0.02107781171798706, -0.35588544607162476, -0.10962789505720139, 0.02477332204580307, 0.2088586837053299, -0.11848437786102295, -0.011485274881124496, 0.16402983665466309, 0.4175153970718384, -0.28343379497528076, 0.18122875690460205, -0.27417391538619995, 0.06815566122531891, -0.13448330760002136, 0.143355131149292, 0.2966635823249817, 0.1102958470582962, 0.41485002636909485, -0.4782288670539856, 0.0036653727293014526, -0.41019168496131897, -0.23549064993858337, 0.416313499212265, -0.25668489933013916, 0.46830105781555176, 0.4135790169239044, 0.3176943063735962, -0.10982009768486023, -0.3503819704055786, 0.16578511893749237, -0.14534838497638702, -0.25363343954086304, -0.22802357375621796, -0.14901740849018097, -0.03367718309164047, -0.29528459906578064, -0.3671421408653259, 0.0887567400932312, -0.3745468258857727, 0.4221068322658539, 0.1810496598482132, 0.2059258669614792, -0.005533803254365921, 0.2311750054359436, 0.15428964793682098, -0.3301951289176941, 0.43848657608032227, -0.1417878270149231, -0.7005830407142639, 0.02233814261853695, -0.3281922936439514, -0.3040541112422943, -0.009723708033561707, 0.047211430966854095, 0.26872164011001587, -0.29396742582321167, -0.43724408745765686, -0.15509679913520813, -0.07186096906661987, 0.1233401820063591, -0.013203025795519352, 0.3214876353740692, 0.21457552909851074, 0.055731382220983505, -0.056411031633615494, 0.10966894030570984, -0.24883216619491577, 0.01919724978506565, -0.08561764657497406, 0.21645407378673553, -0.11074231564998627, 0.3478841781616211, -0.2740933299064636, 0.6721934080123901, 0.22413811087608337, 0.069705531001091, 0.23742249608039856, -0.013172703795135021, 0.5774884819984436, -0.26086899638175964, -0.12583446502685547, 0.39670467376708984, 0.04225056618452072, -0.24464008212089539, 0.16135329008102417, 0.3628969192504883, 0.2679886519908905, -0.2075720876455307, -0.027193862944841385, -0.2864101827144623, -0.30492669343948364, 0.23760655522346497, 0.05624757707118988, 0.08858087658882141, -0.2528132200241089, -0.04956299066543579, -0.027542777359485626, 0.05946221575140953, 0.08600156009197235, 0.39542266726493835, 0.5438829064369202, -0.009926561266183853, -0.41449448466300964, 0.028989020735025406, -0.5691583156585693, -0.10094644129276276, 0.08711394667625427, -0.16304920613765717, -0.21219396591186523, -0.021407093852758408, 0.11411252617835999, 0.1051325649023056, 0.4414045512676239, -0.05111468583345413, -0.27785465121269226, 0.005425631999969482, -0.11479038000106812, -0.3264780640602112, 0.2543657720088959, -0.010351032018661499, 0.13777656853199005, -0.032865799963474274, 0.5064999461174011, -0.6257623434066772, -0.5402968525886536, 0.22611108422279358, 0.3222687244415283, -0.09401588886976242, -0.10848180949687958, -0.06944677233695984, -0.22194749116897583, -0.2653702199459076, -0.06839592754840851, -0.04180916026234627, -0.09895660728216171, 0.20810623466968536, 0.20217010378837585, 0.06434287130832672, 0.15325014293193817, 0.03408186882734299, -0.07090336084365845, 0.3688930571079254, -0.04065840691328049, 0.09792819619178772, 0.2353905886411667, 0.29371997714042664, 0.06598810851573944, 0.4586639404296875, -0.26850488781929016, 0.07476291060447693, 0.07043995708227158, -0.048987045884132385, 0.2419002652168274, 0.3268304169178009, 0.06741219013929367, -0.129550501704216, 0.08485762774944305, 0.13834284245967865, -0.642618715763092, 0.031048893928527832, 0.14454485476016998, -0.07332932204008102, -0.17578138411045074, -0.3262074589729309, 0.5415946841239929, -0.19042351841926575, -0.1127658262848854, 0.23627272248268127, 0.5059678554534912, -0.20003429055213928, 0.2778806984424591, 0.14863359928131104, 0.9309664368629456, 0.10575930774211884, 0.46122801303863525, 0.3694600462913513, -0.1452573835849762, 0.3456459045410156, -0.20063915848731995, -0.08984281867742538, -0.28519296646118164, -0.13608160614967346, 0.005984596908092499, -0.08066868782043457, 0.05484906956553459, 0.09629516303539276, -0.12508082389831543, 0.16267691552639008, -0.025917217135429382, 0.22000887989997864, -0.2225501835346222, 0.4173997640609741, -0.23726780712604523, -0.3768996000289917, -0.28875792026519775, 0.16476237773895264, 0.15547414124011993, 0.005597901530563831, -0.13041529059410095, -0.060732968151569366, 0.006292074918746948, -0.003651432693004608, -0.10810893774032593, -0.1628393828868866, -0.2091982066631317, -0.015888800844550133, 0.3273937404155731, -0.15821385383605957, 0.16163013875484467, 0.37227681279182434, 0.26052477955818176, 0.003232053481042385, -0.36953505873680115, 0.15436610579490662, -0.3724311292171478, 0.017425861209630966, -0.14859290421009064, -0.0860547125339508, 0.22635915875434875, -0.0846647173166275, 0.0484028160572052, -0.21500103175640106, -0.32011115550994873, -0.1393745243549347, -0.1950082629919052, -0.2720305621623993, -0.19575434923171997, -0.35659995675086975, -0.3211206793785095, 0.039486195892095566, -0.1640920341014862, -0.10019877552986145, 0.19207049906253815, 0.29243436455726624, -0.10715223848819733, -0.17430824041366577, 0.26724863052368164, -0.08940540254116058, -0.284531831741333, 0.21224695444107056, 0.03334389626979828, -0.17238445580005646, 0.050435151904821396, 0.1231752336025238, -0.23786015808582306, -0.32152241468429565, 0.22417610883712769, 0.6412709951400757, -0.21314293146133423, 0.07822538912296295, 0.13728798925876617, -0.0531378835439682, -0.08749546855688095, 0.29128578305244446, 0.40957191586494446, -0.03540647029876709, -0.05724932998418808, 0.09677419811487198, -0.4159386157989502, 0.37567922472953796, 0.02439279854297638, 0.19789379835128784, -0.08273011445999146, 0.09384970366954803, 0.3890208601951599, 0.059968456625938416, -0.4081706404685974, -0.09286444634199142, -0.056987516582012177, -0.031162459403276443, 0.38413235545158386, 0.20030011236667633, 0.24166306853294373, -0.05876215174794197, 0.11501535028219223, -0.21580468118190765, -0.38771963119506836, -0.17472624778747559, -0.060132358223199844, 0.13085325062274933, 0.14119991660118103, 0.07293473184108734, 0.16638335585594177, 0.07368513941764832, -0.15994299948215485, -0.2436104714870453, 0.10501241683959961, -0.07780550420284271, -0.0022066645324230194, 0.06682752072811127, -0.002728234976530075, 0.041050024330616, -0.1692121922969818, -0.07381090521812439, -0.03190561756491661, 0.5335554480552673, 0.0855773389339447, -0.18189111351966858, -0.26542651653289795, -0.28988754749298096, 0.18704800307750702, 0.45456352829933167, 0.0574173741042614, 0.20506183803081512, 0.06752541661262512, 0.09404132515192032, -0.05490187183022499, -0.004878032952547073, 0.4884509742259979, 0.145387664437294, -0.03701711446046829, 0.15971019864082336, 0.25840726494789124, 0.23514343798160553, 0.07958191633224487, -0.07265806198120117, -0.10778573900461197, -0.24030658602714539, 0.18927602469921112, 0.11694727092981339, 0.04704310745000839, 0.08771151304244995, -0.22765477001667023, 0.017309028655290604, 0.2730632722377777, -0.14106504619121552, 0.04734879359602928, 0.0316060334444046, -0.2305399477481842, 0.1266656070947647, 0.4603138864040375, -0.012419497594237328, 0.2032511979341507, 0.11970488727092743, -0.1054987907409668, 0.3304236829280853, -0.0938425213098526, 0.36631661653518677, 0.23290222883224487, 0.00904306024312973, 0.15014618635177612, 0.3002910614013672, -0.01047130674123764, -0.11723489314317703, -0.18080222606658936, 0.47797927260398865, -0.24970006942749023, -0.30201271176338196, -0.17365270853042603, 0.21299166977405548, -0.10072013735771179, -0.21366316080093384, -0.18187056481838226, -0.27439185976982117, -0.1343354731798172, 0.05237795412540436, -0.09210731089115143, -0.2651098966598511, 0.18083995580673218, -0.12786675989627838, 0.0915721207857132, -0.2414226084947586, 0.08906146883964539, 0.10924994200468063, 0.13615025579929352, -0.14286461472511292, 0.18532350659370422, -0.051430415362119675, -0.2088463455438614, -0.2454802691936493, 0.48554527759552, 0.39528119564056396, 0.15174856781959534, 0.0932907909154892, -0.05238450691103935, -0.09780418872833252, 0.04896668344736099, -0.12481498718261719, 0.11952853202819824, -0.11963017284870148, -0.06928390264511108, 0.27649807929992676, 0.20566457509994507, -0.2509157061576843, -0.006864084396511316, 0.08561888337135315, -0.0262686125934124, -0.0870545357465744, -0.050987616181373596, -0.11650504916906357, -0.0678318589925766, -0.018774788826704025, 0.051123566925525665, -0.4325060546398163, 0.07967217266559601, 0.3091105818748474, -0.19494730234146118, 0.08344897627830505, -0.17128421366214752, 0.13217031955718994, 0.22732870280742645, 0.6860935091972351, 0.18453611433506012, 0.09599651396274567, -0.34505772590637207, -0.4621278941631317, -0.5565210580825806, -0.24619290232658386, 0.10568709671497345, 0.19313111901283264, -0.03524252399802208, 0.2697201371192932, 0.13297595083713531, 0.3627685606479645, -0.10133879631757736, 0.19295701384544373, 0.11575508117675781, -0.15960034728050232, -0.14575541019439697, -0.04210368171334267, 0.11426419764757156, 0.372614324092865, -0.03646422177553177, -0.18546003103256226, 0.21807485818862915, -0.1530226767063141, 0.04706263542175293, 0.04604700580239296, 0.400417685508728, 0.07790155708789825, -0.06615000218153, 0.148463636636734, 0.1213548332452774, 0.012466926127672195, -0.24932551383972168, -0.48891595005989075, -0.057337068021297455, -0.20807810127735138, -0.10224296152591705, 0.21472492814064026, 0.046950843185186386, 0.2985387444496155, -0.24460512399673462, -0.09964677691459656, -0.5165963768959045, 0.10158710181713104, 0.2700301706790924, 0.07691526412963867, -0.48128271102905273, 0.1953859031200409, 0.023913830518722534, -0.1908639669418335, 0.14772871136665344, 0.31559035181999207, -0.13602031767368317, -0.033905841410160065, -0.07762078940868378, -0.1676020324230194, 0.4456600248813629, -0.06942572444677353, 0.0192350372672081, 0.08892497420310974, 0.045112140476703644, 0.33998432755470276, -0.20362107455730438, -0.5934323072433472, 0.15812915563583374, 0.12733909487724304, -0.037102386355400085, -0.10160064697265625, 0.30907946825027466, 0.019941147416830063, 0.04606601595878601, -0.09901569038629532, 0.4146788716316223, 0.17675569653511047, -0.27900874614715576, 0.139011412858963, -0.25488778948783875 ]
https://github.com/huggingface/datasets/issues/5798
Hi ! We're using process pools for parallelism right now. I was wondering if there's a package that implements the same API as a process pool but runs with Spark under the hood ? That or something similar would be cool because users could use whatever distributed framework they want this way. Feel free to ping us when you'd like to open PRs for this kind of things, so that we can discuss this before you start working on it ^^
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
81
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Hi ! We're using process pools for parallelism right now. I was wondering if there's a package that implements the same API as a process pool but runs with Spark under the hood ? That or something similar would be cool because users could use whatever distributed framework they want this way. Feel free to ping us when you'd like to open PRs for this kind of things, so that we can discuss this before you start working on it ^^
[ -0.5311525464057922, -0.4519221782684326, -0.28954362869262695, 0.08191453665494919, -0.04725201427936554, -0.007369197905063629, 0.2613649368286133, 0.19786617159843445, 0.2873057425022125, 0.1246139332652092, 0.019359782338142395, 0.4726947844028473, -0.083057701587677, 0.5264351963996887, -0.019624417647719383, -0.35356056690216064, 0.15029501914978027, -0.05556221306324005, 0.00670146569609642, 0.17381727695465088, -0.020996302366256714, 0.1001475527882576, 0.018770307302474976, -0.2185099571943283, 0.11762339621782303, -0.12945348024368286, -0.31129178404808044, -0.06327269971370697, -0.2257753163576126, -0.18099117279052734, 0.016353383660316467, 0.4291953444480896, 0.19074498116970062, 0.45703092217445374, -0.00010730956273619086, -0.23857006430625916, 0.1969604790210724, 0.12034549564123154, 0.09800444543361664, -0.20478573441505432, -0.09224288165569305, -0.3746532201766968, 0.2423253059387207, -0.12288717925548553, 0.13591313362121582, 0.03942824900150299, 0.10466670244932175, -0.016779929399490356, 0.26802584528923035, -0.37203291058540344, 0.21751701831817627, 0.03117135912179947, -0.09685976058244705, -0.04652932286262512, -0.19657739996910095, 0.011775888502597809, -0.18788114190101624, 0.31477290391921997, 0.7173704504966736, -0.22737449407577515, -0.19010400772094727, -0.039704784750938416, -0.37871602177619934, 0.20005814731121063, 0.4172287583351135, -0.13601680099964142, -0.10574542731046677, -0.5605137944221497, -0.3002495765686035, 0.1147744357585907, 0.6614857912063599, -0.16567149758338928, -0.3716069459915161, -0.44308334589004517, -0.29022151231765747, -0.002730332314968109, -0.2357875108718872, 0.24992536008358002, -0.38252341747283936, 0.013938861899077892, -0.2827923893928528, -0.2709099352359772, 0.04044918715953827, -0.08387137949466705, 0.21077007055282593, 0.6024168133735657, 0.09873805940151215, 0.019017603248357773, 0.24652205407619476, 0.26370254158973694, 0.12377160042524338, -0.19701862335205078, 0.29129350185394287, 0.04676399752497673, -0.3037366271018982, -0.1471506655216217, -0.04088630899786949, -0.2690636217594147, 0.1920139193534851, 0.35908639430999756, 0.12050989270210266, -0.015663128346204758, 0.09053511917591095, 0.21703670918941498, 0.17016734182834625, -0.10373823344707489, 0.006511842831969261, -0.12363533675670624, 0.16818402707576752, -0.07338885962963104, 0.22959010303020477, 0.048283640295267105, -0.07027927786111832, 0.06179739162325859, -0.38846418261528015, 0.1507931798696518, -0.34877267479896545, 0.26410943269729614, -0.09550327807664871, -0.20865650475025177, 0.21293869614601135, -0.0731775090098381, -0.05331677570939064, 0.0027942266315221786, -0.09192555397748947, 0.41458141803741455, -0.10080410540103912, 0.1687900424003601, 0.07291201502084732, 0.014348462224006653, -0.05863502621650696, -0.04265424236655235, -0.12100910395383835, 0.16361194849014282, 0.08682768046855927, 0.0308830589056015, 0.16952338814735413, 0.15850120782852173, 0.06593784689903259, 0.2087607979774475, 0.3677210211753845, -0.06636691093444824, -0.4557064175605774, 0.04537469148635864, 0.024966612458229065, -0.10117970407009125, 0.05042519420385361, 0.4972841739654541, -0.23331935703754425, 0.19072271883487701, -0.18530011177062988, -0.24647057056427002, 0.034133851528167725, 0.22290043532848358, -0.07203206419944763, -0.17697761952877045, -0.4403667449951172, 0.2945900857448578, -0.19305318593978882, -0.1944919228553772, 0.2539404630661011, 0.11339111626148224, -0.3400697112083435, -0.33467862010002136, 0.05435597151517868, 0.3840707242488861, -0.2365139126777649, -0.07013475894927979, -0.23549140989780426, -0.16306442022323608, 0.15501795709133148, -0.0027257371693849564, 0.007160775363445282, 0.0513579323887825, -0.09644731134176254, 0.22766898572444916, 0.1919148564338684, -0.43201693892478943, -0.0727366954088211, 0.6279987692832947, -0.27319836616516113, -0.07732480764389038, 0.24721646308898926, 0.2201319932937622, 0.41500791907310486, 0.033857330679893494, 0.19607843458652496, 0.23498916625976562, -0.28082844614982605, 0.07822519540786743, -0.15068580210208893, -0.45771026611328125, 0.06109568104147911, 0.3493322730064392, 0.11198703944683075, 0.15621554851531982, 0.12781253457069397, -0.26749032735824585, 0.3259194493293762, 0.20213204622268677, 0.2522507607936859, -0.003913690336048603, 0.028331970795989037, 0.47306227684020996, -0.1725815236568451, -0.3204020857810974, -0.046734053641557693, 0.18930107355117798, 0.25959470868110657, 0.04136732220649719, 0.18094584345817566, -0.08990384638309479, 0.09249222278594971, -0.05098392069339752, 0.14414167404174805, -0.11952192336320877, 0.08747488260269165, -0.3509153723716736, -0.05498753488063812, 0.005668237805366516, -0.17668160796165466, 0.5283644199371338, -0.003358781337738037, 0.014650553464889526, 0.09693623334169388, 0.2657068967819214, 0.04233669489622116, -0.19606146216392517, -0.014860674738883972, -0.041340336203575134, -0.0797041803598404, 0.02059616521000862, 0.07376714050769806, 0.06907600909471512, -0.1541510969400406, 0.27627018094062805, 0.28015267848968506, 0.5042009353637695, 0.46302756667137146, 0.2128995656967163, 0.1944698691368103, -0.34233522415161133, 0.04356984794139862, -0.1778947412967682, -0.1022801473736763, 0.21526506543159485, -0.4497959017753601, 0.02381640113890171, -0.0004263743758201599, 0.1690327376127243, 0.04678361862897873, 0.10260941088199615, 0.09879881143569946, 0.39646050333976746, 0.21686486899852753, 0.03524189442396164, 0.1991865038871765, -0.08616486936807632, -0.25715193152427673, 0.24785634875297546, -0.236565962433815, -0.04412805289030075, 0.0019230693578720093, 0.06435275077819824, 0.1272781938314438, 0.14944519102573395, 0.5314286351203918, 0.3454365134239197, 0.3377692699432373, 0.23858219385147095, -0.12510748207569122, 0.01765511743724346, 0.44867798686027527, -0.07237297296524048, 0.08345656841993332, 0.21168635785579681, 0.07661798596382141, 0.1543196737766266, 0.0013679862022399902, 0.12803424894809723, 0.08605960011482239, -0.32780593633651733, 0.20339807868003845, -0.11327629536390305, 0.07987959682941437, -0.002516932785511017, 0.07392042130231857, -0.17444860935211182, -0.1604173332452774, 0.2872772514820099, -0.09752394258975983, -0.1153063178062439, -0.09341312944889069, 0.5522298812866211, -0.05171862244606018, 0.01936155930161476, -0.12287208437919617, 0.27423083782196045, -0.260402113199234, -0.36066874861717224, -0.4313429296016693, -0.05133497342467308, 0.09965361654758453, 0.15300697088241577, 0.0992373675107956, -0.09217432886362076, 0.38788414001464844, 0.23996013402938843, -0.06601957231760025, -0.38902711868286133, 0.03125995397567749, 0.13370025157928467, -0.2582220137119293, -0.01502346433699131, 0.24481506645679474, 0.07620571553707123, 0.1311020851135254, -0.4130701720714569, 0.02999907359480858, -0.28242161870002747, -0.02590196207165718, -0.4526994228363037, 0.19035062193870544, -0.139261394739151, -0.15279161930084229, -0.2263391762971878, -0.6577090620994568, -0.48724862933158875, 0.4437795877456665, -0.10301491618156433, 0.12728376686573029, -0.42701056599617004, 0.14842653274536133, -0.1940895915031433, 0.2806991934776306, -0.36699676513671875, 0.09089693427085876, -0.2519184350967407, 0.0626160055398941, -0.07439444214105606, -0.0015964205376803875, -0.08658593893051147, 0.08502395451068878, -0.016923043876886368, 0.25425127148628235, -0.05035724863409996, -0.24205473065376282, 0.07388266921043396, 0.4947037994861603, -0.10956751555204391, 0.11210992932319641, 0.3453199565410614, 0.04441371560096741, 0.012783333659172058, 0.07496762275695801, 0.0013519898056983948, -0.06672205030918121, 0.11580206453800201, 0.12226913124322891, 0.2631755471229553, 0.3295852541923523, 0.11755533516407013, 0.964945912361145, -0.2818804979324341, 0.15114007890224457, 0.33326345682144165, 0.07316655665636063, -0.26837271451950073, 0.05263572558760643, -0.36955294013023376, 0.005754698067903519, -0.3304536044597626, -0.15633666515350342, 0.00045149773359298706, -0.0830467939376831, -0.37418612837791443, -0.20309284329414368, -0.2823101878166199, -0.24588918685913086, 0.1766369789838791, 0.028918055817484856, -0.33304014801979065, 0.20509150624275208, -0.222247913479805, -0.2081076204776764, -0.31716734170913696, -0.02387509122490883, -0.052689079195261, 0.09508901834487915, 0.2559312880039215, -0.02036968059837818, 0.20993348956108093, 0.3586980700492859, -0.5781944990158081, -0.023319296538829803, 0.20751899480819702, -0.23057644069194794, -0.14553891122341156, 0.15058821439743042, 0.011918410658836365, -0.1398351490497589, 0.8511199951171875, -0.16828252375125885, -0.09995201230049133, -0.14561742544174194, -0.4133474826812744, 0.14126887917518616, -0.06234516203403473, -0.09232763946056366, -0.05147819593548775, 0.4204598367214203, 0.060214556753635406, -0.2005089670419693, -0.147536039352417, -0.18792201578617096, -0.34635961055755615, -0.019484959542751312, -0.21090152859687805, -0.08059263974428177, -0.11434949934482574, -0.346103698015213, 0.17022621631622314, 0.3400004804134369, -0.10150997340679169, -0.24798515439033508, -0.13126781582832336, 0.22513553500175476, 0.1876794695854187, 0.12924379110336304, -0.128490149974823, -0.15557484328746796, -0.14332741498947144, 0.15353694558143616, 0.16543282568454742, -0.09706158936023712, 0.0078047458082437515, -0.1142241507768631, -0.10453254729509354, -0.10116904228925705, 0.17571765184402466, -0.15369272232055664, 0.328620970249176, 0.14286595582962036, 0.15628154575824738, 0.11242164671421051, -0.12485138326883316, -0.06378099322319031, -0.5106753706932068, -0.15422137081623077, 0.01055929809808731, 0.08531355857849121, 0.027296271175146103, -0.7317065596580505, 0.3745541274547577, 0.2700634002685547, -0.07972800731658936, 0.4898113012313843, -0.3343067169189453, 0.05625124275684357, 0.24796557426452637, 0.049821898341178894, 0.8181461095809937, -0.06459145992994308, 0.06915595382452011, -0.08749709278345108, -0.1386033296585083, 0.44668877124786377, -0.7491017580032349, 0.3679746687412262, -0.36849525570869446, -0.08887723088264465, -0.18441295623779297, -0.03200887516140938, 0.02856460027396679, 0.3550173342227936, -0.10097992420196533, 0.3014175593852997, 0.19613592326641083, -0.14250168204307556, 0.015886228531599045, 0.4695107936859131, -0.3211851119995117, -0.24723321199417114, 0.15993309020996094, 0.18650513887405396, 0.045587968081235886, 0.15442058444023132, -0.4098851978778839, -0.29046186804771423, -0.009979970753192902, -0.04687390476465225, -0.4842105507850647, -0.015988096594810486, 0.041501183062791824, 0.34022364020347595, -0.20135366916656494, 0.08377379179000854, 0.3434852361679077, 0.2823142111301422, -0.24692454934120178, -0.1899508237838745, -0.17774958908557892, -0.007814908400177956, -0.07836994528770447, 0.13688763976097107, 0.09673962742090225, -0.15928909182548523, 0.151101216673851, -0.26051002740859985, -0.4408096671104431, -0.10883971303701401, 0.03912452235817909, -0.5495133996009827, -0.2974894642829895, 0.24686263501644135, 0.28126758337020874, -0.08305024355649948, -0.061970241367816925, 0.011130880564451218, -0.05050532519817352, -0.0059950873255729675, 0.11524802446365356, 0.08507293462753296, -0.09063419699668884, 0.20002901554107666, -0.16235752403736115, 0.22873230278491974, -0.08274589478969574, 0.2714279592037201, -0.1459938883781433, -0.22353717684745789, -0.03416142985224724, 0.13979485630989075, -0.22416682541370392, -0.11052407324314117, -0.320609450340271, -0.3420720398426056, 0.16910076141357422, 0.004327025264501572, -0.4149416983127594, -0.32568952441215515, 0.03648925572633743, -0.007924187928438187, 0.289101779460907, 0.0015157554298639297, 0.07497037202119827, -0.24657763540744781, -0.09778692573308945, 0.12801150977611542, -0.33820176124572754, 0.009430691599845886, 0.18253454566001892, -0.16637122631072998, 0.2910537123680115, -0.01838802918791771, -0.2939102351665497, 0.07840397953987122, -0.07978825271129608, -0.13199350237846375, 0.350200891494751, -0.11115226149559021, -0.17846868932247162, -0.07134076207876205, 0.05742195248603821, 0.20194736123085022, -0.13674984872341156, -0.16223767399787903, 0.002185508608818054, 0.13151004910469055, -0.11825841665267944, 0.07322297990322113, 0.033206526190042496, -0.09084434807300568, -0.25548556447029114, 0.04596973583102226, 0.01716747134923935, -0.019047223031520844, -0.014251042157411575, -0.2280682474374771, 0.48489275574684143, 0.3499584197998047, -0.3129715919494629, 0.3910118341445923, 0.165886789560318, 0.05699215084314346, -0.0006417781114578247, 0.2767769694328308, 0.4507899582386017, -0.040443964302539825, 0.1464586704969406, -0.02720635011792183, 0.540960431098938, 0.06509310007095337, 0.4528515040874481, 0.23048639297485352, -0.01592278480529785, 0.07185114920139313, 0.3913640081882477, 0.34903788566589355, 0.12858785688877106, -0.022459734231233597, 0.08861759305000305, 0.2823949456214905, -0.016913574188947678, -0.12988623976707458, 0.45302101969718933, 0.298970103263855, -0.0023167282342910767, 0.17246341705322266, 0.5810810327529907, 0.28468477725982666, -0.2982279658317566, 0.19943729043006897, 0.6987048387527466, -0.2212195098400116, 0.0921216607093811, -0.2530108094215393, 0.0434313639998436, 0.2556197941303253, 0.10960296541452408, 0.0798201784491539, 0.05879226699471474, 0.20309045910835266, 0.11815883219242096, 0.26722341775894165, 0.1419280618429184, -0.017007658258080482, 0.13931754231452942, -0.313579797744751, -0.12898600101470947, -0.32479730248451233, 0.040798213332891464, 0.19437383115291595, 0.03467794880270958, 0.3782312273979187, -0.15604574978351593, -0.22963497042655945, -0.04341315105557442, 0.25822046399116516, -0.13174881041049957, 0.03661924600601196, 0.08161447197198868, -0.19873017072677612, -0.0656934380531311, 0.07448427379131317, 0.2928171455860138, -0.0716552808880806, 0.8746529817581177, 0.00035979971289634705, 0.09132305532693863, -0.12528899312019348, -0.04059559106826782, 0.18431346118450165, 0.23402482271194458, -0.26571860909461975, -0.24954785406589508, 0.008709535002708435, -0.35520318150520325, -0.23525112867355347, 0.16294865310192108, 0.25339940190315247, 0.15785302221775055, -0.07995933294296265, -0.17940203845500946, -0.23511545360088348, 0.2600773870944977, -0.07831203192472458, 0.12812133133411407, 0.0228830948472023, 0.4877210855484009, -0.05857197195291519, 0.19899050891399384, -0.1162257194519043, 0.024550165981054306, 0.01914936862885952, -0.20588737726211548, -0.26022806763648987, 0.45271894335746765, 0.17680944502353668, -0.167015939950943, 0.0974915623664856, 0.18205001950263977, -0.2092469036579132, 0.2626441419124603, 0.36938828229904175, -0.129591166973114, -0.04087162762880325, -0.0077071040868759155, 0.06956912577152252, -0.025137027725577354, 0.25763165950775146, 0.1713884472846985, 0.11679847538471222, -0.2646697759628296, 0.12449164688587189, -0.46064841747283936, -0.07361479103565216, 0.05448469892144203, 0.16677023470401764, -0.2640855312347412, 0.09410249441862106, 0.07716648280620575, 0.059113942086696625, -0.28201591968536377, 0.0031799525022506714, 0.09782928228378296, 0.44613415002822876, -0.20618845522403717, 0.1364351212978363, -0.2375396192073822, 0.12959171831607819, 0.16641102731227875, -0.014685824513435364, 0.13382360339164734, -0.04470216482877731, 0.02170432358980179, -0.12032648175954819, -0.18952564895153046, 0.29657119512557983, -0.5694491863250732, 0.4887472689151764, -0.028582250699400902, 0.5636995434761047, -0.1565229892730713, -0.015071168541908264, -0.02995060384273529, -0.04351252689957619, -0.1629841923713684, -0.2000371515750885, -0.055519718676805496, -0.059273041784763336, -0.3706461489200592, 0.20038674771785736, -0.3858371376991272, 0.2630854547023773, -0.1727508008480072, 0.06580542027950287, -0.36318376660346985, -0.3481135964393616, -0.12026903033256531, 0.016626819968223572, 0.034701526165008545, 0.3865668475627899, -0.07074057310819626, -0.06279260665178299, -0.2803424298763275, -0.04042128473520279, 0.058716535568237305, -0.4047304391860962, -0.1812693476676941, -0.3934987187385559, -0.04660303145647049, 0.3617496192455292, 0.4150911867618561, -0.2730480432510376, -0.2231713831424713, 0.09877956658601761, -0.0018079085275530815, 0.09317302703857422, 0.27951884269714355, 0.1872578263282776, -0.30411961674690247, -0.10769358277320862, -0.17922843992710114, -0.1567067801952362, -0.11899992823600769, 0.1031159907579422, -0.18435566127300262 ]
https://github.com/huggingface/datasets/issues/5798
Hi, thanks for taking a look and providing your input! I don't know of such packages, and even it exists, I don't think with the process pool API it's possible to run Spark as backend properly; otherwise I understand a unified API would be preferable. The process pool API requires splitting the workload to a fixed number parts for multiprocessing; meanwhile distributed framework such as Spark has sophisticated scheduler to distribute the workload to the processes on multiple machines in a cluster, so the way of splitting things for `multiprocessing.pool` would not suit / be as flexible as directly calling the `sparkContext.parallelize` API. I think this could be a good addition to scale the `datasets` implementation to distributed workers, and from my benchmark results so far it looks promising compared with multiprocessing.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
132
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Hi, thanks for taking a look and providing your input! I don't know of such packages, and even it exists, I don't think with the process pool API it's possible to run Spark as backend properly; otherwise I understand a unified API would be preferable. The process pool API requires splitting the workload to a fixed number parts for multiprocessing; meanwhile distributed framework such as Spark has sophisticated scheduler to distribute the workload to the processes on multiple machines in a cluster, so the way of splitting things for `multiprocessing.pool` would not suit / be as flexible as directly calling the `sparkContext.parallelize` API. I think this could be a good addition to scale the `datasets` implementation to distributed workers, and from my benchmark results so far it looks promising compared with multiprocessing.
[ -0.5754362344741821, -0.26495084166526794, -0.27761897444725037, 0.03848211094737053, -0.06436130404472351, -0.011157408356666565, 0.3694995641708374, 0.21103748679161072, 0.25697705149650574, 0.05093444511294365, -0.021644312888383865, 0.5398142337799072, -0.04608116298913956, 0.5533217191696167, 0.029962752014398575, -0.30173781514167786, 0.07662168145179749, -0.052654288709163666, -0.1683652698993683, 0.20678722858428955, -0.10775892436504364, 0.19808337092399597, -0.06995964795351028, -0.19364416599273682, -0.016879446804523468, -0.22680534422397614, -0.2618253231048584, -0.011367784813046455, -0.10217086225748062, -0.18332388997077942, -0.011055264621973038, 0.39965561032295227, 0.18359430134296417, 0.42143332958221436, -0.00010761975136119872, -0.23270827531814575, 0.11414031684398651, 0.09292574971914291, 0.0320306159555912, -0.2284412980079651, -0.0696636438369751, -0.4267534613609314, 0.2383284866809845, -0.23932069540023804, 0.21538522839546204, 0.13453614711761475, 0.024008257314562798, -0.032046690583229065, 0.28842976689338684, -0.26946747303009033, 0.21789607405662537, 0.12145891785621643, -0.14050227403640747, 0.044689543545246124, -0.18312036991119385, 0.03119158186018467, -0.13661330938339233, 0.23275698721408844, 0.6255799531936646, -0.18014934659004211, -0.22646094858646393, 0.016311626881361008, -0.28407299518585205, 0.23926034569740295, 0.3448215425014496, -0.07144498080015182, -0.16487108170986176, -0.6003450155258179, -0.20535293221473694, 0.19282166659832, 0.6981651782989502, -0.19922104477882385, -0.424902081489563, -0.4960026144981384, -0.24141837656497955, 0.039490677416324615, -0.09983393549919128, 0.2626717686653137, -0.3054006099700928, 0.019703079015016556, -0.27928680181503296, -0.2163083851337433, 0.07669690251350403, -0.07276462763547897, 0.1183529943227768, 0.5981568694114685, -0.024130932986736298, 0.09810268878936768, 0.3258058726787567, 0.19858920574188232, 0.08241841942071915, -0.2523890435695648, 0.3687434494495392, 0.06350210309028625, -0.35265493392944336, -0.13865861296653748, -0.05089884251356125, -0.2881357669830322, 0.17382308840751648, 0.30313700437545776, 0.13177864253520966, 0.037646107375621796, 0.06416352093219757, 0.1665460169315338, 0.21010024845600128, -0.02727631665766239, -0.0007078777998685837, -0.07156053930521011, 0.22966992855072021, -0.053038839250802994, 0.18489398062229156, 0.08850406110286713, -0.08170466125011444, 0.017225928604602814, -0.3933333158493042, 0.20145532488822937, -0.33160102367401123, 0.2881091237068176, -0.1064290776848793, -0.23930121958255768, 0.382432222366333, -0.18654634058475494, -0.029825350269675255, 0.08663134276866913, -0.10139651596546173, 0.412740558385849, -0.11813735961914062, 0.1214396208524704, 0.07350024580955505, -0.05008949339389801, -0.013271775096654892, -0.04807896167039871, -0.11085431277751923, 0.1216728463768959, 0.1690511852502823, -0.11057345569133759, 0.2813487648963928, 0.13408547639846802, 0.04610422998666763, 0.18656419217586517, 0.3530249297618866, -0.07668650150299072, -0.47249966859817505, 0.11314725875854492, 0.03419160097837448, 0.03679092973470688, -0.026347212493419647, 0.5156991481781006, -0.2964448928833008, 0.19583047926425934, -0.25649112462997437, -0.2762344181537628, 0.009336104616522789, 0.21057164669036865, -0.06872672587633133, -0.0724925696849823, -0.5526452660560608, 0.15637226402759552, -0.06293652951717377, -0.10936284065246582, 0.1742488145828247, 0.08076781034469604, -0.3566446900367737, -0.3370233178138733, 0.08185110241174698, 0.41286501288414, -0.2156604528427124, -0.09196682274341583, -0.25194400548934937, -0.15677371621131897, 0.1852511316537857, -0.07434671372175217, -0.069643035531044, 0.09614585340023041, -0.15100914239883423, 0.24383938312530518, 0.24217769503593445, -0.5262421369552612, -0.11738936603069305, 0.6730195879936218, -0.18290504813194275, -0.07463379949331284, 0.18091727793216705, 0.10365158319473267, 0.44392797350883484, 0.05947527661919594, 0.1766527146100998, 0.35583990812301636, -0.22928623855113983, 0.13661590218544006, -0.09761416167020798, -0.47084060311317444, 0.1618327796459198, 0.3972388505935669, 0.15839678049087524, 0.03820523992180824, 0.1078302413225174, -0.27706554532051086, 0.3232775330543518, 0.1672700196504593, 0.2981874346733093, -0.02967032603919506, -0.16471806168556213, 0.37463071942329407, -0.08007670938968658, -0.2560078501701355, -0.25079429149627686, 0.2251540720462799, 0.2887686789035797, 0.000285211019217968, 0.08857104182243347, -0.157573863863945, 0.08158841729164124, -0.12846098840236664, 0.005714899860322475, -0.09264440834522247, 0.08653765916824341, -0.2463316023349762, -0.002438478171825409, 0.07453195750713348, -0.1928100734949112, 0.46285563707351685, -0.07381658256053925, 0.043154191225767136, 0.12217302620410919, 0.21566319465637207, 0.08386868983507156, -0.05497434735298157, -0.027867700904607773, -0.08049429953098297, -0.02803952619433403, -0.10462012887001038, -0.01200920157134533, 0.10652415454387665, -0.11231109499931335, 0.28608858585357666, 0.14345166087150574, 0.4098365306854248, 0.4047060012817383, 0.30099809169769287, 0.2186802625656128, -0.2513503134250641, 0.0053747668862342834, -0.25775784254074097, -0.13823381066322327, 0.36004638671875, -0.4610765278339386, 0.06847020238637924, -0.04497625678777695, 0.14719708263874054, 0.10645736753940582, 0.06971114873886108, 0.02964143455028534, 0.267703652381897, 0.09076300263404846, -0.07069620490074158, 0.31587186455726624, -0.03272806107997894, -0.31042855978012085, 0.18971659243106842, -0.09638617932796478, -0.02476712316274643, 0.09385496377944946, 0.10532261431217194, 0.10620680451393127, 0.03415858745574951, 0.5111269950866699, 0.505409300327301, 0.4380561113357544, 0.16700735688209534, -0.08304104208946228, -0.03225939720869064, 0.5096216201782227, 0.005446352064609528, 0.039896950125694275, 0.1290542632341385, 0.19907744228839874, 0.26090750098228455, -0.06113387644290924, 0.12391281127929688, 0.15849091112613678, -0.323623389005661, 0.3274933099746704, -0.0980086401104927, 0.014965973794460297, -0.057131145149469376, 0.009675584733486176, -0.13448208570480347, -0.11989657580852509, 0.23967184126377106, -0.07824113965034485, -0.07638568431138992, -0.12779521942138672, 0.48444366455078125, -0.0741189494729042, 0.02903950959444046, -0.1409052610397339, 0.25626078248023987, -0.25223809480667114, -0.3959324359893799, -0.34190142154693604, 0.08610288798809052, 0.13778601586818695, 0.14621856808662415, 0.15332676470279694, -0.042309194803237915, 0.2948172986507416, 0.12120731920003891, -0.04480874538421631, -0.3638438880443573, 0.05400467664003372, 0.10980363190174103, -0.26410967111587524, -0.03462347760796547, 0.27800479531288147, -0.03207449987530708, 0.0098453089594841, -0.38469260931015015, 0.013178013265132904, -0.22105148434638977, -0.032185811549425125, -0.45138460397720337, 0.19451366364955902, -0.0913441926240921, -0.1397760510444641, -0.29902729392051697, -0.7749160528182983, -0.4483485221862793, 0.39192232489585876, -0.10514681786298752, 0.20989423990249634, -0.5068838596343994, 0.06687818467617035, -0.18321870267391205, 0.3273206949234009, -0.32241594791412354, 0.09510180354118347, -0.35739898681640625, 0.15725040435791016, -0.14160418510437012, -0.059288591146469116, -0.042648475617170334, 0.06175926327705383, 0.11906445026397705, 0.1790977418422699, -0.0444912314414978, -0.1905546337366104, 0.04038020968437195, 0.5191726088523865, -0.1774163842201233, 0.11434102803468704, 0.33319881558418274, 0.09110069274902344, 0.035338371992111206, -0.00717589259147644, -0.006570607423782349, -0.09618672728538513, 0.148715540766716, -0.012790892273187637, 0.23782718181610107, 0.28817465901374817, 0.06809695065021515, 0.9634746313095093, -0.23672179877758026, 0.10037018358707428, 0.28950247168540955, 0.05868213623762131, -0.28267163038253784, 0.06159750372171402, -0.38690364360809326, 0.020093630999326706, -0.35975033044815063, -0.020049571990966797, 0.02430419996380806, -0.1106242835521698, -0.3908117711544037, -0.16588115692138672, -0.29990577697753906, -0.34978634119033813, 0.13428428769111633, 0.07731632888317108, -0.18747413158416748, 0.212734654545784, -0.20170359313488007, -0.1756318211555481, -0.296440988779068, 0.04577818140387535, -0.05736629664897919, 0.05650446191430092, 0.2560679614543915, -0.038747433573007584, 0.1116936057806015, 0.2317759394645691, -0.6240556836128235, -0.01784830540418625, 0.1827642321586609, -0.20590832829475403, -0.04320473223924637, 0.1728590428829193, 0.029121289029717445, -0.08489330112934113, 0.834717333316803, -0.188749760389328, -0.07023786008358002, -0.11419081687927246, -0.5158761739730835, 0.12184052169322968, -0.05250873416662216, -0.0660785511136055, 0.07241787016391754, 0.41999512910842896, 0.12667961418628693, -0.17690706253051758, -0.2550627291202545, -0.17267408967018127, -0.2591933012008667, -0.05814781039953232, -0.22594715654850006, -0.0369592010974884, -0.13113299012184143, -0.43168023228645325, 0.15239714086055756, 0.3415244221687317, -0.03218689560890198, -0.23057106137275696, -0.1614931970834732, 0.2625241279602051, 0.19957268238067627, 0.09247590601444244, -0.05415273457765579, -0.10508768260478973, -0.09017253667116165, 0.1949514001607895, 0.08853030204772949, -0.08168148249387741, 0.046290360391139984, 0.03979446738958359, -0.14012643694877625, -0.0858733206987381, 0.2070356011390686, -0.17687952518463135, 0.26016005873680115, 0.0261976420879364, 0.003032226115465164, 0.011089552193880081, -0.17536529898643494, 0.0463998019695282, -0.5329622626304626, -0.052070144563913345, 0.0782821923494339, 0.1779502034187317, -0.0016167648136615753, -0.7417441606521606, 0.32353565096855164, 0.15819749236106873, -0.09176038205623627, 0.47620218992233276, -0.3582764267921448, 0.007136493921279907, 0.1995721310377121, 0.0928986668586731, 0.7289770245552063, -0.010493537411093712, 0.054277658462524414, -0.13730469346046448, -0.02688143402338028, 0.5170776844024658, -0.6819671392440796, 0.34073495864868164, -0.3041066527366638, 0.060166556388139725, -0.15888142585754395, 0.045840755105018616, 0.018960440531373024, 0.38867640495300293, -0.15875083208084106, 0.3065014183521271, 0.24928998947143555, -0.2587488293647766, -0.13696199655532837, 0.5470438003540039, -0.3450637459754944, -0.366801381111145, 0.21814116835594177, 0.16399642825126648, 0.01634032651782036, 0.172206312417984, -0.29126960039138794, -0.17234624922275543, 0.10221731662750244, -0.009088866412639618, -0.36666345596313477, -0.027528148144483566, 0.002902332693338394, 0.40686851739883423, -0.26198267936706543, 0.031097233295440674, 0.45978039503097534, 0.2967228889465332, -0.26198306679725647, -0.2436174899339676, -0.14330680668354034, -0.03668275475502014, -0.22362487018108368, 0.2621593475341797, 0.05184917896986008, -0.1780146360397339, 0.11288711428642273, -0.22322922945022583, -0.38254034519195557, -0.24519208073616028, 0.02811821550130844, -0.43671315908432007, -0.07084068655967712, 0.26224857568740845, 0.24095599353313446, -0.19597801566123962, -0.08427448570728302, 0.06965088844299316, -0.06820361316204071, -0.014525949954986572, 0.10812689363956451, 0.07256986945867538, -0.09409242868423462, 0.35673531889915466, -0.22868508100509644, 0.136033296585083, -0.06605672836303711, 0.27757930755615234, -0.03814990073442459, -0.18928205966949463, 0.031811099499464035, 0.18478626012802124, -0.2503735423088074, -0.13949662446975708, -0.2055855244398117, -0.276969313621521, 0.059960782527923584, 0.10230720043182373, -0.28391575813293457, -0.19039033353328705, 0.007095698267221451, 0.01688007451593876, 0.2169308364391327, 0.07814596593379974, 0.0378204807639122, -0.2799254059791565, -0.1451757699251175, 0.12808085978031158, -0.3100619316101074, 0.029491368681192398, 0.21150293946266174, -0.21962156891822815, 0.3552587032318115, 0.08030516654253006, -0.293949156999588, 0.14612630009651184, -0.07803712785243988, -0.14528676867485046, 0.41001439094543457, -0.024398790672421455, -0.1317376047372818, 0.008860800415277481, 0.04021433740854263, 0.17908790707588196, -0.12505963444709778, -0.16096121072769165, 0.02991470694541931, 0.12413127720355988, -0.032855529338121414, 0.006412137299776077, 0.0661691203713417, -0.050017524510622025, -0.2699038088321686, -0.07722391188144684, 0.22592264413833618, -0.026178181171417236, -0.07077568024396896, -0.04772518575191498, 0.3597431778907776, 0.25809288024902344, -0.3333159387111664, 0.3754933476448059, 0.16561926901340485, -0.006274346262216568, -0.037541307508945465, 0.3783092200756073, 0.4886181950569153, 0.019512131810188293, 0.08664774894714355, -0.09614092111587524, 0.493868350982666, 0.06812315434217453, 0.43763336539268494, 0.1430349200963974, -0.01194269210100174, 0.025425247848033905, 0.3846386671066284, 0.3020683526992798, 0.07850277423858643, -0.04208469018340111, 0.18287687003612518, 0.274507611989975, -0.06379813700914383, -0.2086234837770462, 0.4539303481578827, 0.2536132037639618, 0.01581132411956787, 0.15032143890857697, 0.5780930519104004, 0.19871750473976135, -0.2360936403274536, 0.16299530863761902, 0.7450397610664368, -0.16603904962539673, 0.11955230683088303, -0.0741683691740036, -0.01714346557855606, 0.26635193824768066, 0.23404157161712646, 0.09584766626358032, 0.07136955112218857, 0.2534785270690918, 0.08087652176618576, 0.32598868012428284, 0.24646158516407013, 0.07880684733390808, 0.1126103550195694, -0.4934767484664917, -0.02934613823890686, -0.26849114894866943, -0.05979669466614723, 0.18501123785972595, -0.04657379165291786, 0.3631986677646637, -0.2570498287677765, -0.28835389018058777, -0.1474992036819458, 0.2697080373764038, -0.20256958901882172, 0.01623646914958954, 0.05368788540363312, -0.18613773584365845, -0.0033262819051742554, 0.1518949270248413, 0.22976168990135193, -0.11214213073253632, 0.8609771728515625, -0.04087892919778824, -0.003569226711988449, -0.1135680302977562, -0.054618485271930695, 0.09389956295490265, 0.1953555941581726, -0.23700985312461853, -0.25715455412864685, -0.0041415393352508545, -0.24318771064281464, -0.3265696167945862, 0.1648995578289032, 0.275896817445755, 0.1890583336353302, 0.03485859930515289, -0.15453070402145386, -0.1899939924478531, 0.3120582103729248, -0.1197827011346817, 0.13482561707496643, -0.03347588703036308, 0.37876778841018677, 0.027517098933458328, 0.18157793581485748, -0.11537308990955353, -0.061886318027973175, 0.009911857545375824, -0.219511479139328, -0.15483218431472778, 0.2309519499540329, 0.1710299551486969, -0.18796607851982117, 0.04776791110634804, 0.1707363724708557, -0.23269250988960266, 0.17298094928264618, 0.47866255044937134, -0.17980782687664032, 0.026577219367027283, -0.05154205113649368, 0.07049740105867386, -0.07022325694561005, 0.28092318773269653, 0.09877817332744598, 0.1254333108663559, -0.2763870358467102, 0.06116388738155365, -0.42797112464904785, -0.08513890951871872, 0.09886223077774048, 0.10015007853507996, -0.17574073374271393, 0.14858728647232056, 0.0699315294623375, 0.001024371013045311, -0.16142238676548004, -0.03777991980314255, 0.17719103395938873, 0.46040767431259155, -0.18342410027980804, 0.22254513204097748, -0.3343290686607361, 0.19447758793830872, 0.157373309135437, -0.1082831397652626, 0.1319614052772522, -0.02173147350549698, -0.0268833190202713, -0.19702322781085968, -0.16775384545326233, 0.2558624744415283, -0.54490065574646, 0.5446762442588806, -0.021447479724884033, 0.49490225315093994, -0.17812040448188782, 0.08819709718227386, 0.00421078409999609, -0.01960226520895958, -0.15817037224769592, -0.15565553307533264, -0.02764948271214962, -0.011011600494384766, -0.2848950922489166, 0.31482812762260437, -0.445547878742218, 0.22517618536949158, -0.1534760296344757, 0.12762418389320374, -0.20199370384216309, -0.2819710969924927, -0.17733146250247955, -0.011447031050920486, 0.11934024095535278, 0.40298670530319214, -0.06721635162830353, -0.12497696280479431, -0.28265881538391113, -0.0853886753320694, 0.041884176433086395, -0.3634234666824341, -0.1641874760389328, -0.4835185706615448, 0.03928196430206299, 0.31525275111198425, 0.32623291015625, -0.3522278070449829, -0.18710291385650635, 0.14773598313331604, 0.0444963313639164, 0.025149300694465637, 0.2814832329750061, 0.044146087020635605, -0.29977160692214966, -0.11550282686948776, -0.270022451877594, -0.22427767515182495, -0.1369742453098297, 0.013611666858196259, -0.3103727102279663 ]
https://github.com/huggingface/datasets/issues/5798
I see ! I think we only need an equivalent of `pool.map`. We use it to run download and conversion of data files on disk. That would require less changes in the internal code - and therefore less tests to write ;) We also use `pool.apply_async` in some places with a `Queue` to get progress updates of the running jobs. I'm mentioning this in case there's a way to get a python generator from a running spark job ? This is less important though
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
84
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. I see ! I think we only need an equivalent of `pool.map`. We use it to run download and conversion of data files on disk. That would require less changes in the internal code - and therefore less tests to write ;) We also use `pool.apply_async` in some places with a `Queue` to get progress updates of the running jobs. I'm mentioning this in case there's a way to get a python generator from a running spark job ? This is less important though
[ -0.5281373858451843, -0.18202292919158936, -0.2799943685531616, 0.029995812103152275, 0.0023557282984256744, -0.012214362621307373, 0.3677160441875458, 0.36550411581993103, 0.26282089948654175, 0.1473686397075653, -0.027858640998601913, 0.5398534536361694, -0.02363302744925022, 0.3558046817779541, 0.02059299126267433, -0.29452499747276306, 0.03186694160103798, -0.05069185420870781, -0.22918754816055298, 0.10151608288288116, -0.15175089240074158, 0.05493711680173874, 0.04176521301269531, -0.1778884381055832, -0.07547616213560104, -0.20635582506656647, -0.24931466579437256, 0.0951402559876442, -0.1767243891954422, -0.22873419523239136, -0.12988750636577606, 0.4110359251499176, 0.22273683547973633, 0.41363057494163513, -0.00010453669528942555, -0.15144528448581696, 0.20473037660121918, 0.07421763241291046, -0.1337505578994751, -0.262927770614624, -0.08049118518829346, -0.5312958359718323, 0.2130332887172699, -0.310234010219574, 0.09474518150091171, 0.15767596662044525, 0.0745759829878807, -0.08200870454311371, 0.3157120943069458, -0.17829391360282898, 0.24424414336681366, 0.19172686338424683, -0.24679593741893768, -0.057705994695425034, -0.04520852491259575, 0.09145542979240417, -0.11372373253107071, 0.37612107396125793, 0.6825656890869141, -0.2660360634326935, -0.37994104623794556, 0.11912880837917328, -0.2936621308326721, 0.15587309002876282, 0.3522498905658722, 0.013608511537313461, 0.09988981485366821, -0.5656762719154358, -0.13386332988739014, 0.14896808564662933, 0.5800904631614685, -0.2395014762878418, -0.41668978333473206, -0.5018820762634277, -0.21476386487483978, 0.10290117561817169, -0.10448247939348221, 0.24121536314487457, -0.3666103482246399, 0.028647104278206825, -0.2851714789867401, -0.21265588700771332, 0.0942259132862091, -0.15339036285877228, 0.10245165228843689, 0.48016777634620667, 0.06541014462709427, 0.005603451281785965, 0.2980751693248749, 0.3137078285217285, 0.2516700327396393, -0.21681314706802368, 0.3573645055294037, 0.023565664887428284, -0.29997754096984863, -0.1398105025291443, -0.05222515016794205, -0.2481260597705841, 0.23392672836780548, 0.1975003033876419, 0.18480990827083588, -0.026956064626574516, 0.08371995389461517, 0.23342949151992798, 0.16610828042030334, -0.044068384915590286, -0.04284844547510147, -0.004575900733470917, 0.23496484756469727, -0.018750889226794243, 0.08233745396137238, 0.06547713279724121, -0.04044542461633682, -0.09565144032239914, -0.18694469332695007, 0.3451630175113678, -0.31186866760253906, 0.289961576461792, 0.003512568771839142, -0.2493816614151001, 0.2595665454864502, -0.17389731109142303, 0.010863464325666428, 0.2030230015516281, -0.07204927504062653, 0.3167606294155121, -0.09976357221603394, 0.127678781747818, 0.11572381854057312, -0.09190326929092407, -0.059910111129283905, -0.01955517940223217, -0.10366307199001312, 0.1097487211227417, 0.13233444094657898, -0.03060103952884674, 0.3537743091583252, 0.051476284861564636, 0.05285835266113281, 0.1384948343038559, 0.33766329288482666, -0.06595257669687271, -0.2895348072052002, 0.1218637228012085, 0.0383274108171463, -0.11189483106136322, -0.020235653966665268, 0.4011439383029938, -0.3217814564704895, 0.31644511222839355, -0.13843485713005066, -0.377471387386322, 0.020592162385582924, 0.25542545318603516, -0.06022469699382782, 0.03681347891688347, -0.4501400887966156, 0.18108484148979187, -0.05270414426922798, -0.11721665412187576, 0.20457974076271057, 0.0646209865808487, -0.32062891125679016, -0.28447863459587097, 0.14671987295150757, 0.4146919250488281, -0.15057064592838287, 0.057016871869564056, -0.21985483169555664, -0.11586441099643707, 0.19839316606521606, 0.038037098944187164, -0.1398167908191681, 0.15496638417243958, -0.15481160581111908, 0.21858100593090057, 0.34392234683036804, -0.42222824692726135, -0.147614523768425, 0.6639305353164673, -0.2936399579048157, -0.17814427614212036, 0.2625727653503418, 0.17854821681976318, 0.5504087209701538, -0.059205882251262665, 0.1714099496603012, 0.27874132990837097, -0.3264232575893402, 0.27118295431137085, -0.304959774017334, -0.3917360305786133, 0.16339290142059326, 0.3654184937477112, 0.1345461755990982, 0.03566355258226395, 0.10583283007144928, -0.31798413395881653, 0.27907052636146545, 0.1277468204498291, 0.22921499609947205, -0.1205986738204956, -0.11426860094070435, 0.27701660990715027, -0.18478643894195557, -0.06506513059139252, -0.39553529024124146, 0.2222444862127304, 0.17325714230537415, 0.0381091833114624, 0.18497367203235626, -0.23023200035095215, -0.06300266087055206, -0.007900923490524292, 0.06302942335605621, -0.07879318296909332, 0.1360795795917511, -0.21557869017124176, 0.011089593172073364, 0.002378508448600769, -0.21431875228881836, 0.29969942569732666, -0.18970155715942383, 0.026842791587114334, 0.044500768184661865, 0.26388320326805115, -0.049831777811050415, -0.08448351919651031, -0.011605218052864075, -0.12342274188995361, -0.06653910130262375, -0.028267722576856613, -0.05119474232196808, 0.05722025781869888, -0.12443132698535919, 0.42595887184143066, 0.21792829036712646, 0.382386714220047, 0.3962300419807434, 0.23046940565109253, 0.2591935992240906, -0.23413880169391632, 0.0501352958381176, -0.19136671721935272, -0.19276851415634155, 0.2808157205581665, -0.45060694217681885, 0.0850963294506073, -0.04382879287004471, 0.12396354973316193, 0.04115394502878189, 0.049046486616134644, -0.037300027906894684, 0.2884397804737091, 0.036597348749637604, 0.14277315139770508, 0.2643918991088867, 0.0775223970413208, -0.27785032987594604, 0.26197201013565063, 0.1464952826499939, -0.1630997657775879, 0.010966920293867588, 0.20804455876350403, 0.16860127449035645, -0.09544272720813751, 0.45414555072784424, 0.5207757949829102, 0.32899636030197144, 0.2222694456577301, 0.16988345980644226, 0.03279902786016464, 0.4605270326137543, -0.11040304601192474, 0.07787325978279114, 0.19596272706985474, 0.1353583186864853, 0.2677697539329529, 0.02458760142326355, 0.06812451034784317, 0.059789739549160004, -0.3175308108329773, 0.25616455078125, 0.02378859557211399, 0.05088263750076294, -0.10888861119747162, 0.26605167984962463, -0.10396727919578552, -0.08842436969280243, 0.22089265286922455, -0.07744055986404419, -0.15292221307754517, -0.033035703003406525, 0.4489325284957886, -0.17756366729736328, 0.045642927289009094, -0.07557565718889236, 0.13114045560359955, -0.21822020411491394, -0.3234449028968811, -0.504746675491333, -0.13689692318439484, 0.09505988657474518, 0.113615483045578, 0.1775837540626526, 0.03869013860821724, 0.35837939381599426, 0.08577070385217667, -0.06892494857311249, -0.34367626905441284, 0.03986237943172455, 0.013618121854960918, -0.1991283893585205, 0.03788062930107117, 0.207752525806427, 0.06526869535446167, 0.01772257685661316, -0.3996261656284332, -0.012894511222839355, -0.19629991054534912, -0.07503104209899902, -0.4248199164867401, 0.139584481716156, 0.025611773133277893, -0.16230276226997375, -0.3417285680770874, -0.6732606887817383, -0.6184021234512329, 0.36299318075180054, -0.1512899100780487, 0.26638323068618774, -0.5012065768241882, 0.11421354115009308, -0.2158898115158081, 0.3171508312225342, -0.28370851278305054, 0.04306120052933693, -0.48770156502723694, 0.1256432682275772, -0.08816894143819809, 0.0020743925124406815, -0.12709997594356537, -0.09579376131296158, 0.1171722263097763, 0.09105373919010162, -0.06630166620016098, -0.23003357648849487, -0.013877883553504944, 0.5789909362792969, -0.11641111969947815, 0.12515956163406372, 0.3390013575553894, 0.19757340848445892, -0.026372583582997322, 0.19386644661426544, 0.08288159966468811, -0.0880000963807106, 0.31895291805267334, -0.01738319918513298, 0.2181738168001175, 0.37620872259140015, 0.14896495640277863, 0.8558065891265869, -0.13502779603004456, 0.14309416711330414, 0.1672181934118271, 0.0659545511007309, -0.2318228930234909, -0.042581915855407715, -0.424632728099823, -0.02735000103712082, -0.32112041115760803, -0.23408930003643036, 0.1063893735408783, -0.16703923046588898, -0.3365141451358795, -0.12925484776496887, -0.30510860681533813, -0.3959946930408478, -0.07594034820795059, 0.2931838929653168, -0.2685784101486206, 0.1499926596879959, -0.15254704654216766, -0.03302285075187683, -0.2344023734331131, 0.06113038212060928, -0.08681481331586838, 0.0573590025305748, 0.3413735032081604, -0.0679703950881958, 0.21983857452869415, 0.3247286081314087, -0.7481870055198669, 0.012226838618516922, 0.19869624078273773, -0.2138071209192276, -0.05196757987141609, 0.06826139986515045, 0.12204012274742126, -0.12669414281845093, 0.8044930100440979, -0.20016509294509888, -0.004943550564348698, -0.02480432018637657, -0.4709789454936981, 0.21841445565223694, 0.022267721593379974, -0.049202416092157364, 0.01010812446475029, 0.5057026743888855, 0.24042348563671112, -0.19855764508247375, -0.22271117568016052, -0.1245601624250412, -0.21164526045322418, 0.02038312703371048, -0.1903473436832428, -0.04819406941533089, -0.15428024530410767, -0.46228256821632385, 0.23825235664844513, 0.32494068145751953, -0.12336993962526321, -0.2979748547077179, -0.18812277913093567, 0.3297755718231201, 0.15406621992588043, 0.12629660964012146, 0.025923892855644226, -0.17359481751918793, -0.11326250433921814, 0.19682089984416962, 0.2774379849433899, -0.14185522496700287, -0.0029722359031438828, 0.03550184890627861, -0.20232266187667847, 0.03517674282193184, 0.18900810182094574, -0.12727975845336914, 0.30446261167526245, 0.229800283908844, 0.12454228103160858, -0.06024429574608803, -0.09995698928833008, 0.06910429894924164, -0.4481571316719055, -0.08902958035469055, 0.025002479553222656, 0.07237386703491211, 0.016860932111740112, -0.7056875824928284, 0.33073025941848755, 0.007332444190979004, -0.08360691368579865, 0.3258313238620758, -0.4874977767467499, -0.010670287534594536, 0.317962646484375, 0.059381596744060516, 0.8387115001678467, -0.18737930059432983, 0.057384178042411804, -0.013515906408429146, -0.0431881844997406, 0.45689481496810913, -0.7367607355117798, 0.27601343393325806, -0.355654239654541, -0.01551894098520279, -0.05837167799472809, -0.060011401772499084, -0.007210236042737961, 0.4365788996219635, -0.2353629767894745, 0.22534702718257904, 0.20124316215515137, -0.1735198199748993, -0.11372280865907669, 0.5657761096954346, -0.4311578571796417, -0.40905624628067017, 0.005222538486123085, 0.17422416806221008, -0.01948918029665947, 0.1994696706533432, -0.16816216707229614, -0.304351270198822, -0.024091191589832306, -0.01080368459224701, -0.23620474338531494, -0.06637439131736755, -0.048079848289489746, 0.301908403635025, -0.33697226643562317, -0.03735505789518356, 0.289440393447876, 0.32569393515586853, -0.2328495979309082, -0.09574677050113678, -0.011152563616633415, 0.030014410614967346, -0.04364192858338356, 0.2850891649723053, 0.09923286736011505, -0.15759119391441345, 0.15848569571971893, -0.19384272396564484, -0.373296856880188, -0.08591409772634506, -0.1030454933643341, -0.45160651206970215, -0.11114876717329025, 0.14258429408073425, 0.20415973663330078, -0.20163026452064514, -0.021410774439573288, 0.062332019209861755, -0.29330652952194214, -0.06231006234884262, 0.15376392006874084, 0.13745824992656708, -0.22976475954055786, 0.32626867294311523, -0.14324083924293518, 0.06795667111873627, -0.07401983439922333, 0.21058663725852966, -0.09545096755027771, -0.09214691072702408, -0.08413666486740112, 0.11020636558532715, -0.24484989047050476, -0.22372379899024963, -0.07589149475097656, -0.245214581489563, 0.02470313012599945, 0.09362052381038666, -0.3079650402069092, -0.2915041446685791, -0.027045585215091705, 0.04549185559153557, 0.2869952321052551, 0.07082143425941467, 0.018457047641277313, -0.23385745286941528, -0.37600043416023254, 0.12766538560390472, -0.06214357540011406, 0.13569822907447815, 0.19804200530052185, -0.1320415884256363, 0.15458542108535767, 0.09866798669099808, -0.3773733973503113, 0.10423405468463898, -0.21063658595085144, 0.03002673014998436, 0.3851836323738098, -0.22864897549152374, -0.07905277609825134, 0.006870865821838379, 0.09810172766447067, 0.20827355980873108, -0.20156502723693848, -0.22039388120174408, 0.0840546041727066, 0.1105450838804245, -0.07090891897678375, 0.16144493222236633, 0.009078681468963623, -0.04089934378862381, -0.2655775547027588, -0.10308906435966492, 0.1616213172674179, -0.11012433469295502, -0.07759153097867966, -0.06745230406522751, 0.21767784655094147, 0.3208664059638977, -0.2869357466697693, 0.36098265647888184, 0.05888449400663376, 0.11252506077289581, -0.19429056346416473, 0.3656560480594635, 0.3460593521595001, -0.06157763674855232, 0.057380400598049164, -0.011453118175268173, 0.4374615252017975, 0.13790298998355865, 0.49041804671287537, 0.23689790070056915, 0.028382383286952972, 0.016258426010608673, 0.36906981468200684, 0.2818322479724884, 0.13262002170085907, 0.022741608321666718, 0.1320469081401825, 0.31742802262306213, -0.08871464431285858, -0.02735084667801857, 0.4016776978969574, 0.07769964635372162, 0.22125424444675446, 0.1592004895210266, 0.5187574625015259, 0.2664748430252075, -0.269233375787735, 0.13130590319633484, 0.6885741949081421, -0.275386244058609, 0.002143893390893936, 0.08771039545536041, 0.005622096359729767, 0.23846179246902466, 0.13401739299297333, 0.05580582469701767, 0.17414075136184692, 0.2893890142440796, 0.10798340290784836, 0.4564126133918762, 0.10174313187599182, 0.14107613265514374, 0.16101160645484924, -0.4162764847278595, 0.09678417444229126, -0.09065447002649307, -0.04338191822171211, 0.16138985753059387, 0.031954117119312286, 0.33718621730804443, -0.26895225048065186, -0.21451647579669952, -0.16246476769447327, 0.25271135568618774, -0.20006099343299866, 0.07937298715114594, 0.07248567789793015, -0.19906187057495117, -0.05752333253622055, 0.14989355206489563, 0.15016579627990723, 0.0033534448593854904, 0.7017289400100708, 0.0695243626832962, 0.07423656433820724, -0.004569912329316139, -0.06632860004901886, 0.05682171508669853, 0.21510040760040283, -0.34568580985069275, -0.2709580361843109, -0.03597498685121536, -0.19955185055732727, -0.33977210521698, 0.1924116462469101, 0.34391477704048157, 0.14444467425346375, -0.07154906541109085, -0.086988665163517, -0.14309406280517578, 0.1439788043498993, -0.2394622415304184, 0.11992944777011871, -0.04631932079792023, 0.2541062533855438, 0.08130182325839996, 0.21885129809379578, -0.17586642503738403, -0.09633795917034149, 0.07149547338485718, -0.3042173385620117, -0.048200830817222595, 0.2125154435634613, 0.31388548016548157, -0.2767896056175232, 0.06768060475587845, -0.007001630961894989, -0.29001137614250183, 0.05752546340227127, 0.255611777305603, -0.20616155862808228, 0.07549908757209778, -0.01762833632528782, 0.10804367065429688, -0.012923608534038067, 0.23905502259731293, 0.08266721665859222, 0.1710074543952942, -0.4456332325935364, 0.055342674255371094, -0.45636093616485596, -0.17594940960407257, 0.10171438753604889, 0.15446969866752625, -0.14252883195877075, 0.21619945764541626, 0.07487074285745621, 0.17802481353282928, -0.21211285889148712, -0.07752184569835663, 0.11392305046319962, 0.5031387209892273, -0.01520836353302002, 0.06242498382925987, -0.24319788813591003, 0.044466838240623474, 0.17847351729869843, -0.268047958612442, 0.13604912161827087, -0.06564699113368988, 0.06035056710243225, -0.1998414695262909, -0.04647023230791092, 0.32889753580093384, -0.2858637571334839, 0.43342116475105286, -0.019349925220012665, 0.38326165080070496, -0.16568973660469055, 0.03758452832698822, 0.03870360553264618, -0.059576526284217834, -0.08333731442689896, -0.07936209440231323, -0.05974777042865753, 0.018114544451236725, -0.18926268815994263, 0.20162706077098846, -0.48566290736198425, 0.23027488589286804, -0.11269470304250717, 0.10221085697412491, -0.2374984323978424, -0.2632443308830261, -0.16120001673698425, 0.07162274420261383, 0.09364726394414902, 0.3386019766330719, -0.022407211363315582, -0.11014634370803833, -0.44480645656585693, -0.08310376107692719, 0.07285546511411667, -0.3070206642150879, -0.23218078911304474, -0.4492339491844177, 0.1032291054725647, 0.330670565366745, 0.46232500672340393, -0.3223116099834442, -0.16805660724639893, 0.14278358221054077, -0.08732753992080688, 0.0692729651927948, 0.2719307243824005, 0.15980511903762817, -0.2857245206832886, -0.17906823754310608, -0.09761501848697662, -0.31339025497436523, -0.09557326138019562, -0.11274214088916779, -0.3568079173564911 ]
https://github.com/huggingface/datasets/issues/5798
For Spark, `rdd.map` (where `rdd` can be created by `sparkContext.parallelize`) is the most similar as `pool.map`, but it requires creating a Spark RDD first that is used for distributing the `iterable` and the actual parallelization is managed by the Spark framework; `pool.map` takes the splits of `iterable` that are split into `num_proc` parts by the Python code. You can also check my PR #5807 in the `src/datasets/utils/py_utils.py` file to compare the differences of the APIs, it might make more sense than the the above description. Given the different inputs and mechanisms of calling the `map` functions, this is why I think it's not that feasible to reuse most of the `multiprocessing` code. Progress bar updating might be challenging with Spark, I'll consider it as a followup work.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
127
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. For Spark, `rdd.map` (where `rdd` can be created by `sparkContext.parallelize`) is the most similar as `pool.map`, but it requires creating a Spark RDD first that is used for distributing the `iterable` and the actual parallelization is managed by the Spark framework; `pool.map` takes the splits of `iterable` that are split into `num_proc` parts by the Python code. You can also check my PR #5807 in the `src/datasets/utils/py_utils.py` file to compare the differences of the APIs, it might make more sense than the the above description. Given the different inputs and mechanisms of calling the `map` functions, this is why I think it's not that feasible to reuse most of the `multiprocessing` code. Progress bar updating might be challenging with Spark, I'll consider it as a followup work.
[ -0.4450608193874359, -0.29352670907974243, -0.2786247730255127, -0.005575243383646011, -0.029473690316081047, 0.013661235570907593, 0.3585393726825714, 0.24527771770954132, 0.2660626173019409, 0.11462710797786713, -0.17100560665130615, 0.5936993360519409, -0.10378982871770859, 0.39364495873451233, -0.029040077701210976, -0.28659194707870483, 0.09003624320030212, -0.07516766339540482, -0.10011009126901627, 0.20243136584758759, -0.18669752776622772, 0.15241682529449463, -0.04599948972463608, -0.16779479384422302, 0.04525216296315193, -0.15204501152038574, -0.27214863896369934, 0.06150346249341965, -0.08189938962459564, -0.3801693320274353, 0.015175305306911469, 0.41921529173851013, 0.18005400896072388, 0.40051010251045227, -0.00010132294846698642, -0.11275222897529602, 0.1360519826412201, 0.05188421905040741, 0.029270339757204056, -0.20497268438339233, 0.017255954444408417, -0.4008983373641968, 0.2711452841758728, -0.36429405212402344, 0.23151209950447083, 0.011474572122097015, -0.00023812800645828247, -0.15097592771053314, 0.3680574893951416, -0.15651047229766846, 0.2668232023715973, 0.2154480218887329, -0.12929318845272064, -0.023212550207972527, -0.12409716844558716, -0.02428550273180008, -0.05384403467178345, 0.396463006734848, 0.5617814660072327, -0.19710078835487366, -0.32292190194129944, 0.1622934192419052, -0.33794665336608887, 0.28709131479263306, 0.27858930826187134, -0.04720456153154373, 0.036724332720041275, -0.631181538105011, -0.12179553508758545, 0.1934995949268341, 0.5188915729522705, -0.27211084961891174, -0.3377734422683716, -0.43832090497016907, -0.26394131779670715, -0.04278729856014252, -0.10344895720481873, 0.14427779614925385, -0.2474057376384735, 0.02081255428493023, -0.3545333445072174, -0.1135411262512207, 0.147772878408432, -0.13289643824100494, 0.02755354344844818, 0.5160637497901917, 0.03090909868478775, 0.07912157475948334, 0.3574514389038086, 0.0842101126909256, 0.08328227698802948, -0.22715014219284058, 0.306512713432312, 0.008927673101425171, -0.4341347813606262, -0.122136190533638, 0.10648307204246521, -0.2816924750804901, 0.13974831998348236, 0.2615654468536377, 0.1972462236881256, 0.04114486277103424, 0.10102449357509613, 0.24811294674873352, 0.09119488298892975, -0.06490834057331085, -0.03461119532585144, -0.06596960127353668, 0.22205737233161926, 0.0022093988955020905, 0.08828052133321762, 0.067386195063591, 0.03435691073536873, -0.004986584186553955, -0.17945539951324463, 0.28421080112457275, -0.18765413761138916, 0.2956138551235199, -0.07962428778409958, -0.2586817443370819, 0.2099464386701584, -0.18529090285301208, -0.003937568515539169, 0.1536581814289093, 0.009080775082111359, 0.350625604391098, -0.17868654429912567, 0.12830814719200134, 0.04928990453481674, 0.010511413216590881, -0.04940010607242584, 0.028762757778167725, -0.09165725857019424, 0.20429165661334991, 0.13478124141693115, -0.005045069381594658, 0.24192973971366882, 0.09363649785518646, 0.02643592096865177, 0.10547246038913727, 0.35113775730133057, -0.1025473102927208, -0.13761815428733826, 0.10596419125795364, 0.061912909150123596, 0.00039265304803848267, 0.030500978231430054, 0.35132890939712524, -0.3165653347969055, 0.19782701134681702, -0.24129904806613922, -0.3331829011440277, 0.045585669577121735, 0.30432623624801636, -0.012322898954153061, -0.021241525188088417, -0.3853442370891571, 0.2969503700733185, -0.009841613471508026, -0.2293732464313507, 0.23582273721694946, 0.042807262390851974, -0.36184149980545044, -0.43481287360191345, 0.14320991933345795, 0.3710162937641144, -0.15109184384346008, -0.046067364513874054, -0.22884097695350647, -0.09164583683013916, 0.19467990100383759, 0.024195104837417603, -0.19112244248390198, 0.15660898387432098, -0.16040295362472534, 0.397912859916687, 0.2775176465511322, -0.5502753853797913, -0.1308833360671997, 0.6243047118186951, -0.1583007574081421, -0.03365948051214218, 0.17029768228530884, 0.10027813911437988, 0.48076102137565613, -0.01707252860069275, 0.1927349865436554, 0.23035942018032074, -0.2431735396385193, 0.2144077867269516, -0.14298269152641296, -0.3757076561450958, 0.17523589730262756, 0.26123520731925964, 0.10613080859184265, -0.0013779737055301666, 0.11402930319309235, -0.4068240821361542, 0.3260854482650757, 0.0666869580745697, 0.23042070865631104, 0.019938934594392776, -0.15074633061885834, 0.1852077841758728, -0.16993677616119385, -0.3078530430793762, -0.3379085063934326, 0.2862449288368225, 0.24640925228595734, -0.06291165947914124, 0.12816593050956726, -0.21195420622825623, -0.012508150190114975, -0.05863918736577034, -0.020308468490839005, -0.1422463357448578, 0.19562698900699615, -0.1325892060995102, 0.04866957664489746, -0.02185247838497162, -0.21617037057876587, 0.2504708766937256, -0.05686718970537186, -0.017858119681477547, -0.0178754273802042, 0.2342010736465454, -0.059170499444007874, -0.11990290880203247, -0.014277227222919464, -0.10077078640460968, -0.044014688581228256, -0.08718791604042053, -0.031138557940721512, 0.21832019090652466, -0.07728485763072968, 0.2661677598953247, 0.09233441948890686, 0.42192381620407104, 0.4063408672809601, 0.2053278684616089, 0.2344864308834076, -0.09885099530220032, 0.0871955007314682, -0.25112318992614746, -0.14901921153068542, 0.38715001940727234, -0.312134325504303, 0.1608075052499771, 0.052391864359378815, 0.10636650770902634, 0.05748211592435837, 0.10627630352973938, 0.03241343796253204, 0.17425039410591125, 0.03930043801665306, 0.09865063428878784, 0.3264240026473999, -0.07268857955932617, -0.19896337389945984, 0.2561667859554291, 0.11130057275295258, -0.09040160477161407, 0.03239971399307251, 0.12829428911209106, 0.08027483522891998, -0.0853067934513092, 0.3891313970088959, 0.5271438360214233, 0.4409778118133545, 0.18131503462791443, 0.10285158455371857, 0.0008426867425441742, 0.40723925828933716, -0.0840216726064682, 0.1652262955904007, 0.1848992258310318, 0.2512831389904022, 0.22632649540901184, 0.06953011453151703, 0.07436282932758331, 0.0634981244802475, -0.4154825210571289, 0.25245967507362366, -0.0855870246887207, 0.11114512383937836, -0.03377431631088257, -0.010507211089134216, -0.1132575273513794, -0.02155236154794693, 0.20741933584213257, -0.13440638780593872, -0.23564408719539642, -0.15297435224056244, 0.42057347297668457, -0.1782383769750595, 0.057303719222545624, -0.12333136051893234, 0.040629953145980835, -0.21293073892593384, -0.2757064700126648, -0.3397775888442993, -0.11842475831508636, 0.09577611088752747, 0.14721161127090454, 0.12138178944587708, -0.12509721517562866, 0.3890809118747711, 0.11483737081289291, -0.0034603364765644073, -0.396960973739624, 0.025787517428398132, 0.09773673117160797, -0.16738560795783997, -0.10628557205200195, 0.2605154812335968, -0.011735383421182632, 0.04020296037197113, -0.36617401242256165, 0.07376314699649811, -0.25497710704803467, -0.08395978063344955, -0.38709279894828796, 0.08754919469356537, -0.010483771562576294, -0.20153594017028809, -0.31872981786727905, -0.7220634818077087, -0.5527968406677246, 0.39846566319465637, -0.16173002123832703, 0.3187112510204315, -0.34685856103897095, 0.033426906913518906, -0.0761311799287796, 0.25640949606895447, -0.21431225538253784, 0.023931562900543213, -0.2946951389312744, 0.08776123076677322, -0.16897353529930115, -0.06315365433692932, -0.11506067961454391, -0.05946783348917961, 0.14327779412269592, 0.11957059055566788, 0.03820525109767914, -0.20825259387493134, -0.10185910761356354, 0.5525829792022705, -0.08658557385206223, 0.11103188246488571, 0.3502112627029419, 0.2353721559047699, -0.08714304119348526, 0.07810238003730774, -0.0518852099776268, -0.07466746866703033, 0.2494441419839859, -0.12758563458919525, 0.376491516828537, 0.31645843386650085, 0.08303826302289963, 0.8935316205024719, -0.08348671346902847, 0.1168079599738121, 0.3303074240684509, -0.006576274521648884, -0.2074853479862213, -0.08057510852813721, -0.38343650102615356, -0.09425012767314911, -0.39490455389022827, -0.034829746931791306, 0.1542319357395172, -0.12482835352420807, -0.45995286107063293, -0.10685396939516068, -0.19407270848751068, -0.3720182776451111, -0.10790890455245972, 0.17332781851291656, -0.19518627226352692, 0.10886649042367935, -0.15232136845588684, -0.10071240365505219, -0.32058173418045044, 0.08564920723438263, -0.05750406160950661, 0.06475339084863663, 0.21340127289295197, -0.18567590415477753, 0.024159081280231476, 0.25942474603652954, -0.7076820135116577, 0.10108985006809235, 0.20935456454753876, -0.18362359702587128, 0.019086673855781555, -0.03627233952283859, 0.011979274451732635, -0.20360121130943298, 0.7390056848526001, -0.24254590272903442, -0.09998203814029694, 0.06743209064006805, -0.3976762592792511, 0.12301751971244812, -0.08442690968513489, -0.13991563022136688, 0.25334885716438293, 0.46218934655189514, 0.21974043548107147, -0.17840325832366943, -0.24809518456459045, -0.11426012963056564, -0.16836532950401306, 0.02327956259250641, -0.2387387454509735, -0.03950100019574165, -0.1266641616821289, -0.49738049507141113, 0.07688824832439423, 0.30627357959747314, -0.007782924920320511, -0.27357739210128784, -0.11148689687252045, 0.2911900579929352, 0.13560360670089722, 0.1241450309753418, 0.03221530839800835, -0.05310404300689697, -0.08472584933042526, 0.19402892887592316, 0.19672128558158875, -0.08815781772136688, -0.007390378043055534, 0.07848481088876724, -0.2712467312812805, -0.06124235317111015, 0.2077336609363556, -0.09738947451114655, 0.14714980125427246, 0.1223139762878418, 0.12822604179382324, 0.12619031965732574, -0.08643357455730438, 0.04156866669654846, -0.45691901445388794, -0.12115578353404999, 0.09685517102479935, 0.042193152010440826, -0.035644177347421646, -0.672805905342102, 0.33928149938583374, 0.14797639846801758, -0.18885229527950287, 0.45707300305366516, -0.3995767831802368, -0.07116676867008209, 0.25256919860839844, 0.07908915728330612, 0.7200572490692139, -0.06220982223749161, 0.11931008100509644, -0.022866960614919662, -0.07479172945022583, 0.4006318747997284, -0.5525040626525879, 0.2957509756088257, -0.38108378648757935, -0.021333804354071617, -0.06078339368104935, 0.032394543290138245, -0.023261163383722305, 0.4394165575504303, -0.20540741086006165, 0.2979500889778137, 0.19426879286766052, -0.016082461923360825, -0.08233251422643661, 0.5173023343086243, -0.32524991035461426, -0.3770463764667511, 0.05959060788154602, 0.201063871383667, 0.052153486758470535, 0.05822255462408066, -0.304606556892395, -0.22948579490184784, 0.19024792313575745, -0.0718848705291748, -0.32698893547058105, -0.06097591295838356, -0.11897225677967072, 0.4369303286075592, -0.3625031113624573, 0.006260380148887634, 0.24155184626579285, 0.378010094165802, -0.3119589388370514, -0.2276109904050827, -0.09056517481803894, -0.05605223774909973, -0.06551536172628403, 0.32640203833580017, -0.06392619758844376, -0.23998300731182098, 0.22931987047195435, -0.17262426018714905, -0.3699009418487549, -0.12070392072200775, -0.05591382831335068, -0.3664458692073822, -0.09987697750329971, 0.32641446590423584, 0.24232563376426697, -0.12727224826812744, -0.0694824680685997, 0.002624139189720154, -0.27427417039871216, -0.0853789672255516, 0.14226390421390533, 0.00044505298137664795, -0.10287649929523468, 0.2718196213245392, -0.2506661117076874, 0.027899086475372314, 0.0002716383896768093, 0.24646620452404022, 0.016440412029623985, -0.10748293250799179, 0.03690439835190773, 0.09720071405172348, -0.27772408723831177, -0.26130741834640503, -0.14467352628707886, -0.17535752058029175, 0.0038881823420524597, 0.18439827859401703, -0.28040820360183716, -0.163894921541214, 0.05734420567750931, -0.009974762797355652, 0.21938101947307587, 0.08827108144760132, -0.05634696036577225, -0.21906712651252747, -0.2768523693084717, 0.12831246852874756, -0.16632752120494843, 0.16674774885177612, 0.13166099786758423, -0.2148643434047699, 0.23117411136627197, 0.10481934994459152, -0.4046506881713867, 0.16540862619876862, -0.10803042352199554, -0.1298573911190033, 0.34040960669517517, -0.16204732656478882, -0.05167405307292938, 0.10279175639152527, 0.11688213795423508, 0.19392916560173035, -0.19173425436019897, -0.254584938287735, 0.010175980627536774, 0.09106940031051636, -0.12223158776760101, 0.00902833417057991, 0.10815444588661194, -0.04481390863656998, -0.31433671712875366, -0.16169971227645874, 0.19163203239440918, -0.10867306590080261, 0.001080155372619629, -0.04863268882036209, 0.3184109330177307, 0.25473618507385254, -0.24755814671516418, 0.34878385066986084, 0.10660264641046524, 0.1471293419599533, -0.1105920746922493, 0.3573503792285919, 0.28923922777175903, -0.09568046033382416, 0.07759267836809158, -0.04243342578411102, 0.48921579122543335, -0.0021637538447976112, 0.3699878752231598, 0.19930791854858398, -0.08787156641483307, 0.010769300162792206, 0.41366028785705566, 0.34209319949150085, 0.03149056434631348, 0.020792938768863678, 0.09789536893367767, 0.32038891315460205, -0.11541081964969635, -0.07539290934801102, 0.45943546295166016, 0.006958115845918655, 0.23582085967063904, 0.16276803612709045, 0.47813886404037476, 0.31296682357788086, -0.2136944681406021, 0.11655706912279129, 0.6591130495071411, -0.25106900930404663, 0.07921015471220016, -0.02510952576994896, 0.06720791757106781, 0.23254455626010895, 0.28498387336730957, 0.040091510862112045, 0.2414923757314682, 0.23299607634544373, -0.032471489161252975, 0.4995102882385254, 0.1909174621105194, -0.01970406249165535, 0.2345818430185318, -0.45677897334098816, 0.09033611416816711, -0.1713971495628357, -0.10789615660905838, 0.2566221356391907, 0.0726858377456665, 0.2741720378398895, -0.2897831201553345, -0.2545454502105713, -0.16382762789726257, 0.3370843231678009, -0.15050852298736572, -0.07095243036746979, 0.1672193706035614, -0.27339351177215576, -0.09698569774627686, 0.1275244951248169, 0.15421779453754425, -0.04612463712692261, 0.8957236409187317, -0.02535710483789444, 0.10446585714817047, -0.16930629312992096, -0.13381047546863556, 0.028717897832393646, 0.2914862632751465, -0.2956131100654602, -0.24372093379497528, 0.18596862256526947, -0.21619895100593567, -0.32102522253990173, 0.20938268303871155, 0.4342193901538849, 0.1844625473022461, -0.1549161970615387, -0.047660697251558304, -0.11390567570924759, 0.17292073369026184, -0.09953001141548157, 0.10005414485931396, -0.014324914664030075, 0.2511800527572632, 0.11296097934246063, 0.22275009751319885, -0.19778630137443542, -0.11658018827438354, 0.14742831885814667, -0.21512465178966522, -0.13658203184604645, 0.2246496081352234, 0.21431061625480652, -0.2100505530834198, 0.1249641552567482, 0.16634196043014526, -0.38614341616630554, 0.03705998882651329, 0.38506019115448, -0.21965497732162476, 0.09868569672107697, 0.0037312135100364685, 0.1269150972366333, 0.0394967757165432, 0.28032639622688293, 0.09011399745941162, 0.16488197445869446, -0.3415929675102234, 0.060002073645591736, -0.5071402788162231, -0.12967053055763245, 0.08987998962402344, 0.09698086231946945, -0.19129249453544617, 0.22896453738212585, 0.026574313640594482, 0.03770500794053078, -0.07212433218955994, -0.1553543657064438, 0.24572710692882538, 0.4792017340660095, -0.14950381219387054, 0.12331563979387283, -0.20696645975112915, 0.008547937497496605, 0.13608141243457794, -0.2535102963447571, 0.12401434779167175, -0.06300345063209534, 0.09928922355175018, -0.3253290355205536, -0.05960161238908768, 0.37904107570648193, -0.4898044466972351, 0.5167226195335388, 0.04504374414682388, 0.4119322597980499, -0.28908059000968933, -0.09824606776237488, 0.032964035868644714, 0.06266362220048904, -0.06126326695084572, -0.07351931929588318, 0.020175538957118988, 0.04682055115699768, -0.25288093090057373, 0.19389964640140533, -0.4249997138977051, 0.13749997317790985, -0.11059103906154633, 0.09134037792682648, -0.29280295968055725, -0.17527857422828674, -0.02740587294101715, 0.01844070479273796, 0.04919657111167908, 0.40693366527557373, -0.02074054256081581, 0.032352015376091, -0.31537896394729614, -0.21850815415382385, 0.1445312649011612, -0.35936614871025085, -0.20460660755634308, -0.43826279044151306, 0.12068935483694077, 0.1923118531703949, 0.4876784682273865, -0.4720398783683777, -0.13770925998687744, 0.20604190230369568, -0.07722935080528259, -0.097724050283432, 0.30347496271133423, 0.02332882210612297, -0.3137884736061096, -0.15338438749313354, -0.10804673284292221, -0.1940971314907074, -0.21793237328529358, -0.01592446118593216, -0.31200456619262695 ]
https://github.com/huggingface/datasets/issues/5798
Indeed I think the current use of multiprocessing.Pool in `map_nested` can be rewritten to work like `sparkContext.parallelize` - without splitting the iterable. Maybe from the user's perspective it's ok to let multiprocessing.Pool or spark distribute the load on their own, as long as it takes a list and runs jobs in parallel in the end :)
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
56
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Indeed I think the current use of multiprocessing.Pool in `map_nested` can be rewritten to work like `sparkContext.parallelize` - without splitting the iterable. Maybe from the user's perspective it's ok to let multiprocessing.Pool or spark distribute the load on their own, as long as it takes a list and runs jobs in parallel in the end :)
[ -0.5608075261116028, -0.2904577851295471, -0.28479528427124023, 0.12091349065303802, -0.09748193621635437, 0.04721705615520477, 0.4310897886753082, 0.21069492399692535, 0.3261694312095642, 0.09282231330871582, -0.1244276836514473, 0.477003812789917, -0.03488113731145859, 0.4295397102832794, -0.16103261709213257, -0.2587110996246338, 0.027434945106506348, -0.09138114750385284, -0.1547417789697647, 0.25483351945877075, -0.19481167197227478, 0.17782028019428253, -0.05463697761297226, -0.15856526792049408, -0.06994535773992538, -0.24685519933700562, -0.25267401337623596, 0.122529536485672, -0.02371184527873993, -0.28433045744895935, 0.08110158890485764, 0.4083636701107025, 0.12049660086631775, 0.39903631806373596, -0.00010061221109936014, -0.09662260115146637, 0.14407019317150116, 0.07907894253730774, -0.018549907952547073, -0.12183167040348053, 0.076915442943573, -0.4276859760284424, 0.16877557337284088, -0.24783551692962646, 0.15408261120319366, 0.19145619869232178, 0.016276687383651733, -0.07630248367786407, 0.30941566824913025, -0.29279881715774536, 0.26852864027023315, 0.20116116106510162, -0.19002172350883484, -0.004022624343633652, -0.12859323620796204, 0.016466006636619568, -0.10613836348056793, 0.3299317955970764, 0.5832134485244751, -0.18666663765907288, -0.3127666711807251, 0.1370125412940979, -0.321344256401062, 0.22310346364974976, 0.2531629800796509, -0.10477942228317261, -0.028363343328237534, -0.5346487760543823, -0.15885941684246063, 0.24811391532421112, 0.5210201144218445, -0.12504872679710388, -0.3279308080673218, -0.5734089612960815, -0.23545661568641663, -0.12212777882814407, -0.004256680607795715, 0.08426548540592194, -0.2643282413482666, 0.0640472024679184, -0.18846310675144196, -0.19235718250274658, 0.15564420819282532, -0.19875210523605347, 0.0425439327955246, 0.5377487540245056, -0.04497981444001198, 0.026352914050221443, 0.3189997971057892, 0.16014423966407776, 0.14398017525672913, -0.18649575114250183, 0.3180122375488281, 0.014765210449695587, -0.48562222719192505, -0.1037115603685379, -0.08643472194671631, -0.321677565574646, 0.16725552082061768, 0.16549038887023926, 0.2667924761772156, 0.05175856500864029, 0.12516483664512634, 0.23967251181602478, 0.27548035979270935, -0.10342984646558762, -0.11155617237091064, -0.12902210652828217, 0.18816305696964264, 0.01191752403974533, 0.09072482585906982, 0.02017989382147789, 0.054406411945819855, -0.056137815117836, -0.28191784024238586, 0.26892778277397156, -0.20417433977127075, 0.32486820220947266, -0.18761886656284332, -0.30748531222343445, 0.1304667741060257, -0.20536097884178162, 0.02887120470404625, 0.16483695805072784, -0.0012330859899520874, 0.43829545378685, -0.24998685717582703, 0.1735018789768219, 0.09632617980241776, -0.039098214358091354, -0.06177254766225815, -0.09389962255954742, -0.0426785871386528, 0.16132983565330505, 0.14269757270812988, -0.07894809544086456, 0.23931914567947388, 0.09745495766401291, 0.060103144496679306, 0.09108060598373413, 0.27574947476387024, -0.04981568828225136, -0.2774614095687866, 0.11789959669113159, -0.004462406039237976, 0.03981001675128937, 0.05520610138773918, 0.35355913639068604, -0.29111558198928833, 0.24032062292099, -0.29267236590385437, -0.38320478796958923, 0.07454858720302582, 0.2474290430545807, -0.014249961823225021, 0.010875875130295753, -0.42193639278411865, 0.20907609164714813, 0.13244350254535675, -0.10688630491495132, 0.19692526757717133, 0.09450052678585052, -0.37858718633651733, -0.35234951972961426, 0.12471912056207657, 0.3276391327381134, -0.035714928060770035, -0.017455875873565674, -0.36324870586395264, -0.08600413799285889, 0.1747339516878128, 0.1513354629278183, -0.08081790804862976, 0.24597139656543732, -0.19921934604644775, 0.47209638357162476, 0.1463613212108612, -0.4727567434310913, -0.15009915828704834, 0.7374377250671387, -0.27102142572402954, 0.11784279346466064, 0.26930856704711914, 0.08930070698261261, 0.44544580578804016, -0.10908548533916473, 0.1711636483669281, 0.2822282314300537, -0.24135690927505493, 0.16948524117469788, -0.2809361219406128, -0.3441179394721985, 0.22128473222255707, 0.2828254699707031, 0.0611632838845253, 0.03795921429991722, 0.017591945827007294, -0.27661991119384766, 0.4275946319103241, 0.0736888125538826, 0.26129668951034546, 0.015394410118460655, -0.17310164868831635, 0.2552355229854584, -0.14788267016410828, -0.16512855887413025, -0.38329988718032837, 0.2719734311103821, 0.21179655194282532, -0.15102331340312958, 0.1379777491092682, -0.2568896412849426, -0.016603492200374603, -0.03475824370980263, -0.06104661524295807, -0.16076549887657166, 0.17696616053581238, -0.18800556659698486, -0.042804617434740067, -0.065249502658844, -0.18351078033447266, 0.3618411123752594, -0.058989472687244415, -0.012677641585469246, 0.0741020143032074, 0.2586023807525635, 0.06428446620702744, -0.05230151116847992, -0.007045216858386993, -0.03149823471903801, -0.02909848466515541, -0.12739123404026031, 0.0482918955385685, 0.20836468040943146, -0.18760810792446136, 0.24264883995056152, 0.10289907455444336, 0.32485276460647583, 0.37539374828338623, 0.1628129929304123, 0.16546519100666046, -0.22072890400886536, -0.01646784134209156, -0.27471575140953064, -0.09791833162307739, 0.3386523723602295, -0.4042142629623413, 0.2108193039894104, -0.06903895735740662, 0.10408821702003479, 0.04904410243034363, 0.02063620835542679, 0.02343374490737915, 0.19671009480953217, 0.061317116022109985, 0.07174637168645859, 0.26829370856285095, -0.028883088380098343, -0.269462525844574, 0.28554296493530273, 0.01729189231991768, 0.02333984524011612, 0.019726311787962914, 0.09973849356174469, 0.17711389064788818, -0.05240962281823158, 0.40718549489974976, 0.383101224899292, 0.3770182132720947, 0.21747808158397675, 0.20401521027088165, -0.053176045417785645, 0.43045321106910706, -0.08877263963222504, 0.09741430729627609, 0.100202277302742, 0.2814241051673889, 0.26181310415267944, -0.029900383204221725, 0.030038148164749146, 0.008835315704345703, -0.3225995898246765, 0.26775720715522766, -0.09808721393346786, 0.01673101633787155, -0.022061195224523544, 0.10565712302923203, -0.07816512137651443, 0.033197805285453796, 0.18879181146621704, -0.12339580804109573, -0.20479699969291687, -0.06996066123247147, 0.6284096837043762, -0.14720353484153748, -0.005087088793516159, 0.026024580001831055, 0.16157694160938263, -0.1890154629945755, -0.1982944756746292, -0.44800567626953125, 0.013824645429849625, 0.19155529141426086, 0.1660366952419281, 0.1550092250108719, -0.21546436846256256, 0.2710007131099701, 0.19710293412208557, -0.04364810883998871, -0.3228733241558075, 0.1381189525127411, 0.0449117086827755, -0.2535441517829895, -0.11680395156145096, 0.18917225301265717, 0.07751931250095367, 0.03180579096078873, -0.3907989263534546, 0.03911404311656952, -0.048419274389743805, -0.048715002834796906, -0.4201633632183075, 0.19870541989803314, 0.07426895201206207, -0.1476563662290573, -0.24114608764648438, -0.6871339678764343, -0.5803459286689758, 0.48405492305755615, -0.19087783992290497, 0.2445598542690277, -0.415828675031662, 0.04590105637907982, -0.1752735823392868, 0.23083847761154175, -0.38907140493392944, -0.01073189452290535, -0.39823657274246216, 0.035864923149347305, -0.213807612657547, 0.018649231642484665, -0.1057511493563652, 0.01684311032295227, 0.15636569261550903, 0.08834094554185867, -0.03805658966302872, -0.0839758887887001, 0.02183491550385952, 0.5643405318260193, -0.10296426713466644, 0.023725291714072227, 0.3068779408931732, 0.20668575167655945, -0.07733498513698578, 0.0831979513168335, 0.11135748028755188, -0.10405363142490387, 0.19142702221870422, -0.04590817168354988, 0.26645755767822266, 0.18063022196292877, 0.24293623864650726, 0.9302749037742615, -0.06400591135025024, 0.2559624910354614, 0.34561821818351746, 0.06713485717773438, -0.21779662370681763, 0.04580867290496826, -0.38091492652893066, -0.06821804493665695, -0.35748541355133057, -0.07637134194374084, 0.15344738960266113, -0.0786057710647583, -0.4441244602203369, -0.056782931089401245, -0.25588080286979675, -0.24661919474601746, -0.07298319041728973, 0.24822033941745758, -0.20799294114112854, 0.18170630931854248, -0.15641745924949646, -0.15005283057689667, -0.16921544075012207, 0.01825103536248207, -0.11735890060663223, -0.044346995651721954, 0.23277506232261658, -0.183965265750885, 0.12929153442382812, 0.20631742477416992, -0.6973894834518433, 0.07113029062747955, 0.1976686418056488, -0.2017737329006195, 0.007809802889823914, -0.005310021340847015, 0.08755194395780563, -0.11310581862926483, 0.8782020807266235, -0.24101145565509796, -0.02437230944633484, 0.009295523166656494, -0.4097209572792053, 0.1442066729068756, -0.08359639346599579, -0.03704816475510597, 0.24133363366127014, 0.48816537857055664, 0.3058493137359619, -0.225115567445755, -0.2492276430130005, -0.20984606444835663, -0.22975480556488037, -0.021387480199337006, -0.24098458886146545, -0.04228628799319267, -0.1674967110157013, -0.44052761793136597, 0.2509716749191284, 0.4410518407821655, 0.003098677843809128, -0.3484528064727783, -0.23811103403568268, 0.21295320987701416, 0.1144254058599472, 0.07149294763803482, -0.06528958678245544, -0.11977005004882812, -0.043054621666669846, 0.18961995840072632, 0.22750802338123322, -0.013354964554309845, 0.028226198628544807, 0.19222912192344666, -0.18221400678157806, 0.0544734001159668, 0.16783347725868225, -0.12888897955417633, 0.25126326084136963, 0.20911264419555664, 0.09448963403701782, 0.07592059671878815, 0.01172841340303421, 0.12126922607421875, -0.4330720901489258, -0.0687064528465271, 0.10990148037672043, 0.04166596010327339, -0.10123283416032791, -0.5593346357345581, 0.2875557839870453, 0.1055617406964302, -0.1161804273724556, 0.37143346667289734, -0.5347796082496643, -0.08278242498636246, 0.19591869413852692, 0.09813898056745529, 0.6926741600036621, -0.11455980688333511, 0.0649336576461792, -0.13041923940181732, 0.10913314670324326, 0.37971553206443787, -0.7363709807395935, 0.29134252667427063, -0.2872096300125122, -0.09238652884960175, -0.04896136373281479, 0.03190718591213226, -0.008122684434056282, 0.4274428188800812, -0.19588497281074524, 0.19490781426429749, 0.2422380894422531, -0.14411470293998718, -0.13268718123435974, 0.4895590543746948, -0.35910823941230774, -0.3874654173851013, 0.12803605198860168, 0.18130862712860107, 0.07418884336948395, 0.11536393314599991, -0.22396139800548553, -0.25117018818855286, 0.13375940918922424, -0.09680317342281342, -0.30553311109542847, -0.062259674072265625, -0.13434851169586182, 0.2818973660469055, -0.33081549406051636, -0.03363495320081711, 0.30753952264785767, 0.3323640823364258, -0.31374773383140564, -0.27256879210472107, -0.07500559836626053, -0.004480798728764057, -0.06468282639980316, 0.19435659050941467, -0.06734718382358551, -0.22082668542861938, 0.14135678112506866, -0.16723522543907166, -0.2965235710144043, -0.13625101745128632, -0.05515873804688454, -0.41780728101730347, 0.03078038990497589, 0.31016531586647034, 0.11306825280189514, -0.19661422073841095, -0.05735861137509346, 0.12886379659175873, -0.17695999145507812, -0.11080421507358551, 0.13617031276226044, 0.08446881175041199, -0.18986928462982178, 0.2926041781902313, -0.2184271514415741, 0.0019415020942687988, -0.048610929399728775, 0.2979675829410553, 0.026074502617120743, -0.07257158309221268, 0.014833491295576096, 0.12734799087047577, -0.18523648381233215, -0.23637819290161133, -0.1192731186747551, -0.1909947395324707, 0.049650028347969055, 0.1634739339351654, -0.23178325593471527, -0.18008649349212646, -0.042569324374198914, 0.040823712944984436, 0.2591032087802887, 0.06584399938583374, -0.15021900832653046, -0.18903033435344696, -0.20394623279571533, 0.10057729482650757, -0.15572276711463928, 0.12592877447605133, 0.016194596886634827, -0.13172200322151184, 0.25732412934303284, 0.09794770926237106, -0.37355053424835205, 0.07668151706457138, -0.18771210312843323, -0.15498489141464233, 0.5062455534934998, -0.0947771668434143, 0.04785623773932457, 0.057730745524168015, 0.11279322952032089, 0.20590068399906158, -0.1695256233215332, -0.2673739194869995, 0.07203426957130432, 0.07684051990509033, 0.028907455503940582, 0.06628204137086868, 0.06425776332616806, -0.00888022780418396, -0.2508862316608429, -0.12979215383529663, 0.2116861492395401, -0.17894919216632843, -0.06925182044506073, -0.029276547953486443, 0.1574963480234146, 0.35038429498672485, -0.31096816062927246, 0.33044469356536865, 0.08141754567623138, 0.03786583989858627, -0.15630128979682922, 0.3725738525390625, 0.3473016917705536, -0.07086411118507385, 0.0755762979388237, -0.06061634048819542, 0.4998091459274292, 0.047476574778556824, 0.3725581169128418, 0.19711163640022278, -0.13985341787338257, 0.029819123446941376, 0.41215190291404724, 0.3065156936645508, 0.10505962371826172, -0.06017748638987541, 0.08452396094799042, 0.3166753947734833, -0.06747429072856903, -0.022447528317570686, 0.4431329071521759, 0.03698654845356941, 0.20517249405384064, 0.20710164308547974, 0.5977274179458618, 0.2140076756477356, -0.26736462116241455, 0.12168684601783752, 0.6784157752990723, -0.1901925504207611, 0.11759249866008759, 0.00835992582142353, 0.01287936419248581, 0.2736033797264099, 0.30797094106674194, 0.02749677002429962, 0.21442684531211853, 0.2953588366508484, 0.06695083528757095, 0.3935539722442627, 0.21550503373146057, 0.08361034840345383, 0.1030287817120552, -0.4650060832500458, 0.11285889148712158, -0.2108471691608429, -0.009285133332014084, 0.12934032082557678, -0.006587579846382141, 0.3678585886955261, -0.3155718147754669, -0.33861401677131653, -0.19481179118156433, 0.34188657999038696, -0.2118859887123108, -0.01262308657169342, 0.12553787231445312, -0.25333550572395325, -0.10822316259145737, 0.03721799701452255, 0.14472496509552002, -0.061693236231803894, 0.8028809428215027, -0.051259350031614304, 0.09806221723556519, -0.12951283156871796, -0.07245218753814697, 0.07064919173717499, 0.30963045358657837, -0.3099631667137146, -0.22542940080165863, 0.04795566573739052, -0.2134118676185608, -0.2975076735019684, 0.2392825484275818, 0.38877490162849426, 0.12669245898723602, -0.09290578216314316, -0.10837225615978241, -0.22994914650917053, 0.21102274954319, -0.18799853324890137, 0.08182692527770996, -0.13638582825660706, 0.2503809332847595, 0.1601082980632782, 0.21170219779014587, -0.19387935101985931, -0.02008826844394207, 0.09154362976551056, -0.15079477429389954, -0.15483145415782928, 0.07188822329044342, 0.1768726259469986, -0.2494688630104065, 0.07617668807506561, 0.03240561485290527, -0.32320600748062134, 0.055878739804029465, 0.40578076243400574, -0.3588743507862091, 0.12323510646820068, -0.052558306604623795, 0.12639661133289337, 0.05728092044591904, 0.34200409054756165, 0.027702558785676956, 0.1491127610206604, -0.35110825300216675, 0.12804807722568512, -0.5166683197021484, -0.13343119621276855, -0.053907573223114014, 0.14941439032554626, -0.1353878527879715, 0.2344927191734314, 0.07522690296173096, 0.13057976961135864, -0.11017362773418427, -0.2543688714504242, 0.13222818076610565, 0.5304065346717834, -0.14651907980442047, 0.17703372240066528, -0.12230809032917023, 0.09943361580371857, 0.14527805149555206, -0.2107536941766739, 0.17041169106960297, -0.05790957435965538, 0.07745633274316788, -0.20561283826828003, -0.17171213030815125, 0.26269352436065674, -0.5235472917556763, 0.45785656571388245, 0.00524921715259552, 0.3284682333469391, -0.1988266110420227, -0.061286233365535736, 0.001896888017654419, -0.0047720931470394135, -0.10708001255989075, -0.08418811112642288, 0.06443476676940918, 0.044503189623355865, -0.3308219015598297, 0.2376232147216797, -0.4239848852157593, 0.18768101930618286, -0.027927719056606293, 0.10952123999595642, -0.21629005670547485, -0.15868601202964783, -0.11537137627601624, 0.05700686201453209, 0.07490843534469604, 0.40816837549209595, -0.03085651993751526, -0.05123716592788696, -0.3805614113807678, -0.2288326621055603, 0.044826194643974304, -0.26953524351119995, -0.21453920006752014, -0.4031285345554352, 0.19784966111183167, 0.36123836040496826, 0.43723997473716736, -0.2463708221912384, -0.19492202997207642, 0.19857922196388245, -0.08999762684106827, -0.035847753286361694, 0.22513775527477264, 0.005626510828733444, -0.3964430093765259, -0.15450334548950195, -0.2488202154636383, -0.23494431376457214, -0.20778405666351318, 0.022767670452594757, -0.31223222613334656 ]
https://github.com/huggingface/datasets/issues/5798
From your feedback, seems to me there are two paths to consider now for supporting spark's `map` function in `map_nested` now: 1. Keep the current `pool.map` implementation, and add an if statement for the spark's `map` code (which is what I did in my current PR) -- the code change is just a few lines in the `map_nested` function, and it has been tested by unit tests + manual testing on real Spark clusters; if you have other concerns I'd also be happy to address them. 2. Rewrite the current `pool.map` implementation to remove splitting the iterable, and we will still need to add an if statement to use either ```python with Pool(...) as pool: mapped = pool.map(_single_map_nested, iterable) ``` or ```python rdd = spark.sparkContext.parallelize(iterable) mapped = rdd.map(lambda obj: _single_map_nested((function, obj, types, None, True, None))).collect() ``` because there is no unified API that supports both `pool.map` and `rdd.map`. This can be more unified and flexible in the long run, but might require more work, and it will change the existing multiprocessing behavior, which is why I'm not leaning towards this option. Am I understanding correctly?
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
185
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. From your feedback, seems to me there are two paths to consider now for supporting spark's `map` function in `map_nested` now: 1. Keep the current `pool.map` implementation, and add an if statement for the spark's `map` code (which is what I did in my current PR) -- the code change is just a few lines in the `map_nested` function, and it has been tested by unit tests + manual testing on real Spark clusters; if you have other concerns I'd also be happy to address them. 2. Rewrite the current `pool.map` implementation to remove splitting the iterable, and we will still need to add an if statement to use either ```python with Pool(...) as pool: mapped = pool.map(_single_map_nested, iterable) ``` or ```python rdd = spark.sparkContext.parallelize(iterable) mapped = rdd.map(lambda obj: _single_map_nested((function, obj, types, None, True, None))).collect() ``` because there is no unified API that supports both `pool.map` and `rdd.map`. This can be more unified and flexible in the long run, but might require more work, and it will change the existing multiprocessing behavior, which is why I'm not leaning towards this option. Am I understanding correctly?
[ -0.473716676235199, -0.3848658800125122, -0.25377580523490906, 0.05113663896918297, -0.21205277740955353, -0.031120195984840393, 0.3600761890411377, 0.3059087097644806, 0.3719865083694458, -0.014005929231643677, -0.03372737765312195, 0.5151513814926147, -0.07134740054607391, 0.20039573311805725, -0.21842467784881592, -0.1687861979007721, 0.20008055865764618, -0.11382612586021423, 0.02369658835232258, 0.2988213002681732, -0.2886989712715149, 0.2678358852863312, -0.08448007702827454, -0.11145247519016266, 0.05882031470537186, -0.286598801612854, -0.2467435598373413, 0.07688648253679276, -0.21692097187042236, -0.2633149027824402, 0.04396162927150726, 0.46121007204055786, 0.16738271713256836, 0.4151838421821594, -0.00010798428411362693, -0.06747424602508545, 0.09378405660390854, -0.02375250682234764, 0.22478844225406647, -0.3067607283592224, 0.0946270003914833, -0.23554207384586334, 0.10844450443983078, -0.2878507077693939, 0.11726757138967514, 0.05937427282333374, 0.016017258167266846, -0.1475868821144104, 0.26493269205093384, -0.2477470338344574, 0.20229646563529968, 0.09808772802352905, -0.08612498641014099, 0.030386611819267273, -0.09969919919967651, 0.017269745469093323, -0.045071981847286224, 0.4655803442001343, 0.5077584981918335, -0.250692754983902, -0.3969937860965729, 0.12229369580745697, -0.3246386647224426, 0.06541827321052551, 0.35335686802864075, -0.0977880209684372, 0.07153449952602386, -0.6393730044364929, -0.1878652125597, 0.056107789278030396, 0.3288385272026062, -0.05747503042221069, -0.30260375142097473, -0.42320945858955383, -0.3734947144985199, -0.07042011618614197, 0.08987970650196075, -0.06585562974214554, -0.16124044358730316, 0.046632058918476105, -0.24937567114830017, -0.2049427330493927, 0.1465080976486206, -0.08134497702121735, -0.012890398502349854, 0.6657642126083374, 0.045874543488025665, 0.10971330106258392, 0.3463395833969116, 0.08525362610816956, 0.13262850046157837, -0.27331551909446716, 0.30808025598526, -0.03203453868627548, -0.2275809943675995, -0.11169831454753876, 0.08655853569507599, -0.32569169998168945, 0.14885705709457397, 0.08199582993984222, 0.2629571855068207, -0.008093906566500664, 0.10971173644065857, 0.2104644477367401, 0.2653760313987732, -0.15780091285705566, -0.007547713816165924, -0.09616772830486298, 0.19402992725372314, 0.0831136628985405, 0.17461726069450378, 0.015101345255970955, 0.08862568438053131, -0.10182604193687439, -0.350175678730011, 0.3554116487503052, -0.056108467280864716, 0.3278133273124695, 0.020484618842601776, -0.24223363399505615, -0.06301096081733704, -0.3604857325553894, 0.07346653938293457, 0.08980180323123932, 0.050132714211940765, 0.4407503604888916, -0.16771140694618225, 0.18241754174232483, 0.1451430767774582, 0.08921415358781815, 0.02877749130129814, -0.045815855264663696, -0.08383200317621231, 0.13122671842575073, 0.12249991297721863, 0.11143283545970917, 0.1944599151611328, 0.1768874228000641, 0.1005977913737297, 0.1535378396511078, 0.025643818080425262, -0.19807782769203186, -0.0025029256939888, -0.010411232709884644, -0.03270469605922699, 0.02289634197950363, 0.04408182203769684, 0.240554079413414, -0.18606439232826233, 0.29422739148139954, -0.20761092007160187, -0.4395958483219147, 0.10600616782903671, 0.16653813421726227, -0.05605509877204895, 0.09236820042133331, -0.5200506448745728, 0.46923747658729553, 0.09613277018070221, -0.3066313862800598, 0.24738414585590363, 0.07915063947439194, -0.49480414390563965, -0.4223552346229553, 0.16723428666591644, 0.29557985067367554, -0.10125327110290527, 0.1326165795326233, -0.34864285588264465, -0.029518304392695427, 0.10145513713359833, 0.05319114401936531, -0.266864150762558, 0.2776937782764435, -0.26819390058517456, 0.554354190826416, 0.14676706492900848, -0.4444776475429535, -0.1361275017261505, 0.7201322913169861, -0.1188097596168518, 0.09898198395967484, 0.2762604355812073, -0.12738382816314697, 0.5017022490501404, -0.1750558316707611, 0.24455392360687256, 0.006067465990781784, -0.20711153745651245, 0.09336832910776138, -0.28290829062461853, -0.26278138160705566, 0.3405168056488037, 0.09944428503513336, 0.12326047569513321, 0.010703030973672867, -0.07875482738018036, -0.32324326038360596, 0.37111231684684753, 0.09455221146345139, 0.1470441222190857, -0.0489390566945076, -0.030845221132040024, 0.050030097365379333, -0.2411351352930069, -0.1606348752975464, -0.41167792677879333, 0.33381083607673645, 0.18178008496761322, -0.0520126037299633, 0.13106505572795868, -0.08808369189500809, 0.12388552725315094, -0.042727429419755936, -0.007422741502523422, -0.09439282864332199, 0.16274245083332062, -0.23579451441764832, -0.04905451834201813, -0.24993835389614105, -0.2472280114889145, 0.07779771834611893, -0.03514763340353966, -0.058820754289627075, 0.05104516074061394, 0.23686173558235168, -0.03903951123356819, -0.07729201018810272, -0.035208478569984436, -0.07458087801933289, 0.09676675498485565, -0.08361294865608215, 0.09442481398582458, 0.26990997791290283, -0.21297959983348846, 0.1800999939441681, -0.0063588181510567665, 0.270679771900177, 0.43782371282577515, 0.09797732532024384, 0.079621322453022, -0.196550190448761, 0.07975460588932037, -0.2895723879337311, -0.1908806562423706, 0.276690810918808, -0.32551276683807373, 0.22750496864318848, -0.06939880549907684, -0.027335908263921738, -0.06780709326267242, 0.10811756551265717, -0.09366227686405182, 0.11141222715377808, -0.15312312543392181, 0.16988131403923035, 0.1788223683834076, -0.03858011215925217, -0.18022212386131287, 0.31973057985305786, 0.015232711099088192, 0.04871196299791336, -0.17517179250717163, 0.10429129749536514, 0.2624352276325226, -0.10725941509008408, 0.45468640327453613, 0.3689368963241577, 0.4672210216522217, 0.14427664875984192, 0.08520770817995071, -0.05028059333562851, 0.38115251064300537, -0.01067350059747696, 0.22437766194343567, 0.15692341327667236, 0.3010811507701874, 0.24473489820957184, 0.007800348103046417, 0.16532954573631287, -0.018725238740444183, -0.3584209978580475, 0.1753803789615631, -0.14566953480243683, -0.005694985389709473, -0.04206261783838272, 0.15946459770202637, -0.11916932463645935, 0.09026771783828735, 0.2689288556575775, -0.19646570086479187, -0.2143760621547699, -0.09067309647798538, 0.5478851795196533, -0.14579740166664124, 0.05214279145002365, 0.19973623752593994, 0.027612000703811646, -0.2708141803741455, -0.29063501954078674, -0.3641892671585083, -0.017679598182439804, 0.22489352524280548, 0.13446667790412903, 0.19428493082523346, -0.29604464769363403, 0.26897528767585754, 0.23832383751869202, -0.14329320192337036, -0.27101075649261475, -0.01782156527042389, 0.09329627454280853, -0.3822413980960846, -0.22627156972885132, 0.26342880725860596, 0.13801729679107666, -0.11058354377746582, -0.48690375685691833, 0.10906495153903961, -0.10708658397197723, -0.05047309026122093, -0.4373629093170166, 0.11836349219083786, -0.03622511401772499, -0.22642722725868225, -0.23451478779315948, -0.5457591414451599, -0.5668290257453918, 0.4037986993789673, -0.11425569653511047, 0.2535349130630493, -0.4626968204975128, 0.08635213226079941, -0.16290169954299927, 0.23689231276512146, -0.4719107747077942, -0.053001437336206436, -0.2755558490753174, 0.11906854808330536, -0.09847825765609741, 0.03386720269918442, 0.000753939151763916, -0.016622960567474365, 0.13895168900489807, 0.09652306139469147, -0.026766911149024963, -0.19846166670322418, 0.17176641523838043, 0.5344487428665161, 0.019736535847187042, -0.042522966861724854, 0.42332422733306885, 0.27978411316871643, -0.03631947562098503, 0.08394768089056015, -0.09523604810237885, -0.0051204487681388855, 0.35319215059280396, 0.003956951200962067, 0.5247676968574524, 0.2918568253517151, 0.25477921962738037, 1.084384560585022, 0.07790384441614151, 0.23842740058898926, 0.25558122992515564, 0.08948296308517456, -0.21522314846515656, 0.010402210056781769, -0.35239359736442566, -0.12165550142526627, -0.3815542459487915, -0.08962242305278778, 0.12388482689857483, -0.1855412721633911, -0.4896649420261383, -0.14393094182014465, -0.036575909703969955, -0.20713847875595093, -0.17913849651813507, 0.3693758249282837, -0.24717898666858673, 0.18615292012691498, -0.24907353520393372, -0.10808121412992477, -0.23251941800117493, 0.04550223797559738, -0.08334827423095703, -0.06755731999874115, 0.4269183874130249, -0.08735238015651703, 0.029938749969005585, 0.2646584212779999, -0.6922666430473328, 0.06580355018377304, 0.2754541039466858, -0.12373918294906616, 0.018763139843940735, -0.08551700413227081, -0.024833112955093384, -0.2504848539829254, 0.8171546459197998, -0.29746896028518677, -0.02307959832251072, 0.0651034563779831, -0.4153274893760681, 0.028266124427318573, -0.07744768261909485, -0.07136517763137817, 0.32731929421424866, 0.4990626573562622, 0.379883736371994, -0.2834618389606476, -0.1871236264705658, -0.22565093636512756, -0.2956385016441345, 0.08914293348789215, -0.29773151874542236, -0.025273025035858154, -0.04704270139336586, -0.3864084780216217, 0.16854402422904968, 0.5706577301025391, -0.03380510210990906, -0.19003170728683472, -0.1580207645893097, 0.42540988326072693, -0.04136565327644348, 0.10017317533493042, -0.03300033509731293, -0.028620343655347824, -0.09134344756603241, 0.08050324767827988, 0.3693172335624695, -0.10618690401315689, 0.0006145164370536804, 0.25720396637916565, -0.1732829362154007, 0.08705778419971466, 0.18131448328495026, -0.0006211660802364349, 0.245079904794693, 0.3919859528541565, 0.024852339178323746, 0.03433967009186745, 0.10484762489795685, 0.012085581198334694, -0.45159003138542175, -0.14716972410678864, 0.09988214820623398, -0.0932249128818512, -0.11028014868497849, -0.44379091262817383, 0.22494429349899292, 0.1531866490840912, -0.2039758861064911, 0.3451288640499115, -0.43282753229141235, -0.21862676739692688, 0.4324400722980499, 0.03346174955368042, 0.7790173292160034, 0.042128533124923706, -0.09364999830722809, 0.04493642970919609, 0.19299077987670898, 0.16563689708709717, -0.6575810313224792, 0.2537823021411896, -0.2293923795223236, 0.08311089873313904, -0.12419737875461578, 0.039774082601070404, -0.01754060387611389, 0.45092421770095825, -0.2593485414981842, 0.22308911383152008, 0.33983972668647766, 0.13816821575164795, -0.08155801892280579, 0.5104302167892456, -0.17838376760482788, -0.31989890336990356, 0.10402370989322662, 0.08206960558891296, 0.0027491915971040726, 0.036574773490428925, -0.1439342498779297, -0.37175121903419495, 0.0421847403049469, -0.22065573930740356, -0.35392361879348755, -0.2226613461971283, -0.25376778841018677, 0.26634934544563293, -0.3387027084827423, 0.013161987066268921, 0.3876335620880127, 0.4817926287651062, -0.39054909348487854, -0.23560726642608643, -0.06466317176818848, -0.0724937841296196, 0.15012957155704498, 0.21015122532844543, -0.1441904604434967, -0.21822896599769592, 0.022594956681132317, -0.15384146571159363, -0.22201277315616608, -0.1854316145181656, -0.17627276480197906, -0.356920063495636, -0.24167904257774353, 0.28594401478767395, 0.22484561800956726, -0.26409587264060974, -0.09525196254253387, 0.13655897974967957, -0.28946417570114136, -0.04109923914074898, 0.077115498483181, 0.02623414248228073, 0.001839134842157364, 0.17669923603534698, -0.17289914190769196, 0.11840841174125671, 0.011500393971800804, 0.34851205348968506, -0.046220917254686356, 0.036749742925167084, -0.22528284788131714, 0.04315997660160065, -0.2501468062400818, -0.11865629255771637, -0.1710204780101776, -0.22029131650924683, 0.022898361086845398, 0.11052334308624268, -0.2066972702741623, -0.16771571338176727, -0.07757072895765305, 0.012619955465197563, 0.3798966407775879, 0.12808901071548462, -0.08231691271066666, -0.033986181020736694, -0.21034389734268188, 0.28179481625556946, -0.1901739537715912, 0.06968961656093597, 0.10251110792160034, -0.19114351272583008, 0.21377527713775635, 0.0665576383471489, -0.32062891125679016, 0.09079161286354065, -0.0313892737030983, -0.13226251304149628, 0.36705920100212097, -0.19966751337051392, -0.021794218569993973, -0.08624148368835449, 0.08621545881032944, 0.20325438678264618, -0.27643632888793945, -0.17473168671131134, 0.13601845502853394, 0.11332738399505615, 0.1279696822166443, -0.033738721162080765, 0.07528021186590195, -0.07642766833305359, -0.19048158824443817, -0.10148471593856812, 0.1288203001022339, -0.17425522208213806, -0.06680136919021606, -0.14172393083572388, 0.20462444424629211, 0.23116321861743927, -0.31041911244392395, 0.26199647784233093, 0.06394869089126587, 0.16878753900527954, -0.11101794242858887, 0.41626277565956116, 0.284799188375473, -0.17236949503421783, 0.10796371102333069, -0.01096009835600853, 0.36540964245796204, 0.17563408613204956, 0.4661910831928253, 0.26269280910491943, -0.07725457847118378, -0.01592918485403061, 0.42461463809013367, 0.28601306676864624, -0.057367272675037384, 0.022629275918006897, -0.08015692979097366, 0.2580500841140747, -0.06052558124065399, 0.044046033173799515, 0.562568724155426, 0.1168658658862114, 0.28542470932006836, 0.25686395168304443, 0.679659366607666, 0.16277533769607544, -0.21829597651958466, 0.14680305123329163, 0.6439697742462158, -0.22532731294631958, 0.0678531676530838, -0.051975034177303314, -0.061292752623558044, 0.3024385869503021, 0.3023914694786072, 0.002712015062570572, 0.22698692977428436, 0.22482962906360626, 0.1198917105793953, 0.36358097195625305, 0.34131354093551636, 0.03669287636876106, 0.2687321901321411, -0.42941945791244507, 0.2127099335193634, -0.19240674376487732, 0.07973715662956238, 0.13034243881702423, 0.1815250664949417, 0.3305562138557434, -0.34898999333381653, -0.4376119375228882, 0.02756699174642563, 0.1900547593832016, -0.2545808255672455, 0.020593706518411636, 0.08211315423250198, -0.2584727704524994, -0.17093980312347412, 0.08327480405569077, -0.03493137285113335, -0.15149906277656555, 0.8365586996078491, -0.042763590812683105, 0.024159768596291542, 0.02194434218108654, -0.23028716444969177, -0.1397429257631302, 0.37208765745162964, -0.22090135514736176, -0.04576294869184494, 0.14526963233947754, -0.1354265809059143, -0.26064223051071167, 0.29938384890556335, 0.4252610504627228, 0.14514997601509094, -0.10962194204330444, -0.07042012363672256, -0.03254437819123268, 0.11004450917243958, -0.151714026927948, -0.07880313694477081, -0.06641271710395813, 0.28235921263694763, 0.15034694969654083, 0.1912463903427124, -0.1115674376487732, 0.005026004742830992, 0.09914569556713104, -0.09250791370868683, 0.017529185861349106, 0.09950222074985504, 0.15663433074951172, -0.2378983497619629, 0.3732326030731201, -0.022407129406929016, -0.2482914924621582, -0.017251791432499886, 0.32831093668937683, -0.2288675755262375, 0.18042954802513123, 0.07684668898582458, 0.09889452159404755, 0.21801507472991943, 0.12937107682228088, -0.1043328046798706, 0.004276473540812731, -0.4516126811504364, 0.1341712474822998, -0.41477951407432556, -0.23053988814353943, 0.10558931529521942, 0.3065056800842285, -0.08833667635917664, 0.13392052054405212, 0.22635982930660248, 0.22113099694252014, -0.08207132667303085, -0.4448049068450928, -0.009947169572114944, 0.518082320690155, -0.07819712907075882, 0.2334858477115631, 0.023794099688529968, 0.1156943216919899, 0.15801700949668884, -0.11672528088092804, 0.19536738097667694, -0.056449826806783676, 0.05594080686569214, -0.25548750162124634, -0.19725628197193146, 0.19876456260681152, -0.5826045870780945, 0.4417765736579895, 0.07031603157520294, 0.26293066143989563, -0.22536316514015198, -0.06526768952608109, 0.04608997330069542, 0.15555384755134583, -0.05985080450773239, 0.1098327785730362, -0.007454314269125462, 0.22526542842388153, -0.31715840101242065, 0.12342801690101624, -0.36416953802108765, 0.00731363520026207, -0.11849085986614227, 0.09451562166213989, -0.4206054210662842, -0.03321275860071182, -0.14454972743988037, 0.051802050322294235, -0.06455504894256592, 0.46896839141845703, -0.056322332471609116, 0.010429903864860535, -0.4215015769004822, -0.1955934464931488, 0.020500384271144867, -0.319874107837677, -0.1695765256881714, -0.1440511792898178, 0.048365477472543716, 0.37210091948509216, 0.6134577989578247, -0.4628989100456238, -0.3771379590034485, 0.13953572511672974, -0.1639212816953659, -0.10316862165927887, 0.08280730247497559, 0.06358833611011505, -0.35544994473457336, -0.1891876459121704, -0.22415275871753693, -0.2003525346517563, -0.33292293548583984, 0.018336839973926544, -0.3207937777042389 ]
https://github.com/huggingface/datasets/issues/5798
Yup correct ! I think it's a nice path because it would be possible for users to define whatever parallel processing backend they want. I think we still need to discuss how that would look like in the `datasets` API : how to specify it has to use the "spark" parallel backend ? And how to specify the spark session parameters (number of executors etc.) ? Maybe there is something more practical than `use_spark=True` I'll check with the team internally if they have some ideas, but feel free to share your thoughts here !
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
94
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Yup correct ! I think it's a nice path because it would be possible for users to define whatever parallel processing backend they want. I think we still need to discuss how that would look like in the `datasets` API : how to specify it has to use the "spark" parallel backend ? And how to specify the spark session parameters (number of executors etc.) ? Maybe there is something more practical than `use_spark=True` I'll check with the team internally if they have some ideas, but feel free to share your thoughts here !
[ -0.36371368169784546, -0.18536823987960815, -0.2672674059867859, 0.06818731129169464, -0.1409541815519333, -0.04652605950832367, 0.3026992678642273, 0.2803654372692108, 0.24448606371879578, 0.01529906690120697, 0.05880527198314667, 0.49277788400650024, -0.07215771824121475, 0.5174586772918701, -0.032247696071863174, -0.3423739969730377, 0.05129051208496094, -0.08183883130550385, -0.16983535885810852, 0.17260852456092834, -0.14714495837688446, 0.12102903425693512, -0.03199973702430725, -0.12300489842891693, -0.14526495337486267, -0.2056002914905548, -0.15836702287197113, 0.1424911469221115, -0.3259289562702179, -0.25094807147979736, -0.04152562469244003, 0.31986063718795776, 0.058931853622198105, 0.5063010454177856, -0.00010283831943525001, -0.2615838646888733, 0.16600516438484192, 0.07189556956291199, -0.10362748801708221, -0.23927946388721466, -0.19175443053245544, -0.35923147201538086, 0.15336957573890686, -0.23855647444725037, 0.06853683292865753, 0.10342644155025482, -0.010799018666148186, -0.07838117331266403, 0.1781986802816391, -0.07539252936840057, 0.2609274685382843, 0.10585220158100128, -0.15125370025634766, -0.02607215940952301, -0.06255651265382767, 0.3051580786705017, -0.21932391822338104, 0.16077843308448792, 0.4749855697154999, -0.20156630873680115, -0.2723751664161682, 0.1074695736169815, -0.22483371198177338, 0.15963521599769592, 0.44518813490867615, -0.033391840755939484, -0.05124050751328468, -0.49872153997421265, -0.13027256727218628, 0.21637870371341705, 0.8248546123504639, -0.1387426257133484, -0.49819833040237427, -0.4723603427410126, -0.28297722339630127, -0.05437900125980377, -0.08750572055578232, 0.08095171302556992, -0.28804197907447815, 0.06033380329608917, -0.14956822991371155, -0.23046475648880005, 0.030905768275260925, -0.0060899704694747925, 0.10286714136600494, 0.5914021730422974, 0.008126046508550644, 0.06880193948745728, 0.24621839821338654, 0.2485235333442688, 0.10331246256828308, -0.14692731201648712, 0.36164647340774536, -0.02202259749174118, -0.3648780286312103, -0.05485306307673454, -0.0012674294412136078, -0.18931430578231812, 0.28119054436683655, 0.3347712755203247, 0.21618278324604034, 0.04708924517035484, -0.06438861042261124, 0.18107947707176208, 0.14380444586277008, 0.021413244307041168, -0.0928700864315033, -0.11686904728412628, 0.3356668949127197, 0.00844172015786171, 0.29992032051086426, 0.08812844753265381, -0.038874443620443344, -0.11136269569396973, -0.4182702600955963, 0.2142622023820877, -0.043703414499759674, 0.20531466603279114, -0.1016751155257225, -0.1831280142068863, 0.30963239073753357, -0.21178069710731506, -0.05875341594219208, 0.09685312211513519, -0.10402584075927734, 0.3038916289806366, -0.19163307547569275, 0.13363970816135406, 0.08580891788005829, -0.02325998619198799, -0.04606682434678078, -0.09358005225658417, -0.2135028839111328, 0.1567462980747223, 0.1588214635848999, 0.01517246663570404, 0.33701637387275696, 0.10303366184234619, 0.09215588122606277, 0.12219678610563278, 0.45361942052841187, 0.05961105599999428, -0.2546043395996094, 0.10982823371887207, -0.127003014087677, 0.013855747878551483, 0.05513475462794304, 0.34343838691711426, -0.30153006315231323, 0.2946036756038666, -0.12042739987373352, -0.37859833240509033, -0.10443700104951859, 0.24988628923892975, -0.11581052094697952, -0.07618194818496704, -0.477001428604126, 0.22154216468334198, 0.021375466138124466, -0.03627777099609375, 0.3749687075614929, 0.20169955492019653, -0.2626408636569977, -0.30610913038253784, 0.08521032333374023, 0.41682931780815125, -0.3011757731437683, 0.03730583190917969, -0.2382703423500061, -0.19340293109416962, 0.04746021330356598, 0.1211274042725563, -0.13681507110595703, 0.06684131920337677, -0.1698867678642273, 0.229228213429451, 0.2872111201286316, -0.49467188119888306, -0.08534655719995499, 0.5642865300178528, -0.2525181472301483, -0.017048679292201996, 0.3647614121437073, 0.1749863177537918, 0.40473660826683044, -0.02151087485253811, 0.19101737439632416, 0.3116711676120758, -0.2450680434703827, 0.15745022892951965, -0.3765185475349426, -0.4633524715900421, 0.25467821955680847, 0.3595520853996277, 0.11132492870092392, -0.03319058567285538, 0.06630899012088776, -0.43390005826950073, 0.303778737783432, 0.19795310497283936, 0.1599365472793579, -0.14571470022201538, -0.07010382413864136, 0.2245243936777115, 0.0031698718667030334, 0.021621830761432648, -0.398757666349411, 0.12122277170419693, 0.25834035873413086, 0.14923138916492462, 0.20082339644432068, -0.29777440428733826, -0.14362695813179016, -0.09432259202003479, -0.08371362835168839, -0.172754168510437, 0.16434243321418762, -0.2652531564235687, -0.1525324136018753, 0.028940826654434204, -0.2609477937221527, 0.4641887843608856, -0.11035853624343872, 0.051935065537691116, -0.12494570016860962, 0.231733039021492, -0.05956162512302399, 0.09251371026039124, -0.07812158018350601, -0.009170323610305786, -0.043451763689517975, -0.07041061669588089, 0.01654868945479393, 0.1882694512605667, 0.0009421072900295258, 0.3624434173107147, 0.2284342348575592, 0.41774579882621765, 0.44986143708229065, 0.19285689294338226, 0.24867701530456543, -0.09294737130403519, 0.05520987883210182, -0.20980647206306458, -0.16030120849609375, 0.21181446313858032, -0.46334129571914673, 0.050790734589099884, -0.10756631940603256, 0.13384190201759338, 0.0811120793223381, 0.05885904282331467, -0.2262745201587677, 0.29398202896118164, 0.11927767097949982, -0.012252840213477612, 0.17141695320606232, 0.08658701181411743, -0.24919679760932922, 0.2557435631752014, 0.09028035402297974, 0.03337020426988602, 0.058792974799871445, 0.13863056898117065, 0.11293168365955353, -0.13980506360530853, 0.440268874168396, 0.4751528203487396, 0.3577185273170471, 0.2841728627681732, 0.08534346520900726, -0.04728446155786514, 0.3794110119342804, -0.09433025121688843, 0.10055902600288391, 0.25589510798454285, 0.1427009403705597, 0.2540099322795868, -0.11883628368377686, 0.100925974547863, 0.12863025069236755, -0.47770148515701294, 0.29193925857543945, 0.0560465082526207, -0.10449077188968658, -0.09778672456741333, 0.16876596212387085, -0.187715083360672, 0.07430849224328995, -0.0500018373131752, -0.010841429233551025, -0.1920045018196106, 0.04158297926187515, 0.3146321773529053, -0.23664481937885284, 0.13380873203277588, -0.09897133708000183, 0.33908721804618835, -0.2952081561088562, -0.2966383397579193, -0.48938441276550293, -0.07948746532201767, 0.11264831572771072, 0.16824710369110107, 0.20898893475532532, 0.014664657413959503, 0.34987154603004456, 0.11515152454376221, -0.088762566447258, -0.41728800535202026, -0.09665855765342712, 0.017804380506277084, -0.1845417320728302, 0.05666755139827728, 0.3148234486579895, 0.0441824272274971, 0.0909639298915863, -0.41802525520324707, -0.0555671788752079, -0.05311695113778114, 0.037141576409339905, -0.45791512727737427, 0.14352616667747498, -0.044623978435993195, -0.10428270697593689, -0.30840545892715454, -0.6087992191314697, -0.602652370929718, 0.4614432156085968, -0.1002330482006073, 0.19703739881515503, -0.3696773946285248, 0.10373888909816742, -0.11455550789833069, 0.27847132086753845, -0.3649781346321106, -0.05997087061405182, -0.4548201560974121, 0.06541019678115845, -0.29555371403694153, -0.029311247169971466, -0.010691799223423004, 0.11515921354293823, 0.21756164729595184, -0.04469318315386772, -0.012518756091594696, -0.3454129695892334, 0.0034569893032312393, 0.520361065864563, -0.09962388128042221, 0.06050588935613632, 0.3772546648979187, 0.13199383020401, -0.1007966622710228, 0.18637782335281372, -0.09107263386249542, -0.1009097620844841, 0.05376492068171501, 0.05732056498527527, 0.1662212610244751, 0.21995940804481506, 0.26126521825790405, 0.9560853242874146, -0.09659674018621445, 0.13861681520938873, 0.26243022084236145, 0.20485661923885345, -0.12676836550235748, -0.09669190645217896, -0.37592005729675293, -0.020421316847205162, -0.27344146370887756, -0.20867416262626648, 0.08730783313512802, -0.06340071558952332, -0.28708013892173767, -0.15153545141220093, -0.31049472093582153, -0.2990662157535553, -0.001810617744922638, 0.2349211871623993, -0.26970136165618896, 0.09649929404258728, -0.1729167401790619, -0.17671698331832886, -0.2840422987937927, 0.06058840826153755, -0.06147679314017296, 0.24512538313865662, 0.2896004617214203, -0.007320832461118698, 0.08418818563222885, 0.3674868941307068, -0.629322350025177, 0.1765122413635254, 0.13686750829219818, -0.22614827752113342, -0.046218231320381165, 0.037396132946014404, 0.040105901658535004, -0.044473983347415924, 0.8985578417778015, -0.21656721830368042, -0.2147645354270935, -0.03136172145605087, -0.25842463970184326, 0.15099641680717468, 0.011662706732749939, 0.11446474492549896, 0.06268982589244843, 0.3877272605895996, 0.31430646777153015, -0.1355108916759491, -0.2260960191488266, -0.09600357711315155, -0.29430097341537476, 0.10676832497119904, -0.1906190812587738, -0.03890497237443924, -0.16584037244319916, -0.39823126792907715, 0.21227924525737762, 0.45926016569137573, -0.2856520414352417, -0.21093708276748657, -0.3233127295970917, 0.1994010955095291, 0.18267102539539337, 0.13423089683055878, -0.05670618638396263, -0.10771826654672623, -0.15353186428546906, 0.11705568432807922, 0.09421055018901825, -0.09878095239400864, -0.007836779579520226, 0.10144287347793579, -0.20797047019004822, 0.04847051948308945, 0.27545714378356934, -0.24564115703105927, 0.24698153138160706, 0.25400686264038086, 0.08806568384170532, 0.1095118448138237, -0.09461309015750885, 0.1825159341096878, -0.4590335488319397, -0.04019917547702789, 0.1237572431564331, 0.06365729868412018, -0.19678622484207153, -0.696104109287262, 0.420510470867157, -0.06179661676287651, -0.20794811844825745, 0.40507546067237854, -0.07712016999721527, -0.05206677317619324, 0.191434845328331, 0.09344934672117233, 0.9216998815536499, 0.00890260562300682, 0.22652457654476166, -0.0350172333419323, -0.036476463079452515, 0.5281763076782227, -0.7320476770401001, 0.12249588966369629, -0.23026441037654877, -0.018796507269144058, -0.1606171727180481, -0.023562729358673096, 0.06426067650318146, 0.22319355607032776, -0.28102636337280273, 0.21422094106674194, 0.23421236872673035, -0.21875116229057312, -0.1181655153632164, 0.6156102418899536, -0.3051844537258148, -0.4205281138420105, 0.1125045120716095, 0.20991088449954987, -0.03212941437959671, 0.07336001098155975, -0.18539999425411224, -0.2514037787914276, -0.030614830553531647, -0.03559919074177742, -0.32770562171936035, -0.21141593158245087, -0.018018383532762527, 0.23142176866531372, -0.33583077788352966, -0.1467120200395584, 0.42281875014305115, 0.17560970783233643, -0.03957872465252876, -0.16531404852867126, -0.23167498409748077, -0.00830939318984747, -0.15508046746253967, 0.22477662563323975, 0.06244545802474022, -0.24851548671722412, 0.21730594336986542, -0.2768518626689911, -0.27485790848731995, -0.06578537821769714, -0.06366089731454849, -0.4230228662490845, -0.14243654906749725, 0.032590240240097046, 0.20203940570354462, -0.26853641867637634, -0.07133796811103821, 0.10159152746200562, -0.249954953789711, -0.12149553000926971, 0.1544833928346634, 0.10895997285842896, -0.20256417989730835, 0.250961571931839, -0.12726350128650665, 0.06166699528694153, -0.12799139320850372, 0.14889563620090485, -0.047453220933675766, -0.24096354842185974, -0.0415753535926342, 0.12487636506557465, -0.24571755528450012, -0.22861546277999878, -0.05336996167898178, -0.05123426765203476, -0.11527901142835617, -0.06399747729301453, -0.19755300879478455, -0.2062777876853943, 0.00965745747089386, 0.21111547946929932, 0.3888630270957947, -0.02309814840555191, 0.047818392515182495, -0.08661018311977386, -0.21816200017929077, 0.19974851608276367, -0.1778935343027115, 0.2596653699874878, 0.06402085721492767, -0.1997818648815155, 0.28717106580734253, 0.08546774089336395, -0.3784009516239166, 0.1645505428314209, -0.1038566306233406, -0.011375924572348595, 0.6009743213653564, -0.15937340259552002, -0.023494306951761246, -0.009416081011295319, 0.0758252739906311, 0.1543417125940323, -0.22207577526569366, -0.24387423694133759, -0.004198689013719559, 0.13238631188869476, 0.0675233006477356, 0.040849924087524414, 0.16667328774929047, -0.052222516387701035, -0.3328009247779846, 0.07090317457914352, 0.2238188236951828, 0.04297425597906113, -0.07789482176303864, 0.01392710953950882, 0.0761568546295166, 0.3731793761253357, -0.19633901119232178, 0.34391143918037415, 0.21552816033363342, -0.03347095102071762, -0.01948392763733864, 0.28041326999664307, 0.2063102424144745, -0.09154501557350159, 0.02286434918642044, 0.05690927803516388, 0.3757929503917694, 0.26048892736434937, 0.33687347173690796, 0.10566630959510803, 0.0018815100193023682, -0.059384193271398544, 0.4187885820865631, 0.16685479879379272, 0.10391315817832947, -0.057694513350725174, 0.24889005720615387, 0.3441619575023651, -0.07568826526403427, -0.09865269064903259, 0.30013078451156616, 0.13079029321670532, 0.13992191851139069, 0.15508216619491577, 0.6171351075172424, 0.28052306175231934, -0.1980421394109726, 0.18027622997760773, 0.6070584654808044, -0.2508167624473572, 0.15834861993789673, -0.014050744473934174, -0.15669076144695282, 0.21965345740318298, 0.20353983342647552, 0.10138753801584244, 0.17617754638195038, 0.32149994373321533, 0.035751812160015106, 0.5310671329498291, 0.29732921719551086, 0.0904315710067749, 0.15590664744377136, -0.3867511749267578, 0.19746828079223633, -0.2508074641227722, -0.052987996488809586, 0.08757925033569336, 0.09348700940608978, 0.48449012637138367, -0.2398359179496765, -0.13719680905342102, -0.2330542802810669, 0.07359244674444199, -0.10619573295116425, 0.03843993693590164, 0.025516420602798462, -0.34952861070632935, 0.027355290949344635, -0.07951726764440536, 0.059827905148267746, 0.008308152668178082, 0.7780439257621765, -0.006440810859203339, 0.07601067423820496, -0.05287858843803406, 0.032308224588632584, 0.012415168806910515, 0.26655733585357666, -0.2677621841430664, -0.27930477261543274, -0.0792713314294815, -0.2430204153060913, -0.3809841573238373, 0.15477599203586578, 0.333446741104126, 0.1639101654291153, -0.04884408414363861, -0.12261630594730377, -0.1223316490650177, 0.16382408142089844, -0.14878201484680176, 0.10896672308444977, 0.1325162649154663, 0.13189378380775452, 0.06556815654039383, 0.2364148050546646, -0.20082035660743713, 0.10516473650932312, -0.0011809458956122398, -0.33311009407043457, -0.2663928270339966, 0.15370039641857147, 0.2344631552696228, -0.2652452886104584, 0.1368848830461502, 0.19222161173820496, -0.3143864870071411, -0.039699822664260864, 0.3094179332256317, -0.13845747709274292, 0.08739149570465088, -0.0718369111418724, 0.11116961389780045, -0.040354982018470764, 0.22085142135620117, 0.09333837032318115, 0.2276117503643036, -0.4283066987991333, 0.17238840460777283, -0.5550316572189331, -0.03951781988143921, 0.08177527040243149, 0.06373117119073868, -0.13614125549793243, 0.08969292044639587, 0.20046979188919067, 0.16002507507801056, -0.08558861911296844, -0.1896171271800995, 0.11836385726928711, 0.46286144852638245, -0.06380560249090195, 0.22457748651504517, -0.18283677101135254, 0.03517264872789383, 0.15410250425338745, -0.18293693661689758, 0.06934206187725067, 0.09612295031547546, 0.045525290071964264, -0.31172969937324524, -0.08308553695678711, 0.362381249666214, -0.2954358756542206, 0.4274420142173767, 0.007198533043265343, 0.3324870467185974, -0.10392443835735321, -0.04445107281208038, -0.20854425430297852, 0.0018677152693271637, -0.1692979335784912, -0.20565935969352722, 0.016512591391801834, 0.08563454449176788, -0.22629910707473755, 0.1706911325454712, -0.46584469079971313, 0.25541502237319946, -0.14016489684581757, 0.21979956328868866, -0.27759256958961487, -0.15511496365070343, -0.06097561493515968, -0.03181168809533119, 0.06165231019258499, 0.3039003312587738, 0.01654926873743534, -0.11869387328624725, -0.39865201711654663, -0.06659673154354095, 0.06350070238113403, -0.1931840181350708, -0.11093265563249588, -0.48763585090637207, 0.14359351992607117, 0.5197895169258118, 0.3400069773197174, -0.4165205955505371, -0.2611311078071594, 0.15251001715660095, 0.04859698936343193, 0.11402030289173126, 0.36031103134155273, 0.030389640480279922, -0.35729771852493286, -0.19684310257434845, -0.208232119679451, -0.29261651635169983, -0.08503424376249313, -0.035262804478406906, -0.45781105756759644 ]
https://github.com/huggingface/datasets/issues/5798
Sure, please let me know if you have more updates regarding the API and implementation from the team. For parameters we don't need to worry about setting them for Spark, because Spark will figure out the environment / number of worker nodes by itself, so it's preferable to just provide some parameter such as `use_spark` to use the RDD `map` function.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
61
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Sure, please let me know if you have more updates regarding the API and implementation from the team. For parameters we don't need to worry about setting them for Spark, because Spark will figure out the environment / number of worker nodes by itself, so it's preferable to just provide some parameter such as `use_spark` to use the RDD `map` function.
[ -0.4812101125717163, -0.3032202124595642, -0.290436714887619, 0.07637719064950943, -0.020943492650985718, -0.10099832713603973, 0.34414246678352356, 0.2184220850467682, 0.2572854161262512, 0.07534430176019669, -0.00004504993557929993, 0.5947644114494324, -0.14878487586975098, 0.4232860207557678, -0.06932780146598816, -0.41775259375572205, -0.03562726080417633, -0.08403755724430084, -0.1995391696691513, 0.07708828151226044, -0.16192682087421417, 0.22075769305229187, 0.02073410153388977, -0.2709581255912781, -0.19911333918571472, -0.14217673242092133, -0.19691184163093567, 0.1992470771074295, -0.11498630791902542, -0.2168462723493576, -0.04262283444404602, 0.4120350480079651, 0.2335192859172821, 0.34881189465522766, -0.00010119759826920927, -0.2088049352169037, 0.13803263008594513, 0.009605348110198975, -0.12034536898136139, -0.17447687685489655, 0.018596410751342773, -0.4612881541252136, 0.2103537917137146, -0.3088570833206177, 0.09567475318908691, 0.02812764048576355, -0.0467442125082016, 0.04225008189678192, 0.30059361457824707, -0.044319164007902145, 0.279590368270874, 0.24998721480369568, -0.16847258806228638, -0.03621254488825798, 0.004196770489215851, 0.1938576102256775, -0.07545813918113708, 0.3737271726131439, 0.5264976024627686, -0.10668525099754333, -0.35469508171081543, 0.09851150959730148, -0.26132985949516296, 0.19237814843654633, 0.40973415970802307, -0.07339949905872345, 0.049927979707717896, -0.6054896116256714, -0.08989649266004562, 0.22178880870342255, 0.6915830373764038, -0.2369018942117691, -0.24552088975906372, -0.3911176323890686, -0.3101562559604645, -0.03273924067616463, -0.0177864171564579, 0.05282459408044815, -0.29113996028900146, 0.00741579569876194, -0.22470280528068542, -0.15913482010364532, 0.028608903288841248, -0.09547889232635498, 0.04959416389465332, 0.5760980844497681, -0.006644876673817635, -0.026584599167108536, 0.3978205919265747, 0.09360028803348541, 0.06798018515110016, -0.150946706533432, 0.2627081871032715, 0.0752173364162445, -0.4499254822731018, -0.19638416171073914, -0.010024111717939377, -0.12216807901859283, 0.16236963868141174, 0.41321060061454773, 0.1272600144147873, 0.02206522971391678, 0.07438115030527115, 0.24486234784126282, 0.04249750077724457, 0.06632646918296814, -0.07046754658222198, -0.12559063732624054, 0.2513786852359772, -0.05443130433559418, 0.1442331075668335, 0.10563751310110092, -0.05052313953638077, -0.14138463139533997, -0.2676847279071808, 0.2381439208984375, -0.12738391757011414, 0.29973340034484863, -0.017845571041107178, -0.2054314911365509, 0.37405142188072205, -0.1343352347612381, -0.05555131286382675, 0.2689574360847473, -0.045553240925073624, 0.2518722116947174, -0.14455552399158478, 0.11729401350021362, 0.11987397074699402, -0.026901457458734512, -0.0547761395573616, -0.044614940881729126, -0.08382696658372879, 0.08647575229406357, 0.1771242320537567, -0.02051606960594654, 0.3539743423461914, 0.03781871497631073, 0.025555523112416267, 0.163894385099411, 0.29324135184288025, -0.031219948083162308, -0.21049638092517853, 0.17545080184936523, 0.0051994770765304565, -0.03154410421848297, 0.036742761731147766, 0.389618456363678, -0.3079339265823364, 0.23515699803829193, -0.1767520308494568, -0.3618411719799042, -0.08906032890081406, 0.30279797315597534, -0.07972873747348785, -0.06540773063898087, -0.4194296598434448, 0.2890356779098511, -0.03220023959875107, -0.10517404973506927, 0.2259185016155243, 0.19156783819198608, -0.36480358242988586, -0.4283614158630371, 0.15365055203437805, 0.4169746935367584, -0.17633818089962006, -0.008777692914009094, -0.21711671352386475, -0.1026330292224884, 0.1413552314043045, 0.1517794132232666, -0.17430207133293152, 0.09145155549049377, -0.14382028579711914, 0.25486066937446594, 0.2857414484024048, -0.4316096901893616, -0.19415168464183807, 0.6907122731208801, -0.2742106020450592, -0.15278619527816772, 0.29482054710388184, 0.15412434935569763, 0.5409327149391174, 0.02986665815114975, 0.0517253503203392, 0.3948405683040619, -0.18936114013195038, 0.16776974499225616, -0.30834099650382996, -0.34839650988578796, 0.1358242630958557, 0.36439818143844604, 0.11205340921878815, -0.0030742324888706207, 0.0998273640871048, -0.4406284987926483, 0.30101966857910156, 0.18415582180023193, 0.22972190380096436, -0.011646171100437641, -0.1387559473514557, 0.18118014931678772, -0.031347550451755524, -0.08083287626504898, -0.3790699541568756, 0.18775850534439087, 0.301107794046402, 0.02645309828221798, 0.22875027358531952, -0.23832997679710388, -0.13195547461509705, -0.06862200051546097, -0.014731604605913162, -0.09419718384742737, 0.20709332823753357, -0.21855314075946808, 0.012783698737621307, 0.05570372939109802, -0.22322428226470947, 0.2756968140602112, -0.15193751454353333, -0.013422220945358276, 0.01500517874956131, 0.24237209558486938, -0.04935407638549805, -0.10833107680082321, -0.03712592273950577, -0.17389599978923798, -0.04654092341661453, -0.0185726135969162, -0.019771385937929153, 0.1517111212015152, -0.04222450405359268, 0.32327795028686523, 0.14769849181175232, 0.41533416509628296, 0.4020082354545593, 0.1583874523639679, 0.21003875136375427, -0.009892876259982586, 0.07306268811225891, -0.2594985067844391, -0.24140247702598572, 0.2653442621231079, -0.3801054060459137, 0.04218854010105133, -0.08626656979322433, 0.14120346307754517, 0.11049111932516098, 0.026091739535331726, -0.018663723021745682, 0.2516007423400879, 0.1368941068649292, 0.0354771763086319, 0.16104161739349365, 0.0557357594370842, -0.2640453577041626, 0.19051708281040192, -0.056502632796764374, -0.03968087211251259, 0.13580693304538727, 0.11543162167072296, 0.0893867164850235, -0.11049596965312958, 0.3915387690067291, 0.5977644920349121, 0.3548085391521454, 0.2416212409734726, 0.10167254507541656, -0.03203018009662628, 0.45196330547332764, -0.15530607104301453, 0.13756881654262543, 0.09019963443279266, 0.11821632087230682, 0.30723902583122253, -0.10266664624214172, 0.04052306339144707, -0.02475939691066742, -0.43870118260383606, 0.353909432888031, 0.05654599517583847, -0.004236295819282532, -0.15079918503761292, 0.16374844312667847, -0.2172597348690033, 0.08841948211193085, 0.13711559772491455, -0.11924377083778381, -0.0940917581319809, -0.021335531026124954, 0.40814194083213806, -0.25303423404693604, 0.12488887459039688, 0.008133113384246826, 0.24286428093910217, -0.2317752093076706, -0.2932176887989044, -0.46017393469810486, -0.10382585227489471, 0.11786627769470215, 0.18061485886573792, 0.126023530960083, 0.005611121654510498, 0.35459333658218384, 0.003959059715270996, 0.024806860834360123, -0.36671873927116394, 0.06202869117259979, -0.011645521968603134, -0.06815376877784729, 0.022296467795968056, 0.16777583956718445, 0.13017144799232483, -0.03809453547000885, -0.3541768789291382, 0.030987050384283066, -0.10190454125404358, -0.01865961030125618, -0.43598872423171997, 0.1079477071762085, -0.0794719010591507, -0.20301707088947296, -0.2540284991264343, -0.6445388197898865, -0.607140302658081, 0.379219651222229, -0.08148425817489624, 0.29652559757232666, -0.34564208984375, 0.09094925224781036, -0.17353227734565735, 0.23293644189834595, -0.25019630789756775, 0.04260376840829849, -0.43674713373184204, 0.21501471102237701, -0.2185220718383789, -0.14356397092342377, -0.0644022673368454, -0.0020824000239372253, 0.12616243958473206, 0.031044989824295044, 0.0096987783908844, -0.20842015743255615, -0.0936480313539505, 0.5618280172348022, -0.1418960839509964, 0.11314386874437332, 0.37035971879959106, 0.1820589154958725, -0.057565174996852875, 0.12051419913768768, 0.003164045512676239, -0.020252786576747894, 0.2183047980070114, 0.0004890039563179016, 0.2777966260910034, 0.30352503061294556, 0.04112701863050461, 0.8970474600791931, -0.16838477551937103, 0.047535426914691925, 0.3377300202846527, 0.0552162304520607, -0.13160200417041779, 0.050958938896656036, -0.3923346996307373, -0.01846752129495144, -0.26702457666397095, -0.13738305866718292, 0.22646769881248474, -0.1352929025888443, -0.34197574853897095, -0.10309989005327225, -0.45617032051086426, -0.22620853781700134, -0.022482000291347504, 0.24964815378189087, -0.23367446660995483, 0.15426145493984222, -0.21686765551567078, -0.10196127742528915, -0.23965002596378326, 0.0457603856921196, 0.010572083294391632, 0.22390411794185638, 0.22793495655059814, -0.1063886433839798, 0.08512361347675323, 0.2864696979522705, -0.6366702914237976, -0.0209149569272995, 0.15196764469146729, -0.21601659059524536, -0.08091560006141663, 0.05873695760965347, 0.052472203969955444, -0.07470963150262833, 0.8290573954582214, -0.25168079137802124, -0.06767541170120239, -0.0743192732334137, -0.33485496044158936, 0.1162782832980156, 0.01171141117811203, 0.004608854651451111, -0.04026711732149124, 0.4004952609539032, 0.27352604269981384, -0.18430671095848083, -0.17526262998580933, -0.1302236169576645, -0.2616328299045563, -0.030451349914073944, -0.34582430124282837, 0.011579051613807678, -0.14015591144561768, -0.503911018371582, 0.22539301216602325, 0.40145063400268555, -0.1426108032464981, -0.2728041410446167, -0.12648099660873413, 0.2849060893058777, 0.1617826223373413, 0.13422909379005432, 0.02250543236732483, 0.006363585591316223, -0.11015141010284424, 0.14136061072349548, 0.0982939749956131, -0.1048923134803772, -0.042305946350097656, 0.13472773134708405, -0.2031698375940323, 0.027492929250001907, 0.15956653654575348, -0.1038302630186081, 0.22992971539497375, 0.17038966715335846, 0.05150981992483139, 0.09133787453174591, -0.14014369249343872, 0.13661083579063416, -0.47106245160102844, -0.09142865985631943, 0.150382399559021, -0.012110672891139984, 0.046900149434804916, -0.5883128046989441, 0.3526957929134369, -0.07403557002544403, -0.09190253913402557, 0.2708303928375244, -0.30073532462120056, -0.029309596866369247, 0.33196866512298584, 0.13065731525421143, 0.8498225808143616, 0.12217461317777634, 0.10149824619293213, -0.08596482872962952, -0.1120370626449585, 0.3846330940723419, -0.5632977485656738, 0.20065739750862122, -0.38155102729797363, -0.013227267190814018, -0.0556754395365715, 0.04679344594478607, -0.09087151288986206, 0.3989796042442322, -0.28607091307640076, 0.14280802011489868, 0.16674771904945374, -0.16612012684345245, -0.13032637536525726, 0.5717445015907288, -0.3558579385280609, -0.39684242010116577, 0.07919207215309143, 0.19480137526988983, 0.031114215031266212, 0.11192477494478226, -0.25421345233917236, -0.3536437451839447, 0.1480194479227066, -0.09762958437204361, -0.21389517188072205, -0.12588274478912354, -0.1643906831741333, 0.3232628107070923, -0.33323612809181213, -0.0077448636293411255, 0.26670706272125244, 0.35088279843330383, -0.17097163200378418, -0.11567884683609009, -0.1707681268453598, 0.034697435796260834, -0.06254006922245026, 0.24565894901752472, -0.03913654759526253, -0.20827241241931915, 0.2138541042804718, -0.24753649532794952, -0.3823598027229309, -0.1422131061553955, -0.059018176048994064, -0.3060183525085449, -0.15164247155189514, 0.09883067011833191, 0.06903281062841415, -0.15069419145584106, -0.09816616028547287, -0.06002235785126686, -0.3351500928401947, -0.036497361958026886, 0.19528646767139435, 0.1013001799583435, -0.1844964474439621, 0.3522908687591553, -0.07254409044981003, 0.05307067930698395, -0.07822316884994507, 0.29765111207962036, -0.014741536229848862, -0.08913058042526245, -0.06894047558307648, 0.17184719443321228, -0.2746582627296448, -0.24669551849365234, -0.045148029923439026, -0.14878340065479279, -0.19853220880031586, 0.1440417319536209, -0.19964756071567535, -0.1570647805929184, -0.00022011250257492065, 0.0892777219414711, 0.36962997913360596, 0.09565993398427963, -0.002345561981201172, -0.1330220103263855, -0.38327503204345703, 0.12091633677482605, -0.236237570643425, 0.19711674749851227, 0.112297922372818, -0.3164004385471344, 0.2969360053539276, 0.19877392053604126, -0.43606477975845337, 0.14542287588119507, -0.14309290051460266, -0.0774930864572525, 0.4593662619590759, -0.16183310747146606, 0.020433958619832993, 0.0950319692492485, 0.0812702476978302, 0.15529607236385345, -0.21931391954421997, -0.2451692670583725, -0.00453682616353035, 0.10105599462985992, -0.009179405868053436, 0.07316939532756805, -0.008625607937574387, -0.1344991773366928, -0.35335391759872437, -0.007921112701296806, 0.24088513851165771, -0.12251895666122437, -0.0739240050315857, -0.005393072962760925, 0.27489936351776123, 0.3225792348384857, -0.2894737124443054, 0.38373592495918274, 0.16391953825950623, 0.02582239918410778, -0.11288242042064667, 0.26340171694755554, 0.252035528421402, -0.10662104189395905, 0.1274990290403366, 0.004733243957161903, 0.44807782769203186, -0.08028878271579742, 0.4018903970718384, 0.1550586074590683, -0.06920730322599411, -0.09055965393781662, 0.4507667124271393, 0.19053496420383453, 0.10210893303155899, -0.03808792680501938, 0.18832442164421082, 0.34995296597480774, -0.12467344105243683, -0.09864059090614319, 0.35879653692245483, 0.13280752301216125, 0.2102174013853073, 0.13683609664440155, 0.5648570656776428, 0.1890173703432083, -0.20259441435337067, 0.18761099874973297, 0.5950790643692017, -0.2723093330860138, -0.03204815089702606, 0.004125702194869518, -0.035423412919044495, 0.16000261902809143, 0.24075396358966827, 0.18386274576187134, 0.21379636228084564, 0.27081355452537537, 0.03710702806711197, 0.48268428444862366, 0.28727802634239197, 0.055684931576251984, 0.17500892281532288, -0.42697247862815857, 0.13408008217811584, -0.22771964967250824, -0.12023893743753433, 0.09073805809020996, 0.00805424153804779, 0.2772323191165924, -0.15942002832889557, -0.22536838054656982, -0.22478553652763367, 0.22084812819957733, -0.28566449880599976, -0.01081915944814682, 0.05191536247730255, -0.33287519216537476, -0.15811428427696228, 0.03372921794652939, 0.15220102667808533, -0.015700004994869232, 0.6355781555175781, 0.026623878628015518, 0.09272241592407227, -0.009638035669922829, -0.13374631106853485, 0.09604234993457794, 0.22829429805278778, -0.3406708836555481, -0.2780577838420868, 0.023108333349227905, -0.1983404904603958, -0.27521753311157227, 0.20057010650634766, 0.4152752459049225, 0.19169136881828308, -0.10184959322214127, -0.07654434442520142, -0.08449053019285202, 0.1494850516319275, -0.08729249984025955, 0.18564127385616302, 0.07744160294532776, 0.2154809832572937, 0.14625975489616394, 0.2363196462392807, -0.22252359986305237, -0.04724452272057533, 0.05225425586104393, -0.33332523703575134, -0.08893440663814545, 0.1598784625530243, 0.2592814862728119, -0.27152925729751587, -0.009259738959372044, 0.03532518818974495, -0.3569280207157135, -0.008031792938709259, 0.3367515802383423, -0.16039535403251648, 0.10644450783729553, -0.15519890189170837, 0.13058847188949585, -0.03574502840638161, 0.41562607884407043, 0.04234771430492401, 0.1490086317062378, -0.3491574227809906, 0.010039031505584717, -0.5269865393638611, -0.03277726471424103, 0.14414846897125244, 0.10531814396381378, -0.10587701946496964, 0.17656750977039337, 0.09693361818790436, 0.07468301802873611, -0.21462824940681458, -0.20002417266368866, 0.1849549263715744, 0.5184445977210999, -0.08097979426383972, 0.20108485221862793, -0.2959299087524414, 0.06458216160535812, 0.13910095393657684, -0.16894692182540894, 0.10181814432144165, -0.043142009526491165, 0.09418842196464539, -0.3300674557685852, -0.12001687288284302, 0.2998655438423157, -0.29432085156440735, 0.32770973443984985, -0.0637245774269104, 0.46456342935562134, -0.19815480709075928, 0.06955955177545547, -0.037098176777362823, 0.08126301318407059, -0.13947127759456635, -0.18802829086780548, 0.1404159516096115, 0.038260988891124725, -0.15262600779533386, 0.1712222695350647, -0.422888845205307, 0.21871435642242432, -0.1302502155303955, 0.23377619683742523, -0.11149998009204865, -0.2311875820159912, 0.005097329616546631, -0.028156597167253494, 0.10951035469770432, 0.2889384627342224, -0.01861891895532608, -0.059068549424409866, -0.3812383711338043, -0.1786024421453476, 0.16108238697052002, -0.2560769319534302, -0.15191105008125305, -0.5092836022377014, 0.1884760558605194, 0.36689117550849915, 0.43186432123184204, -0.3534652590751648, -0.16054822504520416, 0.1114049032330513, -0.06793786585330963, 0.09739330410957336, 0.3631957769393921, 0.0846603512763977, -0.21736294031143188, -0.12617701292037964, -0.2818021774291992, -0.18844692409038544, -0.06904930621385574, -0.15398254990577698, -0.44104108214378357 ]
https://github.com/huggingface/datasets/issues/5798
Hi! I wanted to check in to see if there is any update from the team. A potential change of API I can think of is change the argument to `distributed_backend=...`, which accepts `str`, such as `load_dataset(..., distributed_backend="spark")`. Implementation wise, we can add a class / function to abstract away the details of using multiprocessing vs. spark vs. other parallel processing frameworks in `map_nested` and `_prepare_split`.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
66
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Hi! I wanted to check in to see if there is any update from the team. A potential change of API I can think of is change the argument to `distributed_backend=...`, which accepts `str`, such as `load_dataset(..., distributed_backend="spark")`. Implementation wise, we can add a class / function to abstract away the details of using multiprocessing vs. spark vs. other parallel processing frameworks in `map_nested` and `_prepare_split`.
[ -0.4750991463661194, -0.3348017930984497, -0.2552705705165863, 0.09217201173305511, -0.1191941648721695, -0.07862095534801483, 0.3384152352809906, 0.20579347014427185, 0.3066742718219757, 0.09049621224403381, 0.0406356006860733, 0.5110883712768555, -0.0026250481605529785, 0.4793178141117096, -0.1331353634595871, -0.3552037477493286, 0.07859744876623154, -0.1746918261051178, -0.00596880167722702, 0.234905406832695, -0.21268624067306519, 0.2739655077457428, -0.10492641478776932, -0.21620813012123108, -0.1572115570306778, -0.18336577713489532, -0.31548619270324707, 0.1828504502773285, -0.09616811573505402, -0.30151188373565674, 0.07928913831710815, 0.4249613881111145, 0.18018242716789246, 0.41284385323524475, -0.00010931216093013063, -0.16937261819839478, 0.19265994429588318, 0.056373871862888336, -0.028723008930683136, -0.2605648636817932, -0.039661891758441925, -0.4832535982131958, 0.19183778762817383, -0.19235379993915558, 0.09599427878856659, 0.05414480343461037, -0.005714091472327709, -0.11729512363672256, 0.21134953200817108, -0.2108987420797348, 0.1906857192516327, 0.1095087081193924, -0.010340258479118347, -0.051829371601343155, -0.22175370156764984, 0.20697852969169617, -0.1487918496131897, 0.266706645488739, 0.647443413734436, -0.21499952673912048, -0.3965499699115753, 0.07929903268814087, -0.2738493084907532, 0.23081928491592407, 0.33433017134666443, -0.10734166204929352, -0.057713013142347336, -0.5440600514411926, -0.2014356106519699, 0.15975287556648254, 0.6091117858886719, -0.07298639416694641, -0.37727972865104675, -0.5524038672447205, -0.3270748555660248, -0.08329281210899353, -0.006729546934366226, 0.018275093287229538, -0.33083176612854004, 0.06793361902236938, -0.17294394969940186, -0.34443584084510803, 0.10797397792339325, -0.18872973322868347, 0.04308786988258362, 0.6369341611862183, 0.055404432117938995, 0.055657416582107544, 0.3537990152835846, 0.1338900625705719, 0.04908480867743492, -0.13861466944217682, 0.3341488540172577, 0.011955216526985168, -0.4170219898223877, -0.03170006722211838, -0.028536692261695862, -0.3846229612827301, 0.08000324666500092, 0.3703947067260742, 0.21088428795337677, 0.05902828648686409, 0.06457535922527313, 0.19493313133716583, 0.20456324517726898, -0.0002943985164165497, -0.039782002568244934, -0.07756141573190689, 0.22655239701271057, 0.07094087451696396, 0.14938867092132568, 0.005933850072324276, 0.03617275878787041, -0.08354440331459045, -0.4719030559062958, 0.331957072019577, -0.10148957371711731, 0.2845737636089325, -0.08211635053157806, -0.3324308395385742, 0.2061423361301422, -0.3629472255706787, -0.05770090967416763, 0.14449118077754974, -0.04163188487291336, 0.5243341326713562, -0.13217125833034515, 0.1687241494655609, 0.14751958847045898, -0.1602240800857544, -0.027868468314409256, -0.09021209925413132, -0.13369733095169067, 0.25270652770996094, 0.16228652000427246, 0.009398423135280609, 0.22016502916812897, 0.13093239068984985, 0.11444534361362457, 0.16292060911655426, 0.2482699453830719, -0.07748442143201828, -0.18733853101730347, 0.08607427775859833, -0.048048537224531174, 0.1146719679236412, 0.05324716493487358, 0.43161582946777344, -0.23187819123268127, 0.365820050239563, -0.3334912359714508, -0.46747952699661255, -0.0871402844786644, 0.15227696299552917, -0.05046328157186508, -0.08054107427597046, -0.5308998227119446, 0.3050054907798767, 0.02195613458752632, -0.19084997475147247, 0.17769178748130798, 0.1358909159898758, -0.43361330032348633, -0.389932781457901, 0.16414634883403778, 0.34642258286476135, -0.138271763920784, 0.017850548028945923, -0.4487898349761963, -0.09621992707252502, 0.22439822554588318, 0.11318458616733551, -0.125484436750412, 0.11519449949264526, -0.14484551548957825, 0.3431059718132019, 0.2707478404045105, -0.6924703121185303, -0.16879549622535706, 0.6724373698234558, -0.19131243228912354, 0.06087666004896164, 0.3163527846336365, 0.0379520021378994, 0.46821779012680054, 0.04223925992846489, 0.14474967122077942, 0.31441184878349304, -0.19051013886928558, 0.18606974184513092, -0.3278225064277649, -0.33760371804237366, 0.2639332115650177, 0.339938759803772, 0.09006404876708984, 0.000990934669971466, 0.05853106081485748, -0.29263824224472046, 0.43597182631492615, 0.20621709525585175, 0.28223559260368347, -0.029896831139922142, -0.1271396279335022, 0.23393359780311584, -0.08109229803085327, -0.06124546751379967, -0.3396867513656616, 0.25045013427734375, 0.2358132302761078, 0.08580058813095093, 0.13854451477527618, -0.1431681513786316, -0.042555779218673706, -0.050423573702573776, -0.03366705775260925, -0.21695220470428467, 0.09268493205308914, -0.15609514713287354, -0.02118547633290291, -0.010977290570735931, -0.16768915951251984, 0.4223453998565674, -0.022851020097732544, 0.04680439084768295, 0.030307818204164505, 0.20748624205589294, 0.02857036702334881, -0.12526312470436096, -0.03978670760989189, -0.054838474839925766, 0.015528187155723572, -0.05469247326254845, -0.03744018077850342, 0.1893850862979889, -0.02858416736125946, 0.25837409496307373, 0.14531981945037842, 0.31777238845825195, 0.36763182282447815, 0.23933014273643494, 0.20432984828948975, -0.18267428874969482, 0.008389502763748169, -0.24450379610061646, -0.19851812720298767, 0.24581684172153473, -0.3639180064201355, 0.13427257537841797, -0.10281316936016083, 0.1109064519405365, 0.003301560878753662, 0.0546870231628418, 0.02514396607875824, 0.17456570267677307, -0.009753500111401081, -0.0810285434126854, 0.19806553423404694, -0.0515776127576828, -0.25952982902526855, 0.27965569496154785, -0.0011574309319257736, 0.0784326046705246, -0.032619915902614594, 0.11671645939350128, 0.20195379853248596, -0.18601399660110474, 0.45236140489578247, 0.5046753287315369, 0.43784311413764954, 0.139164537191391, 0.09683407843112946, -0.0691814199090004, 0.534237265586853, -0.10362712293863297, 0.11554160714149475, 0.11363503336906433, 0.16810859739780426, 0.23570288717746735, 0.02400943636894226, 0.06029793247580528, 0.11297551542520523, -0.36579084396362305, 0.34141644835472107, 0.009267451241612434, 0.03378671407699585, -0.11132855713367462, 0.023833058774471283, -0.10416288673877716, -0.04974677413702011, 0.019439443945884705, -0.192392498254776, -0.20330190658569336, -0.14805898070335388, 0.4957359731197357, -0.09229303896427155, 0.09013475477695465, 0.0027938708662986755, 0.2135109305381775, -0.2738596796989441, -0.27084609866142273, -0.4437982141971588, 0.040022872388362885, 0.17152485251426697, 0.12298452854156494, 0.1950262188911438, -0.07897414267063141, 0.23201464116573334, 0.18903955817222595, -0.003546997904777527, -0.32493817806243896, 0.08304401487112045, 0.025438405573368073, -0.27750903367996216, -0.12468849122524261, 0.22062933444976807, 0.03350768983364105, 0.13724905252456665, -0.33914726972579956, 0.058982815593481064, -0.10706520080566406, -0.005792625248432159, -0.5408567190170288, 0.17547549307346344, 0.03417568653821945, -0.10908112674951553, -0.24961203336715698, -0.7056781649589539, -0.6000387072563171, 0.4359074532985687, -0.10637113451957703, 0.1897263526916504, -0.549924373626709, 0.06561171263456345, -0.24640364944934845, 0.22393843531608582, -0.39985060691833496, 0.051778197288513184, -0.3845810294151306, 0.01552444975823164, -0.1944018304347992, 0.018608860671520233, -0.07507431507110596, 0.09650057554244995, 0.17724646627902985, -0.036516766995191574, 0.006501428782939911, -0.21456030011177063, 0.0601893812417984, 0.5742677450180054, -0.07478839159011841, 0.02813277579843998, 0.4058552384376526, 0.19029967486858368, -0.0235273614525795, 0.153126060962677, -0.04075010493397713, -0.0767475813627243, 0.17947788536548615, 0.0456550158560276, 0.36065855622291565, 0.09076711535453796, 0.15342417359352112, 1.0067121982574463, -0.12228688597679138, 0.17655925452709198, 0.3392627239227295, 0.1776571124792099, -0.2630392611026764, 0.022434066981077194, -0.4300941228866577, -0.06566199660301208, -0.29549914598464966, -0.029099103063344955, 0.06998594105243683, -0.14026792347431183, -0.3538055121898651, -0.16609808802604675, -0.3452976942062378, -0.17997974157333374, -0.034145135432481766, 0.25359609723091125, -0.28840893507003784, 0.2292310893535614, -0.17981871962547302, -0.17450472712516785, -0.31496793031692505, -0.01269223541021347, -0.09813253581523895, 0.049223147332668304, 0.3354418873786926, -0.14797402918338776, 0.14571015536785126, 0.22758227586746216, -0.6194541454315186, 0.17542020976543427, 0.24851129949092865, -0.10587341338396072, -0.09592048823833466, 0.010122157633304596, 0.16059070825576782, -0.1077195554971695, 0.8139382600784302, -0.29169315099716187, -0.20647354423999786, -0.009978976100683212, -0.3894634544849396, 0.18160846829414368, -0.08084481954574585, 0.011533409357070923, 0.14505469799041748, 0.4065241813659668, 0.33231502771377563, -0.15711985528469086, -0.3871268630027771, -0.12077188491821289, -0.32304295897483826, -0.052645448595285416, -0.23612317442893982, -0.03422003239393234, -0.06985202431678772, -0.41203099489212036, 0.2140330970287323, 0.3606213331222534, -0.0013198554515838623, -0.30465278029441833, -0.12828248739242554, 0.2677537798881531, 0.19864431023597717, 0.06237006559967995, -0.07709009200334549, -0.07176918536424637, -0.1165086030960083, 0.09434967488050461, 0.1334095299243927, -0.023510701954364777, 0.08562881499528885, 0.1438974291086197, -0.29323047399520874, 0.006975039839744568, 0.259611040353775, -0.10556401312351227, 0.33598312735557556, 0.19699901342391968, 0.09306331723928452, 0.1724899262189865, -0.0813402384519577, 0.08528131246566772, -0.5801680684089661, -0.16922375559806824, 0.21816173195838928, 0.019539467990398407, -0.10695409774780273, -0.6624677181243896, 0.24852606654167175, 0.13570107519626617, -0.17152510583400726, 0.3009378910064697, -0.3475857973098755, -0.0035123638808727264, 0.2747866213321686, 0.04837528616189957, 0.7959355115890503, 0.017464660108089447, 0.011361176148056984, -0.09372257441282272, 0.038982972502708435, 0.3757423758506775, -0.718776285648346, 0.31331098079681396, -0.31909146904945374, -0.0802965983748436, -0.12841592729091644, 0.054432108998298645, 0.037243299186229706, 0.359457790851593, -0.17811700701713562, 0.22668598592281342, 0.2789541482925415, -0.2867196798324585, -0.09175214916467667, 0.5506810545921326, -0.23692502081394196, -0.36699825525283813, 0.13710007071495056, 0.1213042140007019, 0.050776850432157516, 0.13352197408676147, -0.1351909339427948, -0.26278823614120483, 0.026625201106071472, -0.1670236885547638, -0.40479791164398193, -0.1703648865222931, -0.0475851334631443, 0.2667294442653656, -0.23314791917800903, -0.0293794646859169, 0.459227591753006, 0.35847049951553345, -0.19267608225345612, -0.36985182762145996, -0.06515776365995407, 0.013182887807488441, -0.16775229573249817, 0.15326693654060364, -0.03184245154261589, -0.19203943014144897, 0.21333299577236176, -0.21409709751605988, -0.4191005825996399, -0.09533868730068207, -0.11512689292430878, -0.4120734930038452, -0.24044308066368103, 0.3217499852180481, 0.12088330090045929, -0.25225627422332764, -0.13642042875289917, 0.08193263411521912, -0.08451935648918152, -0.06593553721904755, 0.08363223820924759, 0.11229951679706573, -0.16504940390586853, 0.34843710064888, -0.1697547286748886, 0.03486979007720947, 0.02814694494009018, 0.3644616901874542, 0.074265256524086, -0.19410842657089233, -0.016470840200781822, 0.1956174075603485, -0.15639835596084595, -0.13745418190956116, -0.09636358171701431, -0.1671200841665268, -0.06310977041721344, 0.16927185654640198, -0.12895669043064117, -0.17475153505802155, -0.008212439715862274, 0.13641402125358582, 0.2207052856683731, 0.1424761861562729, -0.1050766184926033, -0.15003269910812378, -0.20444262027740479, 0.16123147308826447, -0.34406977891921997, 0.018878642469644547, 0.07326849550008774, -0.2525061368942261, 0.28763073682785034, 0.22654353082180023, -0.3022856116294861, 0.19910356402397156, -0.06416711211204529, -0.10417626798152924, 0.6243011355400085, -0.15495777130126953, 0.03310532122850418, 0.08988167345523834, 0.00859883800148964, 0.11964060366153717, -0.1146409660577774, -0.1509118676185608, 0.05217432230710983, 0.14479990303516388, -0.006456876173615456, 0.11968092620372772, -0.018732812255620956, -0.1083960309624672, -0.23830989003181458, -0.0011596009135246277, 0.19431667029857635, -0.0623566210269928, -0.060862455517053604, 0.012555383145809174, 0.20887213945388794, 0.3235280513763428, -0.3149122893810272, 0.4623338580131531, 0.1512104719877243, 0.07240787148475647, -0.08615218847990036, 0.3451042175292969, 0.30185872316360474, -0.07769500464200974, 0.0821431428194046, -0.08954712748527527, 0.48401394486427307, 0.15486083924770355, 0.4243232011795044, 0.18465113639831543, -0.13726359605789185, -0.10588636994361877, 0.41630858182907104, 0.22531677782535553, 0.17667868733406067, -0.0018923357129096985, 0.07274705171585083, 0.23085340857505798, -0.03662390261888504, -0.14560802280902863, 0.5415441989898682, 0.0977737233042717, 0.13515248894691467, 0.20054911077022552, 0.6860323548316956, 0.21846351027488708, -0.24797679483890533, 0.16851933300495148, 0.6762071847915649, -0.19001051783561707, 0.05415064096450806, -0.0036549698561429977, -0.0441049188375473, 0.25653040409088135, 0.33293309807777405, 0.0391899049282074, 0.21517354249954224, 0.22479285299777985, 0.03201403096318245, 0.42295917868614197, 0.3781795799732208, 0.04364635795354843, 0.1602751612663269, -0.4558701515197754, 0.1350409984588623, -0.2311720997095108, -0.032625846564769745, 0.06933858245611191, -0.04092121869325638, 0.5401830673217773, -0.32873043417930603, -0.30283308029174805, -0.1729152649641037, 0.30406439304351807, -0.18487080931663513, -0.03341256082057953, 0.14241164922714233, -0.26592880487442017, -0.2566572427749634, -0.015342332422733307, 0.09415105730295181, 0.03383751958608627, 0.8740354776382446, -0.11669759452342987, 0.12981025874614716, -0.028526687994599342, -0.29951465129852295, 0.05758696049451828, 0.2565409541130066, -0.24096381664276123, -0.16604915261268616, 0.05533391982316971, -0.1954871267080307, -0.20664751529693604, 0.24001269042491913, 0.5131908655166626, 0.1663077473640442, -0.11505726724863052, -0.2143639624118805, -0.1734413355588913, 0.23465539515018463, -0.07923517376184464, 0.22747382521629333, -0.05442515388131142, 0.1871006190776825, 0.051661599427461624, 0.14632736146450043, -0.09770768880844116, -0.006998267490416765, 0.03834253549575806, -0.11495201289653778, -0.13525807857513428, 0.3125443756580353, 0.154008686542511, -0.2354753315448761, 0.09575028717517853, 0.0892125591635704, -0.3343541920185089, 0.05633024871349335, 0.27886587381362915, -0.24123945832252502, 0.060550756752491, -0.12349122762680054, 0.06836020201444626, 0.07422977685928345, 0.3163926601409912, 0.08079659938812256, 0.09569419920444489, -0.33732736110687256, -0.0029839277267456055, -0.5446293950080872, -0.041332028806209564, 0.15134447813034058, 0.16466672718524933, -0.25482016801834106, 0.1216520369052887, 0.16581487655639648, 0.061747077852487564, -0.07289180159568787, -0.2986200749874115, 0.16566571593284607, 0.5886789560317993, -0.16188588738441467, 0.3218294382095337, -0.16479745507240295, 0.061263784766197205, 0.13156962394714355, -0.024100854992866516, 0.14531636238098145, 0.07378174364566803, -0.027777861803770065, -0.2730778753757477, -0.21483001112937927, 0.3137078285217285, -0.41398221254348755, 0.41958144307136536, 0.038577765226364136, 0.43602877855300903, -0.13142748177051544, -0.10507109761238098, -0.07013209164142609, 0.051509033888578415, -0.06341433525085449, -0.038896314799785614, 0.045325521379709244, 0.131028950214386, -0.2771056294441223, 0.24120238423347473, -0.46607816219329834, 0.26659446954727173, -0.16456395387649536, 0.22093868255615234, -0.29280611872673035, -0.23890429735183716, -0.057743389159440994, -0.08975493907928467, 0.17378365993499756, 0.30143603682518005, 0.07159782201051712, -0.08067682385444641, -0.3837427794933319, -0.14449915289878845, 0.04108025133609772, -0.28397297859191895, -0.12233233451843262, -0.5096024870872498, 0.058424875140190125, 0.26212912797927856, 0.44171667098999023, -0.4367569088935852, -0.23511412739753723, 0.13670186698436737, 0.08302953839302063, 0.06009858846664429, 0.24054187536239624, 0.012983351945877075, -0.32792919874191284, -0.15542972087860107, -0.2285122573375702, -0.22465629875659943, -0.0728670209646225, -0.03537556156516075, -0.24486228823661804 ]
https://github.com/huggingface/datasets/issues/5798
I found this quite interesting: https://github.com/joblib/joblib-spark with this syntax: ```python with parallel_backend('spark', n_jobs=3): ... ``` cc @lu-wang-dl who might know better
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
21
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. I found this quite interesting: https://github.com/joblib/joblib-spark with this syntax: ```python with parallel_backend('spark', n_jobs=3): ... ``` cc @lu-wang-dl who might know better
[ -0.46477270126342773, -0.2248917818069458, -0.2864758372306824, 0.15008693933486938, -0.0498322919011116, -0.02512441575527191, 0.43911606073379517, 0.19149240851402283, 0.27764448523521423, 0.10016019642353058, 0.010865975171327591, 0.5445321798324585, -0.07295788824558258, 0.4865700602531433, -0.065657839179039, -0.3041093051433563, -0.03203146904706955, -0.08561527729034424, -0.2496434450149536, 0.1947464942932129, -0.13726209104061127, 0.22112534940242767, 0.0014102458953857422, -0.29261404275894165, -0.1768849790096283, -0.12587076425552368, -0.17283931374549866, 0.13193067908287048, -0.032029084861278534, -0.12913912534713745, -0.0008259415626525879, 0.3451194167137146, 0.18649983406066895, 0.44671088457107544, -0.00010334968101233244, -0.16559606790542603, 0.15496599674224854, 0.07432453334331512, -0.08318975567817688, -0.19943088293075562, -0.01523686945438385, -0.48605185747146606, 0.2006283402442932, -0.276725709438324, 0.05746118724346161, 0.3074004054069519, 0.01724998466670513, -0.01680261641740799, 0.26716166734695435, -0.24823108315467834, 0.2599664032459259, 0.15483403205871582, -0.2345099151134491, -0.021710921078920364, -0.0810021385550499, 0.18143771588802338, -0.10562370717525482, 0.34424692392349243, 0.5337838530540466, -0.1905137002468109, -0.24447518587112427, 0.14816637337207794, -0.25197118520736694, 0.23954430222511292, 0.30883336067199707, -0.08817758411169052, -0.09449450671672821, -0.4139944612979889, -0.15514299273490906, 0.22653797268867493, 0.6656327843666077, -0.18001404404640198, -0.3130339980125427, -0.5160934329032898, -0.2241867333650589, -0.03747132048010826, -0.0622500404715538, 0.14268402755260468, -0.22929167747497559, -0.027399791404604912, -0.11809522658586502, -0.18474328517913818, 0.16828276216983795, -0.15922898054122925, 0.17087502777576447, 0.5886359810829163, -0.040991079062223434, 0.02567506767809391, 0.3541978597640991, 0.1761559396982193, 0.07146964967250824, -0.15750190615653992, 0.34506040811538696, 0.08669546246528625, -0.40478411316871643, -0.06250836700201035, -0.16329242289066315, -0.3657601475715637, 0.20011836290359497, 0.2547609508037567, 0.13669300079345703, 0.030523207038640976, 0.03815532475709915, 0.22160692512989044, 0.12897934019565582, 0.016358014196157455, -0.050701942294836044, -0.01844479888677597, 0.22131484746932983, 0.056641463190317154, 0.11124232411384583, 0.028535977005958557, -0.12224911153316498, -0.1466156244277954, -0.3742564022541046, 0.3303033113479614, -0.2533489167690277, 0.31810611486434937, -0.12362182885408401, -0.31230661273002625, 0.32689177989959717, -0.22557613253593445, -0.0396941602230072, 0.22333276271820068, -0.0742306113243103, 0.24979713559150696, -0.15088769793510437, 0.1248919814825058, 0.09658081829547882, -0.0824514701962471, -0.07023333013057709, -0.04452500119805336, -0.04997124895453453, 0.05346020311117172, 0.10511276125907898, -0.19532443583011627, 0.33870455622673035, 0.12618860602378845, -0.0033203568309545517, 0.11423712968826294, 0.30953332781791687, -0.02043135091662407, -0.42999979853630066, 0.1139485239982605, 0.014288932085037231, 0.05838979035615921, -0.004408599808812141, 0.49382972717285156, -0.25299984216690063, 0.26446694135665894, -0.2364857792854309, -0.29642853140830994, -0.10152965039014816, 0.22327913343906403, -0.021385587751865387, -0.05731983110308647, -0.5506110787391663, 0.10831767320632935, 0.10369804501533508, -0.1329384744167328, 0.275846391916275, 0.16289810836315155, -0.3287853002548218, -0.31396520137786865, 0.10307055711746216, 0.4165394902229309, -0.18199202418327332, 0.0033268630504608154, -0.23815178871154785, -0.1188134029507637, 0.24202066659927368, 0.13745278120040894, -0.12288840115070343, 0.042788658291101456, -0.1863536387681961, 0.2962198257446289, 0.2908239960670471, -0.5158653855323792, -0.15017345547676086, 0.6925491094589233, -0.3114033043384552, -0.029458969831466675, 0.2898162007331848, 0.20096641778945923, 0.4427112638950348, -0.06032077968120575, 0.07006017118692398, 0.40883246064186096, -0.13515709340572357, 0.16526958346366882, -0.30935198068618774, -0.4266946315765381, 0.21024267375469208, 0.3311167061328888, 0.09924005717039108, -0.056234437972307205, 0.012097340077161789, -0.3346857726573944, 0.4511394500732422, 0.18654869496822357, 0.2982048988342285, -0.07162422686815262, -0.2453264445066452, 0.3468407392501831, -0.10818459093570709, -0.09133870154619217, -0.25651872158050537, 0.22865593433380127, 0.28974151611328125, 0.012883637100458145, 0.17974179983139038, -0.23094592988491058, -0.09223346412181854, -0.12235993146896362, -0.046891555190086365, -0.10770305246114731, 0.13756367564201355, -0.19707904756069183, -0.008846893906593323, 0.12698090076446533, -0.12761959433555603, 0.46571317315101624, -0.17553405463695526, 0.04409640654921532, -0.07790787518024445, 0.24350737035274506, 0.07039627432823181, -0.05654844641685486, -0.134957417845726, -0.10300124436616898, -0.01941331848502159, -0.10887347161769867, -0.05225788801908493, 0.08980333805084229, -0.03604448214173317, 0.3229811191558838, 0.1348053216934204, 0.3210482597351074, 0.39473631978034973, 0.2862829566001892, 0.14704519510269165, -0.08352115005254745, 0.056243229657411575, -0.23548167943954468, -0.09811022877693176, 0.20654986798763275, -0.4094926118850708, 0.006117839366197586, -0.18137294054031372, 0.08753665536642075, 0.07324741035699844, -0.019754156470298767, 0.03026137501001358, 0.2294815480709076, 0.16318784654140472, 0.008048772811889648, 0.14112654328346252, -0.004911087453365326, -0.35965415835380554, 0.12969617545604706, -0.07277801632881165, -0.03033280000090599, 0.12717205286026, 0.049959778785705566, 0.10851038992404938, 0.034721918404102325, 0.37674450874328613, 0.5177035331726074, 0.28220534324645996, 0.20782379806041718, 0.12050828337669373, -0.0822804868221283, 0.4929189383983612, -0.15527215600013733, 0.013562042266130447, 0.07915259897708893, 0.2519233822822571, 0.3029380440711975, -0.06883977353572845, 0.10027235746383667, 0.16388742625713348, -0.3879913091659546, 0.3418155312538147, 0.015945682302117348, 0.005940757691860199, -0.14319947361946106, 0.06907732039690018, -0.1814313530921936, -0.035319846123456955, 0.03501330688595772, -0.05447088181972504, -0.05024472624063492, -0.08478622138500214, 0.532857358455658, -0.1362886279821396, 0.006865698844194412, -0.09270703792572021, 0.11684390902519226, -0.2479102909564972, -0.33788493275642395, -0.41659197211265564, 0.019697554409503937, 0.14409121870994568, 0.14468912780284882, 0.2911919355392456, 0.04400058463215828, 0.1886545568704605, 0.0967976450920105, -0.06344109028577805, -0.34847161173820496, 0.1972455084323883, -0.010648421943187714, -0.17285078763961792, 0.018633531406521797, 0.17111191153526306, 0.01680443435907364, 0.010602913796901703, -0.3850671947002411, -0.03734927996993065, -0.11663893610239029, 0.013258956372737885, -0.41973966360092163, 0.1775352656841278, 0.05828838050365448, -0.13772891461849213, -0.18647927045822144, -0.7091244459152222, -0.5707394480705261, 0.3863462507724762, -0.09175113588571548, 0.23655013740062714, -0.4874987304210663, 0.033592790365219116, -0.22996613383293152, 0.32735225558280945, -0.367457777261734, 0.013213038444519043, -0.4647050201892853, 0.10385242104530334, -0.19066189229488373, -0.08623041957616806, -0.11390203982591629, 0.014942489564418793, 0.11519446223974228, -0.11073790490627289, -0.0016829296946525574, -0.14538899064064026, 0.007412498816847801, 0.5027136206626892, -0.21901626884937286, 0.05640552192926407, 0.3427519202232361, 0.057957351207733154, 0.0055639781057834625, 0.11595666408538818, 0.07312627881765366, -0.08226541429758072, 0.1731112003326416, 0.01354190707206726, 0.24914944171905518, 0.21133336424827576, 0.15562450885772705, 0.8125832676887512, -0.14364996552467346, 0.07351603358983994, 0.35810190439224243, 0.1030540019273758, -0.32091110944747925, 0.07465599477291107, -0.3631020784378052, -0.09085153043270111, -0.3009715974330902, -0.12234631180763245, 0.11310748755931854, -0.12600108981132507, -0.27729183435440063, -0.10529868304729462, -0.4754526615142822, -0.3675389587879181, -0.009930863976478577, 0.21282491087913513, -0.3556286096572876, 0.0639805942773819, -0.1764245629310608, -0.13282911479473114, -0.22630536556243896, 0.07112248241901398, -0.06953201442956924, 0.1039784699678421, 0.2205871194601059, -0.16302700340747833, 0.22897258400917053, 0.30344846844673157, -0.6176465749740601, 0.040382400155067444, 0.2009146362543106, -0.2677527070045471, -0.033874206244945526, 0.07484650611877441, 0.14021621644496918, -0.10248415172100067, 0.9197291731834412, -0.14591871201992035, -0.039193905889987946, -0.052883803844451904, -0.43005937337875366, 0.16031107306480408, -0.046577684581279755, -0.0007397383451461792, -0.0968560129404068, 0.47819870710372925, 0.35895681381225586, -0.17227540910243988, -0.18100959062576294, -0.1788497269153595, -0.26068034768104553, -0.0747847706079483, -0.33110982179641724, -0.11714278161525726, -0.17240622639656067, -0.44383320212364197, 0.21468183398246765, 0.3822743892669678, -0.014203518629074097, -0.24445638060569763, -0.2069883644580841, 0.21063509583473206, 0.19214564561843872, 0.07173125445842743, -0.05448378622531891, -0.10513826459646225, -0.06656245142221451, 0.168122336268425, 0.13741034269332886, -0.14387917518615723, 0.0072178710252046585, 0.05923779308795929, -0.1198643147945404, 0.07606172561645508, 0.17977921664714813, -0.06571225076913834, 0.28118354082107544, 0.06814678013324738, 0.12243996560573578, 0.06534689664840698, -0.12286630272865295, 0.07861122488975525, -0.43229758739471436, -0.08725449442863464, 0.1278969645500183, 0.10746616870164871, -0.08632451295852661, -0.6469311714172363, 0.33582058548927307, 0.0560479611158371, -0.03455311059951782, 0.36748459935188293, -0.41383662819862366, 0.03502592444419861, 0.22045421600341797, 0.07259780168533325, 0.7772407531738281, -0.0661163404583931, 0.08392800390720367, -0.13806292414665222, -0.10822606086730957, 0.5546106696128845, -0.6477096080780029, 0.2789858281612396, -0.36373695731163025, -0.07907241582870483, -0.06204449012875557, 0.05681069195270538, 0.020430192351341248, 0.2737492024898529, -0.12820489704608917, 0.17939969897270203, 0.12840010225772858, -0.24929389357566833, -0.20085656642913818, 0.5281631350517273, -0.45939722657203674, -0.33650991320610046, 0.15640513598918915, 0.17452764511108398, 0.04369497299194336, 0.1994553506374359, -0.23515060544013977, -0.2989332675933838, 0.050303563475608826, 0.0002786293625831604, -0.24249620735645294, -0.028992079198360443, -0.033325254917144775, 0.35173192620277405, -0.3295944333076477, -0.1428551971912384, 0.34231871366500854, 0.27391940355300903, -0.22060756385326385, -0.20261594653129578, -0.03833539038896561, -0.028340235352516174, -0.11287248134613037, 0.19440335035324097, -0.055643174797296524, -0.18457022309303284, 0.15217989683151245, -0.2341533750295639, -0.42096322774887085, -0.18572470545768738, 0.020050860941410065, -0.4340831935405731, 0.036036521196365356, 0.21620634198188782, 0.07245214283466339, -0.1778482347726822, -0.2237023413181305, 0.07333258539438248, -0.18072918057441711, -0.09194441139698029, 0.14425301551818848, 0.09202204644680023, -0.2861286997795105, 0.2949581742286682, -0.11379263550043106, 0.03966662287712097, -0.08756434917449951, 0.33990737795829773, 0.011022629216313362, -0.07353569567203522, -0.007052864879369736, 0.19493040442466736, -0.16887880861759186, -0.1531897485256195, -0.06057921051979065, -0.07704782485961914, -0.10380826145410538, 0.04989759624004364, -0.18992406129837036, -0.11141686886548996, 0.02052636444568634, 0.1804237812757492, 0.2969006896018982, 0.049392133951187134, -0.08233204483985901, -0.17696541547775269, -0.25324803590774536, 0.13562899827957153, -0.24804401397705078, 0.08897535502910614, 0.13918666541576385, -0.11868993937969208, 0.26171302795410156, 0.1393270641565323, -0.3476269245147705, 0.22260817885398865, -0.1934458315372467, -0.13540945947170258, 0.5314170718193054, -0.10634242743253708, 0.04649981111288071, 0.13743385672569275, 0.08676574379205704, 0.23827868700027466, -0.14910930395126343, -0.2212313413619995, 0.06891480088233948, 0.09161105751991272, 0.012365026399493217, 0.11042453348636627, -0.053215641528367996, -0.0870603695511818, -0.263264924287796, -0.02791069820523262, 0.1680479198694229, -0.062053557485342026, -0.05815042555332184, 0.04743427783250809, 0.24129685759544373, 0.3684142231941223, -0.3543742299079895, 0.416397362947464, 0.08807940781116486, -0.0820746049284935, -0.10474972426891327, 0.26535531878471375, 0.38781893253326416, 0.032159917056560516, -0.08817620575428009, -0.14071328938007355, 0.5709359645843506, 0.08513619005680084, 0.34714609384536743, 0.11725413799285889, -0.002265326678752899, -0.004855446517467499, 0.4237906336784363, 0.21843193471431732, 0.19652456045150757, -0.1354815661907196, 0.23139846324920654, 0.3075351417064667, -0.10411221534013748, -0.08386937528848648, 0.40653038024902344, 0.21297456324100494, 0.13301441073417664, 0.1676768958568573, 0.5595076680183411, 0.3386855721473694, -0.3291914463043213, 0.1800624281167984, 0.7050805687904358, -0.22595727443695068, 0.054437149316072464, 0.11787283420562744, -0.01933155208826065, 0.2180449664592743, 0.2597636878490448, 0.11066585779190063, 0.20268501341342926, 0.2264510989189148, 0.017362991347908974, 0.4271487295627594, 0.20205721259117126, 0.05095236375927925, 0.07383203506469727, -0.49132025241851807, 0.06320996582508087, -0.15176834166049957, -0.12983739376068115, 0.06054902821779251, -0.06966215372085571, 0.46776920557022095, -0.24808597564697266, -0.16912145912647247, -0.23327036201953888, 0.3348715901374817, -0.2174108475446701, 0.037545230239629745, 0.10254276543855667, -0.21497046947479248, -0.026303842663764954, 0.010091520845890045, 0.1611936241388321, 0.07719020545482635, 0.7848737239837646, -0.023266077041625977, 0.02460351772606373, -0.0875995010137558, -0.11341293156147003, 0.15008293092250824, 0.21755379438400269, -0.30166664719581604, -0.278188019990921, -0.026220787316560745, -0.14390406012535095, -0.35261619091033936, 0.17406141757965088, 0.3567776381969452, 0.10886383056640625, 0.019684504717588425, -0.22789277136325836, -0.18628475069999695, 0.275992214679718, -0.07859541475772858, 0.18000227212905884, 0.03720502555370331, 0.2770323157310486, 0.13004203140735626, 0.20659416913986206, -0.20768609642982483, 0.0723343938589096, 0.074659563601017, -0.21582183241844177, -0.10402446985244751, 0.13717526197433472, 0.12108047306537628, -0.18316084146499634, -0.04191835969686508, 0.0905551016330719, -0.3561449646949768, 0.14023885130882263, 0.29878437519073486, -0.27727261185646057, 0.04922416806221008, -0.05355442687869072, 0.09185676276683807, 0.0025117676705121994, 0.2535568177700043, 0.06023130938410759, 0.14086173474788666, -0.34276503324508667, 0.06436207890510559, -0.5295048952102661, -0.024599812924861908, 0.011532444506883621, 0.07374831289052963, -0.2438703179359436, 0.19760966300964355, 0.09162292629480362, 0.0013514598831534386, -0.1563209891319275, -0.08732394874095917, 0.13025273382663727, 0.5850708484649658, -0.03136932849884033, 0.2273143231868744, -0.3243853449821472, 0.003949202597141266, 0.16925805807113647, -0.14765611290931702, 0.10240030288696289, -0.0709107369184494, 0.03893493115901947, -0.19217243790626526, -0.18762367963790894, 0.30353569984436035, -0.33132585883140564, 0.47799065709114075, -0.07088696956634521, 0.4278651475906372, -0.17885519564151764, 0.06652610749006271, -0.006890727207064629, 0.034252628684043884, -0.1369166225194931, -0.16748471558094025, 0.12324182689189911, 0.04370398074388504, -0.22843146324157715, 0.36670392751693726, -0.43097037076950073, 0.31828445196151733, -0.20495718717575073, 0.2146158218383789, -0.19321869313716888, -0.3071720004081726, -0.07442767918109894, -0.049221333116292953, 0.12156045436859131, 0.2966947555541992, 0.0074811410158872604, -0.1483800709247589, -0.3912842869758606, -0.12112896144390106, 0.06237547844648361, -0.27338334918022156, -0.1736059933900833, -0.5656713843345642, 0.1539507508277893, 0.41317296028137207, 0.33045223355293274, -0.28419870138168335, -0.1165761724114418, 0.12101742625236511, 0.06966626644134521, 0.16031867265701294, 0.2682543396949768, 0.11679212749004364, -0.25285813212394714, -0.10805395990610123, -0.2937740981578827, -0.2161571979522705, -0.05093102902173996, -0.029751155525445938, -0.358588844537735 ]
https://github.com/huggingface/datasets/issues/5798
Joblib spark is providing Spark backend for joblib. We can implement a general parallel backend like ``` with parallel_backend("<parallel-backedn>", n_jobs=..): ``` It can support multiprocessing , spark, ray, and etc. https://joblib.readthedocs.io/en/latest/parallel.html#joblib.parallel_backend
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
31
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Joblib spark is providing Spark backend for joblib. We can implement a general parallel backend like ``` with parallel_backend("<parallel-backedn>", n_jobs=..): ``` It can support multiprocessing , spark, ray, and etc. https://joblib.readthedocs.io/en/latest/parallel.html#joblib.parallel_backend
[ -0.5077944993972778, -0.21592821180820465, -0.296323299407959, 0.10189136862754822, -0.049831487238407135, -0.051647864282131195, 0.43653202056884766, 0.22513099014759064, 0.26978829503059387, 0.1350201815366745, -0.1023634523153305, 0.5332247614860535, -0.03646765649318695, 0.5378420352935791, -0.06175719201564789, -0.24731087684631348, -0.03819264471530914, -0.06931866705417633, -0.29053205251693726, 0.22795706987380981, -0.08290325850248337, 0.2179477959871292, 0.04559166729450226, -0.3013412356376648, -0.14232905209064484, -0.1232840046286583, -0.17478488385677338, 0.148341104388237, 0.016366252675652504, -0.1418447345495224, 0.023692160844802856, 0.3547036647796631, 0.20375192165374756, 0.4348357915878296, -0.0001010977357509546, -0.12456680834293365, 0.15890271961688995, 0.06353433430194855, -0.16004317998886108, -0.23269495368003845, -0.00719432532787323, -0.4517390727996826, 0.22695358097553253, -0.28271979093551636, 0.10312467068433762, 0.2815955579280853, 0.04077211022377014, -0.04218827933073044, 0.32626503705978394, -0.2882574498653412, 0.2752451002597809, 0.22212788462638855, -0.23170536756515503, -0.007645305246114731, -0.035427384078502655, 0.16615723073482513, -0.07446960359811783, 0.26332980394363403, 0.5557375550270081, -0.1590222865343094, -0.29988735914230347, 0.17382045090198517, -0.2658756971359253, 0.23910526931285858, 0.2877650856971741, -0.09111635386943817, -0.10172513127326965, -0.3806201219558716, -0.1975586712360382, 0.2624063789844513, 0.6042588353157043, -0.20238102972507477, -0.3421246111392975, -0.5414687395095825, -0.20749610662460327, -0.03787544369697571, -0.03868025913834572, 0.1099001094698906, -0.2054833024740219, -0.059816621243953705, -0.1441679447889328, -0.13457812368869781, 0.15773266553878784, -0.11986633390188217, 0.18157899379730225, 0.5883395671844482, -0.03543417155742645, 0.037117451429367065, 0.34274041652679443, 0.19431860744953156, 0.10621915757656097, -0.17315317690372467, 0.3255220949649811, 0.07335355877876282, -0.4423520863056183, -0.07459074258804321, -0.1887412667274475, -0.31037694215774536, 0.19646860659122467, 0.2527065873146057, 0.13822698593139648, 0.08801102638244629, 0.058870747685432434, 0.22544986009597778, 0.1968342661857605, 0.014874357730150223, -0.030279286205768585, -0.07777758687734604, 0.21363705396652222, 0.061036378145217896, 0.08366721123456955, 0.04656554386019707, -0.08582177758216858, -0.14004045724868774, -0.3517056405544281, 0.29123979806900024, -0.3185245394706726, 0.2988364100456238, -0.1468050181865692, -0.37033334374427795, 0.3807715177536011, -0.20091138780117035, -0.010816046968102455, 0.24406524002552032, -0.09772323071956635, 0.21661566197872162, -0.1580856442451477, 0.09319544583559036, 0.07899791747331619, -0.1007983535528183, -0.06460603326559067, -0.07686452567577362, -0.07285908609628677, 0.028489356860518456, 0.1352098137140274, -0.2481255978345871, 0.32048389315605164, 0.08859983086585999, -0.02700759470462799, 0.12461564689874649, 0.3299398720264435, -0.07370217889547348, -0.39640378952026367, 0.09592677652835846, 0.06282657384872437, 0.066507488489151, -0.07329677790403366, 0.47226884961128235, -0.23658134043216705, 0.20598572492599487, -0.29699134826660156, -0.2713577151298523, -0.05310654640197754, 0.25094127655029297, -0.040540847927331924, -0.025415681302547455, -0.5670297741889954, 0.07989252358675003, 0.06797411292791367, -0.13214752078056335, 0.15600129961967468, 0.09404519200325012, -0.3435361981391907, -0.3076232075691223, 0.11501327902078629, 0.40650832653045654, -0.17700108885765076, -0.0024711638689041138, -0.2790270745754242, -0.135369673371315, 0.25232040882110596, 0.10819809138774872, -0.13200533390045166, 0.061539556831121445, -0.20573338866233826, 0.3105542063713074, 0.23989877104759216, -0.480888694524765, -0.123393714427948, 0.7138372659683228, -0.29853057861328125, -0.026492927223443985, 0.2850850820541382, 0.24730418622493744, 0.4541321396827698, -0.08633606135845184, 0.017467666417360306, 0.41180506348609924, -0.15247975289821625, 0.17616957426071167, -0.2169354110956192, -0.37374305725097656, 0.10046254098415375, 0.31392043828964233, 0.10214141011238098, -0.10708927363157272, 0.0169887226074934, -0.3512125611305237, 0.4373539090156555, 0.18740582466125488, 0.33632194995880127, -0.03122630901634693, -0.3160898983478546, 0.33192840218544006, -0.08622507750988007, -0.15196338295936584, -0.3448445200920105, 0.2365271896123886, 0.25728434324264526, -0.02320190519094467, 0.1377669870853424, -0.26490381360054016, -0.11000444740056992, -0.09493096172809601, -0.03166057541966438, -0.04458994045853615, 0.16341860592365265, -0.13961169123649597, -0.01295439898967743, 0.06839926540851593, -0.16174206137657166, 0.4269525706768036, -0.1281854510307312, 0.06623589992523193, -0.029042676091194153, 0.24599695205688477, 0.06950967758893967, -0.07957981526851654, -0.09509594738483429, -0.14100727438926697, -0.04641108214855194, -0.15229564905166626, -0.04036814346909523, 0.1524847000837326, -0.06859424710273743, 0.3513926565647125, 0.13132591545581818, 0.3067895770072937, 0.36785805225372314, 0.3629641532897949, 0.11012203991413116, -0.1267930269241333, 0.05865825340151787, -0.254018098115921, -0.07130399346351624, 0.2822481691837311, -0.43602943420410156, 0.033907897770404816, -0.1399255245923996, 0.0626506432890892, 0.07720407843589783, -0.039788831025362015, 0.07651316374540329, 0.20307683944702148, 0.1685521900653839, -0.021586595103144646, 0.13509346544742584, -0.020574193447828293, -0.3200150728225708, 0.12817712128162384, -0.10024359822273254, -0.01951560750603676, 0.12883366644382477, 0.03302139788866043, 0.08837714046239853, 0.037072546780109406, 0.37481629848480225, 0.5699665546417236, 0.28761595487594604, 0.23387081921100616, 0.13588371872901917, -0.08681535720825195, 0.49395015835762024, -0.14343051612377167, 0.026903267949819565, 0.07021084427833557, 0.27980220317840576, 0.3140573501586914, -0.08120787143707275, 0.04359455034136772, 0.17743781208992004, -0.3863554000854492, 0.31501495838165283, -0.033012814819812775, 0.008531048893928528, -0.10238336771726608, 0.031190119683742523, -0.1529310643672943, -0.04962494969367981, 0.11083643138408661, -0.019588857889175415, -0.06640369445085526, -0.0726383775472641, 0.5488333702087402, -0.17039334774017334, -0.018907714635133743, -0.12443232536315918, 0.044173404574394226, -0.2175043523311615, -0.37185877561569214, -0.40867745876312256, -0.023198440670967102, 0.11637613922357559, 0.15893515944480896, 0.334697425365448, 0.024510137736797333, 0.2027805596590042, 0.09559798240661621, -0.06247254088521004, -0.34502241015434265, 0.2007736712694168, 0.014278185553848743, -0.1565520465373993, 0.02618897520005703, 0.17127253115177155, -0.025400381535291672, -0.02978876605629921, -0.33095240592956543, -0.04189375415444374, -0.12267954647541046, -0.03084365278482437, -0.37662163376808167, 0.1942603588104248, 0.05948231369256973, -0.1529807299375534, -0.19160084426403046, -0.6866551041603088, -0.5347639322280884, 0.2997612953186035, -0.09684215486049652, 0.21772977709770203, -0.5303629636764526, 0.012224037200212479, -0.2255719155073166, 0.28385454416275024, -0.27148643136024475, 0.021725021302700043, -0.45569783449172974, 0.11190958321094513, -0.16261982917785645, -0.09100741147994995, -0.120545893907547, -0.01927432417869568, 0.14821761846542358, -0.035197481513023376, -0.028877146542072296, -0.10140708088874817, 0.023219255730509758, 0.4846596419811249, -0.22171585261821747, 0.054505810141563416, 0.32908958196640015, 0.08817609399557114, -0.019768524914979935, 0.07756270468235016, 0.10726246237754822, -0.05709009990096092, 0.08302834630012512, -0.013644710183143616, 0.20038361847400665, 0.1727953851222992, 0.1661987006664276, 0.7597837448120117, -0.24265003204345703, 0.013627559877932072, 0.3633088767528534, 0.09296293556690216, -0.31137388944625854, 0.05715499073266983, -0.3282955288887024, -0.08967247605323792, -0.3554770350456238, -0.052352502942085266, 0.0993485078215599, -0.1386151760816574, -0.2915065288543701, -0.16654714941978455, -0.4031314551830292, -0.35150855779647827, -0.002723224461078644, 0.2297368198633194, -0.28418615460395813, 0.06586632132530212, -0.1370733082294464, -0.10019706934690475, -0.20631319284439087, 0.018133193254470825, -0.055279575288295746, 0.09394575655460358, 0.1714889109134674, -0.1981329321861267, 0.17957213521003723, 0.29853326082229614, -0.5424191355705261, 0.09376289695501328, 0.24267318844795227, -0.2815818190574646, 0.032681286334991455, 0.04023933410644531, 0.10775324702262878, -0.13396188616752625, 0.8933537006378174, -0.07300899177789688, -0.03329487517476082, -0.06544587761163712, -0.42911913990974426, 0.14542552828788757, -0.05883272737264633, -0.03318997845053673, -0.05528905242681503, 0.5044888854026794, 0.38179856538772583, -0.21853718161582947, -0.19990438222885132, -0.20421314239501953, -0.19588986039161682, -0.09066274017095566, -0.375399112701416, -0.07251821458339691, -0.12201584875583649, -0.41652414202690125, 0.16436141729354858, 0.2902270257472992, 0.030354462563991547, -0.2190287709236145, -0.23356899619102478, 0.14430393278598785, 0.13943159580230713, 0.06720423698425293, -0.04039662331342697, -0.08442401885986328, -0.10389295220375061, 0.1941075474023819, 0.10473455488681793, -0.01737908087670803, 0.009644819423556328, 0.06540187448263168, -0.13093110918998718, 0.12351583689451218, 0.16130325198173523, -0.07875405997037888, 0.1754683554172516, 0.01897440478205681, 0.09902338683605194, 0.07011823356151581, -0.0716196820139885, 0.05732347071170807, -0.43341150879859924, -0.03508424386382103, 0.10118661820888519, 0.17842432856559753, -0.08307956159114838, -0.5892417430877686, 0.28598350286483765, 0.01767643541097641, -0.040024593472480774, 0.36218684911727905, -0.4454817473888397, 0.03785765916109085, 0.18621091544628143, 0.08990910649299622, 0.7142944931983948, -0.07848411798477173, 0.06960839033126831, -0.11229367554187775, -0.1018933579325676, 0.5232744812965393, -0.5925443172454834, 0.2817738652229309, -0.3571098744869232, -0.05930417403578758, -0.01987992599606514, 0.048390112817287445, 0.005927720107138157, 0.32458943128585815, -0.09455545991659164, 0.21911436319351196, 0.19744527339935303, -0.2217276245355606, -0.23896966874599457, 0.5438504219055176, -0.4341580867767334, -0.3470233678817749, 0.16341254115104675, 0.18520982563495636, -0.015534661710262299, 0.18852975964546204, -0.23797418177127838, -0.2604035437107086, 0.09550023078918457, 0.06012725830078125, -0.18351951241493225, -0.02336251363158226, -0.06929333508014679, 0.3389836549758911, -0.3146762251853943, -0.11690706014633179, 0.2810880243778229, 0.25917452573776245, -0.2315206080675125, -0.21450269222259521, -0.03138571232557297, -0.005859310273081064, -0.14014217257499695, 0.2118682861328125, -0.03962229937314987, -0.19005943834781647, 0.17693190276622772, -0.20747509598731995, -0.381195604801178, -0.18463769555091858, 0.07465843856334686, -0.38728854060173035, 0.12072619795799255, 0.19545330107212067, 0.07854939252138138, -0.19996632635593414, -0.19200024008750916, 0.059023793786764145, -0.16370436549186707, -0.10425813496112823, 0.16212619841098785, 0.06612876802682877, -0.23898455500602722, 0.3481549918651581, -0.1277269870042801, 0.03314211964607239, -0.10261902213096619, 0.40597036480903625, 0.019931688904762268, -0.11660231649875641, 0.07188235223293304, 0.18610386550426483, -0.19363635778427124, -0.17108537256717682, -0.07233071327209473, -0.12887805700302124, -0.09955637902021408, 0.12237241119146347, -0.23047992587089539, -0.13481879234313965, 0.04584513604640961, 0.10443859547376633, 0.3040276765823364, 0.05229942500591278, -0.0919632539153099, -0.1773684322834015, -0.24751625955104828, 0.11103654652833939, -0.18365225195884705, 0.11807120591402054, 0.19295495748519897, -0.13264644145965576, 0.2106163650751114, 0.13362006843090057, -0.3774220645427704, 0.17256750166416168, -0.1574295163154602, -0.12165823578834534, 0.519623875617981, -0.09556874632835388, 0.09536492079496384, 0.12080800533294678, 0.12186208367347717, 0.20840667188167572, -0.17047664523124695, -0.2497614026069641, 0.09884695708751678, 0.0616489052772522, -0.04437551274895668, 0.1153908222913742, -0.04337529093027115, -0.08521731942892075, -0.25439387559890747, -0.07158888876438141, 0.18429981172084808, -0.10371831059455872, -0.054823510348796844, 0.044138628989458084, 0.2147224098443985, 0.31478291749954224, -0.3218090534210205, 0.41585472226142883, 0.06305574625730515, -0.07580223679542542, -0.11453530937433243, 0.2782561182975769, 0.36147722601890564, -0.0035783052444458008, -0.08282361924648285, -0.16323626041412354, 0.525042712688446, 0.049009501934051514, 0.38372379541397095, 0.09580475091934204, -0.07055336236953735, 0.005008414387702942, 0.45099711418151855, 0.22214020788669586, 0.21894490718841553, -0.1545696258544922, 0.2843145430088043, 0.3303978443145752, -0.10320958495140076, -0.06404224783182144, 0.3374219238758087, 0.24374771118164062, 0.18585723638534546, 0.16752506792545319, 0.4643104076385498, 0.30837029218673706, -0.3396449685096741, 0.17635200917720795, 0.6409579515457153, -0.18286404013633728, -0.031136825680732727, 0.09722594916820526, 0.05369432270526886, 0.21513570845127106, 0.2411607950925827, 0.07625304162502289, 0.20522233843803406, 0.24136239290237427, -0.045865561813116074, 0.47213780879974365, 0.19803062081336975, 0.07226510345935822, 0.09966780245304108, -0.49339559674263, 0.05926608294248581, -0.11466871201992035, -0.12349826842546463, 0.08798344433307648, -0.035771168768405914, 0.4551761746406555, -0.19915401935577393, -0.21478775143623352, -0.22012662887573242, 0.36945196986198425, -0.22376587986946106, 0.011838220059871674, -0.009524136781692505, -0.21658390760421753, 0.013516470789909363, 0.06792493164539337, 0.14563465118408203, 0.08806511759757996, 0.7168426513671875, 0.00953475572168827, 0.07816935330629349, -0.05668988078832626, -0.09864110499620438, 0.1298828125, 0.2446165680885315, -0.2690412402153015, -0.2693249583244324, 0.03533116728067398, -0.13069219887256622, -0.3233497142791748, 0.15935873985290527, 0.34048551321029663, 0.11651552468538284, 0.010459519922733307, -0.22109070420265198, -0.16273252665996552, 0.2688484191894531, -0.15150883793830872, 0.17936471104621887, -0.005259387195110321, 0.24504220485687256, 0.23048987984657288, 0.22341492772102356, -0.21956497430801392, 0.02571718581020832, 0.05942593887448311, -0.21372923254966736, -0.030911030247807503, 0.09161964803934097, 0.1689438819885254, -0.18959492444992065, -0.061304572969675064, 0.09007050096988678, -0.35643017292022705, 0.11706753075122833, 0.30599379539489746, -0.3299158215522766, 0.0777512863278389, -0.032472141087055206, 0.11492080986499786, 0.01122470572590828, 0.30385446548461914, 0.0638393685221672, 0.13728879392147064, -0.31824642419815063, 0.07366316020488739, -0.47701457142829895, -0.023407548666000366, -0.011752013117074966, 0.025559663772583008, -0.29167670011520386, 0.23939049243927002, 0.06731937825679779, -0.0012949751690030098, -0.1019732877612114, -0.10523220151662827, 0.16614598035812378, 0.5796564817428589, -0.08017399907112122, 0.19454261660575867, -0.3326510488986969, 0.004332643002271652, 0.1642950177192688, -0.181543231010437, 0.09151208400726318, -0.07888932526111603, 0.06439411640167236, -0.15289396047592163, -0.16978341341018677, 0.3093329668045044, -0.32555878162384033, 0.45724719762802124, -0.10348586738109589, 0.40110763907432556, -0.21554993093013763, 0.07343994081020355, 0.003899306058883667, 0.045335497707128525, -0.144233837723732, -0.19349195063114166, 0.16560149192810059, 0.03998490422964096, -0.23067833483219147, 0.39659708738327026, -0.4077726900577545, 0.3388548493385315, -0.16512849926948547, 0.20489951968193054, -0.170654296875, -0.2834461033344269, -0.07814733684062958, -0.05376297980546951, 0.12969616055488586, 0.3532611131668091, 0.023762432858347893, -0.14465607702732086, -0.37936022877693176, -0.16296249628067017, 0.08907286822795868, -0.2956651449203491, -0.11028677225112915, -0.5209208130836487, 0.11351940035820007, 0.41346120834350586, 0.31656163930892944, -0.27684545516967773, -0.08500754833221436, 0.13567638397216797, 0.08152861893177032, 0.1815987527370453, 0.23940537869930267, 0.06319880485534668, -0.23343715071678162, -0.11133600771427155, -0.38155224919319153, -0.168608158826828, -0.08269208669662476, -0.06834487617015839, -0.33748379349708557 ]
https://github.com/huggingface/datasets/issues/5798
Thank you @lhoestq for finding this repo. I validated that it can distribute downloading jobs with Spark to arbitrary cluster worker nodes evenly with `n_jobs=-1`. For the API, I think it makes sense to define it as ```python load_dataset(..., parallel_backend=<str>) ``` where `parallel_backend` can be `spark`, `multiprocessing`, and potentially other supported joblib backends including `ray` and `dask`. Implementation-wise, do you think it is better to just use `joblib` for `spark` backend in `map_nested`, or also migrate the `multiprocessing.Pool` code to use `joblib`?
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
82
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Thank you @lhoestq for finding this repo. I validated that it can distribute downloading jobs with Spark to arbitrary cluster worker nodes evenly with `n_jobs=-1`. For the API, I think it makes sense to define it as ```python load_dataset(..., parallel_backend=<str>) ``` where `parallel_backend` can be `spark`, `multiprocessing`, and potentially other supported joblib backends including `ray` and `dask`. Implementation-wise, do you think it is better to just use `joblib` for `spark` backend in `map_nested`, or also migrate the `multiprocessing.Pool` code to use `joblib`?
[ -0.4051167368888855, -0.1918499618768692, -0.26870977878570557, 0.046584147959947586, -0.263689249753952, -0.15612906217575073, 0.4492082893848419, 0.159150168299675, 0.36480194330215454, -0.006678774952888489, 0.06409858912229538, 0.5088892579078674, -0.07883021235466003, 0.5097713470458984, 0.035320840775966644, -0.24760618805885315, 0.07500765472650528, -0.19236162304878235, -0.15383011102676392, 0.22928006947040558, -0.24377672374248505, 0.21822616457939148, 0.0007632076740264893, -0.09149961173534393, 0.0677158534526825, -0.23406478762626648, -0.22604918479919434, 0.1674880087375641, -0.1494137942790985, -0.053389545530080795, 0.09572239220142365, 0.282962828874588, 0.23203949630260468, 0.4695402979850769, -0.00010802109318319708, -0.06953245401382446, 0.06677809357643127, 0.027703382074832916, 0.12447938323020935, -0.21922384202480316, 0.03101114183664322, -0.48105737566947937, 0.1882099211215973, -0.3291613459587097, 0.21073178946971893, 0.275968074798584, 0.07872267067432404, -0.1593119204044342, 0.35678374767303467, -0.19411367177963257, 0.20406249165534973, 0.09666699171066284, -0.19246262311935425, 0.08440078794956207, -0.22914274036884308, 0.0348346084356308, -0.14204420149326324, 0.22160938382148743, 0.6258319020271301, -0.1217048168182373, -0.3792150616645813, 0.05647595599293709, -0.27990466356277466, 0.13429224491119385, 0.3589305877685547, -0.08784441649913788, -0.09226246178150177, -0.5646427869796753, -0.14944951236248016, 0.2463565468788147, 0.5807801485061646, -0.14903026819229126, -0.36750251054763794, -0.4462689757347107, -0.31499508023262024, -0.10025876760482788, -0.031547050923109055, 0.15427036583423615, -0.1409692019224167, -0.009150342084467411, -0.158906027674675, -0.24246758222579956, 0.11142648756504059, -0.2283756285905838, -0.026730164885520935, 0.6005060076713562, 0.02784738689661026, 0.11948952078819275, 0.21143193542957306, 0.06875403225421906, 0.10312537103891373, -0.166893869638443, 0.4286346137523651, 0.03771818429231644, -0.19171464443206787, -0.08881352096796036, 0.009014185518026352, -0.3749020993709564, 0.21578167378902435, 0.2984190285205841, 0.11817841231822968, 0.06077630817890167, -0.030112717300653458, 0.17038704454898834, 0.19245769083499908, -0.025991491973400116, 0.08892379701137543, -0.1160394549369812, 0.3037092983722687, 0.05136140435934067, 0.18293747305870056, 0.04191473126411438, -0.20295977592468262, -0.002185620367527008, -0.39803677797317505, 0.3615768253803253, -0.26543721556663513, 0.2681882977485657, -0.06578761339187622, -0.16605699062347412, 0.24691788852214813, -0.34637022018432617, 0.014809995889663696, 0.12626059353351593, -0.06755492836236954, 0.3803747892379761, -0.10555048286914825, 0.12976287305355072, 0.213796466588974, 0.043051205575466156, -0.022362112998962402, -0.030120735988020897, -0.20789910852909088, 0.13398000597953796, 0.05293337255716324, 0.007611319422721863, 0.43246176838874817, 0.03978550806641579, 0.10635018348693848, 0.1827559769153595, 0.2623705267906189, -0.043715931475162506, -0.26580700278282166, 0.09355083107948303, 0.05779813230037689, 0.008057840168476105, -0.1493651568889618, 0.3866552710533142, -0.2595648467540741, 0.3344945013523102, -0.28763508796691895, -0.4852221608161926, 0.026558151468634605, 0.17844997346401215, -0.1067136600613594, -0.013778487220406532, -0.7697320580482483, 0.21161358058452606, 0.12334215641021729, -0.10497869551181793, 0.2497163712978363, 0.0898226723074913, -0.3273822069168091, -0.38257452845573425, -0.03373849019408226, 0.22750994563102722, -0.23942042887210846, 0.0943455845117569, -0.20959998667240143, -0.09573125094175339, 0.25436931848526, 0.03146197646856308, -0.19552718102931976, 0.10249637067317963, -0.17379765212535858, 0.3277478814125061, 0.3683513402938843, -0.5916662216186523, -0.09109804034233093, 0.6176797151565552, -0.12611016631126404, 0.0009324774146080017, 0.26399296522140503, 0.04893353208899498, 0.40083497762680054, -0.13248978555202484, 0.24925988912582397, 0.24204479157924652, -0.102098248898983, 0.1638576090335846, -0.21446236968040466, -0.36775755882263184, 0.18561209738254547, 0.2453795075416565, 0.18784113228321075, -0.11102603375911713, -0.1467333734035492, -0.2793869972229004, 0.40056517720222473, 0.1861969232559204, 0.2882620692253113, -0.16160491108894348, -0.18428394198417664, 0.2021280974149704, -0.14982546865940094, -0.09131892770528793, -0.33999311923980713, 0.21077057719230652, 0.09570793807506561, 0.09659663587808609, 0.11985047161579132, -0.15472733974456787, 0.018597353249788284, -0.15931448340415955, -0.028716091066598892, -0.10931652784347534, 0.09131984412670135, -0.21258549392223358, -0.020985163748264313, -0.11013861745595932, -0.2601222097873688, 0.2741592228412628, -0.11248880624771118, 0.05081446096301079, -0.07893283665180206, 0.18420344591140747, 0.06429897248744965, -0.03620486333966255, -0.13730260729789734, -0.006311710923910141, -0.0253608375787735, -0.15088224411010742, 0.12062892317771912, 0.11342310905456543, 0.047905370593070984, 0.17899197340011597, -0.0027967551723122597, 0.3231002390384674, 0.4521734118461609, 0.3840823173522949, 0.23793312907218933, -0.1375892460346222, 0.02735883742570877, -0.23680832982063293, -0.05251733213663101, 0.2663135230541229, -0.3136849105358124, 0.13896167278289795, -0.10867822170257568, 0.04609265178442001, 0.05871400982141495, 0.1552949696779251, -0.12160991132259369, 0.18698470294475555, -0.045106805860996246, 0.05737227573990822, 0.12823298573493958, 0.024996357038617134, -0.36075252294540405, 0.2609482705593109, 0.0034608507994562387, -0.06980649381875992, -0.10935372859239578, 0.11320410668849945, 0.2129513919353485, -0.11837244778871536, 0.37595242261886597, 0.5103381872177124, 0.4813801944255829, 0.14424283802509308, 0.04425046965479851, -0.10543081164360046, 0.5346492528915405, -0.03914305195212364, 0.07547838985919952, 0.1207655519247055, 0.3170088231563568, 0.2492264360189438, -0.07963234186172485, 0.13806229829788208, 0.28017356991767883, -0.4776284694671631, 0.2793148159980774, -0.011690696701407433, 0.04138029366731644, -0.0972122997045517, 0.10764005780220032, -0.1534387171268463, -0.07389293611049652, 0.03669649735093117, -0.10871262103319168, -0.1544959396123886, -0.15810246765613556, 0.37076833844184875, -0.15293872356414795, -0.005764119327068329, -0.16080346703529358, 0.13412673771381378, -0.4158865809440613, -0.36270973086357117, -0.2755468785762787, -0.02145833894610405, 0.14797449111938477, 0.14247506856918335, 0.2498098760843277, 0.029563743621110916, 0.32830071449279785, 0.09906809031963348, -0.16671256721019745, -0.30288439989089966, 0.03824953734874725, 0.10084028542041779, -0.287264883518219, -0.04383022338151932, 0.3534865975379944, 0.12429304420948029, -0.04336117208003998, -0.47423306107521057, -0.03844397887587547, -0.10318545252084732, -0.11610539257526398, -0.40221184492111206, 0.11737115681171417, -0.002725355327129364, -0.03624231740832329, -0.21014635264873505, -0.7208700776100159, -0.5406770706176758, 0.3299143314361572, -0.04219961538910866, 0.31184113025665283, -0.5608787536621094, -0.1058112382888794, -0.1787583976984024, 0.480384886264801, -0.39330559968948364, -0.03175852447748184, -0.46526503562927246, 0.002415742725133896, -0.2355186641216278, -0.04295812174677849, -0.03671693056821823, 0.03338304162025452, 0.24751394987106323, 0.03980269655585289, 0.02400684356689453, -0.32072505354881287, 0.1157548651099205, 0.5330931544303894, 0.02677425742149353, 0.010491598397493362, 0.40107375383377075, 0.1795205920934677, 0.04590097814798355, 0.07639160752296448, -0.10643764585256577, 0.03214852139353752, 0.19624699652194977, 0.029082532972097397, 0.5004018545150757, 0.1849871575832367, 0.0913483053445816, 1.0077745914459229, 0.03886505216360092, 0.0921986997127533, 0.25049281120300293, 0.16027577221393585, -0.41702356934547424, 0.0052856095135211945, -0.25177398324012756, -0.04807655140757561, -0.319436639547348, -0.06217208132147789, -0.009445704519748688, -0.1311308890581131, -0.3326634168624878, -0.1912122666835785, -0.32972151041030884, -0.33039841055870056, -0.049211286008358, 0.3023243844509125, -0.26330769062042236, 0.09000775218009949, -0.13899683952331543, -0.16876938939094543, -0.26262015104293823, 0.13790889084339142, -0.02452486753463745, 0.13333983719348907, 0.2649644613265991, -0.08232716470956802, 0.035823747515678406, 0.18606600165367126, -0.7595200538635254, 0.125796839594841, 0.18600411713123322, -0.22183045744895935, 0.13623368740081787, -0.013723291456699371, 0.03311021253466606, -0.21686996519565582, 0.6687488555908203, -0.23400555551052094, -0.08588425815105438, -0.054663777351379395, -0.40728169679641724, 0.116244375705719, -0.1180391013622284, -0.06339298188686371, 0.16727429628372192, 0.5901246666908264, 0.43187135457992554, -0.2659487724304199, -0.2626858949661255, -0.18281906843185425, -0.299248069524765, -0.01322232186794281, -0.2731402814388275, -0.12222160398960114, -0.27783966064453125, -0.23745733499526978, 0.08673376590013504, 0.4666966497898102, 0.05522933229804039, -0.09326088428497314, -0.09191683679819107, 0.302695631980896, 0.08756458759307861, 0.14636462926864624, -0.009641975164413452, -0.07465600967407227, -0.1443551480770111, 0.18577611446380615, 0.024084046483039856, -0.07104475796222687, 0.1265464872121811, 0.1871616244316101, -0.2604697644710541, 0.17178523540496826, 0.19915732741355896, -0.07566304504871368, 0.35127130150794983, 0.05504320561885834, 0.09491948783397675, -0.04702012240886688, -0.05079789087176323, -0.08783575892448425, -0.46377354860305786, -0.12127188593149185, 0.018394820392131805, 0.09050168097019196, -0.10558228939771652, -0.8010701537132263, 0.25417444109916687, 0.1839158833026886, -0.18478131294250488, 0.3614065647125244, -0.27619633078575134, -0.08179828524589539, 0.2573963701725006, 0.15743078291416168, 0.7756317853927612, 0.01678805612027645, -0.018449660390615463, 0.08947856724262238, 0.028298281133174896, 0.500530481338501, -0.6478327512741089, 0.25455838441848755, -0.3588082790374756, 0.10943558812141418, -0.1066589206457138, 0.001610495150089264, -0.022377796471118927, 0.24300836026668549, -0.11908680945634842, 0.28198257088661194, 0.3699241876602173, -0.33901408314704895, -0.23919671773910522, 0.5251305103302002, -0.3246745467185974, -0.322991281747818, 0.06801794469356537, 0.09446831047534943, 0.0017506685107946396, 0.13659712672233582, -0.17486947774887085, -0.26650887727737427, -0.07013934850692749, -0.001953795552253723, -0.35683971643447876, -0.1872594803571701, -0.013458333909511566, 0.2988694906234741, -0.24976521730422974, -0.13033512234687805, 0.41120660305023193, 0.30658185482025146, -0.2237083613872528, -0.35815948247909546, 0.03495442867279053, -0.10472358018159866, -0.154061958193779, 0.1805170625448227, 0.04588043689727783, -0.1780061274766922, 0.2377130389213562, -0.34215354919433594, -0.3508372902870178, -0.1617187112569809, -0.07660344243049622, -0.29398560523986816, -0.09277460724115372, 0.32180625200271606, 0.1355023980140686, -0.32177940011024475, -0.2541263997554779, 0.22742444276809692, -0.08334618806838989, 0.04378300905227661, 0.08277204632759094, 0.13072381913661957, -0.18250924348831177, 0.3695487678050995, -0.2832362651824951, 0.11688357591629028, -0.038285255432128906, 0.17732156813144684, 0.07902004569768906, -0.10223399847745895, -0.10792262107133865, 0.15893033146858215, -0.19106313586235046, -0.06725694984197617, -0.057402610778808594, 0.04638272523880005, -0.026335671544075012, -0.024807879701256752, -0.15047040581703186, -0.31485414505004883, 0.00781848281621933, 0.1355724185705185, 0.32870426774024963, 0.0609775073826313, 0.000013634562492370605, -0.09380094707012177, -0.2722374498844147, 0.29764461517333984, -0.251187801361084, -0.0019524693489074707, 0.10615202784538269, -0.21847106516361237, 0.28900134563446045, 0.0483039990067482, -0.30732259154319763, 0.16861669719219208, -0.1425943672657013, -0.12874820828437805, 0.4304666817188263, -0.15538489818572998, -0.060622651129961014, 0.06282654404640198, 0.03047720342874527, 0.1836915910243988, -0.2539595663547516, -0.1418408751487732, -0.004664719104766846, 0.12831950187683105, 0.009984714910387993, -0.06811349093914032, 0.17875424027442932, -0.09107034653425217, -0.29316145181655884, 0.06141093000769615, 0.21967163681983948, -0.024946197867393494, -0.007666628807783127, -0.016525093466043472, 0.2571844756603241, 0.2940261662006378, -0.4006269872188568, 0.40748560428619385, 0.20299431681632996, 0.1286911517381668, -0.06006135419011116, 0.39973902702331543, 0.28636348247528076, -0.08201703429222107, 0.0811459869146347, -0.09405501186847687, 0.4709233045578003, 0.3158801198005676, 0.3672255575656891, 0.11225763708353043, -0.040134601294994354, 0.005750726908445358, 0.39708662033081055, 0.4092617332935333, 0.09258870780467987, -0.03026450052857399, 0.14690819382667542, 0.2745979130268097, -0.14314627647399902, -0.07454648613929749, 0.465093731880188, 0.1941460818052292, 0.09039683640003204, 0.26597386598587036, 0.591505229473114, 0.2095509171485901, -0.2918080985546112, 0.17826518416404724, 0.7977715134620667, -0.2326253205537796, -0.019631586968898773, -0.12014374881982803, -0.11882752925157547, 0.30036234855651855, 0.24573300778865814, 0.211567685008049, 0.15214203298091888, 0.12105580419301987, 0.06824706494808197, 0.4030917286872864, 0.4317736327648163, 0.0787525400519371, 0.15058276057243347, -0.4708380699157715, 0.06519384682178497, -0.08405299484729767, -0.0805678516626358, 0.111161008477211, 0.08779649436473846, 0.4582604169845581, -0.30627763271331787, -0.2360517382621765, -0.06389015167951584, 0.2751794755458832, -0.24784141778945923, -0.043064847588539124, 0.02097359299659729, -0.2042924165725708, 0.01116277277469635, 0.047086864709854126, 0.08740442991256714, -0.005107088014483452, 0.8494611382484436, -0.13703185319900513, -0.029420040547847748, 0.006647629663348198, -0.2868589162826538, -0.09416741132736206, 0.2695011496543884, -0.159266859292984, -0.0568421334028244, 0.11198047548532486, -0.16856062412261963, -0.29026079177856445, 0.19641683995723724, 0.38658732175827026, 0.14030520617961884, -0.002769794315099716, -0.07474508881568909, -0.08096061646938324, 0.2978808283805847, -0.22670622169971466, 0.09817234426736832, 0.008155707269906998, 0.2961355149745941, 0.08333288133144379, 0.17075884342193604, -0.10481543093919754, -0.049286194145679474, 0.17089924216270447, -0.14060096442699432, 0.01695699617266655, 0.2655491530895233, 0.10062752664089203, -0.24472248554229736, 0.1647331416606903, 0.0895252376794815, -0.28573644161224365, 0.07489414513111115, 0.2724694311618805, -0.1828618049621582, 0.11056818068027496, -0.010755009949207306, 0.077545665204525, 0.026524879038333893, 0.21076640486717224, 0.014402911067008972, 0.1597079634666443, -0.3804916441440582, 0.12170332670211792, -0.37587684392929077, -0.04949163645505905, 0.06653750687837601, -0.024287421256303787, -0.2604190409183502, 0.16623789072036743, 0.08021757006645203, 0.0030130278319120407, -0.15246331691741943, -0.09827052056789398, 0.14729167520999908, 0.5731213092803955, -0.13187386095523834, 0.22843606770038605, -0.14235126972198486, 0.1243988573551178, 0.18163789808750153, -0.14375676214694977, 0.026374805718660355, 0.030773401260375977, -0.00418265163898468, -0.23130080103874207, -0.22791317105293274, 0.4010944664478302, -0.37260520458221436, 0.5329779386520386, 0.02190321870148182, 0.30052900314331055, -0.19622790813446045, -0.005289219319820404, 0.0263412743806839, 0.18367552757263184, -0.14153841137886047, -0.15654970705509186, 0.04819886386394501, 0.004490658640861511, -0.3098420798778534, 0.2987695336341858, -0.36069971323013306, 0.19428125023841858, -0.15545156598091125, 0.1788160800933838, -0.3268737196922302, -0.13378024101257324, -0.1301795393228531, -0.13528774678707123, 0.037893008440732956, 0.4840894341468811, 0.03515194356441498, -0.17430317401885986, -0.3427509069442749, -0.10749266296625137, 0.10826350748538971, -0.41406041383743286, -0.08241520822048187, -0.38706284761428833, 0.08949695527553558, 0.3541657030582428, 0.45275068283081055, -0.503376841545105, -0.13782456517219543, 0.1108468547463417, 0.004947178065776825, -0.024371284991502762, 0.1259651929140091, 0.004710309207439423, -0.4015744924545288, -0.14168988168239594, -0.23482568562030792, -0.28490012884140015, -0.2138366401195526, 0.009092994034290314, -0.29981404542922974 ]
https://github.com/huggingface/datasets/issues/5798
Hello @lhoestq, I wanted to follow up on my previous comment with some prototyping code that demonstrates how `map_nested` would be like if we unify `multiprocessing` and `spark` with `joblib`. The snippet hasn't hashed out the details such as dealing with `tqdm` yet. In terms of API, the way of using multiprocessing is still the same; for Spark, the user sets `parallel_backend='spark'` can reuse the `num_proc` argument to pass in the number of executors, or preferably, just set `num_proc=-1` and joblib is able to decide it (I've validated it by running it on a Spark cluster). ```python def map_nested( # ... same args parallel_backend: Optional[str] = None, # proposed new argument ): # ... same code # allow user to specify num_proc=-1, so that joblib will optimize it if (num_proc <= 1 and num_proc != -1) or len(iterable) < parallel_min_length: # same code mapped = [ _single_map_nested((function, obj, types, None, True, None)) for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) ] else: if not parallel_backend: parallel_backend = 'loky' # 'loky' is joblib's own implementation of robust multiprocessing n_jobs = min(num_proc, len(iterable)) if parallel_backend == 'spark': n_jobs = -1 # 'loky' is joblib's own implementation of robust multiprocessing from joblibspark import register_spark register_spark() # parallelized with the same API with joblib.parallel_backend(parallel_backend, n_jobs=n_jobs): mapped = joblib.Parallel()( joblib.delayed( _single_map_nested((function, obj, types, None, True, None)) )(obj) for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) ) # ... same code ``` We can always `joblib` for Spark and other distributed backends such as Ray if people want to support them later. It's worth noting that some distributed backends do not currently have `joblib` implementations. I would appreciate your thoughts on this proposed new API. We can also discuss the pros and cons of migrating the `multiprocessing` code to `joblib` later.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
291
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Hello @lhoestq, I wanted to follow up on my previous comment with some prototyping code that demonstrates how `map_nested` would be like if we unify `multiprocessing` and `spark` with `joblib`. The snippet hasn't hashed out the details such as dealing with `tqdm` yet. In terms of API, the way of using multiprocessing is still the same; for Spark, the user sets `parallel_backend='spark'` can reuse the `num_proc` argument to pass in the number of executors, or preferably, just set `num_proc=-1` and joblib is able to decide it (I've validated it by running it on a Spark cluster). ```python def map_nested( # ... same args parallel_backend: Optional[str] = None, # proposed new argument ): # ... same code # allow user to specify num_proc=-1, so that joblib will optimize it if (num_proc <= 1 and num_proc != -1) or len(iterable) < parallel_min_length: # same code mapped = [ _single_map_nested((function, obj, types, None, True, None)) for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) ] else: if not parallel_backend: parallel_backend = 'loky' # 'loky' is joblib's own implementation of robust multiprocessing n_jobs = min(num_proc, len(iterable)) if parallel_backend == 'spark': n_jobs = -1 # 'loky' is joblib's own implementation of robust multiprocessing from joblibspark import register_spark register_spark() # parallelized with the same API with joblib.parallel_backend(parallel_backend, n_jobs=n_jobs): mapped = joblib.Parallel()( joblib.delayed( _single_map_nested((function, obj, types, None, True, None)) )(obj) for obj in logging.tqdm(iterable, disable=disable_tqdm, desc=desc) ) # ... same code ``` We can always `joblib` for Spark and other distributed backends such as Ray if people want to support them later. It's worth noting that some distributed backends do not currently have `joblib` implementations. I would appreciate your thoughts on this proposed new API. We can also discuss the pros and cons of migrating the `multiprocessing` code to `joblib` later.
[ -0.5167416930198669, -0.3007856607437134, -0.2685208022594452, 0.08404047787189484, -0.08992109447717667, -0.07849778234958649, 0.448391854763031, 0.2081310898065567, 0.29894667863845825, 0.08510483056306839, -0.07281912863254547, 0.5960126519203186, -0.07160244882106781, 0.49020475149154663, -0.0555802620947361, -0.2281559556722641, -0.028804808855056763, -0.27572211623191833, -0.38741838932037354, 0.36640772223472595, -0.16980165243148804, 0.3285035192966461, -0.10715237259864807, -0.21233239769935608, -0.14005570113658905, -0.19523225724697113, -0.19900059700012207, 0.2537012994289398, 0.006899969652295113, -0.10434388369321823, 0.0024082809686660767, 0.32950156927108765, 0.12385092675685883, 0.4684244990348816, -0.00010254661174258217, -0.031150057911872864, 0.07847442477941513, 0.005692675709724426, 0.09753591567277908, -0.17153508961200714, 0.17275965213775635, -0.4559328258037567, 0.13163521885871887, -0.30164581537246704, 0.15845976769924164, 0.32894331216812134, 0.0025861337780952454, -0.1912137269973755, 0.4381895065307617, -0.332061231136322, 0.2576712667942047, 0.27437660098075867, -0.2557302713394165, 0.05479135364294052, -0.2470730096101761, -0.05783117935061455, -0.10618798434734344, 0.17036652565002441, 0.7020467519760132, -0.23685963451862335, -0.3781357407569885, 0.17552915215492249, -0.24655060470104218, 0.2234448790550232, 0.18728193640708923, -0.03064228780567646, -0.04535964876413345, -0.48401153087615967, -0.19106149673461914, 0.23101553320884705, 0.4242161512374878, -0.2593730688095093, -0.34269508719444275, -0.49340155720710754, -0.3111458718776703, -0.18139465153217316, 0.030153585597872734, -0.039904940873384476, -0.3028659224510193, -0.005894851870834827, -0.22374188899993896, -0.10187964886426926, 0.18617404997348785, -0.19106930494308472, 0.09611985087394714, 0.5243587493896484, -0.014190971851348877, 0.06290042400360107, 0.2635205388069153, 0.10780316591262817, 0.02433772385120392, -0.1555442363023758, 0.4273182451725006, 0.11999466270208359, -0.358383446931839, -0.1671222746372223, 0.007459670305252075, -0.3808342218399048, 0.18529237806797028, 0.21717900037765503, 0.13022872805595398, 0.07313840091228485, -0.06359034776687622, 0.24004261195659637, 0.158531054854393, -0.07935801893472672, -0.03975648060441017, -0.275751531124115, 0.1271793693304062, 0.06217639893293381, 0.0949293002486229, 0.06641525030136108, 0.029770512133836746, -0.20277325809001923, -0.25951653718948364, 0.40767231583595276, -0.16836386919021606, 0.3456017076969147, -0.08780893683433533, -0.2588406801223755, 0.24716386198997498, -0.13798320293426514, -0.02880694717168808, 0.21652859449386597, -0.07948713004589081, 0.3281867802143097, -0.16374942660331726, 0.16351401805877686, 0.06387972831726074, -0.08302497863769531, -0.05338851362466812, -0.08413821458816528, -0.04847576469182968, 0.10877341777086258, 0.10264309495687485, 0.02920498326420784, 0.26290443539619446, 0.15207719802856445, 0.1329280436038971, 0.15461179614067078, 0.26690518856048584, -0.05325235798954964, -0.15798376500606537, 0.09009276330471039, 0.04131684452295303, 0.08356751501560211, 0.08258231729269028, 0.29117634892463684, -0.27240705490112305, 0.26018744707107544, -0.29736819863319397, -0.3534102439880371, 0.03955578804016113, 0.21150757372379303, -0.04380546510219574, 0.01526029221713543, -0.5898240804672241, 0.23533013463020325, 0.13845929503440857, -0.01651826500892639, 0.20837846398353577, 0.03451041132211685, -0.3835673928260803, -0.34710943698883057, 0.15445153415203094, 0.2982380986213684, -0.09366437792778015, -0.03520099073648453, -0.35064083337783813, -0.044933922588825226, 0.21389484405517578, 0.10858425498008728, -0.13365992903709412, 0.278836727142334, -0.1606002151966095, 0.4635699391365051, 0.22846686840057373, -0.5693373084068298, -0.09794361144304276, 0.7446311712265015, -0.3406010866165161, 0.18265807628631592, 0.2647537291049957, 0.06842125952243805, 0.5061482787132263, -0.0899190902709961, 0.20053386688232422, 0.3474870026111603, -0.1873166859149933, 0.1297093778848648, -0.25150901079177856, -0.31970804929733276, 0.06746073067188263, 0.1124182641506195, 0.06292995810508728, -0.19802430272102356, -0.05617295950651169, -0.41578733921051025, 0.4599905014038086, 0.14960213005542755, 0.32443374395370483, 0.02730969339609146, -0.2610597610473633, 0.14083266258239746, -0.15770958364009857, -0.2304524928331375, -0.4878913164138794, 0.32231026887893677, 0.22272460162639618, 0.007894448935985565, -0.03822528198361397, -0.1970895528793335, 0.021680030971765518, 0.0006427466869354248, -0.023779496550559998, -0.15225067734718323, 0.18910232186317444, -0.20173117518424988, -0.17010870575904846, -0.16915255784988403, -0.20843005180358887, 0.25293469429016113, 0.09638462960720062, 0.013088386505842209, 0.03459440544247627, 0.1782829314470291, 0.08509942144155502, -0.14060664176940918, -0.16965532302856445, -0.0410822331905365, -0.07345244288444519, -0.07183776050806046, 0.09994426369667053, 0.2507040500640869, -0.004774004220962524, 0.2229536920785904, 0.13431814312934875, 0.29198598861694336, 0.26704779267311096, 0.23042061924934387, 0.02542688511312008, -0.12131096422672272, 0.00711899995803833, -0.21646633744239807, -0.04005058482289314, 0.31560176610946655, -0.3756541311740875, 0.129403218626976, -0.1363770067691803, 0.10273677855730057, 0.02059388905763626, -0.042578745633363724, 0.03367665410041809, 0.12821689248085022, 0.05920528993010521, 0.0915193259716034, 0.011077217757701874, -0.1541983038187027, -0.2952944338321686, 0.3728044033050537, -0.06924367696046829, 0.019608289003372192, -0.03837563097476959, -0.10564886778593063, 0.09841789305210114, 0.038166530430316925, 0.3189535140991211, 0.39604640007019043, 0.3984181880950928, 0.19126920402050018, 0.2088194191455841, -0.04214927926659584, 0.36489006876945496, -0.06356688588857651, 0.11923399567604065, 0.049077510833740234, 0.23564773797988892, 0.257176011800766, -0.0600111149251461, 0.07997409999370575, 0.11361680179834366, -0.4989051818847656, 0.31706172227859497, -0.06521433591842651, -0.08217953890562057, -0.055084362626075745, -0.00863616168498993, -0.006314188241958618, 0.01538432389497757, 0.01310909166932106, -0.06072603166103363, -0.15777400135993958, -0.004868606571108103, 0.5180737972259521, -0.2436876744031906, 0.021971460431814194, -0.044256120920181274, 0.043970465660095215, -0.2196808159351349, -0.33361437916755676, -0.3015720844268799, -0.0616622269153595, 0.20135095715522766, 0.1825018674135208, 0.3354264199733734, -0.07213456928730011, 0.27000850439071655, 0.1452500820159912, -0.09948566555976868, -0.2949806749820709, 0.08380590379238129, 0.052403733134269714, -0.2655550539493561, 0.07682346552610397, 0.14959682524204254, 0.055289849638938904, -0.028247300535440445, -0.32839614152908325, 0.06857995688915253, -0.03923306241631508, -0.09681607037782669, -0.41957366466522217, 0.22403322160243988, 0.03654293715953827, -0.20157194137573242, -0.14331680536270142, -0.5991582870483398, -0.5239737033843994, 0.346824049949646, -0.08710411936044693, 0.24944522976875305, -0.4959390461444855, -0.0386849120259285, -0.20187954604625702, 0.2634336054325104, -0.31502214074134827, -0.0005876533687114716, -0.4508461356163025, 0.03258202597498894, -0.1468304544687271, -0.0669432133436203, -0.16385900974273682, -0.05896662175655365, 0.23809556663036346, -0.05125251039862633, -0.02106049656867981, -0.19016870856285095, 0.14751873910427094, 0.6378699541091919, -0.0419708751142025, 0.008188176900148392, 0.40451011061668396, 0.26197442412376404, -0.05762968212366104, 0.02269614487886429, 0.06578244268894196, -0.09565886855125427, 0.11068874597549438, -0.025433428585529327, 0.22481775283813477, 0.13833583891391754, 0.21626168489456177, 0.9292828440666199, -0.07791805267333984, 0.2111017405986786, 0.27752768993377686, 0.017834870144724846, -0.2946507930755615, 0.03968767449259758, -0.25351640582084656, -0.18237462639808655, -0.4199197292327881, -0.034368522465229034, 0.08565808832645416, -0.08513622730970383, -0.22950957715511322, -0.07118844985961914, -0.12280052155256271, -0.27318039536476135, -0.10863654315471649, 0.32328087091445923, -0.3615691661834717, 0.0892447829246521, -0.08804745972156525, -0.15671321749687195, -0.2690715789794922, 0.11037588864564896, 0.010025899857282639, 0.04948347434401512, 0.1773654669523239, -0.20754262804985046, 0.11536343395709991, 0.20970913767814636, -0.6006293892860413, 0.16311657428741455, 0.2759588360786438, -0.2717607617378235, 0.06590987741947174, -0.1340300440788269, 0.058333620429039, -0.1431693136692047, 0.6429657936096191, -0.23748230934143066, -0.07231767475605011, 0.11314524710178375, -0.5033724308013916, 0.04542159289121628, -0.06297186762094498, -0.13748948276042938, 0.11038891226053238, 0.5404708385467529, 0.5913259983062744, -0.2741090953350067, -0.2545033395290375, -0.28262990713119507, -0.25935497879981995, -0.04057951644062996, -0.32455503940582275, -0.05686613544821739, -0.12394781410694122, -0.3980568051338196, 0.2586173117160797, 0.4325444996356964, 0.1037801206111908, -0.2361230105161667, -0.14202558994293213, 0.19454623758792877, 0.08342204988002777, 0.13918322324752808, -0.012028437107801437, -0.07510867714881897, -0.14385519921779633, 0.24019977450370789, 0.08282911032438278, -0.09020884335041046, -0.10474599897861481, 0.22278983891010284, -0.1380021870136261, 0.18616807460784912, 0.15100276470184326, 0.03812536969780922, 0.2680816650390625, 0.09498734772205353, 0.06369040906429291, 0.09287995100021362, 0.03662928566336632, 0.12354511022567749, -0.46572625637054443, -0.02619834803044796, 0.12790551781654358, 0.15968172252178192, -0.020079029724001884, -0.4225645363330841, 0.2257557511329651, 0.10739365220069885, -0.12761837244033813, 0.46330317854881287, -0.6342647671699524, -0.013378089293837547, 0.10143999010324478, 0.1524437665939331, 0.6679213643074036, -0.07290701568126678, 0.07218285650014877, 0.003131631761789322, 0.06095486879348755, 0.2644074559211731, -0.5818479061126709, 0.30598217248916626, -0.32074621319770813, -0.10772000253200531, -0.055700138211250305, 0.00493168830871582, 0.025172896683216095, 0.32176482677459717, -0.15788301825523376, 0.11780324578285217, 0.3112555146217346, -0.08074069023132324, -0.15986847877502441, 0.3481002748012543, -0.30441954731941223, -0.43151357769966125, 0.09115435183048248, 0.1454344540834427, 0.15498560667037964, 0.10641059279441833, -0.21364761888980865, -0.32510673999786377, 0.07569164037704468, -0.051945943385362625, -0.21071621775627136, -0.0923115611076355, -0.28869903087615967, 0.32763364911079407, -0.12682655453681946, -0.0058725327253341675, 0.22999754548072815, 0.3449667990207672, -0.3485940992832184, -0.28968295454978943, -0.014316318556666374, -0.03337346017360687, 0.007541768252849579, 0.23574316501617432, 0.07391883432865143, -0.2762312889099121, 0.2631784975528717, -0.17733031511306763, -0.25320547819137573, -0.08625168353319168, -0.009177733212709427, -0.30304422974586487, 0.10457661747932434, 0.3125895857810974, 0.031736552715301514, -0.16361093521118164, -0.13371002674102783, 0.19659146666526794, -0.10270668566226959, -0.06675087660551071, 0.13578256964683533, 0.06659559160470963, -0.2519242465496063, 0.421100914478302, -0.2688697576522827, -0.03642947971820831, 0.021101392805576324, 0.3415924608707428, 0.10088156163692474, 0.03818011283874512, 0.01732233725488186, 0.18564337491989136, -0.2107124775648117, -0.20888744294643402, -0.07978785037994385, -0.08642537146806717, -0.04979276657104492, 0.2359457015991211, -0.15639805793762207, -0.20717287063598633, -0.014739762991666794, 0.15624895691871643, 0.23686067759990692, 0.0364103689789772, -0.2528749108314514, -0.13119827210903168, -0.346189022064209, 0.2150591015815735, -0.2628534734249115, 0.04289643093943596, 0.10534065961837769, 0.0865127295255661, 0.16802354156970978, 0.16570578515529633, -0.4003886282444, 0.10903015732765198, -0.11220959573984146, -0.14771367609500885, 0.5359727144241333, -0.1606113165616989, 0.20565351843833923, 0.11401302367448807, 0.09922342002391815, 0.18049556016921997, -0.23291397094726562, -0.2639259696006775, 0.040654256939888, 0.06107071787118912, 0.009803516790270805, 0.002027861773967743, 0.08747301995754242, -0.004070766270160675, -0.2109799087047577, -0.10722527652978897, 0.21710745990276337, -0.0764566957950592, -0.049674682319164276, -0.07384204864501953, 0.16901428997516632, 0.3092769980430603, -0.3790254294872284, 0.3270875811576843, 0.1093696653842926, 0.09527647495269775, -0.11043274402618408, 0.23978808522224426, 0.22726678848266602, -0.06816156208515167, 0.06063631549477577, -0.03770684078335762, 0.5104154348373413, 0.10372249782085419, 0.4473379850387573, 0.15374888479709625, -0.19227060675621033, -0.049450382590293884, 0.4310202896595001, 0.19569027423858643, 0.09447189420461655, -0.13730952143669128, 0.09755365550518036, 0.3064825236797333, -0.08694105595350266, 0.016637153923511505, 0.28353893756866455, 0.12344072759151459, 0.27698150277137756, 0.2084304839372635, 0.4642447233200073, 0.18913500010967255, -0.26470276713371277, 0.14536282420158386, 0.532484233379364, -0.21614429354667664, -0.09769585728645325, -0.0069843437522649765, 0.014127910137176514, 0.2954913377761841, 0.3146490454673767, 0.0637727603316307, 0.2767317295074463, 0.07128990441560745, 0.03242892771959305, 0.3190886378288269, 0.2827129662036896, -0.029557589441537857, 0.09673227369785309, -0.46601322293281555, 0.11040282249450684, -0.23132993280887604, 0.0005972273647785187, 0.07428477704524994, -0.004898238927125931, 0.3859540820121765, -0.20760862529277802, -0.19362995028495789, -0.1653643697500229, 0.48571139574050903, -0.24979837238788605, -0.11280976235866547, 0.18346592783927917, -0.22317025065422058, -0.03652770072221756, -0.015929803252220154, 0.030116330832242966, 0.07512396574020386, 0.8482139706611633, -0.12991832196712494, 0.10378943383693695, -0.0771191418170929, -0.33477097749710083, 0.11769938468933105, 0.21898357570171356, -0.276879221200943, -0.04828967899084091, 0.1607545018196106, -0.12630373239517212, -0.32671797275543213, 0.28434938192367554, 0.4950137138366699, 0.09194646775722504, -0.16717785596847534, -0.1753734052181244, -0.1267981231212616, 0.2151757776737213, -0.1571059226989746, 0.15364472568035126, -0.10897310078144073, 0.23719879984855652, 0.23191168904304504, 0.21719762682914734, -0.175191730260849, -0.043169401586055756, 0.13546544313430786, -0.11634513735771179, 0.05040727183222771, 0.11936508119106293, 0.16382303833961487, -0.11775699257850647, 0.08696959912776947, 0.10079534351825714, -0.3733348250389099, -0.043942395597696304, 0.3931563198566437, -0.37158533930778503, 0.1505424529314041, -0.04886240512132645, 0.1334148794412613, 0.11310037225484848, 0.313329815864563, 0.07110760360956192, 0.06605565547943115, -0.3909832239151001, 0.1107269823551178, -0.5387939214706421, -0.023146890103816986, -0.006550692953169346, -0.10109822452068329, -0.26687175035476685, 0.23289594054222107, 0.17679700255393982, 0.1594928801059723, -0.009964771568775177, -0.26487231254577637, 0.08059953153133392, 0.601984977722168, -0.18320870399475098, 0.2571650445461273, -0.17242032289505005, 0.07528189569711685, 0.18086177110671997, -0.20410281419754028, 0.12906433641910553, 0.0022783614695072174, 0.09240011125802994, -0.11347544193267822, -0.22771784663200378, 0.29277604818344116, -0.3322754204273224, 0.4155931770801544, -0.03351219743490219, 0.2872403562068939, -0.24639204144477844, -0.006310071796178818, 0.015101251192390919, 0.15038548409938812, -0.06398411840200424, -0.10390876233577728, 0.09312781691551208, 0.011169523000717163, -0.29842376708984375, 0.29766982793807983, -0.3117620646953583, 0.15134575963020325, -0.10148186981678009, 0.08173926174640656, -0.1777719259262085, -0.17035888135433197, -0.09527445584535599, 0.0358453132212162, 0.05201924592256546, 0.5101024508476257, -0.01142558827996254, 0.06568194180727005, -0.36191874742507935, -0.3048473298549652, 0.1391608864068985, -0.2796715199947357, -0.23398546874523163, -0.49218398332595825, 0.15196353197097778, 0.3017479181289673, 0.42259645462036133, -0.3319013714790344, -0.14222942292690277, 0.11736409366130829, 0.05947800725698471, 0.006598733365535736, 0.2246420830488205, -0.019381247460842133, -0.2940109372138977, -0.12798553705215454, -0.29968419671058655, -0.22288355231285095, -0.10586535930633545, -0.06445229053497314, -0.2686976194381714 ]
https://github.com/huggingface/datasets/issues/5798
Nice ! It should be quite easy to make the change then :) I think adding spark support can actually be less than 20 lines of code and would roughly require one line of code to change in map_nested: Maybe we can define a new `datasets.parallel` submodule that has the `parallel_backend()` context manager and a `parallel_map()` function that uses `Pool.map` by default and `joblib` otherwise. `joblib` would be an optional dependency, and `joblib-spark` as well. Then whenever someone wants to use Spark, they can do something like this (similar to scikit-learn parallel_backend): ```python from datasets.parallel import parallel_backend with parallel_backend("spark"): ds = load_dataset(...) ``` What do you think ?
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
108
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Nice ! It should be quite easy to make the change then :) I think adding spark support can actually be less than 20 lines of code and would roughly require one line of code to change in map_nested: Maybe we can define a new `datasets.parallel` submodule that has the `parallel_backend()` context manager and a `parallel_map()` function that uses `Pool.map` by default and `joblib` otherwise. `joblib` would be an optional dependency, and `joblib-spark` as well. Then whenever someone wants to use Spark, they can do something like this (similar to scikit-learn parallel_backend): ```python from datasets.parallel import parallel_backend with parallel_backend("spark"): ds = load_dataset(...) ``` What do you think ?
[ -0.4788985252380371, -0.27889353036880493, -0.29145094752311707, 0.0654510036110878, -0.12983141839504242, 0.10031931102275848, 0.34198427200317383, 0.3615080416202545, 0.36372554302215576, 0.05006475746631622, -0.01716097816824913, 0.5124855041503906, -0.11140985786914825, 0.4177769422531128, -0.17451533675193787, -0.2687499225139618, 0.13101232051849365, -0.09585468471050262, -0.06095245108008385, 0.2495381087064743, -0.25698789954185486, 0.22270894050598145, -0.03750523924827576, -0.29649674892425537, -0.16809341311454773, -0.1855868101119995, -0.2373839020729065, 0.08424213528633118, -0.2036173790693283, -0.3277662992477417, 0.08942796289920807, 0.4398510456085205, 0.128409281373024, 0.47556936740875244, -0.00010493751324247569, -0.12486708164215088, 0.1509900987148285, 0.08516092598438263, -0.049040403217077255, -0.18129771947860718, 0.039601996541023254, -0.4214755892753601, 0.1423468291759491, -0.2915768027305603, 0.12272846698760986, 0.26587963104248047, -0.03508391231298447, -0.20696613192558289, 0.2978263795375824, -0.2645844519138336, 0.22066432237625122, 0.15076179802417755, -0.04787568747997284, -0.030080337077379227, -0.0751878172159195, 0.11451460421085358, -0.18782061338424683, 0.33205658197402954, 0.5501709580421448, -0.2088223397731781, -0.23096734285354614, 0.21528510749340057, -0.37868741154670715, 0.06981946527957916, 0.47250592708587646, -0.08423160016536713, -0.0037721414119005203, -0.550445020198822, -0.1980218142271042, 0.27725207805633545, 0.5018967390060425, -0.11301113665103912, -0.34655871987342834, -0.6183072924613953, -0.28399357199668884, -0.10692887008190155, -0.03585953265428543, 0.023072805255651474, -0.2131890505552292, 0.040299467742443085, -0.08019037544727325, -0.27172791957855225, 0.08049072325229645, -0.12714368104934692, 0.227754145860672, 0.6407862305641174, 0.0954149067401886, 0.05583162605762482, 0.3541266918182373, 0.13646838068962097, 0.11406181752681732, -0.18624785542488098, 0.2740931510925293, 0.08908019959926605, -0.37364286184310913, -0.1104247123003006, -0.06355923414230347, -0.412000834941864, 0.11887887120246887, 0.14780212938785553, 0.23168934881687164, 0.06621436029672623, -0.019297312945127487, 0.27840250730514526, 0.08053255081176758, -0.047200027853250504, -0.0553109310567379, -0.051795803010463715, 0.2913494110107422, 0.03616311401128769, 0.2375231683254242, 0.0632864311337471, -0.033450521528720856, -0.16916726529598236, -0.4306272268295288, 0.34049099683761597, -0.01717526838183403, 0.287418931722641, -0.001103132963180542, -0.30948662757873535, 0.13195142149925232, -0.22101005911827087, -0.08427347242832184, 0.1211419627070427, -0.022326331585645676, 0.30356475710868835, -0.0854404866695404, 0.1494431346654892, 0.14209115505218506, -0.0627860575914383, 0.012075427919626236, -0.06699934601783752, -0.0453365333378315, 0.29038792848587036, 0.12881594896316528, 0.08032549172639847, 0.2110978662967682, 0.06373283267021179, 0.08201777189970016, 0.17038527131080627, 0.248013436794281, -0.021758638322353363, -0.27949175238609314, 0.037677329033613205, -0.1656976193189621, 0.04708632081747055, 0.09387992322444916, 0.33008623123168945, -0.31277430057525635, 0.22577805817127228, -0.2518022358417511, -0.41008949279785156, -0.06313418596982956, 0.1911083161830902, -0.05484195053577423, -0.006576255429536104, -0.5475277304649353, 0.35978904366493225, 0.12333051860332489, -0.2267339825630188, 0.29814332723617554, 0.15768975019454956, -0.501192569732666, -0.3146975040435791, 0.13066858053207397, 0.4504896104335785, -0.20293112099170685, 0.010791495442390442, -0.4062833786010742, -0.016865286976099014, 0.0839182436466217, 0.040020737797021866, -0.16453349590301514, 0.2593320310115814, -0.20470061898231506, 0.4253804087638855, 0.20584636926651, -0.4379199743270874, -0.09448576718568802, 0.547185480594635, -0.29793328046798706, 0.0789945125579834, 0.2313421666622162, 0.12279290705919266, 0.4060308337211609, -0.16619755327701569, 0.1580670177936554, 0.2506287097930908, -0.19592627882957458, 0.07640403509140015, -0.37269875407218933, -0.40677979588508606, 0.3047986924648285, 0.2578449845314026, 0.07102836668491364, -0.051622431725263596, -0.015259869396686554, -0.35229986906051636, 0.31290414929389954, 0.1365167796611786, 0.1917240023612976, -0.004244707524776459, -0.050745707005262375, 0.2481546700000763, -0.15496894717216492, -0.10959617793560028, -0.3758765161037445, 0.23788315057754517, 0.23001176118850708, 0.06744831055402756, -0.012348305433988571, -0.23958848416805267, 0.050644420087337494, 0.023594260215759277, -0.01628050208091736, -0.17550134658813477, 0.15245656669139862, -0.2859618067741394, -0.04663356766104698, -0.09747083485126495, -0.08848020434379578, 0.32641440629959106, -0.030467361211776733, 0.0607127919793129, -0.17533084750175476, 0.13345171511173248, 0.0025122659280896187, -0.030430501326918602, -0.022175252437591553, -0.021916687488555908, 0.06331098079681396, -0.1277044713497162, -0.012197788804769516, 0.26649579405784607, -0.15403692424297333, 0.3053185045719147, 0.07397691905498505, 0.28903985023498535, 0.30164527893066406, 0.22042834758758545, 0.14159125089645386, -0.13026802241802216, 0.06637446582317352, -0.2974572777748108, -0.18713580071926117, 0.20369525253772736, -0.3168502748012543, 0.22120100259780884, -0.24996495246887207, 0.045866988599300385, -0.11450618505477905, 0.0939704030752182, -0.05331152305006981, 0.20594848692417145, 0.012717176228761673, 0.050934430211782455, 0.08783957362174988, -0.0343223474919796, -0.10081557184457779, 0.32447555661201477, -0.008976861834526062, -0.010366566479206085, -0.04635588452219963, 0.1857525259256363, 0.15536858141422272, -0.07240648567676544, 0.4251241385936737, 0.42239251732826233, 0.39683306217193604, 0.2595049738883972, 0.06091107055544853, 0.06751725822687149, 0.4492266774177551, -0.10419625043869019, 0.17217467725276947, 0.17890334129333496, 0.23956236243247986, 0.15244454145431519, -0.016267698258161545, 0.15554702281951904, 0.1039419174194336, -0.5174665451049805, 0.1851542890071869, -0.022012431174516678, -0.08833698183298111, -0.0593000166118145, 0.16946932673454285, -0.014219172298908234, 0.05430275574326515, 0.10564491897821426, -0.040640849620103836, -0.22076085209846497, -0.03782140463590622, 0.4977536201477051, -0.20072732865810394, 0.13195237517356873, -0.006195031106472015, 0.22546622157096863, -0.24686816334724426, -0.3499002754688263, -0.4190480411052704, -0.09373612701892853, 0.17180469632148743, 0.14105361700057983, 0.3031153082847595, -0.17592114210128784, 0.26259148120880127, 0.22922630608081818, -0.03806579113006592, -0.26008668541908264, -0.06406878679990768, -0.08921215683221817, -0.29511964321136475, -0.08348806202411652, 0.2699405252933502, 0.09538402408361435, 0.013804204761981964, -0.459593802690506, 0.023063018918037415, -0.044503353536129, 0.022079676389694214, -0.5050196647644043, 0.14226186275482178, -0.00043459609150886536, -0.10080328583717346, -0.2512756288051605, -0.6030120849609375, -0.6722737550735474, 0.4256381392478943, -0.21287210285663605, 0.20158839225769043, -0.4828425943851471, 0.12457747012376785, -0.19497661292552948, 0.20943281054496765, -0.41766393184661865, 0.028924260288476944, -0.42168399691581726, 0.17121362686157227, -0.16747882962226868, -0.025710852816700935, -0.06716963648796082, 0.01781698316335678, 0.17516422271728516, -0.07649901509284973, -0.05276574194431305, -0.10634221136569977, -0.005616870708763599, 0.5705754160881042, -0.1366058737039566, 0.026164909824728966, 0.4778888523578644, 0.2964617908000946, -0.06312195956707001, 0.15995487570762634, -0.02934180572628975, -0.12273548543453217, 0.11376476287841797, -0.007179383188486099, 0.25228607654571533, 0.19176819920539856, 0.21961747109889984, 0.9915642738342285, -0.03402452543377876, 0.26497167348861694, 0.26173219084739685, 0.21380308270454407, -0.1444147229194641, 0.0008951015770435333, -0.3748577833175659, -0.04817831143736839, -0.3462512195110321, -0.13691607117652893, 0.06320258229970932, -0.11675526201725006, -0.4187108278274536, -0.11835300922393799, -0.35166770219802856, -0.20031771063804626, -0.06783881038427353, 0.2946472764015198, -0.35052379965782166, 0.10097711533308029, -0.18307650089263916, -0.18765667080879211, -0.31815752387046814, 0.05091653764247894, -0.043246835470199585, 0.012593377381563187, 0.2893860340118408, -0.05771723389625549, -0.021170414984226227, 0.2188226878643036, -0.5565636157989502, 0.1807490736246109, 0.1969555765390396, -0.27022865414619446, -0.029533833265304565, -0.02973972260951996, 0.00720798596739769, -0.09896411746740341, 0.9020877480506897, -0.26059362292289734, -0.12422850728034973, 0.046214759349823, -0.2793726325035095, 0.0009682327508926392, -0.09086634963750839, 0.05527488887310028, 0.08232567459344864, 0.4525984525680542, 0.42062056064605713, -0.18102997541427612, -0.198774516582489, -0.11289101839065552, -0.242140993475914, 0.04826231300830841, -0.31494468450546265, 0.003041692078113556, -0.09816902875900269, -0.40577995777130127, 0.18371620774269104, 0.4194008409976959, -0.028292523697018623, -0.1275731772184372, -0.2676927149295807, 0.1652238667011261, 0.1683935970067978, 0.11968816816806793, -0.042355090379714966, -0.09026314318180084, -0.03426700085401535, 0.1917812079191208, 0.18898513913154602, -0.11397744715213776, 0.041393399238586426, 0.14434565603733063, -0.25998982787132263, 0.08659587055444717, 0.13828173279762268, 0.006581205874681473, 0.3226378560066223, 0.27681028842926025, 0.10312093049287796, 0.16595271229743958, 0.03858225792646408, 0.20421478152275085, -0.5537950396537781, 0.001546621322631836, 0.0330282598733902, 0.19151373207569122, -0.24760031700134277, -0.6907965540885925, 0.4124576151371002, 0.10625747591257095, -0.19955110549926758, 0.3645111322402954, -0.3508487939834595, -0.10695123672485352, 0.3411824107170105, 0.09442584961652756, 0.8961710333824158, -0.023844674229621887, 0.09510613977909088, -0.049858007580041885, 0.03462672233581543, 0.44888532161712646, -0.7626417279243469, 0.2545020580291748, -0.165548175573349, 0.04532851651310921, -0.12098751217126846, 0.05109946429729462, 0.06211378425359726, 0.24517248570919037, -0.28201496601104736, 0.21161897480487823, 0.30300432443618774, -0.10996375977993011, -0.11846461147069931, 0.5151600241661072, -0.20042715966701508, -0.4923335909843445, 0.17386095225811005, 0.17398199439048767, 0.05516651272773743, 0.05062087997794151, -0.1426827311515808, -0.3802279233932495, -0.07288604974746704, -0.20270615816116333, -0.35762977600097656, -0.1682637631893158, -0.22056598961353302, 0.3049187958240509, -0.34098806977272034, -0.03581146150827408, 0.48253577947616577, 0.32136639952659607, -0.20539990067481995, -0.12682662904262543, -0.09243597090244293, -0.030699625611305237, -0.037286143749952316, 0.12000417709350586, 0.01456526666879654, -0.2746787667274475, 0.14233872294425964, -0.20854483544826508, -0.29918372631073, -0.08756683766841888, -0.09179843962192535, -0.4372876286506653, -0.17238907516002655, 0.19380953907966614, 0.14224478602409363, -0.21386083960533142, -0.19862452149391174, 0.1404488980770111, -0.1439766138792038, -0.10405085980892181, 0.13451248407363892, -0.018940746784210205, -0.22901469469070435, 0.26126542687416077, -0.09274780750274658, -0.0065696462988853455, -0.024308232590556145, 0.31630969047546387, 0.04385513812303543, -0.025913052260875702, 0.025155019015073776, 0.14182844758033752, -0.17287194728851318, -0.1917247176170349, -0.014314956963062286, -0.06286739557981491, 0.03757164627313614, 0.06557931005954742, -0.1442294716835022, -0.16825221478939056, -0.05005721375346184, 0.056127943098545074, 0.34331652522087097, 0.0035826396197080612, -0.016640841960906982, -0.05943996459245682, -0.27965453267097473, 0.1089286133646965, -0.2136826515197754, 0.19500473141670227, 0.06986349821090698, -0.20413415133953094, 0.13109217584133148, 0.20679688453674316, -0.3580291271209717, 0.08396544307470322, -0.06347575783729553, -0.11792387813329697, 0.553321897983551, -0.05324333533644676, 0.10029049217700958, -0.07800227403640747, 0.06435181200504303, 0.20038194954395294, -0.2363659143447876, -0.21126383543014526, 0.02315116673707962, 0.11157851666212082, 0.012213196605443954, 0.09106948971748352, 0.10523355007171631, -0.005811095237731934, -0.24717415869235992, -0.07844840735197067, 0.15734998881816864, -0.08558433502912521, -0.05720870569348335, -0.05664258077740669, 0.07212361693382263, 0.3620280921459198, -0.27458256483078003, 0.3519269824028015, 0.06482189148664474, 0.09570668637752533, -0.11282584816217422, 0.27303534746170044, 0.32888495922088623, -0.06710059940814972, 0.11783042550086975, -0.023342397063970566, 0.38072359561920166, 0.15455986559391022, 0.3851502239704132, 0.18217991292476654, -0.17111678421497345, 0.025134630501270294, 0.3376424312591553, 0.18956221640110016, 0.10563410818576813, -0.027577318251132965, 0.08381770551204681, 0.29138004779815674, -0.11630619317293167, -0.032786693423986435, 0.4486301839351654, 0.030845526605844498, 0.21889132261276245, 0.21795281767845154, 0.5906464457511902, 0.2639918327331543, -0.31833669543266296, 0.18912996351718903, 0.685673177242279, -0.1483057737350464, 0.18427453935146332, 0.03565526753664017, 0.005593284964561462, 0.22583018243312836, 0.2825327515602112, 0.19391772150993347, 0.257209837436676, 0.32512980699539185, 0.049111176282167435, 0.40195342898368835, 0.4012804329395294, 0.07836613059043884, 0.14547279477119446, -0.36444252729415894, 0.21151472628116608, -0.09352339804172516, 0.05400427430868149, 0.06226915121078491, 0.007700879126787186, 0.4425863027572632, -0.3345491886138916, -0.4040365219116211, -0.05891493335366249, 0.191739022731781, -0.15219427645206451, 0.034525640308856964, 0.11327822506427765, -0.189795583486557, -0.15477226674556732, -0.08346398174762726, 0.1316198706626892, -0.0928117036819458, 0.7341282367706299, -0.0936996340751648, 0.05287548899650574, 0.02903657965362072, -0.16307377815246582, 0.05736882612109184, 0.3883380889892578, -0.2933512330055237, -0.25539231300354004, 0.005809437483549118, -0.2952454090118408, -0.35893070697784424, 0.22956329584121704, 0.4789825975894928, 0.23514848947525024, -0.10597044229507446, -0.025770369917154312, -0.16406859457492828, 0.14508217573165894, -0.039461180567741394, 0.024378076195716858, -0.013498719781637192, 0.2521688938140869, 0.057617612183094025, 0.19851157069206238, -0.1443866491317749, 0.0903196707367897, 0.031543441116809845, -0.04689731448888779, -0.0715908631682396, 0.12629297375679016, 0.1598605215549469, -0.21778684854507446, 0.09203935414552689, 0.07073657959699631, -0.3380562663078308, 0.021279241889715195, 0.3919808268547058, -0.19765704870224, 0.09150536358356476, -0.08208256959915161, 0.0927109569311142, 0.13693886995315552, 0.30169641971588135, 0.04127462953329086, -0.009120643138885498, -0.3757677972316742, 0.17089758813381195, -0.5247043967247009, -0.1747453510761261, -0.054461926221847534, 0.15380015969276428, -0.16830287873744965, -0.005811050534248352, 0.2660258710384369, 0.15189005434513092, -0.06878088414669037, -0.26968756318092346, 0.026261240243911743, 0.4203675389289856, -0.14931157231330872, 0.24853533506393433, -0.09260367602109909, -0.011553240939974785, 0.23191528022289276, -0.09142684936523438, 0.1506219208240509, 0.004938565194606781, 0.021762482821941376, -0.23588813841342926, -0.11813433468341827, 0.15781721472740173, -0.5085420608520508, 0.6313604116439819, 0.04026187211275101, 0.2770005166530609, -0.19294899702072144, -0.06599865853786469, -0.14618471264839172, 0.07637058198451996, -0.1369975507259369, -0.03625255823135376, 0.1279522031545639, 0.17696437239646912, -0.4280654191970825, 0.0981268659234047, -0.4273541271686554, 0.22248807549476624, -0.1926036775112152, -0.03284041956067085, -0.2716415524482727, -0.172845721244812, -0.0462576225399971, 0.09999077767133713, 0.011865265667438507, 0.25436389446258545, -0.007325325161218643, -0.03960138559341431, -0.4164642095565796, -0.19974607229232788, 0.18949976563453674, -0.19760310649871826, -0.16228801012039185, -0.3771336078643799, 0.055914897471666336, 0.4925575852394104, 0.5240505933761597, -0.35860395431518555, -0.2524356245994568, 0.1259872019290924, 0.08152036368846893, 0.054166167974472046, 0.40454238653182983, 0.03911321610212326, -0.36104410886764526, -0.18751385807991028, -0.2171367108821869, -0.3199254870414734, -0.11214305460453033, -0.03161356598138809, -0.4174156188964844 ]